Add receive-time timestamping mode

This directly uses the receive times of each packet.
This commit is contained in:
Sebastian Dröge 2021-09-29 16:44:16 +03:00
parent 7c3e50c629
commit febb2fb035
3 changed files with 7 additions and 1 deletions

View file

@ -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> {

View file

@ -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

View file

@ -679,6 +679,7 @@ impl Receiver {
(receive_time + diff, duration)
}
}
TimestampMode::ReceiveTime => (receive_time, duration),
};
gst_log!(