cea708mux: forward CEA-608 data correctly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1942>
This commit is contained in:
Matthew Waters 2024-11-28 15:59:14 +11:00 committed by GStreamer Marge Bot
parent 39a8db51de
commit 9eb3ad4412

View file

@ -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; type ParentType = gst_base::Aggregator;
} }
#[derive(Default)]
struct PadState { struct PadState {
format: CeaFormat, format: CeaFormat,
ccp_parser: CCDataParser, ccp_parser: CCDataParser,
@ -651,6 +656,19 @@ struct PadState {
pending_buffer: Option<gst::Buffer>, pending_buffer: Option<gst::Buffer>,
} }
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)] #[derive(Default)]
pub struct Cea708MuxSinkPad { pub struct Cea708MuxSinkPad {
pad_state: Mutex<PadState>, pad_state: Mutex<PadState>,