cea708mux: output padding by default

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1942>
This commit is contained in:
Matthew Waters 2024-12-03 12:37:53 +11:00 committed by GStreamer Marge Bot
parent c0a3b0c868
commit 00cb3fefe9

View file

@ -83,7 +83,6 @@ fn fps_from_caps(caps: &gst::CapsRef) -> Result<Framerate, gst::LoggableError> {
)) ))
} }
#[derive(Default)]
struct State { struct State {
out_format: CeaFormat, out_format: CeaFormat,
fps: Option<Framerate>, fps: Option<Framerate>,
@ -92,6 +91,21 @@ struct State {
n_frames: u64, 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)] #[derive(Default)]
pub struct Cea708Mux { pub struct Cea708Mux {
state: Mutex<State>, state: Mutex<State>,
@ -424,8 +438,6 @@ impl AggregatorImpl for Cea708Mux {
let format = state.out_format; let format = state.out_format;
let fps = state.fps; let fps = state.fps;
*state = State::default(); *state = State::default();
state.writer.set_output_padding(true);
state.writer.set_output_cea608_padding(true);
state.out_format = format; state.out_format = format;
state.fps = fps; state.fps = fps;
state.n_frames = 0; state.n_frames = 0;
@ -586,8 +598,6 @@ impl ElementImpl for Cea708Mux {
gst::StateChange::ReadyToPaused => { gst::StateChange::ReadyToPaused => {
let mut state = self.state.lock().unwrap(); let mut state = self.state.lock().unwrap();
*state = State::default(); *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 => { gst::StateChange::PausedToReady => {
let mut state = self.state.lock().unwrap(); let mut state = self.state.lock().unwrap();
*state = State::default(); *state = State::default();
state.writer.set_output_padding(true);
state.writer.set_output_cea608_padding(true);
} }
_ => (), _ => (),
} }