ndisrc: Only calculate timecode/timestamp mappings if necessary

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1727>
This commit is contained in:
Sebastian Dröge 2024-08-19 13:11:27 +03:00 committed by GStreamer Marge Bot
parent 04da3b2047
commit 57821cade4

View file

@ -651,19 +651,33 @@ impl NdiSrc {
receive_time_real, receive_time_real,
); );
let res_timestamp = state.observations_timestamp[idx].process( let res_timestamp = if matches!(
state.timestamp_mode,
TimestampMode::ReceiveTimeTimestamp | TimestampMode::Auto
) {
state.observations_timestamp[idx].process(
self.obj().upcast_ref(), self.obj().upcast_ref(),
timestamp, timestamp,
receive_time_gst, receive_time_gst,
duration, duration,
); )
} else {
None
};
let res_timecode = state.observations_timecode[idx].process( let res_timecode = if matches!(
state.timestamp_mode,
TimestampMode::ReceiveTimeTimecode | TimestampMode::Auto
) {
state.observations_timecode[idx].process(
self.obj().upcast_ref(), self.obj().upcast_ref(),
Some(timecode), Some(timecode),
receive_time_gst, receive_time_gst,
duration, duration,
); )
} else {
None
};
let (pts, duration, discont) = match state.timestamp_mode { let (pts, duration, discont) = match state.timestamp_mode {
TimestampMode::ReceiveTimeTimecode => match res_timecode { TimestampMode::ReceiveTimeTimecode => match res_timecode {