diff --git a/video/closedcaption/src/cea708mux/imp.rs b/video/closedcaption/src/cea708mux/imp.rs index b07617d4..f5a36232 100644 --- a/video/closedcaption/src/cea708mux/imp.rs +++ b/video/closedcaption/src/cea708mux/imp.rs @@ -316,6 +316,12 @@ impl AggregatorImpl for Cea708Mux { } } } + + if let Some(cea608) = pad_state.ccp_parser.cea608() { + for pair in cea608 { + state.writer.push_cea608(*pair); + } + } } _ => (), } @@ -643,7 +649,6 @@ impl ObjectSubclass for Cea708Mux { type ParentType = gst_base::Aggregator; } -#[derive(Default)] struct PadState { format: CeaFormat, ccp_parser: CCDataParser, @@ -651,6 +656,19 @@ struct PadState { pending_buffer: Option, } +impl Default for PadState { + fn default() -> Self { + let mut ccp_parser = CCDataParser::default(); + ccp_parser.handle_cea608(); + Self { + format: CeaFormat::default(), + ccp_parser, + pending_services: HashMap::default(), + pending_buffer: None, + } + } +} + #[derive(Default)] pub struct Cea708MuxSinkPad { pad_state: Mutex,