Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrançois Laignel <francois@centricular.com>2023-05-10 18:02:08 +0300
committerFrançois Laignel <francois@centricular.com>2023-05-12 13:55:31 +0300
commit7ba0073052c81c8f2f1ebe500048ed6d974e81d8 (patch)
tree26a4f2b74ac8a7129b6ecc95e8affcb302aa1bc2 /video/closedcaption
parent8e93d294e5a61a94f14e812bef59cd0e529494e1 (diff)
use Pad builders for optional name definition
Also, apply auto-naming in the following cases * When building from a non wildcard-named template, the name of the template is automatically assigned to the Pad. User can override with a specific name by calling `name()` on the `PadBuilder`. * When building with a target and no name was provided via the above, the GhostPad is named after the target. See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/448 Auto-naming discussion: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1255#note_1891181 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1197>
Diffstat (limited to 'video/closedcaption')
-rw-r--r--video/closedcaption/src/cea608overlay/imp.rs4
-rw-r--r--video/closedcaption/src/cea608tocea708/imp.rs4
-rw-r--r--video/closedcaption/src/cea608tojson/imp.rs4
-rw-r--r--video/closedcaption/src/cea608tott/imp.rs4
-rw-r--r--video/closedcaption/src/jsontovtt/imp.rs4
-rw-r--r--video/closedcaption/src/mcc_enc/imp.rs4
-rw-r--r--video/closedcaption/src/mcc_parse/imp.rs4
-rw-r--r--video/closedcaption/src/scc_enc/imp.rs4
-rw-r--r--video/closedcaption/src/scc_parse/imp.rs4
-rw-r--r--video/closedcaption/src/transcriberbin/imp.rs61
-rw-r--r--video/closedcaption/src/tttocea608/imp.rs4
-rw-r--r--video/closedcaption/src/tttojson/imp.rs4
12 files changed, 53 insertions, 52 deletions
diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs
index ce7988d33..c3cba0275 100644
--- a/video/closedcaption/src/cea608overlay/imp.rs
+++ b/video/closedcaption/src/cea608overlay/imp.rs
@@ -522,7 +522,7 @@ impl ObjectSubclass for Cea608Overlay {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
Cea608Overlay::catch_panic_pad_function(
parent,
@@ -542,7 +542,7 @@ impl ObjectSubclass for Cea608Overlay {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::PROXY_CAPS)
.flags(gst::PadFlags::PROXY_ALLOCATION)
.build();
diff --git a/video/closedcaption/src/cea608tocea708/imp.rs b/video/closedcaption/src/cea608tocea708/imp.rs
index 2a53c7cbb..bed384630 100644
--- a/video/closedcaption/src/cea608tocea708/imp.rs
+++ b/video/closedcaption/src/cea608tocea708/imp.rs
@@ -721,7 +721,7 @@ impl ObjectSubclass for Cea608ToCea708 {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
Cea608ToCea708::catch_panic_pad_function(
parent,
@@ -740,7 +740,7 @@ impl ObjectSubclass for Cea608ToCea708 {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::FIXED_CAPS)
.build();
diff --git a/video/closedcaption/src/cea608tojson/imp.rs b/video/closedcaption/src/cea608tojson/imp.rs
index c513dff3a..4eda84720 100644
--- a/video/closedcaption/src/cea608tojson/imp.rs
+++ b/video/closedcaption/src/cea608tojson/imp.rs
@@ -780,7 +780,7 @@ impl ObjectSubclass for Cea608ToJson {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
Cea608ToJson::catch_panic_pad_function(
parent,
@@ -799,7 +799,7 @@ impl ObjectSubclass for Cea608ToJson {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::FIXED_CAPS)
.build();
diff --git a/video/closedcaption/src/cea608tott/imp.rs b/video/closedcaption/src/cea608tott/imp.rs
index c265dc7a3..c781585b0 100644
--- a/video/closedcaption/src/cea608tott/imp.rs
+++ b/video/closedcaption/src/cea608tott/imp.rs
@@ -377,7 +377,7 @@ impl ObjectSubclass for Cea608ToTt {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
Cea608ToTt::catch_panic_pad_function(
parent,
@@ -396,7 +396,7 @@ impl ObjectSubclass for Cea608ToTt {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::FIXED_CAPS)
.build();
diff --git a/video/closedcaption/src/jsontovtt/imp.rs b/video/closedcaption/src/jsontovtt/imp.rs
index 42e029409..d2c1549e2 100644
--- a/video/closedcaption/src/jsontovtt/imp.rs
+++ b/video/closedcaption/src/jsontovtt/imp.rs
@@ -536,7 +536,7 @@ impl ObjectSubclass for JsonToVtt {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
JsonToVtt::catch_panic_pad_function(
parent,
@@ -555,7 +555,7 @@ impl ObjectSubclass for JsonToVtt {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::FIXED_CAPS)
.event_function(|pad, parent, event| {
JsonToVtt::catch_panic_pad_function(
diff --git a/video/closedcaption/src/mcc_enc/imp.rs b/video/closedcaption/src/mcc_enc/imp.rs
index 32656e888..bec2b9999 100644
--- a/video/closedcaption/src/mcc_enc/imp.rs
+++ b/video/closedcaption/src/mcc_enc/imp.rs
@@ -424,7 +424,7 @@ impl ObjectSubclass for MccEnc {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
MccEnc::catch_panic_pad_function(
parent,
@@ -438,7 +438,7 @@ impl ObjectSubclass for MccEnc {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.event_function(|pad, parent, event| {
MccEnc::catch_panic_pad_function(parent, || false, |enc| enc.src_event(pad, event))
})
diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs
index f994cc45e..6bbbf0d99 100644
--- a/video/closedcaption/src/mcc_parse/imp.rs
+++ b/video/closedcaption/src/mcc_parse/imp.rs
@@ -1072,7 +1072,7 @@ impl ObjectSubclass for MccParse {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.activate_function(|pad, parent| {
MccParse::catch_panic_pad_function(
parent,
@@ -1109,7 +1109,7 @@ impl ObjectSubclass for MccParse {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.event_function(|pad, parent, event| {
MccParse::catch_panic_pad_function(
parent,
diff --git a/video/closedcaption/src/scc_enc/imp.rs b/video/closedcaption/src/scc_enc/imp.rs
index 75107049e..60dab9460 100644
--- a/video/closedcaption/src/scc_enc/imp.rs
+++ b/video/closedcaption/src/scc_enc/imp.rs
@@ -355,7 +355,7 @@ impl ObjectSubclass for SccEnc {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
SccEnc::catch_panic_pad_function(
parent,
@@ -369,7 +369,7 @@ impl ObjectSubclass for SccEnc {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.event_function(|pad, parent, event| {
SccEnc::catch_panic_pad_function(parent, || false, |enc| enc.src_event(pad, event))
})
diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs
index 78fc6cf63..4cdc96d0a 100644
--- a/video/closedcaption/src/scc_parse/imp.rs
+++ b/video/closedcaption/src/scc_parse/imp.rs
@@ -951,7 +951,7 @@ impl ObjectSubclass for SccParse {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.activate_function(|pad, parent| {
SccParse::catch_panic_pad_function(
parent,
@@ -988,7 +988,7 @@ impl ObjectSubclass for SccParse {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.event_function(|pad, parent, event| {
SccParse::catch_panic_pad_function(
parent,
diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs
index f974ae8f6..5673e5120 100644
--- a/video/closedcaption/src/transcriberbin/imp.rs
+++ b/video/closedcaption/src/transcriberbin/imp.rs
@@ -149,9 +149,8 @@ impl TranscriberBin {
.build(),
);
- let sinkpad = gst::GhostPad::with_target(Some("sink"), &queue.static_pad("sink").unwrap())?;
- let srcpad =
- gst::GhostPad::with_target(Some("src"), &converter.static_pad("src").unwrap())?;
+ let sinkpad = gst::GhostPad::with_target(&queue.static_pad("sink").unwrap()).unwrap();
+ let srcpad = gst::GhostPad::with_target(&converter.static_pad("src").unwrap()).unwrap();
bin.add_pad(&sinkpad)?;
bin.add_pad(&srcpad)?;
@@ -214,14 +213,11 @@ impl TranscriberBin {
state.ccmux.set_property("latency", CEA608MUX_LATENCY);
- let transcription_audio_sinkpad = gst::GhostPad::with_target(
- Some("sink"),
- &aqueue_transcription.static_pad("sink").unwrap(),
- )?;
- let transcription_audio_srcpad = gst::GhostPad::with_target(
- Some("src"),
- &state.transcription_valve.static_pad("src").unwrap(),
- )?;
+ let transcription_audio_sinkpad =
+ gst::GhostPad::with_target(&aqueue_transcription.static_pad("sink").unwrap()).unwrap();
+ let transcription_audio_srcpad =
+ gst::GhostPad::with_target(&state.transcription_valve.static_pad("src").unwrap())
+ .unwrap();
state
.transcription_bin
@@ -260,22 +256,27 @@ impl TranscriberBin {
.video_queue
.link_pads(Some("src"), &state.cccombiner, Some("sink"))?;
- let internal_audio_sinkpad = gst::GhostPad::with_target(
- Some("audio_sink"),
- &aclocksync.static_pad("sink").unwrap(),
- )?;
- let internal_audio_srcpad = gst::GhostPad::with_target(
- Some("audio_src"),
+ let internal_audio_sinkpad =
+ gst::GhostPad::builder_with_target(&aclocksync.static_pad("sink").unwrap())
+ .unwrap()
+ .name("audio_sink")
+ .build();
+ let internal_audio_srcpad = gst::GhostPad::builder_with_target(
&state.audio_queue_passthrough.static_pad("src").unwrap(),
- )?;
- let internal_video_sinkpad = gst::GhostPad::with_target(
- Some("video_sink"),
- &vclocksync.static_pad("sink").unwrap(),
- )?;
- let internal_video_srcpad = gst::GhostPad::with_target(
- Some("video_src"),
- &state.cccombiner.static_pad("src").unwrap(),
- )?;
+ )
+ .unwrap()
+ .name("audio_src")
+ .build();
+ let internal_video_sinkpad =
+ gst::GhostPad::builder_with_target(&vclocksync.static_pad("sink").unwrap())
+ .unwrap()
+ .name("video_sink")
+ .build();
+ let internal_video_srcpad =
+ gst::GhostPad::builder_with_target(&state.cccombiner.static_pad("src").unwrap())
+ .unwrap()
+ .name("video_src")
+ .build();
state.internal_bin.add_pad(&internal_audio_sinkpad)?;
state.internal_bin.add_pad(&internal_audio_srcpad)?;
@@ -835,9 +836,9 @@ impl ObjectSubclass for TranscriberBin {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink_audio").unwrap();
- let audio_sinkpad = gst::GhostPad::from_template(&templ, Some("sink_audio"));
+ let audio_sinkpad = gst::GhostPad::from_template(&templ);
let templ = klass.pad_template("src_audio").unwrap();
- let audio_srcpad = gst::GhostPad::builder_with_template(&templ, Some("src_audio"))
+ let audio_srcpad = gst::GhostPad::builder_from_template(&templ)
.query_function(|pad, parent, query| {
TranscriberBin::catch_panic_pad_function(
parent,
@@ -848,7 +849,7 @@ impl ObjectSubclass for TranscriberBin {
.build();
let templ = klass.pad_template("sink_video").unwrap();
- let video_sinkpad = gst::GhostPad::builder_with_template(&templ, Some("sink_video"))
+ let video_sinkpad = gst::GhostPad::builder_from_template(&templ)
.event_function(|pad, parent, event| {
TranscriberBin::catch_panic_pad_function(
parent,
@@ -858,7 +859,7 @@ impl ObjectSubclass for TranscriberBin {
})
.build();
let templ = klass.pad_template("src_video").unwrap();
- let video_srcpad = gst::GhostPad::builder_with_template(&templ, Some("src_video"))
+ let video_srcpad = gst::GhostPad::builder_from_template(&templ)
.query_function(|pad, parent, query| {
TranscriberBin::catch_panic_pad_function(
parent,
diff --git a/video/closedcaption/src/tttocea608/imp.rs b/video/closedcaption/src/tttocea608/imp.rs
index 9e85ca5eb..f4f916c14 100644
--- a/video/closedcaption/src/tttocea608/imp.rs
+++ b/video/closedcaption/src/tttocea608/imp.rs
@@ -977,7 +977,7 @@ impl ObjectSubclass for TtToCea608 {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
TtToCea608::catch_panic_pad_function(
parent,
@@ -996,7 +996,7 @@ impl ObjectSubclass for TtToCea608 {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src"))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::FIXED_CAPS)
.build();
diff --git a/video/closedcaption/src/tttojson/imp.rs b/video/closedcaption/src/tttojson/imp.rs
index b8d4228e2..e4f98fe39 100644
--- a/video/closedcaption/src/tttojson/imp.rs
+++ b/video/closedcaption/src/tttojson/imp.rs
@@ -192,7 +192,7 @@ impl ObjectSubclass for TtToJson {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
TtToJson::catch_panic_pad_function(
parent,
@@ -210,7 +210,7 @@ impl ObjectSubclass for TtToJson {
.build();
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some("src")).build();
+ let srcpad = gst::Pad::from_template(&templ);
Self {
srcpad,