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
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>
-rw-r--r--audio/audiofx/src/audioloudnorm/imp.rs4
-rw-r--r--generic/sodium/src/decrypter/imp.rs4
-rw-r--r--generic/sodium/src/encrypter/imp.rs4
-rw-r--r--generic/threadshare/examples/standalone/sink/async_mutex/imp.rs2
-rw-r--r--generic/threadshare/examples/standalone/sink/sync_mutex/imp.rs2
-rw-r--r--generic/threadshare/examples/standalone/sink/task/imp.rs2
-rw-r--r--generic/threadshare/examples/standalone/src/imp.rs2
-rw-r--r--generic/threadshare/src/appsrc/imp.rs2
-rw-r--r--generic/threadshare/src/audiotestsrc/imp.rs2
-rw-r--r--generic/threadshare/src/inputselector/imp.rs7
-rw-r--r--generic/threadshare/src/jitterbuffer/imp.rs4
-rw-r--r--generic/threadshare/src/proxy/imp.rs4
-rw-r--r--generic/threadshare/src/queue/imp.rs4
-rw-r--r--generic/threadshare/src/tcpclientsrc/imp.rs2
-rw-r--r--generic/threadshare/src/udpsink/imp.rs2
-rw-r--r--generic/threadshare/src/udpsrc/imp.rs2
-rw-r--r--generic/threadshare/tests/pad.rs4
-rw-r--r--mux/flavors/src/flvdemux/imp.rs4
-rw-r--r--mux/fmp4/src/fmp4mux/imp.rs7
-rw-r--r--net/aws/src/s3hlssink/imp.rs8
-rw-r--r--net/aws/src/transcribe_parse/imp.rs4
-rw-r--r--net/aws/src/transcriber/imp.rs95
-rw-r--r--net/hlssink3/src/imp.rs8
-rw-r--r--net/ndi/src/ndisinkcombiner/imp.rs7
-rw-r--r--net/ndi/src/ndisrcdemux/imp.rs6
-rw-r--r--net/onvif/src/onvifmetadatacombiner/imp.rs5
-rw-r--r--net/onvif/src/onvifmetadataoverlay/imp.rs4
-rw-r--r--net/onvif/src/onvifmetadataparse/imp.rs4
-rw-r--r--net/raptorq/src/raptorqdec/imp.rs7
-rw-r--r--net/raptorq/src/raptorqenc/imp.rs6
-rw-r--r--net/reqwest/tests/reqwesthttpsrc.rs3
-rw-r--r--net/rtp/src/gcc/imp.rs4
-rw-r--r--net/webrtc/src/webrtcsink/imp.rs15
-rw-r--r--net/webrtc/src/webrtcsrc/imp.rs12
-rw-r--r--net/webrtchttp/src/whepsrc/imp.rs4
-rw-r--r--net/webrtchttp/src/whipsink/imp.rs4
-rw-r--r--text/ahead/src/textahead/imp.rs4
-rw-r--r--text/json/src/jsongstenc/imp.rs4
-rw-r--r--text/json/src/jsongstparse/imp.rs4
-rw-r--r--text/regex/src/gstregex/imp.rs4
-rw-r--r--text/wrap/src/gsttextwrap/imp.rs4
-rw-r--r--tutorial/src/identity/imp.rs4
-rw-r--r--tutorial/src/progressbin/imp.rs4
-rw-r--r--utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs7
-rw-r--r--utils/fallbackswitch/src/fallbacksrc/imp.rs40
-rw-r--r--utils/fallbackswitch/src/fallbackswitch/imp.rs72
-rw-r--r--utils/livesync/src/livesync/imp.rs126
-rw-r--r--utils/togglerecord/src/togglerecord/imp.rs10
-rw-r--r--utils/uriplaylistbin/src/uriplaylistbin/imp.rs5
-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
-rw-r--r--video/ffv1/tests/ffv1dec.rs2
-rw-r--r--video/gtk4/examples/gtksink.rs7
-rw-r--r--video/videofx/src/videocompare/mod.rs8
-rw-r--r--video/webp/src/dec/imp.rs4
65 files changed, 328 insertions, 346 deletions
diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs
index 183b7c1c4..cc7c03c19 100644
--- a/audio/audiofx/src/audioloudnorm/imp.rs
+++ b/audio/audiofx/src/audioloudnorm/imp.rs
@@ -1690,7 +1690,7 @@ impl ObjectSubclass for AudioLoudNorm {
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| {
Self::catch_panic_pad_function(
parent,
@@ -1705,7 +1705,7 @@ impl ObjectSubclass for AudioLoudNorm {
.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)
.query_function(|pad, parent, query| {
Self::catch_panic_pad_function(parent, || false, |this| this.src_query(pad, query))
})
diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs
index f722314ed..794e0d5aa 100644
--- a/generic/sodium/src/decrypter/imp.rs
+++ b/generic/sodium/src/decrypter/imp.rs
@@ -526,10 +526,10 @@ impl ObjectSubclass for Decrypter {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::Pad::from_template(&templ, Some("sink"));
+ let sinkpad = gst::Pad::from_template(&templ);
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)
.getrange_function(|pad, parent, offset, buffer, size| {
Decrypter::catch_panic_pad_function(
parent,
diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs
index af99edde6..b6560e0f7 100644
--- a/generic/sodium/src/encrypter/imp.rs
+++ b/generic/sodium/src/encrypter/imp.rs
@@ -329,7 +329,7 @@ impl ObjectSubclass for Encrypter {
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| {
Encrypter::catch_panic_pad_function(
parent,
@@ -347,7 +347,7 @@ impl ObjectSubclass for Encrypter {
.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)
.query_function(|pad, parent, query| {
Encrypter::catch_panic_pad_function(
parent,
diff --git a/generic/threadshare/examples/standalone/sink/async_mutex/imp.rs b/generic/threadshare/examples/standalone/sink/async_mutex/imp.rs
index b909ab48c..75613181f 100644
--- a/generic/threadshare/examples/standalone/sink/async_mutex/imp.rs
+++ b/generic/threadshare/examples/standalone/sink/async_mutex/imp.rs
@@ -241,7 +241,7 @@ impl ObjectSubclass for AsyncMutexSink {
let sink_pad_handler = AsyncPadSinkHandler::default();
Self {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
sink_pad_handler.clone(),
),
sink_pad_handler,
diff --git a/generic/threadshare/examples/standalone/sink/sync_mutex/imp.rs b/generic/threadshare/examples/standalone/sink/sync_mutex/imp.rs
index bef18db1e..18957e402 100644
--- a/generic/threadshare/examples/standalone/sink/sync_mutex/imp.rs
+++ b/generic/threadshare/examples/standalone/sink/sync_mutex/imp.rs
@@ -234,7 +234,7 @@ impl ObjectSubclass for DirectSink {
let sink_pad_handler = SyncPadSinkHandler::default();
Self {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
sink_pad_handler.clone(),
),
sink_pad_handler,
diff --git a/generic/threadshare/examples/standalone/sink/task/imp.rs b/generic/threadshare/examples/standalone/sink/task/imp.rs
index 3979a0e35..1ac869652 100644
--- a/generic/threadshare/examples/standalone/sink/task/imp.rs
+++ b/generic/threadshare/examples/standalone/sink/task/imp.rs
@@ -305,7 +305,7 @@ impl ObjectSubclass for TaskSink {
fn with_class(klass: &Self::Class) -> Self {
Self {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
TaskPadSinkHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/examples/standalone/src/imp.rs b/generic/threadshare/examples/standalone/src/imp.rs
index ba397d2f8..821025f9c 100644
--- a/generic/threadshare/examples/standalone/src/imp.rs
+++ b/generic/threadshare/examples/standalone/src/imp.rs
@@ -318,7 +318,7 @@ impl ObjectSubclass for TestSrc {
fn with_class(klass: &Self::Class) -> Self {
Self {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
TestSrcPadHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs
index ceb79201c..10e5c9637 100644
--- a/generic/threadshare/src/appsrc/imp.rs
+++ b/generic/threadshare/src/appsrc/imp.rs
@@ -432,7 +432,7 @@ impl ObjectSubclass for AppSrc {
fn with_class(klass: &Self::Class) -> Self {
Self {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
AppSrcPadHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/src/audiotestsrc/imp.rs b/generic/threadshare/src/audiotestsrc/imp.rs
index c48f56fa4..a628c1930 100644
--- a/generic/threadshare/src/audiotestsrc/imp.rs
+++ b/generic/threadshare/src/audiotestsrc/imp.rs
@@ -543,7 +543,7 @@ impl ObjectSubclass for AudioTestSrc {
fn with_class(klass: &Self::Class) -> Self {
Self {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
AudioTestSrcPadHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs
index 0455f2271..81cf5cd33 100644
--- a/generic/threadshare/src/inputselector/imp.rs
+++ b/generic/threadshare/src/inputselector/imp.rs
@@ -355,7 +355,7 @@ impl ObjectSubclass for InputSelector {
fn with_class(klass: &Self::Class) -> Self {
Self {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
InputSelectorPadSrcHandler,
),
state: Mutex::new(State::default()),
@@ -545,8 +545,9 @@ impl ElementImpl for InputSelector {
) -> Option<gst::Pad> {
let mut state = self.state.lock().unwrap();
let mut pads = self.pads.lock().unwrap();
- let sink_pad =
- gst::Pad::from_template(templ, Some(format!("sink_{}", pads.pad_serial).as_str()));
+ let sink_pad = gst::Pad::builder_from_template(templ)
+ .name(format!("sink_{}", pads.pad_serial).as_str())
+ .build();
pads.pad_serial += 1;
sink_pad.set_active(true).unwrap();
self.obj().add_pad(&sink_pad).unwrap();
diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs
index 881d68444..b5b515136 100644
--- a/generic/threadshare/src/jitterbuffer/imp.rs
+++ b/generic/threadshare/src/jitterbuffer/imp.rs
@@ -1302,11 +1302,11 @@ impl ObjectSubclass for JitterBuffer {
Self {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
sink_pad_handler.clone(),
),
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
src_pad_handler.clone(),
),
sink_pad_handler,
diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs
index 04acca05a..505374147 100644
--- a/generic/threadshare/src/proxy/imp.rs
+++ b/generic/threadshare/src/proxy/imp.rs
@@ -542,7 +542,7 @@ impl ObjectSubclass for ProxySink {
fn with_class(klass: &Self::Class) -> Self {
Self {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
ProxySinkPadHandler,
),
proxy_ctx: Mutex::new(None),
@@ -1045,7 +1045,7 @@ impl ObjectSubclass for ProxySrc {
fn with_class(klass: &Self::Class) -> Self {
Self {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
ProxySrcPadHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs
index 71cc631da..cc528763c 100644
--- a/generic/threadshare/src/queue/imp.rs
+++ b/generic/threadshare/src/queue/imp.rs
@@ -631,11 +631,11 @@ impl ObjectSubclass for Queue {
fn with_class(klass: &Self::Class) -> Self {
Self {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
QueuePadSinkHandler,
),
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
QueuePadSrcHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs
index cbbf2505f..ee6c18d63 100644
--- a/generic/threadshare/src/tcpclientsrc/imp.rs
+++ b/generic/threadshare/src/tcpclientsrc/imp.rs
@@ -485,7 +485,7 @@ impl ObjectSubclass for TcpClientSrc {
fn with_class(klass: &Self::Class) -> Self {
Self {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
TcpClientSrcPadHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs
index 770532356..138d15e9c 100644
--- a/generic/threadshare/src/udpsink/imp.rs
+++ b/generic/threadshare/src/udpsink/imp.rs
@@ -848,7 +848,7 @@ impl ObjectSubclass for UdpSink {
let sink_pad_handler = UdpSinkPadHandler::default();
Self {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
sink_pad_handler.clone(),
),
sink_pad_handler,
diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs
index cfd95de8f..18f9d0a87 100644
--- a/generic/threadshare/src/udpsrc/imp.rs
+++ b/generic/threadshare/src/udpsrc/imp.rs
@@ -620,7 +620,7 @@ impl ObjectSubclass for UdpSrc {
fn with_class(klass: &Self::Class) -> Self {
Self {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
UdpSrcPadHandler,
),
task: Task::default(),
diff --git a/generic/threadshare/tests/pad.rs b/generic/threadshare/tests/pad.rs
index c99f6a3ba..406b15034 100644
--- a/generic/threadshare/tests/pad.rs
+++ b/generic/threadshare/tests/pad.rs
@@ -282,7 +282,7 @@ mod imp_src {
fn with_class(klass: &Self::Class) -> Self {
ElementSrcTest {
src_pad: PadSrc::new(
- gst::Pad::from_template(&klass.pad_template("src").unwrap(), Some("src")),
+ gst::Pad::from_template(&klass.pad_template("src").unwrap()),
PadSrcTestHandler,
),
task: Task::default(),
@@ -575,7 +575,7 @@ mod imp_sink {
fn with_class(klass: &Self::Class) -> Self {
ElementSinkTest {
sink_pad: PadSink::new(
- gst::Pad::from_template(&klass.pad_template("sink").unwrap(), Some("sink")),
+ gst::Pad::from_template(&klass.pad_template("sink").unwrap()),
PadSinkTestHandler,
),
flushing: AtomicBool::new(true),
diff --git a/mux/flavors/src/flvdemux/imp.rs b/mux/flavors/src/flvdemux/imp.rs
index d92f23767..528d3dae8 100644
--- a/mux/flavors/src/flvdemux/imp.rs
+++ b/mux/flavors/src/flvdemux/imp.rs
@@ -129,7 +129,7 @@ impl ObjectSubclass for FlvDemux {
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| {
FlvDemux::catch_panic_pad_function(
parent,
@@ -620,7 +620,7 @@ impl FlvDemux {
fn create_srcpad(&self, name: &str, caps: &gst::Caps) -> gst::Pad {
let templ = self.obj().element_class().pad_template(name).unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some(name))
+ let srcpad = gst::Pad::builder_from_template(&templ)
.event_function(|pad, parent, event| {
FlvDemux::catch_panic_pad_function(
parent,
diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs
index d96f01998..ae913571b 100644
--- a/mux/fmp4/src/fmp4mux/imp.rs
+++ b/mux/fmp4/src/fmp4mux/imp.rs
@@ -2890,10 +2890,9 @@ impl ObjectImpl for FMP4Mux {
templ.presence() == gst::PadPresence::Always
&& templ.direction() == gst::PadDirection::Sink
}) {
- let sinkpad =
- gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ, Some("sink"))
- .flags(gst::PadFlags::ACCEPT_INTERSECT)
- .build();
+ let sinkpad = gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ)
+ .flags(gst::PadFlags::ACCEPT_INTERSECT)
+ .build();
obj.add_pad(&sinkpad).unwrap();
}
diff --git a/net/aws/src/s3hlssink/imp.rs b/net/aws/src/s3hlssink/imp.rs
index e4255d8ff..1c53189a0 100644
--- a/net/aws/src/s3hlssink/imp.rs
+++ b/net/aws/src/s3hlssink/imp.rs
@@ -884,9 +884,7 @@ impl ElementImpl for S3HlsSink {
}
let audio_pad = self.hlssink.request_pad_simple("audio").unwrap();
- let sink_pad =
- gst::GhostPad::from_template_with_target(templ, Some("audio"), &audio_pad)
- .unwrap();
+ let sink_pad = gst::GhostPad::from_template_with_target(templ, &audio_pad).unwrap();
self.obj().add_pad(&sink_pad).unwrap();
sink_pad.set_active(true).unwrap();
settings.audio_sink = true;
@@ -904,9 +902,7 @@ impl ElementImpl for S3HlsSink {
}
let video_pad = self.hlssink.request_pad_simple("video").unwrap();
- let sink_pad =
- gst::GhostPad::from_template_with_target(templ, Some("video"), &video_pad)
- .unwrap();
+ let sink_pad = gst::GhostPad::from_template_with_target(templ, &video_pad).unwrap();
self.obj().add_pad(&sink_pad).unwrap();
sink_pad.set_active(true).unwrap();
settings.video_sink = true;
diff --git a/net/aws/src/transcribe_parse/imp.rs b/net/aws/src/transcribe_parse/imp.rs
index b8ba0fd5a..4a3a48653 100644
--- a/net/aws/src/transcribe_parse/imp.rs
+++ b/net/aws/src/transcribe_parse/imp.rs
@@ -252,7 +252,7 @@ impl ObjectSubclass for TranscribeParse {
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| {
TranscribeParse::catch_panic_pad_function(
parent,
@@ -270,7 +270,7 @@ impl ObjectSubclass for TranscribeParse {
.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,
diff --git a/net/aws/src/transcriber/imp.rs b/net/aws/src/transcriber/imp.rs
index 9658b8147..bc160b633 100644
--- a/net/aws/src/transcriber/imp.rs
+++ b/net/aws/src/transcriber/imp.rs
@@ -589,7 +589,7 @@ impl ObjectSubclass for Transcriber {
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| {
Transcriber::catch_panic_pad_function(
parent,
@@ -607,29 +607,28 @@ impl ObjectSubclass for Transcriber {
.build();
let templ = klass.pad_template("src").unwrap();
- let static_srcpad =
- gst::PadBuilder::<super::TranslateSrcPad>::from_template(&templ, Some("src"))
- .activatemode_function(|pad, parent, mode, active| {
- Transcriber::catch_panic_pad_function(
- parent,
- || {
- Err(gst::loggable_error!(
- CAT,
- "Panic activating TranslateSrcPad"
- ))
- },
- |elem| TranslateSrcPad::activatemode(elem, pad, mode, active),
- )
- })
- .query_function(|pad, parent, query| {
- Transcriber::catch_panic_pad_function(
- parent,
- || false,
- |elem| TranslateSrcPad::src_query(elem, pad, query),
- )
- })
- .flags(gst::PadFlags::FIXED_CAPS)
- .build();
+ let static_srcpad = gst::PadBuilder::<super::TranslateSrcPad>::from_template(&templ)
+ .activatemode_function(|pad, parent, mode, active| {
+ Transcriber::catch_panic_pad_function(
+ parent,
+ || {
+ Err(gst::loggable_error!(
+ CAT,
+ "Panic activating TranslateSrcPad"
+ ))
+ },
+ |elem| TranslateSrcPad::activatemode(elem, pad, mode, active),
+ )
+ })
+ .query_function(|pad, parent, query| {
+ Transcriber::catch_panic_pad_function(
+ parent,
+ || false,
+ |elem| TranslateSrcPad::src_query(elem, pad, query),
+ )
+ })
+ .flags(gst::PadFlags::FIXED_CAPS)
+ .build();
// Setting the channel capacity so that a TranslateSrcPad that would lag
// behind for some reasons get a chance to catch-up without loosing items.
@@ -986,31 +985,29 @@ impl ElementImpl for Transcriber {
) -> Option<gst::Pad> {
let mut state = self.state.lock().unwrap();
- let pad = gst::PadBuilder::<super::TranslateSrcPad>::from_template(
- templ,
- Some(format!("translate_src_{}", state.pad_serial).as_str()),
- )
- .activatemode_function(|pad, parent, mode, active| {
- Transcriber::catch_panic_pad_function(
- parent,
- || {
- Err(gst::loggable_error!(
- CAT,
- "Panic activating TranslateSrcPad"
- ))
- },
- |elem| TranslateSrcPad::activatemode(elem, pad, mode, active),
- )
- })
- .query_function(|pad, parent, query| {
- Transcriber::catch_panic_pad_function(
- parent,
- || false,
- |elem| TranslateSrcPad::src_query(elem, pad, query),
- )
- })
- .flags(gst::PadFlags::FIXED_CAPS)
- .build();
+ let pad = gst::PadBuilder::<super::TranslateSrcPad>::from_template(templ)
+ .name(format!("translate_src_{}", state.pad_serial).as_str())
+ .activatemode_function(|pad, parent, mode, active| {
+ Transcriber::catch_panic_pad_function(
+ parent,
+ || {
+ Err(gst::loggable_error!(
+ CAT,
+ "Panic activating TranslateSrcPad"
+ ))
+ },
+ |elem| TranslateSrcPad::activatemode(elem, pad, mode, active),
+ )
+ })
+ .query_function(|pad, parent, query| {
+ Transcriber::catch_panic_pad_function(
+ parent,
+ || false,
+ |elem| TranslateSrcPad::src_query(elem, pad, query),
+ )
+ })
+ .flags(gst::PadFlags::FIXED_CAPS)
+ .build();
state.srcpads.insert(pad.clone());
diff --git a/net/hlssink3/src/imp.rs b/net/hlssink3/src/imp.rs
index 324634b12..c629ce401 100644
--- a/net/hlssink3/src/imp.rs
+++ b/net/hlssink3/src/imp.rs
@@ -797,9 +797,7 @@ impl ElementImpl for HlsSink3 {
}
let peer_pad = settings.splitmuxsink.request_pad_simple("audio_0").unwrap();
- let sink_pad =
- gst::GhostPad::from_template_with_target(templ, Some("audio"), &peer_pad)
- .unwrap();
+ let sink_pad = gst::GhostPad::from_template_with_target(templ, &peer_pad).unwrap();
self.obj().add_pad(&sink_pad).unwrap();
sink_pad.set_active(true).unwrap();
settings.audio_sink = true;
@@ -817,9 +815,7 @@ impl ElementImpl for HlsSink3 {
}
let peer_pad = settings.splitmuxsink.request_pad_simple("video").unwrap();
- let sink_pad =
- gst::GhostPad::from_template_with_target(templ, Some("video"), &peer_pad)
- .unwrap();
+ let sink_pad = gst::GhostPad::from_template_with_target(templ, &peer_pad).unwrap();
self.obj().add_pad(&sink_pad).unwrap();
sink_pad.set_active(true).unwrap();
settings.video_sink = true;
diff --git a/net/ndi/src/ndisinkcombiner/imp.rs b/net/ndi/src/ndisinkcombiner/imp.rs
index c29210911..eb83af973 100644
--- a/net/ndi/src/ndisinkcombiner/imp.rs
+++ b/net/ndi/src/ndisinkcombiner/imp.rs
@@ -52,9 +52,7 @@ impl ObjectSubclass for NdiSinkCombiner {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("video").unwrap();
- let video_pad =
- gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ, Some("video"))
- .build();
+ let video_pad = gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ).build();
Self {
video_pad,
@@ -176,8 +174,7 @@ impl AggregatorImpl for NdiSinkCombiner {
return None;
}
- let pad =
- gst::PadBuilder::<gst_base::AggregatorPad>::from_template(templ, Some("audio")).build();
+ let pad = gst::PadBuilder::<gst_base::AggregatorPad>::from_template(templ).build();
*audio_pad_storage = Some(pad.clone());
gst::debug!(CAT, imp: self, "Requested audio pad");
diff --git a/net/ndi/src/ndisrcdemux/imp.rs b/net/ndi/src/ndisrcdemux/imp.rs
index a64c280f2..75901664e 100644
--- a/net/ndi/src/ndisrcdemux/imp.rs
+++ b/net/ndi/src/ndisrcdemux/imp.rs
@@ -40,7 +40,7 @@ impl ObjectSubclass for NdiSrcDemux {
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)
.flags(gst::PadFlags::FIXED_CAPS)
.chain_function(|pad, parent, buffer| {
NdiSrcDemux::catch_panic_pad_function(
@@ -180,7 +180,7 @@ impl NdiSrcDemux {
gst::debug!(CAT, imp: self, "Adding audio pad with caps {}", caps);
let templ = self.obj().element_class().pad_template("audio").unwrap();
- let pad = gst::Pad::builder_with_template(&templ, Some("audio"))
+ let pad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::FIXED_CAPS)
.build();
@@ -229,7 +229,7 @@ impl NdiSrcDemux {
gst::debug!(CAT, imp: self, "Adding video pad with caps {}", caps);
let templ = self.obj().element_class().pad_template("video").unwrap();
- let pad = gst::Pad::builder_with_template(&templ, Some("video"))
+ let pad = gst::Pad::builder_from_template(&templ)
.flags(gst::PadFlags::FIXED_CAPS)
.build();
diff --git a/net/onvif/src/onvifmetadatacombiner/imp.rs b/net/onvif/src/onvifmetadatacombiner/imp.rs
index 2a5e87375..9cd56f53d 100644
--- a/net/onvif/src/onvifmetadatacombiner/imp.rs
+++ b/net/onvif/src/onvifmetadatacombiner/imp.rs
@@ -42,12 +42,11 @@ impl ObjectSubclass for OnvifMetadataCombiner {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("media").unwrap();
let media_sink_pad =
- gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ, Some("media"))
- .build();
+ gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ).build();
let templ = klass.pad_template("meta").unwrap();
let meta_sink_pad =
- gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ, Some("meta")).build();
+ gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ).build();
Self {
media_sink_pad,
diff --git a/net/onvif/src/onvifmetadataoverlay/imp.rs b/net/onvif/src/onvifmetadataoverlay/imp.rs
index f1acaedd8..6003ff3a0 100644
--- a/net/onvif/src/onvifmetadataoverlay/imp.rs
+++ b/net/onvif/src/onvifmetadataoverlay/imp.rs
@@ -715,7 +715,7 @@ impl ObjectSubclass for OnvifMetadataOverlay {
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| {
OnvifMetadataOverlay::catch_panic_pad_function(
parent,
@@ -735,7 +735,7 @@ impl ObjectSubclass for OnvifMetadataOverlay {
.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/net/onvif/src/onvifmetadataparse/imp.rs b/net/onvif/src/onvifmetadataparse/imp.rs
index 2e138d547..f1464e416 100644
--- a/net/onvif/src/onvifmetadataparse/imp.rs
+++ b/net/onvif/src/onvifmetadataparse/imp.rs
@@ -1407,7 +1407,7 @@ impl ObjectSubclass for OnvifMetadataParse {
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| {
OnvifMetadataParse::catch_panic_pad_function(
parent,
@@ -1433,7 +1433,7 @@ impl ObjectSubclass for OnvifMetadataParse {
.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| {
OnvifMetadataParse::catch_panic_pad_function(
parent,
diff --git a/net/raptorq/src/raptorqdec/imp.rs b/net/raptorq/src/raptorqdec/imp.rs
index aba109eb7..6c305b95f 100644
--- a/net/raptorq/src/raptorqdec/imp.rs
+++ b/net/raptorq/src/raptorqdec/imp.rs
@@ -590,7 +590,7 @@ impl ObjectSubclass for RaptorqDec {
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| {
Self::catch_panic_pad_function(
parent,
@@ -612,7 +612,7 @@ impl ObjectSubclass for RaptorqDec {
.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)
.iterate_internal_links_function(|pad, parent| {
Self::catch_panic_pad_function(
parent,
@@ -821,7 +821,8 @@ impl ElementImpl for RaptorqDec {
return None;
}
- let sinkpad_fec = gst::Pad::builder_with_template(templ, name)
+ let sinkpad_fec = gst::Pad::builder_from_template(templ)
+ .maybe_name(name)
.chain_function(|pad, parent, buffer| {
Self::catch_panic_pad_function(
parent,
diff --git a/net/raptorq/src/raptorqenc/imp.rs b/net/raptorq/src/raptorqenc/imp.rs
index 07264d7fe..cb37a0a2a 100644
--- a/net/raptorq/src/raptorqenc/imp.rs
+++ b/net/raptorq/src/raptorqenc/imp.rs
@@ -659,7 +659,7 @@ impl ObjectSubclass for RaptorqEnc {
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| {
Self::catch_panic_pad_function(
parent,
@@ -681,7 +681,7 @@ impl ObjectSubclass for RaptorqEnc {
.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)
.iterate_internal_links_function(|pad, parent| {
Self::catch_panic_pad_function(
parent,
@@ -693,7 +693,7 @@ impl ObjectSubclass for RaptorqEnc {
.build();
let templ = klass.pad_template("fec_0").unwrap();
- let srcpad_fec = gst::Pad::builder_with_template(&templ, Some("fec_0"))
+ let srcpad_fec = gst::Pad::builder_from_template(&templ)
.activatemode_function(move |pad, parent, mode, active| {
Self::catch_panic_pad_function(
parent,
diff --git a/net/reqwest/tests/reqwesthttpsrc.rs b/net/reqwest/tests/reqwesthttpsrc.rs
index da5a9c855..9287822a2 100644
--- a/net/reqwest/tests/reqwesthttpsrc.rs
+++ b/net/reqwest/tests/reqwesthttpsrc.rs
@@ -72,7 +72,8 @@ impl Harness {
let (sender, receiver) = mpsc::sync_channel(0);
// Sink pad that receives everything the source is generating
- let pad = gst::Pad::builder(Some("sink"), gst::PadDirection::Sink)
+ let pad = gst::Pad::builder(gst::PadDirection::Sink)
+ .name("sink")
.chain_function({
let sender_clone = sender.clone();
move |_pad, _parent, buffer| {
diff --git a/net/rtp/src/gcc/imp.rs b/net/rtp/src/gcc/imp.rs
index f56d0a785..1955ecf17 100644
--- a/net/rtp/src/gcc/imp.rs
+++ b/net/rtp/src/gcc/imp.rs
@@ -1146,7 +1146,7 @@ impl ObjectSubclass for BandwidthEstimator {
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, mut buffer| {
BandwidthEstimator::catch_panic_pad_function(
parent,
@@ -1166,7 +1166,7 @@ impl ObjectSubclass for BandwidthEstimator {
.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| {
BandwidthEstimator::catch_panic_pad_function(
parent,
diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs
index c3fbda7c5..5e5a8c894 100644
--- a/net/webrtc/src/webrtcsink/imp.rs
+++ b/net/webrtc/src/webrtcsink/imp.rs
@@ -399,10 +399,8 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
}
};
- ret.add_pad(
- &gst::GhostPad::with_target(Some("sink"), &head.static_pad("sink").unwrap()).unwrap(),
- )
- .unwrap();
+ ret.add_pad(&gst::GhostPad::with_target(&head.static_pad("sink").unwrap()).unwrap())
+ .unwrap();
if video_info.fps().numer() != 0 {
let vrate = make_element("videorate", None)?;
@@ -414,10 +412,8 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
tail = vrate;
}
- ret.add_pad(
- &gst::GhostPad::with_target(Some("src"), &tail.static_pad("src").unwrap()).unwrap(),
- )
- .unwrap();
+ ret.add_pad(&gst::GhostPad::with_target(&tail.static_pad("src").unwrap()).unwrap())
+ .unwrap();
Ok(ret.upcast())
}
@@ -3503,7 +3499,8 @@ impl ElementImpl for BaseWebRTCSink {
(name, false)
};
- let sink_pad = gst::GhostPad::builder_with_template(templ, Some(name.as_str()))
+ let sink_pad = gst::GhostPad::builder_from_template(templ)
+ .name(name.as_str())
.event_function(|pad, parent, event| {
BaseWebRTCSink::catch_panic_pad_function(
parent,
diff --git a/net/webrtc/src/webrtcsrc/imp.rs b/net/webrtc/src/webrtcsrc/imp.rs
index dfedcc73d..86780034b 100644
--- a/net/webrtc/src/webrtcsrc/imp.rs
+++ b/net/webrtc/src/webrtcsrc/imp.rs
@@ -417,7 +417,9 @@ impl WebRTCSrc {
pad.store_sticky_event(&builder.build()).ok();
}
- let ghostpad = gst::GhostPad::builder(None, gst::PadDirection::Src)
+ let ghostpad = gst::GhostPad::builder(gst::PadDirection::Src)
+ .with_target(pad)
+ .unwrap()
.proxy_pad_chain_function(glib::clone!(@weak self as this => @default-panic, move
|pad, parent, buffer| {
let padret = gst::ProxyPad::chain_default(pad, parent, buffer);
@@ -443,8 +445,7 @@ impl WebRTCSrc {
gst::Pad::event_default(pad, parent, event)
}))
- .build_with_target(pad)
- .unwrap();
+ .build();
bin.add_pad(&ghostpad)
.expect("Adding ghostpad to the bin should always work");
@@ -550,7 +551,7 @@ impl WebRTCSrc {
webrtcbin.set_property("stun-server", stun_server);
}
- let bin = gst::Bin::new(None);
+ let bin = gst::Bin::new();
bin.connect_pad_removed(glib::clone!(@weak self as this => move |_, pad|
this.state.lock().unwrap().flow_combiner.remove_pad(pad);
));
@@ -751,7 +752,8 @@ impl WebRTCSrc {
let caps_with_raw = [caps.clone(), raw_caps.clone()]
.into_iter()
.collect::<gst::Caps>();
- let ghost = gst::GhostPad::builder_with_template(&template, Some(&name))
+ let ghost = gst::GhostPad::builder_from_template(&template)
+ .name(name)
.build()
.downcast::<WebRTCSrcPad>()
.unwrap();
diff --git a/net/webrtchttp/src/whepsrc/imp.rs b/net/webrtchttp/src/whepsrc/imp.rs
index e0752ac8c..d8be22844 100644
--- a/net/webrtchttp/src/whepsrc/imp.rs
+++ b/net/webrtchttp/src/whepsrc/imp.rs
@@ -534,9 +534,7 @@ impl WhepSrc {
);
let templ = self_.obj().pad_template("src_%u").unwrap();
- let src_pad = gst::GhostPad::builder_with_template(&templ, Some(&pad.name()))
- .build_with_target(pad)
- .unwrap();
+ let src_pad = gst::GhostPad::from_template_with_target(&templ, pad).unwrap();
src_pad.set_target(Some(pad)).unwrap();
src_pad
diff --git a/net/webrtchttp/src/whipsink/imp.rs b/net/webrtchttp/src/whipsink/imp.rs
index c1ac7c28e..1b3f5b655 100644
--- a/net/webrtchttp/src/whipsink/imp.rs
+++ b/net/webrtchttp/src/whipsink/imp.rs
@@ -135,7 +135,9 @@ impl ElementImpl for WhipSink {
caps: Option<&gst::Caps>,
) -> Option<gst::Pad> {
let wb_sink_pad = self.webrtcbin.request_pad(templ, name, caps)?;
- let sink_pad = gst::GhostPad::new(Some(&wb_sink_pad.name()), gst::PadDirection::Sink);
+ let sink_pad = gst::GhostPad::builder(gst::PadDirection::Sink)
+ .name(wb_sink_pad.name())
+ .build();
sink_pad.set_target(Some(&wb_sink_pad)).unwrap();
self.obj().add_pad(&sink_pad).unwrap();
diff --git a/text/ahead/src/textahead/imp.rs b/text/ahead/src/textahead/imp.rs
index 6af01de99..90c937eaa 100644
--- a/text/ahead/src/textahead/imp.rs
+++ b/text/ahead/src/textahead/imp.rs
@@ -78,7 +78,7 @@ impl ObjectSubclass for TextAhead {
fn with_class(klass: &Self::Class) -> Self {
let templ = klass.pad_template("sink").unwrap();
- let sink_pad = gst::Pad::builder_with_template(&templ, Some("sink"))
+ let sink_pad = gst::Pad::builder_from_template(&templ)
.chain_function(|pad, parent, buffer| {
TextAhead::catch_panic_pad_function(
parent,
@@ -96,7 +96,7 @@ impl ObjectSubclass for TextAhead {
.build();
let templ = klass.pad_template("src").unwrap();
- let src_pad = gst::Pad::builder_with_template(&templ, Some("src")).build();
+ let src_pad = gst::Pad::from_template(&templ);
Self {
sink_pad,
diff --git a/text/json/src/jsongstenc/imp.rs b/text/json/src/jsongstenc/imp.rs
index 84b81e6c5..42e870215 100644
--- a/text/json/src/jsongstenc/imp.rs
+++ b/text/json/src/jsongstenc/imp.rs
@@ -183,7 +183,7 @@ impl ObjectSubclass for JsonGstEnc {
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| {
JsonGstEnc::catch_panic_pad_function(
parent,
@@ -201,7 +201,7 @@ impl ObjectSubclass for JsonGstEnc {
.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,
diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs
index 3550daf69..b15bb739f 100644
--- a/text/json/src/jsongstparse/imp.rs
+++ b/text/json/src/jsongstparse/imp.rs
@@ -822,7 +822,7 @@ impl ObjectSubclass for JsonGstParse {
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| {
JsonGstParse::catch_panic_pad_function(
parent,
@@ -859,7 +859,7 @@ impl ObjectSubclass for JsonGstParse {
.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| {
JsonGstParse::catch_panic_pad_function(
parent,
diff --git a/text/regex/src/gstregex/imp.rs b/text/regex/src/gstregex/imp.rs
index c09f251e3..bfe7987d7 100644
--- a/text/regex/src/gstregex/imp.rs
+++ b/text/regex/src/gstregex/imp.rs
@@ -111,7 +111,7 @@ impl ObjectSubclass for RegEx {
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| {
RegEx::catch_panic_pad_function(
parent,
@@ -123,7 +123,7 @@ impl ObjectSubclass for RegEx {
.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 | gst::PadFlags::FIXED_CAPS)
.build();
diff --git a/text/wrap/src/gsttextwrap/imp.rs b/text/wrap/src/gsttextwrap/imp.rs
index 918476506..de98e2b8e 100644
--- a/text/wrap/src/gsttextwrap/imp.rs
+++ b/text/wrap/src/gsttextwrap/imp.rs
@@ -405,7 +405,7 @@ impl ObjectSubclass for TextWrap {
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| {
TextWrap::catch_panic_pad_function(
parent,
@@ -424,7 +424,7 @@ impl ObjectSubclass for TextWrap {
.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)
.query_function(|pad, parent, query| {
TextWrap::catch_panic_pad_function(
parent,
diff --git a/tutorial/src/identity/imp.rs b/tutorial/src/identity/imp.rs
index 92d566291..7b26806cf 100644
--- a/tutorial/src/identity/imp.rs
+++ b/tutorial/src/identity/imp.rs
@@ -123,7 +123,7 @@ impl ObjectSubclass for Identity {
//
// Details about what each function is good for is next to each function definition
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| {
Identity::catch_panic_pad_function(
parent,
@@ -148,7 +148,7 @@ impl ObjectSubclass for Identity {
.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| {
Identity::catch_panic_pad_function(
parent,
diff --git a/tutorial/src/progressbin/imp.rs b/tutorial/src/progressbin/imp.rs
index f0bdafff4..eee52691a 100644
--- a/tutorial/src/progressbin/imp.rs
+++ b/tutorial/src/progressbin/imp.rs
@@ -58,9 +58,9 @@ impl ObjectSubclass for ProgressBin {
//
// We do that and adding the pads inside glib::Object::constructed() later.
let templ = klass.pad_template("sink").unwrap();
- let sinkpad = gst::GhostPad::from_template(&templ, Some("sink"));
+ let sinkpad = gst::GhostPad::from_template(&templ);
let templ = klass.pad_template("src").unwrap();
- let srcpad = gst::GhostPad::from_template(&templ, Some("src"));
+ let srcpad = gst::GhostPad::from_template(&templ);
// Create the progressreport element.
let progress = gst::ElementFactory::make("progressreport")
diff --git a/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs
index 2159f27a3..b158fa1ba 100644
--- a/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs
+++ b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs
@@ -292,9 +292,10 @@ impl CustomSource {
(self.obj().pad_template("video_%u").unwrap(), name)
};
- let ghost_pad = gst::GhostPad::builder_with_template(&templ, Some(&name))
- .build_with_target(pad)
- .unwrap();
+ let ghost_pad = gst::GhostPad::builder_from_template_with_target(&templ, pad)
+ .unwrap()
+ .name(name)
+ .build();
let stream = Stream {
source_pad: pad.clone(),
diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs
index 8ba75c5ae..4be3ed44c 100644
--- a/utils/fallbackswitch/src/fallbacksrc/imp.rs
+++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs
@@ -943,8 +943,7 @@ impl FallbackSrc {
])
.unwrap();
- let ghostpad =
- gst::GhostPad::with_target(Some("src"), &queue.static_pad("src").unwrap()).unwrap();
+ let ghostpad = gst::GhostPad::with_target(&queue.static_pad("src").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
@@ -1002,8 +1001,7 @@ impl FallbackSrc {
])
.unwrap();
- let ghostpad =
- gst::GhostPad::with_target(Some("src"), &queue.static_pad("src").unwrap()).unwrap();
+ let ghostpad = gst::GhostPad::with_target(&queue.static_pad("src").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
@@ -1204,7 +1202,9 @@ impl FallbackSrc {
.obj()
.pad_template(if is_audio { "audio" } else { "video" })
.unwrap();
- let ghostpad = gst::GhostPad::builder_with_template(&templ, Some(&templ.name()))
+ let ghostpad = gst::GhostPad::builder_from_template_with_target(&templ, &srcpad)
+ .unwrap()
+ .name(templ.name())
.proxy_pad_chain_function({
move |pad, parent, buffer| {
let parent = parent.and_then(|p| p.parent());
@@ -1215,8 +1215,7 @@ impl FallbackSrc {
)
}
})
- .build_with_target(&srcpad)
- .unwrap();
+ .build();
let _ = ghostpad.set_active(true);
@@ -1612,14 +1611,11 @@ impl FallbackSrc {
gst::Element::link_many([&videoconvert, &videoscale, &imagefreeze, &capsfilter]).unwrap();
let ghostpad =
- gst::GhostPad::with_target(Some("sink"), &videoconvert.static_pad("sink").unwrap())
- .unwrap();
+ gst::GhostPad::with_target(&videoconvert.static_pad("sink").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
- let ghostpad =
- gst::GhostPad::with_target(Some("src"), &capsfilter.static_pad("src").unwrap())
- .unwrap();
+ let ghostpad = gst::GhostPad::with_target(&capsfilter.static_pad("src").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
@@ -1660,14 +1656,11 @@ impl FallbackSrc {
gst::Element::link_many([&videoconvert, &videoscale, &capsfilter]).unwrap();
let ghostpad =
- gst::GhostPad::with_target(Some("sink"), &videoconvert.static_pad("sink").unwrap())
- .unwrap();
+ gst::GhostPad::with_target(&videoconvert.static_pad("sink").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
- let ghostpad =
- gst::GhostPad::with_target(Some("src"), &capsfilter.static_pad("src").unwrap())
- .unwrap();
+ let ghostpad = gst::GhostPad::with_target(&capsfilter.static_pad("src").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
@@ -1708,14 +1701,11 @@ impl FallbackSrc {
gst::Element::link_many([&audioconvert, &audioresample, &capsfilter]).unwrap();
let ghostpad =
- gst::GhostPad::with_target(Some("sink"), &audioconvert.static_pad("sink").unwrap())
- .unwrap();
+ gst::GhostPad::with_target(&audioconvert.static_pad("sink").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
- let ghostpad =
- gst::GhostPad::with_target(Some("src"), &capsfilter.static_pad("src").unwrap())
- .unwrap();
+ let ghostpad = gst::GhostPad::with_target(&capsfilter.static_pad("src").unwrap()).unwrap();
ghostpad.set_active(true).unwrap();
bin.add_pad(&ghostpad).unwrap();
@@ -1891,8 +1881,10 @@ impl FallbackSrc {
gst::Element::link_many([&converters, &queue, &clocksync]).unwrap();
- let ghostpad =
- gst::GhostPad::with_target(Some(type_), &clocksync.static_pad("src").unwrap()).unwrap();
+ let ghostpad = gst::GhostPad::builder_with_target(&clocksync.static_pad("src").unwrap())
+ .unwrap()
+ .name(type_)
+ .build();
let _ = ghostpad.set_active(true);
source.source.add_pad(&ghostpad).unwrap();
diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs
index 5db9ba0e5..bea69f1a3 100644
--- a/utils/fallbackswitch/src/fallbackswitch/imp.rs
+++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs
@@ -1043,7 +1043,7 @@ impl ObjectSubclass for FallbackSwitch {
fn with_class(klass: &Self::Class) -> Self {
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)
.query_function(|pad, parent, query| {
FallbackSwitch::catch_panic_pad_function(
parent,
@@ -1334,42 +1334,40 @@ impl ElementImpl for FallbackSwitch {
let pad_serial = self.sink_pad_serial.fetch_add(1, Ordering::SeqCst);
- let pad = gst::PadBuilder::<super::FallbackSwitchSinkPad>::from_template(
- templ,
- Some(format!("sink_{pad_serial}").as_str()),
- )
- .chain_function(|pad, parent, buffer| {
- FallbackSwitch::catch_panic_pad_function(
- parent,
- || Err(gst::FlowError::Error),
- |fallbackswitch| fallbackswitch.sink_chain(pad, buffer),
- )
- })
- .chain_list_function(|pad, parent, bufferlist| {
- FallbackSwitch::catch_panic_pad_function(
- parent,
- || Err(gst::FlowError::Error),
- |fallbackswitch| fallbackswitch.sink_chain_list(pad, bufferlist),
- )
- })
- .event_function(|pad, parent, event| {
- FallbackSwitch::catch_panic_pad_function(
- parent,
- || false,
- |fallbackswitch| fallbackswitch.sink_event(pad, event),
- )
- })
- .query_function(|pad, parent, query| {
- FallbackSwitch::catch_panic_pad_function(
- parent,
- || false,
- |fallbackswitch| fallbackswitch.sink_query(pad, query),
- )
- })
- .activatemode_function(|pad, _parent, mode, activate| {
- Self::sink_activatemode(pad, mode, activate)
- })
- .build();
+ let pad = gst::PadBuilder::<super::FallbackSwitchSinkPad>::from_template(templ)
+ .name(format!("sink_{pad_serial}").as_str())
+ .chain_function(|pad, parent, buffer| {
+ FallbackSwitch::catch_panic_pad_function(
+ parent,
+ || Err(gst::FlowError::Error),
+ |fallbackswitch| fallbackswitch.sink_chain(pad, buffer),
+ )
+ })
+ .chain_list_function(|pad, parent, bufferlist| {
+ FallbackSwitch::catch_panic_pad_function(
+ parent,
+ || Err(gst::FlowError::Error),
+ |fallbackswitch| fallbackswitch.sink_chain_list(pad, bufferlist),
+ )
+ })
+ .event_function(|pad, parent, event| {
+ FallbackSwitch::catch_panic_pad_function(
+ parent,
+ || false,
+ |fallbackswitch| fallbackswitch.sink_event(pad, event),
+ )
+ })
+ .query_function(|pad, parent, query| {
+ FallbackSwitch::catch_panic_pad_function(
+ parent,
+ || false,
+ |fallbackswitch| fallbackswitch.sink_query(pad, query),
+ )
+ })
+ .activatemode_function(|pad, _parent, mode, activate| {
+ Self::sink_activatemode(pad, mode, activate)
+ })
+ .build();
pad.set_active(true).unwrap();
self.obj().add_pad(&pad).unwrap();
diff --git a/utils/livesync/src/livesync/imp.rs b/utils/livesync/src/livesync/imp.rs
index 99eac29f3..93c731328 100644
--- a/utils/livesync/src/livesync/imp.rs
+++ b/utils/livesync/src/livesync/imp.rs
@@ -199,72 +199,70 @@ impl ObjectSubclass for LiveSync {
type ParentType = gst::Element;
fn with_class(class: &Self::Class) -> Self {
- let sinkpad =
- gst::Pad::builder_with_template(&class.pad_template("sink").unwrap(), Some("sink"))
- .activatemode_function(|pad, parent, mode, active| {
- Self::catch_panic_pad_function(
- parent,
- || Err(gst::loggable_error!(CAT, "sink_activate_mode panicked")),
- |livesync| livesync.sink_activate_mode(pad, mode, active),
- )
- })
- .event_function(|pad, parent, event| {
- Self::catch_panic_pad_function(
- parent,
- || false,
- |livesync| livesync.sink_event(pad, event),
- )
- })
- .query_function(|pad, parent, query| {
- Self::catch_panic_pad_function(
- parent,
- || false,
- |livesync| livesync.sink_query(pad, query),
- )
- })
- .chain_function(|pad, parent, buffer| {
- Self::catch_panic_pad_function(
- parent,
- || Err(gst::FlowError::Error),
- |livesync| livesync.sink_chain(pad, buffer),
- )
- })
- .flags(
- gst::PadFlags::PROXY_CAPS
- | gst::PadFlags::PROXY_ALLOCATION
- | gst::PadFlags::PROXY_SCHEDULING,
+ let sinkpad = gst::Pad::builder_from_template(&class.pad_template("sink").unwrap())
+ .activatemode_function(|pad, parent, mode, active| {
+ Self::catch_panic_pad_function(
+ parent,
+ || Err(gst::loggable_error!(CAT, "sink_activate_mode panicked")),
+ |livesync| livesync.sink_activate_mode(pad, mode, active),
)
- .build();
-
- let srcpad =
- gst::Pad::builder_with_template(&class.pad_template("src").unwrap(), Some("src"))
- .activatemode_function(|pad, parent, mode, active| {
- Self::catch_panic_pad_function(
- parent,
- || Err(gst::loggable_error!(CAT, "src_activate_mode panicked")),
- |livesync| livesync.src_activate_mode(pad, mode, active),
- )
- })
- .event_function(|pad, parent, event| {
- Self::catch_panic_pad_function(
- parent,
- || false,
- |livesync| livesync.src_event(pad, event),
- )
- })
- .query_function(|pad, parent, query| {
- Self::catch_panic_pad_function(
- parent,
- || false,
- |livesync| livesync.src_query(pad, query),
- )
- })
- .flags(
- gst::PadFlags::PROXY_CAPS
- | gst::PadFlags::PROXY_ALLOCATION
- | gst::PadFlags::PROXY_SCHEDULING,
+ })
+ .event_function(|pad, parent, event| {
+ Self::catch_panic_pad_function(
+ parent,
+ || false,
+ |livesync| livesync.sink_event(pad, event),
+ )
+ })
+ .query_function(|pad, parent, query| {
+ Self::catch_panic_pad_function(
+ parent,
+ || false,
+ |livesync| livesync.sink_query(pad, query),
+ )
+ })
+ .chain_function(|pad, parent, buffer| {
+ Self::catch_panic_pad_function(
+ parent,
+ || Err(gst::FlowError::Error),
+ |livesync| livesync.sink_chain(pad, buffer),
)
- .build();
+ })
+ .flags(
+ gst::PadFlags::PROXY_CAPS
+ | gst::PadFlags::PROXY_ALLOCATION
+ | gst::PadFlags::PROXY_SCHEDULING,
+ )
+ .build();
+
+ let srcpad = gst::Pad::builder_from_template(&class.pad_template("src").unwrap())
+ .activatemode_function(|pad, parent, mode, active| {
+ Self::catch_panic_pad_function(
+ parent,
+ || Err(gst::loggable_error!(CAT, "src_activate_mode panicked")),
+ |livesync| livesync.src_activate_mode(pad, mode, active),
+ )
+ })
+ .event_function(|pad, parent, event| {
+ Self::catch_panic_pad_function(
+ parent,
+ || false,
+ |livesync| livesync.src_event(pad, event),
+ )
+ })
+ .query_function(|pad, parent, query| {
+ Self::catch_panic_pad_function(
+ parent,
+ || false,
+ |livesync| livesync.src_query(pad, query),
+ )
+ })
+ .flags(
+ gst::PadFlags::PROXY_CAPS
+ | gst::PadFlags::PROXY_ALLOCATION
+ | gst::PadFlags::PROXY_SCHEDULING,
+ )
+ .build();
Self {
state: Default::default(),
diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs
index beffa2064..d32ba3508 100644
--- a/utils/togglerecord/src/togglerecord/imp.rs
+++ b/utils/togglerecord/src/togglerecord/imp.rs
@@ -1705,7 +1705,7 @@ impl ObjectSubclass for ToggleRecord {
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| {
ToggleRecord::catch_panic_pad_function(
parent,
@@ -1737,7 +1737,7 @@ impl ObjectSubclass for ToggleRecord {
.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| {
ToggleRecord::catch_panic_pad_function(
parent,
@@ -2002,7 +2002,8 @@ impl ElementImpl for ToggleRecord {
*pad_count += 1;
let templ = self.obj().pad_template("sink_%u").unwrap();
- let sinkpad = gst::Pad::builder_with_template(&templ, Some(format!("sink_{id}").as_str()))
+ let sinkpad = gst::Pad::builder_from_template(&templ)
+ .name(format!("sink_{id}").as_str())
.chain_function(|pad, parent, buffer| {
ToggleRecord::catch_panic_pad_function(
parent,
@@ -2034,7 +2035,8 @@ impl ElementImpl for ToggleRecord {
.build();
let templ = self.obj().pad_template("src_%u").unwrap();
- let srcpad = gst::Pad::builder_with_template(&templ, Some(format!("src_{id}").as_str()))
+ let srcpad = gst::Pad::builder_from_template(&templ)
+ .name(format!("src_{id}").as_str())
.event_function(|pad, parent, event| {
ToggleRecord::catch_panic_pad_function(
parent,
diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs
index 50f2493b9..c98c25422 100644
--- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs
+++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs
@@ -1342,7 +1342,10 @@ impl UriPlaylistBin {
// ghost streamsynchronizer src pad
let sync_src_name = sync_sink.name().as_str().replace("sink", "src");
let src = state.streamsynchronizer.static_pad(&sync_src_name).unwrap();
- let ghost = gst::GhostPad::with_target(Some(pad_name.as_str()), &src).unwrap();
+ let ghost = gst::GhostPad::builder_with_target(&src)
+ .unwrap()
+ .name(pad_name.as_str())
+ .build();
ghost.set_active(true).unwrap();
// proxy sticky events
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,
diff --git a/video/ffv1/tests/ffv1dec.rs b/video/ffv1/tests/ffv1dec.rs
index d1ae38ad7..47410eb90 100644
--- a/video/ffv1/tests/ffv1dec.rs
+++ b/video/ffv1/tests/ffv1dec.rs
@@ -44,7 +44,7 @@ fn test_decode(name: &str) {
.unwrap();
let srcpad = bin.by_name("ffv1dec").unwrap().static_pad("src").unwrap();
- let _ = bin.add_pad(&gst::GhostPad::with_target(Some("src"), &srcpad).unwrap());
+ let _ = bin.add_pad(&gst::GhostPad::with_target(&srcpad).unwrap());
let mut h = gst_check::Harness::with_element(&bin, None, Some("src"));
diff --git a/video/gtk4/examples/gtksink.rs b/video/gtk4/examples/gtksink.rs
index 77855af75..2346a8cd3 100644
--- a/video/gtk4/examples/gtksink.rs
+++ b/video/gtk4/examples/gtksink.rs
@@ -48,11 +48,8 @@ fn create_ui(app: &gtk::Application) {
sink.add(&gtksink).unwrap();
convert.link(&gtksink).unwrap();
- sink.add_pad(
- &gst::GhostPad::with_target(Some("sink"), &convert.static_pad("sink").unwrap())
- .unwrap(),
- )
- .unwrap();
+ sink.add_pad(&gst::GhostPad::with_target(&convert.static_pad("sink").unwrap()).unwrap())
+ .unwrap();
(src, sink.upcast())
};
diff --git a/video/videofx/src/videocompare/mod.rs b/video/videofx/src/videocompare/mod.rs
index 67bccd4f1..a31493ace 100644
--- a/video/videofx/src/videocompare/mod.rs
+++ b/video/videofx/src/videocompare/mod.rs
@@ -200,7 +200,9 @@ mod test {
let mut message = VideoCompareMessage::default();
message.pad_distances.push(PadDistance {
- pad: gst::Pad::new(Some("sink_0"), gst::PadDirection::Sink),
+ pad: gst::Pad::builder(gst::PadDirection::Sink)
+ .name("sink_0")
+ .build(),
distance: 42_f64,
});
message.running_time = Some(running_time);
@@ -236,7 +238,9 @@ mod test {
gst::Array::from_iter([gst::Structure::builder("pad-distance")
.field(
"pad",
- gst::Pad::new(Some("sink_0"), gst::PadDirection::Sink),
+ gst::Pad::builder(gst::PadDirection::Sink)
+ .name("sink_0")
+ .build(),
)
.field("distance", 42f64)
.build()
diff --git a/video/webp/src/dec/imp.rs b/video/webp/src/dec/imp.rs
index b5f97e56e..8e70c950b 100644
--- a/video/webp/src/dec/imp.rs
+++ b/video/webp/src/dec/imp.rs
@@ -273,7 +273,7 @@ impl ObjectSubclass for WebPDec {
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| {
WebPDec::catch_panic_pad_function(
parent,
@@ -291,7 +291,7 @@ impl ObjectSubclass for WebPDec {
.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| {
WebPDec::catch_panic_pad_function(parent, || false, |dec| dec.src_event(pad, event))
})