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!(
self.obj().upcast_ref(), state.timestamp_mode,
timestamp, TimestampMode::ReceiveTimeTimestamp | TimestampMode::Auto
receive_time_gst, ) {
duration, state.observations_timestamp[idx].process(
); self.obj().upcast_ref(),
timestamp,
receive_time_gst,
duration,
)
} else {
None
};
let res_timecode = state.observations_timecode[idx].process( let res_timecode = if matches!(
self.obj().upcast_ref(), state.timestamp_mode,
Some(timecode), TimestampMode::ReceiveTimeTimecode | TimestampMode::Auto
receive_time_gst, ) {
duration, state.observations_timecode[idx].process(
); self.obj().upcast_ref(),
Some(timecode),
receive_time_gst,
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 {