mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-22 18:16:28 +00:00
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:
parent
04da3b2047
commit
57821cade4
1 changed files with 26 additions and 12 deletions
|
@ -651,19 +651,33 @@ impl NdiSrc {
|
|||
receive_time_real,
|
||||
);
|
||||
|
||||
let res_timestamp = state.observations_timestamp[idx].process(
|
||||
self.obj().upcast_ref(),
|
||||
timestamp,
|
||||
receive_time_gst,
|
||||
duration,
|
||||
);
|
||||
let res_timestamp = if matches!(
|
||||
state.timestamp_mode,
|
||||
TimestampMode::ReceiveTimeTimestamp | TimestampMode::Auto
|
||||
) {
|
||||
state.observations_timestamp[idx].process(
|
||||
self.obj().upcast_ref(),
|
||||
timestamp,
|
||||
receive_time_gst,
|
||||
duration,
|
||||
)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let res_timecode = state.observations_timecode[idx].process(
|
||||
self.obj().upcast_ref(),
|
||||
Some(timecode),
|
||||
receive_time_gst,
|
||||
duration,
|
||||
);
|
||||
let res_timecode = if matches!(
|
||||
state.timestamp_mode,
|
||||
TimestampMode::ReceiveTimeTimecode | TimestampMode::Auto
|
||||
) {
|
||||
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 {
|
||||
TimestampMode::ReceiveTimeTimecode => match res_timecode {
|
||||
|
|
Loading…
Reference in a new issue