mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-24 02:50:34 +00:00
scc_parse: Don't send a new caps event for every new line
Only send new caps when the framerate has actually changed.
This commit is contained in:
parent
e8c5884931
commit
aebbe8c39b
1 changed files with 10 additions and 5 deletions
|
@ -46,6 +46,7 @@ struct State {
|
|||
parser: SccParser,
|
||||
need_segment: bool,
|
||||
pending_events: Vec<gst::Event>,
|
||||
framerate: Option<gst::Fraction>,
|
||||
start_position: gst::ClockTime,
|
||||
last_position: gst::ClockTime,
|
||||
last_timecode: Option<gst_video::ValidVideoTimeCode>,
|
||||
|
@ -58,6 +59,7 @@ impl Default for State {
|
|||
parser: SccParser::new(),
|
||||
need_segment: true,
|
||||
pending_events: Vec::new(),
|
||||
framerate: None,
|
||||
start_position: gst::CLOCK_TIME_NONE,
|
||||
last_position: gst::CLOCK_TIME_NONE,
|
||||
last_timecode: None,
|
||||
|
@ -311,11 +313,14 @@ impl SccParse {
|
|||
|
||||
let mut events = Vec::new();
|
||||
|
||||
let caps = gst::Caps::builder("closedcaption/x-cea-608")
|
||||
.field("format", &"raw")
|
||||
.field("framerate", &framerate)
|
||||
.build();
|
||||
events.push(gst::Event::new_caps(&caps).build());
|
||||
if Some(framerate) != state.framerate {
|
||||
let caps = gst::Caps::builder("closedcaption/x-cea-608")
|
||||
.field("format", &"raw")
|
||||
.field("framerate", &framerate)
|
||||
.build();
|
||||
events.push(gst::Event::new_caps(&caps).build());
|
||||
state.framerate = Some(framerate);
|
||||
}
|
||||
|
||||
if state.need_segment {
|
||||
let segment = gst::FormattedSegment::<gst::format::Time>::new();
|
||||
|
|
Loading…
Reference in a new issue