mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-20 07:58:10 +00:00
Update for gst::Element::link_many()
and related API generalization
Specifically, get rid of now unneeded `&`.
This commit is contained in:
parent
b9cd71d8eb
commit
fc5ed15af5
15 changed files with 70 additions and 70 deletions
|
@ -91,9 +91,9 @@ fn jb_pipeline() {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&src, &enc, &pay, &jb, &depay, &dec, sink.upcast_ref()])
|
.add_many([&src, &enc, &pay, &jb, &depay, &dec, sink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
gst::Element::link_many(&[&src, &enc, &pay, &jb, &depay, &dec, sink.upcast_ref()]).unwrap();
|
gst::Element::link_many([&src, &enc, &pay, &jb, &depay, &dec, sink.upcast_ref()]).unwrap();
|
||||||
|
|
||||||
let (sender, receiver) = mpsc::channel();
|
let (sender, receiver) = mpsc::channel();
|
||||||
sink.set_callbacks(
|
sink.set_callbacks(
|
||||||
|
@ -175,7 +175,7 @@ fn jb_ts_pipeline() {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[
|
.add_many([
|
||||||
&src,
|
&src,
|
||||||
&queue,
|
&queue,
|
||||||
&enc,
|
&enc,
|
||||||
|
@ -186,7 +186,7 @@ fn jb_ts_pipeline() {
|
||||||
sink.upcast_ref(),
|
sink.upcast_ref(),
|
||||||
])
|
])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&src,
|
&src,
|
||||||
&queue,
|
&queue,
|
||||||
&enc,
|
&enc,
|
||||||
|
|
|
@ -85,9 +85,9 @@ fn multiple_contexts_queue() {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&src, &queue, sink.upcast_ref()])
|
.add_many([&src, &queue, sink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
gst::Element::link_many(&[&src, &queue, sink.upcast_ref()]).unwrap();
|
gst::Element::link_many([&src, &queue, sink.upcast_ref()]).unwrap();
|
||||||
|
|
||||||
let sender_clone = sender.clone();
|
let sender_clone = sender.clone();
|
||||||
sink.set_callbacks(
|
sink.set_callbacks(
|
||||||
|
@ -230,7 +230,7 @@ fn multiple_contexts_proxy() {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&src, &proxysink, &proxysrc, sink.upcast_ref()])
|
.add_many([&src, &proxysink, &proxysrc, sink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
src.link(&proxysink).unwrap();
|
src.link(&proxysink).unwrap();
|
||||||
proxysrc.link(&sink).unwrap();
|
proxysrc.link(&sink).unwrap();
|
||||||
|
@ -353,9 +353,9 @@ fn eos() {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&src, &queue, sink.upcast_ref()])
|
.add_many([&src, &queue, sink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
gst::Element::link_many(&[&src, &queue, sink.upcast_ref()]).unwrap();
|
gst::Element::link_many([&src, &queue, sink.upcast_ref()]).unwrap();
|
||||||
|
|
||||||
let (sample_notifier, sample_notif_rcv) = mpsc::channel();
|
let (sample_notifier, sample_notif_rcv) = mpsc::channel();
|
||||||
let (eos_notifier, eos_notif_rcv) = mpsc::channel();
|
let (eos_notifier, eos_notif_rcv) = mpsc::channel();
|
||||||
|
@ -487,9 +487,9 @@ fn premature_shutdown() {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&src, &queue, sink.upcast_ref()])
|
.add_many([&src, &queue, sink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
gst::Element::link_many(&[&src, &queue, sink.upcast_ref()]).unwrap();
|
gst::Element::link_many([&src, &queue, sink.upcast_ref()]).unwrap();
|
||||||
|
|
||||||
let (appsink_sender, appsink_receiver) = mpsc::channel();
|
let (appsink_sender, appsink_receiver) = mpsc::channel();
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ fn test_push() {
|
||||||
let appsink = gst_app::AppSink::builder().build();
|
let appsink = gst_app::AppSink::builder().build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&fakesrc, &proxysink, &proxysrc, appsink.upcast_ref()])
|
.add_many([&fakesrc, &proxysink, &proxysrc, appsink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
fakesrc.link(&proxysink).unwrap();
|
fakesrc.link(&proxysink).unwrap();
|
||||||
proxysrc.link(&appsink).unwrap();
|
proxysrc.link(&appsink).unwrap();
|
||||||
|
@ -122,10 +122,10 @@ fn test_from_pipeline_to_pipeline() {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fakesink = gst::ElementFactory::make("fakesink").build().unwrap();
|
let fakesink = gst::ElementFactory::make("fakesink").build().unwrap();
|
||||||
|
|
||||||
pipe_1.add_many(&[&fakesrc, &pxsink]).unwrap();
|
pipe_1.add_many([&fakesrc, &pxsink]).unwrap();
|
||||||
fakesrc.link(&pxsink).unwrap();
|
fakesrc.link(&pxsink).unwrap();
|
||||||
|
|
||||||
pipe_2.add_many(&[&pxsrc, &fakesink]).unwrap();
|
pipe_2.add_many([&pxsrc, &fakesink]).unwrap();
|
||||||
pxsrc.link(&fakesink).unwrap();
|
pxsrc.link(&fakesink).unwrap();
|
||||||
|
|
||||||
pipe_1.set_state(gst::State::Paused).unwrap();
|
pipe_1.set_state(gst::State::Paused).unwrap();
|
||||||
|
@ -169,10 +169,10 @@ fn test_from_pipeline_to_pipeline_and_back() {
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
pipe_1.add_many(&[&pxsrc_1, &pxsink_1]).unwrap();
|
pipe_1.add_many([&pxsrc_1, &pxsink_1]).unwrap();
|
||||||
pxsrc_1.link(&pxsink_1).unwrap();
|
pxsrc_1.link(&pxsink_1).unwrap();
|
||||||
|
|
||||||
pipe_2.add_many(&[&pxsrc_2, &pxsink_2]).unwrap();
|
pipe_2.add_many([&pxsrc_2, &pxsink_2]).unwrap();
|
||||||
pxsrc_2.link(&pxsink_2).unwrap();
|
pxsrc_2.link(&pxsink_2).unwrap();
|
||||||
|
|
||||||
pipe_1.set_state(gst::State::Paused).unwrap();
|
pipe_1.set_state(gst::State::Paused).unwrap();
|
||||||
|
|
|
@ -44,7 +44,7 @@ fn test_push() {
|
||||||
let appsink = gst_app::AppSink::builder().build();
|
let appsink = gst_app::AppSink::builder().build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&fakesrc, &queue, appsink.upcast_ref()])
|
.add_many([&fakesrc, &queue, appsink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
fakesrc.link(&queue).unwrap();
|
fakesrc.link(&queue).unwrap();
|
||||||
queue.link(&appsink).unwrap();
|
queue.link(&appsink).unwrap();
|
||||||
|
|
|
@ -68,7 +68,7 @@ fn test_push() {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&tcpclientsrc, appsink.upcast_ref()])
|
.add_many([&tcpclientsrc, appsink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
tcpclientsrc.link(&appsink).unwrap();
|
tcpclientsrc.link(&appsink).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -425,7 +425,7 @@ impl VideoStream {
|
||||||
.build()?;
|
.build()?;
|
||||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||||
|
|
||||||
pipeline.add_many(&[
|
pipeline.add_many([
|
||||||
&src,
|
&src,
|
||||||
&raw_capsfilter,
|
&raw_capsfilter,
|
||||||
&timeoverlay,
|
&timeoverlay,
|
||||||
|
@ -435,7 +435,7 @@ impl VideoStream {
|
||||||
appsink.upcast_ref(),
|
appsink.upcast_ref(),
|
||||||
])?;
|
])?;
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&src,
|
&src,
|
||||||
&raw_capsfilter,
|
&raw_capsfilter,
|
||||||
&timeoverlay,
|
&timeoverlay,
|
||||||
|
@ -472,9 +472,9 @@ impl AudioStream {
|
||||||
.build()?;
|
.build()?;
|
||||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||||
|
|
||||||
pipeline.add_many(&[&src, &enc, &mux, appsink.upcast_ref()])?;
|
pipeline.add_many([&src, &enc, &mux, appsink.upcast_ref()])?;
|
||||||
|
|
||||||
gst::Element::link_many(&[&src, &enc, &mux, appsink.upcast_ref()])?;
|
gst::Element::link_many([&src, &enc, &mux, appsink.upcast_ref()])?;
|
||||||
|
|
||||||
probe_encoder(state, enc);
|
probe_encoder(state, enc);
|
||||||
|
|
||||||
|
|
|
@ -318,7 +318,7 @@ impl VideoStream {
|
||||||
.build()?;
|
.build()?;
|
||||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||||
|
|
||||||
pipeline.add_many(&[
|
pipeline.add_many([
|
||||||
&src,
|
&src,
|
||||||
&raw_capsfilter,
|
&raw_capsfilter,
|
||||||
&timeoverlay,
|
&timeoverlay,
|
||||||
|
@ -328,7 +328,7 @@ impl VideoStream {
|
||||||
appsink.upcast_ref(),
|
appsink.upcast_ref(),
|
||||||
])?;
|
])?;
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&src,
|
&src,
|
||||||
&raw_capsfilter,
|
&raw_capsfilter,
|
||||||
&timeoverlay,
|
&timeoverlay,
|
||||||
|
@ -372,9 +372,9 @@ impl AudioStream {
|
||||||
.build()?;
|
.build()?;
|
||||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||||
|
|
||||||
pipeline.add_many(&[&src, &raw_capsfilter, &enc, &mux, appsink.upcast_ref()])?;
|
pipeline.add_many([&src, &raw_capsfilter, &enc, &mux, appsink.upcast_ref()])?;
|
||||||
|
|
||||||
gst::Element::link_many(&[&src, &raw_capsfilter, &enc, &mux, appsink.upcast_ref()])?;
|
gst::Element::link_many([&src, &raw_capsfilter, &enc, &mux, appsink.upcast_ref()])?;
|
||||||
|
|
||||||
probe_encoder(state, enc);
|
probe_encoder(state, enc);
|
||||||
|
|
||||||
|
|
|
@ -174,8 +174,8 @@ fn test_hlssink3_element_with_video_content() -> Result<(), ()> {
|
||||||
Some(true.to_value())
|
Some(true.to_value())
|
||||||
});
|
});
|
||||||
|
|
||||||
try_or_pause!(pipeline.add_many(&[&video_src, &x264enc, &h264parse, &hlssink3,]));
|
try_or_pause!(pipeline.add_many([&video_src, &x264enc, &h264parse, &hlssink3,]));
|
||||||
try_or_pause!(gst::Element::link_many(&[
|
try_or_pause!(gst::Element::link_many([
|
||||||
&video_src, &x264enc, &h264parse, &hlssink3
|
&video_src, &x264enc, &h264parse, &hlssink3
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
@ -280,8 +280,8 @@ fn test_hlssink3_element_with_audio_content() -> Result<(), ()> {
|
||||||
|
|
||||||
hlssink3.connect("delete-fragment", false, move |_| Some(true.to_value()));
|
hlssink3.connect("delete-fragment", false, move |_| Some(true.to_value()));
|
||||||
|
|
||||||
try_or_pause!(pipeline.add_many(&[&audio_src, &hls_avenc_aac, &hlssink3,]));
|
try_or_pause!(pipeline.add_many([&audio_src, &hls_avenc_aac, &hlssink3,]));
|
||||||
try_or_pause!(gst::Element::link_many(&[
|
try_or_pause!(gst::Element::link_many([
|
||||||
&audio_src,
|
&audio_src,
|
||||||
&hls_avenc_aac,
|
&hls_avenc_aac,
|
||||||
&hlssink3
|
&hlssink3
|
||||||
|
@ -379,8 +379,8 @@ fn test_hlssink3_write_correct_playlist_content() -> Result<(), ()> {
|
||||||
Some(true.to_value())
|
Some(true.to_value())
|
||||||
});
|
});
|
||||||
|
|
||||||
try_or_pause!(pipeline.add_many(&[&video_src, &x264enc, &h264parse, &hlssink3,]));
|
try_or_pause!(pipeline.add_many([&video_src, &x264enc, &h264parse, &hlssink3,]));
|
||||||
try_or_pause!(gst::Element::link_many(&[
|
try_or_pause!(gst::Element::link_many([
|
||||||
&video_src, &x264enc, &h264parse, &hlssink3
|
&video_src, &x264enc, &h264parse, &hlssink3
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
|
|
@ -321,8 +321,8 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
|
||||||
let cudaconvert = make_element("cudaconvert", None)?;
|
let cudaconvert = make_element("cudaconvert", None)?;
|
||||||
let cudascale = make_element("cudascale", None)?;
|
let cudascale = make_element("cudascale", None)?;
|
||||||
|
|
||||||
ret.add_many(&[&cudaupload, &cudaconvert, &cudascale])?;
|
ret.add_many([&cudaupload, &cudaconvert, &cudascale])?;
|
||||||
gst::Element::link_many(&[&cudaupload, &cudaconvert, &cudascale])?;
|
gst::Element::link_many([&cudaupload, &cudaconvert, &cudascale])?;
|
||||||
|
|
||||||
(cudaupload, cudascale)
|
(cudaupload, cudascale)
|
||||||
} else if feature.contains(GL_MEMORY_FEATURE) {
|
} else if feature.contains(GL_MEMORY_FEATURE) {
|
||||||
|
@ -330,8 +330,8 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
|
||||||
let glconvert = make_element("glcolorconvert", None)?;
|
let glconvert = make_element("glcolorconvert", None)?;
|
||||||
let glscale = make_element("glcolorscale", None)?;
|
let glscale = make_element("glcolorscale", None)?;
|
||||||
|
|
||||||
ret.add_many(&[&glupload, &glconvert, &glscale])?;
|
ret.add_many([&glupload, &glconvert, &glscale])?;
|
||||||
gst::Element::link_many(&[&glupload, &glconvert, &glscale])?;
|
gst::Element::link_many([&glupload, &glconvert, &glscale])?;
|
||||||
|
|
||||||
(glupload, glscale)
|
(glupload, glscale)
|
||||||
} else if feature.contains(NVMM_MEMORY_FEATURE) {
|
} else if feature.contains(NVMM_MEMORY_FEATURE) {
|
||||||
|
@ -344,16 +344,16 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
|
||||||
make_element("nvvidconv", None)?
|
make_element("nvvidconv", None)?
|
||||||
};
|
};
|
||||||
|
|
||||||
ret.add_many(&[&queue, &nvconvert])?;
|
ret.add_many([&queue, &nvconvert])?;
|
||||||
gst::Element::link_many(&[&queue, &nvconvert])?;
|
gst::Element::link_many([&queue, &nvconvert])?;
|
||||||
|
|
||||||
(queue, nvconvert)
|
(queue, nvconvert)
|
||||||
} else {
|
} else {
|
||||||
let convert = make_element("videoconvert", None)?;
|
let convert = make_element("videoconvert", None)?;
|
||||||
let scale = make_element("videoscale", None)?;
|
let scale = make_element("videoscale", None)?;
|
||||||
|
|
||||||
ret.add_many(&[&convert, &scale])?;
|
ret.add_many([&convert, &scale])?;
|
||||||
gst::Element::link_many(&[&convert, &scale])?;
|
gst::Element::link_many([&convert, &scale])?;
|
||||||
|
|
||||||
(convert, scale)
|
(convert, scale)
|
||||||
}
|
}
|
||||||
|
@ -361,8 +361,8 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
|
||||||
let convert = make_element("videoconvert", None)?;
|
let convert = make_element("videoconvert", None)?;
|
||||||
let scale = make_element("videoscale", None)?;
|
let scale = make_element("videoscale", None)?;
|
||||||
|
|
||||||
ret.add_many(&[&convert, &scale])?;
|
ret.add_many([&convert, &scale])?;
|
||||||
gst::Element::link_many(&[&convert, &scale])?;
|
gst::Element::link_many([&convert, &scale])?;
|
||||||
|
|
||||||
(convert, scale)
|
(convert, scale)
|
||||||
}
|
}
|
||||||
|
@ -490,9 +490,9 @@ fn setup_encoding(
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&conv, &conv_filter, &enc, &parse_filter, &pay])
|
.add_many([&conv, &conv_filter, &enc, &parse_filter, &pay])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
gst::Element::link_many(&[src, &conv, &conv_filter, &enc])
|
gst::Element::link_many([src, &conv, &conv_filter, &enc])
|
||||||
.with_context(|| "Linking encoding elements")?;
|
.with_context(|| "Linking encoding elements")?;
|
||||||
|
|
||||||
let codec_name = codec.caps.structure(0).unwrap().name();
|
let codec_name = codec.caps.structure(0).unwrap().name();
|
||||||
|
@ -505,10 +505,10 @@ fn setup_encoding(
|
||||||
None
|
None
|
||||||
} {
|
} {
|
||||||
pipeline.add(&parser).unwrap();
|
pipeline.add(&parser).unwrap();
|
||||||
gst::Element::link_many(&[&enc, &parser, &parse_filter])
|
gst::Element::link_many([&enc, &parser, &parse_filter])
|
||||||
.with_context(|| "Linking encoding elements")?;
|
.with_context(|| "Linking encoding elements")?;
|
||||||
} else {
|
} else {
|
||||||
gst::Element::link_many(&[&enc, &parse_filter])
|
gst::Element::link_many([&enc, &parse_filter])
|
||||||
.with_context(|| "Linking encoding elements")?;
|
.with_context(|| "Linking encoding elements")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -569,7 +569,7 @@ fn setup_encoding(
|
||||||
|
|
||||||
parse_filter.set_property("caps", parse_caps);
|
parse_filter.set_property("caps", parse_caps);
|
||||||
|
|
||||||
gst::Element::link_many(&[&parse_filter, &pay]).with_context(|| "Linking encoding elements")?;
|
gst::Element::link_many([&parse_filter, &pay]).with_context(|| "Linking encoding elements")?;
|
||||||
|
|
||||||
Ok((enc, conv_filter, pay))
|
Ok((enc, conv_filter, pay))
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element) {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[
|
.add_many([
|
||||||
&video_src,
|
&video_src,
|
||||||
&fallback_video_src,
|
&fallback_video_src,
|
||||||
&fallbackswitch,
|
&fallbackswitch,
|
||||||
|
|
|
@ -925,7 +925,7 @@ impl FallbackSrc {
|
||||||
.build()
|
.build()
|
||||||
.expect("No queue found");
|
.expect("No queue found");
|
||||||
|
|
||||||
bin.add_many(&[
|
bin.add_many([
|
||||||
&audiotestsrc,
|
&audiotestsrc,
|
||||||
&audioconvert,
|
&audioconvert,
|
||||||
&audioresample,
|
&audioresample,
|
||||||
|
@ -934,7 +934,7 @@ impl FallbackSrc {
|
||||||
])
|
])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&audiotestsrc,
|
&audiotestsrc,
|
||||||
&audioconvert,
|
&audioconvert,
|
||||||
&audioresample,
|
&audioresample,
|
||||||
|
@ -984,7 +984,7 @@ impl FallbackSrc {
|
||||||
.build()
|
.build()
|
||||||
.expect("No queue found");
|
.expect("No queue found");
|
||||||
|
|
||||||
bin.add_many(&[
|
bin.add_many([
|
||||||
&videotestsrc,
|
&videotestsrc,
|
||||||
&videoconvert,
|
&videoconvert,
|
||||||
&videoscale,
|
&videoscale,
|
||||||
|
@ -993,7 +993,7 @@ impl FallbackSrc {
|
||||||
])
|
])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&videotestsrc,
|
&videotestsrc,
|
||||||
&videoconvert,
|
&videoconvert,
|
||||||
&videoscale,
|
&videoscale,
|
||||||
|
@ -1601,10 +1601,10 @@ impl FallbackSrc {
|
||||||
.build()
|
.build()
|
||||||
.expect("No capsfilter found");
|
.expect("No capsfilter found");
|
||||||
|
|
||||||
bin.add_many(&[&videoconvert, &videoscale, &imagefreeze, &capsfilter])
|
bin.add_many([&videoconvert, &videoscale, &imagefreeze, &capsfilter])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[&videoconvert, &videoscale, &imagefreeze, &capsfilter]).unwrap();
|
gst::Element::link_many([&videoconvert, &videoscale, &imagefreeze, &capsfilter]).unwrap();
|
||||||
|
|
||||||
let ghostpad =
|
let ghostpad =
|
||||||
gst::GhostPad::with_target(Some("sink"), &videoconvert.static_pad("sink").unwrap())
|
gst::GhostPad::with_target(Some("sink"), &videoconvert.static_pad("sink").unwrap())
|
||||||
|
@ -1649,10 +1649,10 @@ impl FallbackSrc {
|
||||||
.build()
|
.build()
|
||||||
.expect("No capsfilter found");
|
.expect("No capsfilter found");
|
||||||
|
|
||||||
bin.add_many(&[&videoconvert, &videoscale, &capsfilter])
|
bin.add_many([&videoconvert, &videoscale, &capsfilter])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[&videoconvert, &videoscale, &capsfilter]).unwrap();
|
gst::Element::link_many([&videoconvert, &videoscale, &capsfilter]).unwrap();
|
||||||
|
|
||||||
let ghostpad =
|
let ghostpad =
|
||||||
gst::GhostPad::with_target(Some("sink"), &videoconvert.static_pad("sink").unwrap())
|
gst::GhostPad::with_target(Some("sink"), &videoconvert.static_pad("sink").unwrap())
|
||||||
|
@ -1697,10 +1697,10 @@ impl FallbackSrc {
|
||||||
.build()
|
.build()
|
||||||
.expect("No capsfilter found");
|
.expect("No capsfilter found");
|
||||||
|
|
||||||
bin.add_many(&[&audioconvert, &audioresample, &capsfilter])
|
bin.add_many([&audioconvert, &audioresample, &capsfilter])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[&audioconvert, &audioresample, &capsfilter]).unwrap();
|
gst::Element::link_many([&audioconvert, &audioresample, &capsfilter]).unwrap();
|
||||||
|
|
||||||
let ghostpad =
|
let ghostpad =
|
||||||
gst::GhostPad::with_target(Some("sink"), &audioconvert.static_pad("sink").unwrap())
|
gst::GhostPad::with_target(Some("sink"), &audioconvert.static_pad("sink").unwrap())
|
||||||
|
@ -1869,7 +1869,7 @@ impl FallbackSrc {
|
||||||
|
|
||||||
source
|
source
|
||||||
.source
|
.source
|
||||||
.add_many(&[&converters, &queue, &clocksync])
|
.add_many([&converters, &queue, &clocksync])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
converters.sync_state_with_parent().unwrap();
|
converters.sync_state_with_parent().unwrap();
|
||||||
queue.sync_state_with_parent().unwrap();
|
queue.sync_state_with_parent().unwrap();
|
||||||
|
@ -1884,7 +1884,7 @@ impl FallbackSrc {
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
gst::Element::link_many(&[&converters, &queue, &clocksync]).unwrap();
|
gst::Element::link_many([&converters, &queue, &clocksync]).unwrap();
|
||||||
|
|
||||||
let ghostpad =
|
let ghostpad =
|
||||||
gst::GhostPad::with_target(Some(type_), &clocksync.static_pad("src").unwrap()).unwrap();
|
gst::GhostPad::with_target(Some(type_), &clocksync.static_pad("src").unwrap()).unwrap();
|
||||||
|
|
|
@ -506,7 +506,7 @@ fn setup_pipeline(
|
||||||
let queue = gst::ElementFactory::make("queue").build().unwrap();
|
let queue = gst::ElementFactory::make("queue").build().unwrap();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[src.upcast_ref(), &switch, &queue, sink.upcast_ref()])
|
.add_many([src.upcast_ref(), &switch, &queue, sink.upcast_ref()])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
src.link_pads(Some("src"), &switch, Some("sink_0")).unwrap();
|
src.link_pads(Some("src"), &switch, Some("sink_0")).unwrap();
|
||||||
switch.link_pads(Some("src"), &queue, Some("sink")).unwrap();
|
switch.link_pads(Some("src"), &queue, Some("sink")).unwrap();
|
||||||
|
|
|
@ -85,7 +85,7 @@ fn create_pipeline() -> (
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[
|
.add_many([
|
||||||
&video_src,
|
&video_src,
|
||||||
&timeoverlay,
|
&timeoverlay,
|
||||||
&video_tee,
|
&video_tee,
|
||||||
|
@ -113,7 +113,7 @@ fn create_pipeline() -> (
|
||||||
])
|
])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&video_src,
|
&video_src,
|
||||||
&timeoverlay,
|
&timeoverlay,
|
||||||
&video_tee,
|
&video_tee,
|
||||||
|
@ -123,7 +123,7 @@ fn create_pipeline() -> (
|
||||||
])
|
])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&video_tee,
|
&video_tee,
|
||||||
&video_queue2,
|
&video_queue2,
|
||||||
&video_convert2,
|
&video_convert2,
|
||||||
|
@ -142,7 +142,7 @@ fn create_pipeline() -> (
|
||||||
.link_pads(Some("src"), &mux, Some("video_%u"))
|
.link_pads(Some("src"), &mux, Some("video_%u"))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&audio_src,
|
&audio_src,
|
||||||
&audio_tee,
|
&audio_tee,
|
||||||
&audio_queue1,
|
&audio_queue1,
|
||||||
|
@ -151,7 +151,7 @@ fn create_pipeline() -> (
|
||||||
])
|
])
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[
|
gst::Element::link_many([
|
||||||
&audio_tee,
|
&audio_tee,
|
||||||
&audio_queue2,
|
&audio_queue2,
|
||||||
&audio_convert2,
|
&audio_convert2,
|
||||||
|
@ -170,7 +170,7 @@ fn create_pipeline() -> (
|
||||||
.link_pads(Some("src"), &mux, Some("audio_%u"))
|
.link_pads(Some("src"), &mux, Some("audio_%u"))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
gst::Element::link_many(&[&mux, &file_sink]).unwrap();
|
gst::Element::link_many([&mux, &file_sink]).unwrap();
|
||||||
|
|
||||||
(
|
(
|
||||||
pipeline,
|
pipeline,
|
||||||
|
|
|
@ -93,7 +93,7 @@ fn test(
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let mq = gst::ElementFactory::make("multiqueue").build().unwrap();
|
let mq = gst::ElementFactory::make("multiqueue").build().unwrap();
|
||||||
|
|
||||||
pipeline.add_many(&[&playlist, &mq]).unwrap();
|
pipeline.add_many([&playlist, &mq]).unwrap();
|
||||||
|
|
||||||
assert_eq!(playlist.property::<u32>("current-iteration"), 0);
|
assert_eq!(playlist.property::<u32>("current-iteration"), 0);
|
||||||
assert_eq!(playlist.property::<u64>("current-uri-index"), 0);
|
assert_eq!(playlist.property::<u64>("current-uri-index"), 0);
|
||||||
|
|
|
@ -53,9 +53,9 @@ fn test_cdgdec() {
|
||||||
let sink = gst_app::AppSink::builder().build();
|
let sink = gst_app::AppSink::builder().build();
|
||||||
|
|
||||||
pipeline
|
pipeline
|
||||||
.add_many(&[&filesrc, &parse, &dec, sink.upcast_ref()])
|
.add_many([&filesrc, &parse, &dec, sink.upcast_ref()])
|
||||||
.expect("failed to add elements to the pipeline");
|
.expect("failed to add elements to the pipeline");
|
||||||
gst::Element::link_many(&[&filesrc, &parse, &dec, sink.upcast_ref()])
|
gst::Element::link_many([&filesrc, &parse, &dec, sink.upcast_ref()])
|
||||||
.expect("failed to link the elements");
|
.expect("failed to link the elements");
|
||||||
|
|
||||||
sink.set_callbacks(
|
sink.set_callbacks(
|
||||||
|
|
Loading…
Reference in a new issue