mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 23:11:01 +00:00
Add receive-time timestamping mode
This directly uses the receive times of each packet.
This commit is contained in:
parent
7c3e50c629
commit
febb2fb035
3 changed files with 7 additions and 1 deletions
|
@ -32,6 +32,8 @@ pub enum TimestampMode {
|
|||
Timecode = 2,
|
||||
#[genum(name = "NDI Timestamp", nick = "timestamp")]
|
||||
Timestamp = 3,
|
||||
#[genum(name = "Receive Time", nick = "receive-time")]
|
||||
ReceiveTime = 4,
|
||||
}
|
||||
|
||||
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
||||
|
|
|
@ -475,7 +475,10 @@ impl BaseSrcImpl for NdiSrc {
|
|||
let settings = self.settings.lock().unwrap();
|
||||
|
||||
if let Some(latency) = state.current_latency {
|
||||
let min = if settings.timestamp_mode != TimestampMode::Timecode {
|
||||
let min = if matches!(
|
||||
settings.timestamp_mode,
|
||||
TimestampMode::ReceiveTimeTimecode | TimestampMode::ReceiveTimeTimestamp
|
||||
) {
|
||||
latency
|
||||
} else {
|
||||
gst::ClockTime::ZERO
|
||||
|
|
|
@ -679,6 +679,7 @@ impl Receiver {
|
|||
(receive_time + diff, duration)
|
||||
}
|
||||
}
|
||||
TimestampMode::ReceiveTime => (receive_time, duration),
|
||||
};
|
||||
|
||||
gst_log!(
|
||||
|
|
Loading…
Reference in a new issue