mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-18 08:06:31 +00:00
cea708mux: output padding by default
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1942>
This commit is contained in:
parent
c0a3b0c868
commit
00cb3fefe9
1 changed files with 15 additions and 7 deletions
|
@ -83,7 +83,6 @@ fn fps_from_caps(caps: &gst::CapsRef) -> Result<Framerate, gst::LoggableError> {
|
|||
))
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct State {
|
||||
out_format: CeaFormat,
|
||||
fps: Option<Framerate>,
|
||||
|
@ -92,6 +91,21 @@ struct State {
|
|||
n_frames: u64,
|
||||
}
|
||||
|
||||
impl Default for State {
|
||||
fn default() -> Self {
|
||||
let mut writer = CCDataWriter::default();
|
||||
writer.set_output_padding(true);
|
||||
writer.set_output_cea608_padding(true);
|
||||
Self {
|
||||
out_format: CeaFormat::default(),
|
||||
fps: None,
|
||||
dtvcc_seq_no: 0,
|
||||
writer,
|
||||
n_frames: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Cea708Mux {
|
||||
state: Mutex<State>,
|
||||
|
@ -424,8 +438,6 @@ impl AggregatorImpl for Cea708Mux {
|
|||
let format = state.out_format;
|
||||
let fps = state.fps;
|
||||
*state = State::default();
|
||||
state.writer.set_output_padding(true);
|
||||
state.writer.set_output_cea608_padding(true);
|
||||
state.out_format = format;
|
||||
state.fps = fps;
|
||||
state.n_frames = 0;
|
||||
|
@ -586,8 +598,6 @@ impl ElementImpl for Cea708Mux {
|
|||
gst::StateChange::ReadyToPaused => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
*state = State::default();
|
||||
state.writer.set_output_padding(true);
|
||||
state.writer.set_output_cea608_padding(true);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
@ -598,8 +608,6 @@ impl ElementImpl for Cea708Mux {
|
|||
gst::StateChange::PausedToReady => {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
*state = State::default();
|
||||
state.writer.set_output_padding(true);
|
||||
state.writer.set_output_cea608_padding(true);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue