From 9eb3ad4412918cdede460eebe2d25f84767910b5 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 28 Nov 2024 15:59:14 +1100 Subject: [PATCH] cea708mux: forward CEA-608 data correctly Part-of: --- video/closedcaption/src/cea708mux/imp.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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,