From 39a8db51de014b3f6690c734346c9199101d7ce1 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 2 Dec 2024 17:16:11 +0100 Subject: [PATCH] transcriberbin: register pad templates for unsynced source pads Part-of: --- docs/plugins/gst_plugins_cache.json | 20 +++++++++++ video/closedcaption/src/transcriberbin/imp.rs | 34 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/docs/plugins/gst_plugins_cache.json b/docs/plugins/gst_plugins_cache.json index 93ada7fb..858079e2 100644 --- a/docs/plugins/gst_plugins_cache.json +++ b/docs/plugins/gst_plugins_cache.json @@ -7962,6 +7962,26 @@ "caps": "video/x-raw(ANY):\n", "direction": "src", "presence": "always" + }, + "unsynced_src": { + "caps": "application/x-json:\n", + "direction": "src", + "presence": "sometimes" + }, + "unsynced_src_%%u": { + "caps": "application/x-json:\n", + "direction": "src", + "presence": "sometimes" + }, + "unsynced_translate_src_%%u": { + "caps": "application/x-json:\n", + "direction": "src", + "presence": "sometimes" + }, + "unsynced_translate_src_%%u_%%u": { + "caps": "application/x-json:\n", + "direction": "src", + "presence": "sometimes" } }, "properties": { diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs index 5cc8baa6..49c21b72 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -1904,6 +1904,36 @@ impl ElementImpl for TranscriberBin { ) .unwrap(); + let src_caps = gst::Caps::builder("application/x-json").build(); + let unsynced_src_pad_template = gst::PadTemplate::new( + "unsynced_src", + gst::PadDirection::Src, + gst::PadPresence::Sometimes, + &src_caps, + ) + .unwrap(); + let unsynced_translate_src_pad_template = gst::PadTemplate::new( + "unsynced_translate_src_%u", + gst::PadDirection::Src, + gst::PadPresence::Sometimes, + &src_caps, + ) + .unwrap(); + let unsynced_secondary_src_pad_template = gst::PadTemplate::new( + "unsynced_src_%u", + gst::PadDirection::Src, + gst::PadPresence::Sometimes, + &src_caps, + ) + .unwrap(); + let unsynced_secondary_translate_src_pad_template = gst::PadTemplate::new( + "unsynced_translate_src_%u_%u", + gst::PadDirection::Src, + gst::PadPresence::Sometimes, + &src_caps, + ) + .unwrap(); + vec![ video_src_pad_template, video_sink_pad_template, @@ -1911,6 +1941,10 @@ impl ElementImpl for TranscriberBin { audio_sink_pad_template, secondary_audio_sink_pad_template, secondary_audio_src_pad_template, + unsynced_src_pad_template, + unsynced_translate_src_pad_template, + unsynced_secondary_src_pad_template, + unsynced_secondary_translate_src_pad_template, ] });