Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2023-06-15 18:48:39 +0300
committerSeungha Yang <seungha@centricular.com>2023-06-15 19:06:26 +0300
commit02c77d2e44ee5389b1ea0dc1d4031c037c445b29 (patch)
tree9ff392263dc79b6672ee8d78296c9bc41df2b8c4 /video
parent26fd68a37c8ea001297ca12648e9b056c2faee36 (diff)
mccparse: Map timecode to PTS directly without offset
Assumes that caption stream's timeline starts from zero, and maps timecode time_since_daily_jam() to PTS directly without subtracting the first seen timecode. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1246>
Diffstat (limited to 'video')
-rw-r--r--video/closedcaption/src/mcc_parse/imp.rs18
1 files changed, 0 insertions, 18 deletions
diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs
index 6bbbf0d99..99fcbcaf7 100644
--- a/video/closedcaption/src/mcc_parse/imp.rs
+++ b/video/closedcaption/src/mcc_parse/imp.rs
@@ -60,7 +60,6 @@ struct State {
format: Option<Format>,
need_segment: bool,
pending_events: Vec<gst::Event>,
- start_position: Option<gst::ClockTime>,
last_position: Option<gst::ClockTime>,
last_timecode: Option<gst_video::ValidVideoTimeCode>,
timecode_rate: Option<(u8, bool)>,
@@ -86,7 +85,6 @@ impl Default for State {
format: None,
need_segment: true,
pending_events: Vec::new(),
- start_position: None,
last_position: None,
last_timecode: None,
timecode_rate: None,
@@ -204,21 +202,6 @@ impl State {
/// not produce timestamps jumping backwards
fn update_timestamp(&mut self, imp: &MccParse, timecode: &gst_video::ValidVideoTimeCode) {
let nsecs = timecode.time_since_daily_jam();
- if self.start_position.is_none() {
- self.start_position = Some(nsecs);
- }
- let start_position = self.start_position.expect("checked above");
-
- let nsecs = nsecs.checked_sub(start_position).unwrap_or_else(|| {
- gst::fixme!(
- CAT,
- imp: imp,
- "New position {} < start position {}",
- nsecs,
- start_position,
- );
- start_position
- });
if self
.last_position
@@ -849,7 +832,6 @@ impl MccParse {
state.segment = gst::FormattedSegment::new();
state.need_segment = true;
state.pending_events.clear();
- state.start_position = Some(gst::ClockTime::ZERO);
state.last_position = None;
state.last_timecode = None;
state.timecode_rate = None;