mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-14 12:19:23 +00:00
Various minor cleanups
This commit is contained in:
parent
f3546819ed
commit
f058a5e229
|
@ -66,7 +66,7 @@ fn run_test(
|
|||
.downcast::<gst_app::AppSink>()
|
||||
.unwrap();
|
||||
|
||||
sink.set_property("sync", false);
|
||||
sink.set_sync(false);
|
||||
let caps = gst_audio::AudioInfo::builder(gst_audio::AUDIO_FORMAT_F64, 192_000, channels)
|
||||
.build()
|
||||
.unwrap()
|
||||
|
|
|
@ -73,7 +73,7 @@ const CSD: &str = "
|
|||
</CsoundSynthesizer>";
|
||||
|
||||
fn create_pipeline() -> Result<gst::Pipeline, Box<dyn Error>> {
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let audio_src = gst::parse_bin_from_description(AUDIO_SRC, true)?.upcast();
|
||||
|
||||
|
|
|
@ -234,8 +234,6 @@ fn setup_appsink(appsink: &gst_app::AppSink, name: &str, path: &Path, is_video:
|
|||
segment_index: 0,
|
||||
}));
|
||||
|
||||
appsink.set_buffer_list(true);
|
||||
|
||||
appsink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
.new_sample(move |sink| {
|
||||
|
@ -395,20 +393,37 @@ impl VideoStream {
|
|||
.property("is-live", true)
|
||||
.build()?;
|
||||
|
||||
let raw_capsfilter = gst::ElementFactory::make("capsfilter").build()?;
|
||||
let raw_capsfilter = gst::ElementFactory::make("capsfilter")
|
||||
.property(
|
||||
"caps",
|
||||
gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::I420)
|
||||
.width(self.width as i32)
|
||||
.height(self.height as i32)
|
||||
.framerate(30.into())
|
||||
.build(),
|
||||
)
|
||||
.build()?;
|
||||
let timeoverlay = gst::ElementFactory::make("timeoverlay").build()?;
|
||||
let enc = gst::ElementFactory::make("x264enc")
|
||||
.property("bframes", 0u32)
|
||||
.property("bitrate", self.bitrate as u32 / 1000u32)
|
||||
.property_from_str("tune", "zerolatency")
|
||||
.build()?;
|
||||
let h264_capsfilter = gst::ElementFactory::make("capsfilter").build()?;
|
||||
let h264_capsfilter = gst::ElementFactory::make("capsfilter")
|
||||
.property(
|
||||
"caps",
|
||||
gst::Caps::builder("video/x-h264")
|
||||
.field("profile", "main")
|
||||
.build(),
|
||||
)
|
||||
.build()?;
|
||||
let mux = gst::ElementFactory::make("cmafmux")
|
||||
.property("fragment-duration", 2500.mseconds())
|
||||
.property_from_str("header-update-mode", "update")
|
||||
.property("write-mehd", true)
|
||||
.build()?;
|
||||
let appsink = gst::ElementFactory::make("appsink").build()?;
|
||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||
|
||||
pipeline.add_many(&[
|
||||
&src,
|
||||
|
@ -417,26 +432,9 @@ impl VideoStream {
|
|||
&enc,
|
||||
&h264_capsfilter,
|
||||
&mux,
|
||||
&appsink,
|
||||
appsink.upcast_ref(),
|
||||
])?;
|
||||
|
||||
raw_capsfilter.set_property(
|
||||
"caps",
|
||||
gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::I420)
|
||||
.width(self.width as i32)
|
||||
.height(self.height as i32)
|
||||
.framerate(30.into())
|
||||
.build(),
|
||||
);
|
||||
|
||||
h264_capsfilter.set_property(
|
||||
"caps",
|
||||
gst::Caps::builder("video/x-h264")
|
||||
.field("profile", "main")
|
||||
.build(),
|
||||
);
|
||||
|
||||
gst::Element::link_many(&[
|
||||
&src,
|
||||
&raw_capsfilter,
|
||||
|
@ -444,13 +442,11 @@ impl VideoStream {
|
|||
&enc,
|
||||
&h264_capsfilter,
|
||||
&mux,
|
||||
&appsink,
|
||||
appsink.upcast_ref(),
|
||||
])?;
|
||||
|
||||
probe_encoder(state, enc);
|
||||
|
||||
let appsink = appsink.downcast::<gst_app::AppSink>().unwrap();
|
||||
|
||||
setup_appsink(&appsink, &self.name, path, true);
|
||||
|
||||
Ok(())
|
||||
|
@ -474,16 +470,14 @@ impl AudioStream {
|
|||
.property_from_str("header-update-mode", "update")
|
||||
.property("write-mehd", true)
|
||||
.build()?;
|
||||
let appsink = gst::ElementFactory::make("appsink").build()?;
|
||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||
|
||||
pipeline.add_many(&[&src, &enc, &mux, &appsink])?;
|
||||
pipeline.add_many(&[&src, &enc, &mux, appsink.upcast_ref()])?;
|
||||
|
||||
gst::Element::link_many(&[&src, &enc, &mux, &appsink])?;
|
||||
gst::Element::link_many(&[&src, &enc, &mux, appsink.upcast_ref()])?;
|
||||
|
||||
probe_encoder(state, enc);
|
||||
|
||||
let appsink = appsink.downcast::<gst_app::AppSink>().unwrap();
|
||||
|
||||
setup_appsink(&appsink, &self.name, path, false);
|
||||
|
||||
Ok(())
|
||||
|
@ -497,7 +491,7 @@ fn main() -> Result<(), Error> {
|
|||
|
||||
let path = PathBuf::from("hls_live_stream");
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
std::fs::create_dir_all(&path).expect("failed to create directory");
|
||||
|
||||
|
|
|
@ -136,8 +136,6 @@ fn setup_appsink(appsink: &gst_app::AppSink, name: &str, path: &Path, is_video:
|
|||
path,
|
||||
}));
|
||||
|
||||
appsink.set_buffer_list(true);
|
||||
|
||||
let state_clone = state.clone();
|
||||
appsink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
|
@ -289,19 +287,36 @@ impl VideoStream {
|
|||
let src = gst::ElementFactory::make("videotestsrc")
|
||||
.property("num-buffers", 300)
|
||||
.build()?;
|
||||
let raw_capsfilter = gst::ElementFactory::make("capsfilter").build()?;
|
||||
let raw_capsfilter = gst::ElementFactory::make("capsfilter")
|
||||
.property(
|
||||
"caps",
|
||||
gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::I420)
|
||||
.width(self.width as i32)
|
||||
.height(self.height as i32)
|
||||
.framerate(30.into())
|
||||
.build(),
|
||||
)
|
||||
.build()?;
|
||||
let timeoverlay = gst::ElementFactory::make("timeoverlay").build()?;
|
||||
let enc = gst::ElementFactory::make("x264enc")
|
||||
.property("bframes", 0u32)
|
||||
.property("bitrate", self.bitrate as u32 / 1000u32)
|
||||
.build()?;
|
||||
let h264_capsfilter = gst::ElementFactory::make("capsfilter").build()?;
|
||||
let h264_capsfilter = gst::ElementFactory::make("capsfilter")
|
||||
.property(
|
||||
"caps",
|
||||
gst::Caps::builder("video/x-h264")
|
||||
.field("profile", "main")
|
||||
.build(),
|
||||
)
|
||||
.build()?;
|
||||
let mux = gst::ElementFactory::make("cmafmux")
|
||||
.property("fragment-duration", 2500.mseconds())
|
||||
.property_from_str("header-update-mode", "update")
|
||||
.property("write-mehd", true)
|
||||
.build()?;
|
||||
let appsink = gst::ElementFactory::make("appsink").build()?;
|
||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||
|
||||
pipeline.add_many(&[
|
||||
&src,
|
||||
|
@ -310,7 +325,7 @@ impl VideoStream {
|
|||
&enc,
|
||||
&h264_capsfilter,
|
||||
&mux,
|
||||
&appsink,
|
||||
appsink.upcast_ref(),
|
||||
])?;
|
||||
|
||||
gst::Element::link_many(&[
|
||||
|
@ -320,30 +335,11 @@ impl VideoStream {
|
|||
&enc,
|
||||
&h264_capsfilter,
|
||||
&mux,
|
||||
&appsink,
|
||||
appsink.upcast_ref(),
|
||||
])?;
|
||||
|
||||
raw_capsfilter.set_property(
|
||||
"caps",
|
||||
gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::I420)
|
||||
.width(self.width as i32)
|
||||
.height(self.height as i32)
|
||||
.framerate(30.into())
|
||||
.build(),
|
||||
);
|
||||
|
||||
h264_capsfilter.set_property(
|
||||
"caps",
|
||||
gst::Caps::builder("video/x-h264")
|
||||
.field("profile", "main")
|
||||
.build(),
|
||||
);
|
||||
|
||||
probe_encoder(state, enc);
|
||||
|
||||
let appsink = appsink.downcast::<gst_app::AppSink>().unwrap();
|
||||
|
||||
setup_appsink(&appsink, &self.name, path, true);
|
||||
|
||||
Ok(())
|
||||
|
@ -362,28 +358,26 @@ impl AudioStream {
|
|||
.property("samplesperbuffer", 4410)
|
||||
.property_from_str("wave", &self.wave)
|
||||
.build()?;
|
||||
let raw_capsfilter = gst::ElementFactory::make("capsfilter").build()?;
|
||||
let raw_capsfilter = gst::ElementFactory::make("capsfilter")
|
||||
.property(
|
||||
"caps",
|
||||
gst_audio::AudioCapsBuilder::new().rate(44100).build(),
|
||||
)
|
||||
.build()?;
|
||||
let enc = gst::ElementFactory::make("avenc_aac").build()?;
|
||||
let mux = gst::ElementFactory::make("cmafmux")
|
||||
.property("fragment-duration", 2500.mseconds())
|
||||
.property_from_str("header-update-mode", "update")
|
||||
.property("write-mehd", true)
|
||||
.build()?;
|
||||
let appsink = gst::ElementFactory::make("appsink").build()?;
|
||||
let appsink = gst_app::AppSink::builder().buffer_list(true).build();
|
||||
|
||||
pipeline.add_many(&[&src, &raw_capsfilter, &enc, &mux, &appsink])?;
|
||||
pipeline.add_many(&[&src, &raw_capsfilter, &enc, &mux, appsink.upcast_ref()])?;
|
||||
|
||||
gst::Element::link_many(&[&src, &raw_capsfilter, &enc, &mux, &appsink])?;
|
||||
|
||||
raw_capsfilter.set_property(
|
||||
"caps",
|
||||
gst_audio::AudioCapsBuilder::new().rate(44100).build(),
|
||||
);
|
||||
gst::Element::link_many(&[&src, &raw_capsfilter, &enc, &mux, appsink.upcast_ref()])?;
|
||||
|
||||
probe_encoder(state, enc);
|
||||
|
||||
let appsink = appsink.downcast::<gst_app::AppSink>().unwrap();
|
||||
|
||||
setup_appsink(&appsink, &self.name, path, false);
|
||||
|
||||
Ok(())
|
||||
|
@ -397,7 +391,7 @@ fn main() -> Result<(), Error> {
|
|||
|
||||
let path = PathBuf::from("hls_vod_stream");
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
std::fs::create_dir_all(&path).expect("failed to create directory");
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("test-pipeline"));
|
||||
let pipeline = gst::Pipeline::builder().name("test-pipeline").build();
|
||||
pipeline
|
||||
.add_many(&[&filesrc, &decrypter, &typefind, &filesink])
|
||||
.expect("failed to add elements to the pipeline");
|
||||
|
|
|
@ -103,7 +103,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("test-pipeline"));
|
||||
let pipeline = gst::Pipeline::builder().name("test-pipeline").build();
|
||||
pipeline
|
||||
.add_many(&[&filesrc, &encrypter, &filesink])
|
||||
.expect("failed to add elements to the pipeline");
|
||||
|
|
|
@ -61,7 +61,9 @@ fn init() {
|
|||
fn test_pipeline() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("sodium-decrypter-test"));
|
||||
let pipeline = gst::Pipeline::builder()
|
||||
.name("sodium-decrypter-test")
|
||||
.build();
|
||||
|
||||
let input_path = {
|
||||
let mut r = PathBuf::new();
|
||||
|
@ -86,17 +88,16 @@ fn test_pipeline() {
|
|||
// the typefind element here is cause the decrypter only supports
|
||||
// operating in pull mode bu the filesink wants push-mode.
|
||||
let typefind = gst::ElementFactory::make("typefind").build().unwrap();
|
||||
let sink = gst::ElementFactory::make("appsink").build().unwrap();
|
||||
let sink = gst_app::AppSink::builder().build();
|
||||
|
||||
pipeline
|
||||
.add_many(&[&filesrc, &dec, &typefind, &sink])
|
||||
.add_many(&[&filesrc, &dec, &typefind, sink.upcast_ref()])
|
||||
.expect("failed to add elements to the pipeline");
|
||||
gst::Element::link_many(&[&filesrc, &dec, &typefind, &sink])
|
||||
gst::Element::link_many(&[&filesrc, &dec, &typefind, sink.upcast_ref()])
|
||||
.expect("failed to link the elements");
|
||||
|
||||
let adapter = Arc::new(Mutex::new(gst_base::UniqueAdapter::new()));
|
||||
|
||||
let sink = sink.downcast::<gst_app::AppSink>().unwrap();
|
||||
let adapter_clone = adapter.clone();
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
|
@ -154,7 +155,9 @@ fn test_pipeline() {
|
|||
fn test_pull_range() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("sodium-decrypter-pull-range-test"));
|
||||
let pipeline = gst::Pipeline::builder()
|
||||
.name("sodium-decrypter-pull-range-test")
|
||||
.build();
|
||||
let input_path = {
|
||||
let mut r = PathBuf::new();
|
||||
r.push(env!("CARGO_MANIFEST_DIR"));
|
||||
|
|
|
@ -71,7 +71,7 @@ fn main() {
|
|||
.build();
|
||||
|
||||
let l = glib::MainLoop::new(None, false);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let counter = Arc::new(AtomicU64::new(0));
|
||||
|
||||
for i in 0..n_streams {
|
||||
|
|
|
@ -128,7 +128,7 @@ fn main() {
|
|||
|
||||
let args = args();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
for i in 0..args.streams {
|
||||
let ctx_name = format!("standalone {}", i % args.groups);
|
||||
|
|
|
@ -90,7 +90,7 @@ fn send_rtp_buffers(n_streams: u16) {
|
|||
}
|
||||
|
||||
let l = glib::MainLoop::new(None, false);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
for i in 0..n_streams {
|
||||
let src = gst::ElementFactory::make("audiotestsrc")
|
||||
.name(format!("audiotestsrc-{}", i).as_str())
|
||||
|
|
|
@ -49,7 +49,7 @@ fn jb_pipeline() {
|
|||
const LATENCY: u32 = 20;
|
||||
const BUFFER_NB: i32 = 3;
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let src = gst::ElementFactory::make("audiotestsrc")
|
||||
.name("audiotestsrc")
|
||||
|
@ -84,21 +84,19 @@ fn jb_pipeline() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let sink = gst::ElementFactory::make("appsink")
|
||||
let sink = gst_app::AppSink::builder()
|
||||
.name("appsink")
|
||||
.property("sync", false)
|
||||
.property("async", false)
|
||||
.build()
|
||||
.unwrap();
|
||||
.sync(false)
|
||||
.async_(false)
|
||||
.build();
|
||||
|
||||
pipeline
|
||||
.add_many(&[&src, &enc, &pay, &jb, &depay, &dec, &sink])
|
||||
.add_many(&[&src, &enc, &pay, &jb, &depay, &dec, sink.upcast_ref()])
|
||||
.unwrap();
|
||||
gst::Element::link_many(&[&src, &enc, &pay, &jb, &depay, &dec, &sink]).unwrap();
|
||||
gst::Element::link_many(&[&src, &enc, &pay, &jb, &depay, &dec, sink.upcast_ref()]).unwrap();
|
||||
|
||||
let appsink = sink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
let (sender, receiver) = mpsc::channel();
|
||||
appsink.set_callbacks(
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
.new_sample(move |appsink| {
|
||||
let _sample = appsink.pull_sample().unwrap();
|
||||
|
@ -128,7 +126,7 @@ fn jb_ts_pipeline() {
|
|||
const LATENCY: u32 = 20;
|
||||
const BUFFER_NB: i32 = 3;
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let src = gst::ElementFactory::make("audiotestsrc")
|
||||
.name("audiotestsrc")
|
||||
|
@ -170,21 +168,38 @@ fn jb_ts_pipeline() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let sink = gst::ElementFactory::make("appsink")
|
||||
let sink = gst_app::AppSink::builder()
|
||||
.name("appsink")
|
||||
.property("sync", false)
|
||||
.property("async", false)
|
||||
.build()
|
||||
.unwrap();
|
||||
.sync(false)
|
||||
.async_(false)
|
||||
.build();
|
||||
|
||||
pipeline
|
||||
.add_many(&[&src, &queue, &enc, &pay, &jb, &depay, &dec, &sink])
|
||||
.add_many(&[
|
||||
&src,
|
||||
&queue,
|
||||
&enc,
|
||||
&pay,
|
||||
&jb,
|
||||
&depay,
|
||||
&dec,
|
||||
sink.upcast_ref(),
|
||||
])
|
||||
.unwrap();
|
||||
gst::Element::link_many(&[&src, &queue, &enc, &pay, &jb, &depay, &dec, &sink]).unwrap();
|
||||
gst::Element::link_many(&[
|
||||
&src,
|
||||
&queue,
|
||||
&enc,
|
||||
&pay,
|
||||
&jb,
|
||||
&depay,
|
||||
&dec,
|
||||
sink.upcast_ref(),
|
||||
])
|
||||
.unwrap();
|
||||
|
||||
let appsink = sink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
let (sender, receiver) = mpsc::channel();
|
||||
appsink.set_callbacks(
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
.new_sample(move |appsink| {
|
||||
let _sample = appsink.pull_sample().unwrap();
|
||||
|
|
|
@ -693,7 +693,7 @@ fn setup(
|
|||
) {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
// Src
|
||||
let src_element = glib::Object::new::<ElementSrcTest>(&[]);
|
||||
|
|
|
@ -58,7 +58,7 @@ fn multiple_contexts_queue() {
|
|||
const FIRST_PORT: u16 = 40000;
|
||||
|
||||
let l = glib::MainLoop::new(None, false);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let (sender, receiver) = mpsc::channel();
|
||||
|
||||
|
@ -78,19 +78,19 @@ fn multiple_contexts_queue() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let sink = gst::ElementFactory::make("appsink")
|
||||
let sink = gst_app::AppSink::builder()
|
||||
.name(format!("sink-{}", i).as_str())
|
||||
.property("sync", false)
|
||||
.property("async", false)
|
||||
.build()
|
||||
.sync(false)
|
||||
.async_(false)
|
||||
.build();
|
||||
|
||||
pipeline
|
||||
.add_many(&[&src, &queue, sink.upcast_ref()])
|
||||
.unwrap();
|
||||
gst::Element::link_many(&[&src, &queue, sink.upcast_ref()]).unwrap();
|
||||
|
||||
pipeline.add_many(&[&src, &queue, &sink]).unwrap();
|
||||
gst::Element::link_many(&[&src, &queue, &sink]).unwrap();
|
||||
|
||||
let appsink = sink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
let sender_clone = sender.clone();
|
||||
appsink.set_callbacks(
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
.new_sample(move |appsink| {
|
||||
let _sample = appsink.pull_sample().unwrap();
|
||||
|
@ -192,7 +192,7 @@ fn multiple_contexts_proxy() {
|
|||
const FIRST_PORT: u16 = 40000 + OFFSET;
|
||||
|
||||
let l = glib::MainLoop::new(None, false);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let (sender, receiver) = mpsc::channel();
|
||||
|
||||
|
@ -223,22 +223,20 @@ fn multiple_contexts_proxy() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let sink = gst::ElementFactory::make("appsink")
|
||||
let sink = gst_app::AppSink::builder()
|
||||
.name(format!("sink-{}", pipeline_index).as_str())
|
||||
.property("sync", false)
|
||||
.property("async", false)
|
||||
.build()
|
||||
.unwrap();
|
||||
.sync(false)
|
||||
.async_(false)
|
||||
.build();
|
||||
|
||||
pipeline
|
||||
.add_many(&[&src, &proxysink, &proxysrc, &sink])
|
||||
.add_many(&[&src, &proxysink, &proxysrc, sink.upcast_ref()])
|
||||
.unwrap();
|
||||
src.link(&proxysink).unwrap();
|
||||
proxysrc.link(&sink).unwrap();
|
||||
|
||||
let appsink = sink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
let sender_clone = sender.clone();
|
||||
appsink.set_callbacks(
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
.new_sample(move |appsink| {
|
||||
let _sample = appsink.pull_sample().unwrap();
|
||||
|
@ -330,7 +328,7 @@ fn eos() {
|
|||
init();
|
||||
|
||||
let l = glib::MainLoop::new(None, false);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let caps = gst::Caps::builder("foo/bar").build();
|
||||
|
||||
|
@ -348,20 +346,20 @@ fn eos() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let appsink = gst::ElementFactory::make("appsink")
|
||||
let sink = gst_app::AppSink::builder()
|
||||
.name("sink-eos")
|
||||
.property("sync", false)
|
||||
.property("async", false)
|
||||
.build()
|
||||
.unwrap();
|
||||
.sync(false)
|
||||
.async_(false)
|
||||
.build();
|
||||
|
||||
pipeline.add_many(&[&src, &queue, &appsink]).unwrap();
|
||||
gst::Element::link_many(&[&src, &queue, &appsink]).unwrap();
|
||||
pipeline
|
||||
.add_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 (eos_notifier, eos_notif_rcv) = mpsc::channel();
|
||||
let appsink = appsink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
appsink.set_callbacks(
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
.new_sample(move |appsink| {
|
||||
gst::debug!(CAT, obj: appsink, "eos: pulling sample");
|
||||
|
@ -461,7 +459,7 @@ fn premature_shutdown() {
|
|||
const QUEUE_ITEMS_CAPACITY: u32 = 1;
|
||||
|
||||
let l = glib::MainLoop::new(None, false);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let caps = gst::Caps::builder("foo/bar").build();
|
||||
|
||||
|
@ -482,20 +480,20 @@ fn premature_shutdown() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let appsink = gst::ElementFactory::make("appsink")
|
||||
let sink = gst_app::AppSink::builder()
|
||||
.name("sink-ps")
|
||||
.property("sync", false)
|
||||
.property("async", false)
|
||||
.build()
|
||||
.unwrap();
|
||||
.sync(false)
|
||||
.async_(false)
|
||||
.build();
|
||||
|
||||
pipeline.add_many(&[&src, &queue, &appsink]).unwrap();
|
||||
gst::Element::link_many(&[&src, &queue, &appsink]).unwrap();
|
||||
pipeline
|
||||
.add_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 = appsink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
appsink.set_callbacks(
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
.new_sample(move |appsink| {
|
||||
gst::debug!(CAT, obj: appsink, "premature_shutdown: pulling sample");
|
||||
|
@ -620,7 +618,7 @@ fn socket_play_null_play() {
|
|||
init();
|
||||
|
||||
let l = glib::MainLoop::new(None, false);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let socket = gio::Socket::new(
|
||||
SocketFamily::Ipv4,
|
||||
|
|
|
@ -35,7 +35,7 @@ fn init() {
|
|||
fn test_push() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let fakesrc = gst::ElementFactory::make("fakesrc")
|
||||
.property("num-buffers", 3i32)
|
||||
.build()
|
||||
|
@ -51,17 +51,16 @@ fn test_push() {
|
|||
.property("context", "proxy::test")
|
||||
.build()
|
||||
.unwrap();
|
||||
let appsink = gst::ElementFactory::make("appsink").build().unwrap();
|
||||
let appsink = gst_app::AppSink::builder().build();
|
||||
|
||||
pipeline
|
||||
.add_many(&[&fakesrc, &proxysink, &proxysrc, &appsink])
|
||||
.add_many(&[&fakesrc, &proxysink, &proxysrc, appsink.upcast_ref()])
|
||||
.unwrap();
|
||||
fakesrc.link(&proxysink).unwrap();
|
||||
proxysrc.link(&appsink).unwrap();
|
||||
|
||||
let samples = Arc::new(Mutex::new(Vec::new()));
|
||||
|
||||
let appsink = appsink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
let samples_clone = samples.clone();
|
||||
appsink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
|
@ -106,7 +105,7 @@ fn test_push() {
|
|||
fn test_from_pipeline_to_pipeline() {
|
||||
init();
|
||||
|
||||
let pipe_1 = gst::Pipeline::new(None);
|
||||
let pipe_1 = gst::Pipeline::default();
|
||||
let fakesrc = gst::ElementFactory::make("fakesrc").build().unwrap();
|
||||
let pxsink = gst::ElementFactory::make("ts-proxysink")
|
||||
.name("proxysink::test2")
|
||||
|
@ -114,7 +113,7 @@ fn test_from_pipeline_to_pipeline() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let pipe_2 = gst::Pipeline::new(None);
|
||||
let pipe_2 = gst::Pipeline::default();
|
||||
let pxsrc = gst::ElementFactory::make("ts-proxysrc")
|
||||
.name("proxysrc::test2")
|
||||
.property("proxy-context", "proxy::test2_proxy")
|
||||
|
@ -144,7 +143,7 @@ fn test_from_pipeline_to_pipeline() {
|
|||
fn test_from_pipeline_to_pipeline_and_back() {
|
||||
init();
|
||||
|
||||
let pipe_1 = gst::Pipeline::new(None);
|
||||
let pipe_1 = gst::Pipeline::default();
|
||||
let pxsrc_1 = gst::ElementFactory::make("ts-proxysrc")
|
||||
.name("proxysrc1::test3")
|
||||
.property("proxy-context", "proxy::test3_proxy1")
|
||||
|
@ -157,7 +156,7 @@ fn test_from_pipeline_to_pipeline_and_back() {
|
|||
.build()
|
||||
.unwrap();
|
||||
|
||||
let pipe_2 = gst::Pipeline::new(None);
|
||||
let pipe_2 = gst::Pipeline::default();
|
||||
let pxsrc_2 = gst::ElementFactory::make("ts-proxysrc")
|
||||
.name("proxysrc2::test3")
|
||||
.property("proxy-context", "proxy::test3_proxy2")
|
||||
|
|
|
@ -35,21 +35,22 @@ fn init() {
|
|||
fn test_push() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let fakesrc = gst::ElementFactory::make("fakesrc")
|
||||
.property("num-buffers", 3i32)
|
||||
.build()
|
||||
.unwrap();
|
||||
let queue = gst::ElementFactory::make("ts-queue").build().unwrap();
|
||||
let appsink = gst::ElementFactory::make("appsink").build().unwrap();
|
||||
let appsink = gst_app::AppSink::builder().build();
|
||||
|
||||
pipeline.add_many(&[&fakesrc, &queue, &appsink]).unwrap();
|
||||
pipeline
|
||||
.add_many(&[&fakesrc, &queue, appsink.upcast_ref()])
|
||||
.unwrap();
|
||||
fakesrc.link(&queue).unwrap();
|
||||
queue.link(&appsink).unwrap();
|
||||
|
||||
let samples = Arc::new(Mutex::new(Vec::new()));
|
||||
|
||||
let appsink = appsink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
let samples_clone = samples.clone();
|
||||
appsink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
|
|
|
@ -54,7 +54,7 @@ fn test_push() {
|
|||
}
|
||||
});
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let caps = gst::Caps::builder("foo/bar").build();
|
||||
let tcpclientsrc = gst::ElementFactory::make("ts-tcpclientsrc")
|
||||
|
@ -62,18 +62,18 @@ fn test_push() {
|
|||
.property("port", 5000i32)
|
||||
.build()
|
||||
.unwrap();
|
||||
let appsink = gst::ElementFactory::make("appsink")
|
||||
.property("sync", false)
|
||||
.property("async", false)
|
||||
.build()
|
||||
.unwrap();
|
||||
let appsink = gst_app::AppSink::builder()
|
||||
.sync(false)
|
||||
.async_(false)
|
||||
.build();
|
||||
|
||||
pipeline.add_many(&[&tcpclientsrc, &appsink]).unwrap();
|
||||
pipeline
|
||||
.add_many(&[&tcpclientsrc, appsink.upcast_ref()])
|
||||
.unwrap();
|
||||
tcpclientsrc.link(&appsink).unwrap();
|
||||
|
||||
let samples = Arc::new(Mutex::new(Vec::new()));
|
||||
|
||||
let appsink = appsink.dynamic_cast::<gst_app::AppSink>().unwrap();
|
||||
let samples_clone = samples.clone();
|
||||
appsink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
|
|
|
@ -105,7 +105,7 @@ fn test_hlssink3_element_with_video_content() -> Result<(), ()> {
|
|||
|
||||
const BUFFER_NB: i32 = 250;
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("video_pipeline"));
|
||||
let pipeline = gst::Pipeline::builder().name("video_pipeline").build();
|
||||
|
||||
let video_src = try_create_element!("videotestsrc");
|
||||
video_src.set_property("is-live", true);
|
||||
|
@ -253,7 +253,7 @@ fn test_hlssink3_element_with_audio_content() -> Result<(), ()> {
|
|||
|
||||
const BUFFER_NB: i32 = 100;
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("audio_pipeline"));
|
||||
let pipeline = gst::Pipeline::builder().name("audio_pipeline").build();
|
||||
|
||||
let audio_src = try_create_element!("audiotestsrc");
|
||||
audio_src.set_property("is-live", true);
|
||||
|
@ -316,7 +316,7 @@ fn test_hlssink3_write_correct_playlist_content() -> Result<(), ()> {
|
|||
|
||||
const BUFFER_NB: i32 = 50;
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("video_pipeline"));
|
||||
let pipeline = gst::Pipeline::builder().name("video_pipeline").build();
|
||||
|
||||
let video_src = try_create_element!("videotestsrc");
|
||||
video_src.set_property("is-live", true);
|
||||
|
|
|
@ -312,7 +312,7 @@ fn make_converter_for_video_caps(caps: &gst::Caps) -> Result<gst::Element, Error
|
|||
|
||||
let video_info = gst_video::VideoInfo::from_caps(caps)?;
|
||||
|
||||
let ret = gst::Bin::new(None);
|
||||
let ret = gst::Bin::default();
|
||||
|
||||
let (head, mut tail) = {
|
||||
if let Some(feature) = caps.features(0) {
|
||||
|
@ -1403,7 +1403,9 @@ impl WebRTCSink {
|
|||
session_id
|
||||
);
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some(&format!("session-pipeline-{}", session_id)));
|
||||
let pipeline = gst::Pipeline::builder()
|
||||
.name(&format!("session-pipeline-{}", session_id))
|
||||
.build();
|
||||
|
||||
let webrtcbin = make_element("webrtcbin", Some(&format!("webrtcbin-{}", session_id)))
|
||||
.map_err(|err| WebRTCSinkError::SessionPipelineError {
|
||||
|
@ -2068,7 +2070,7 @@ impl WebRTCSink {
|
|||
codec: &Codec,
|
||||
caps: &gst::Caps,
|
||||
) -> Result<gst::Structure, Error> {
|
||||
let pipe = PipelineWrapper(gst::Pipeline::new(None));
|
||||
let pipe = PipelineWrapper(gst::Pipeline::default());
|
||||
|
||||
let src = if codec.is_video() {
|
||||
make_element("videotestsrc", None)?
|
||||
|
|
|
@ -23,7 +23,7 @@ const FALLBACK_PIPELINE: &str = "videotestsrc is-live=true pattern=snow";
|
|||
//const FALLBACK_PIPELINE: &str = "videotestsrc is-live=true pattern=snow ! x264enc tune=zerolatency";
|
||||
|
||||
fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element) {
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let video_src = gst::parse_bin_from_description(MAIN_PIPELINE, true)
|
||||
.unwrap()
|
||||
|
|
|
@ -893,7 +893,7 @@ impl BinImpl for FallbackSrc {
|
|||
|
||||
impl FallbackSrc {
|
||||
fn create_dummy_audio_source(filter_caps: &gst::Caps, min_latency: gst::ClockTime) -> gst::Bin {
|
||||
let bin = gst::Bin::new(None);
|
||||
let bin = gst::Bin::default();
|
||||
|
||||
let audiotestsrc = gst::ElementFactory::make("audiotestsrc")
|
||||
.name("audiosrc")
|
||||
|
@ -952,7 +952,7 @@ impl FallbackSrc {
|
|||
}
|
||||
|
||||
fn create_dummy_video_source(filter_caps: &gst::Caps, min_latency: gst::ClockTime) -> gst::Bin {
|
||||
let bin = gst::Bin::new(None);
|
||||
let bin = gst::Bin::default();
|
||||
|
||||
let videotestsrc = gst::ElementFactory::make("videotestsrc")
|
||||
.name("videosrc")
|
||||
|
@ -1011,7 +1011,7 @@ impl FallbackSrc {
|
|||
}
|
||||
|
||||
fn create_main_input(&self, source: &Source, buffer_duration: i64) -> SourceBin {
|
||||
let bin = gst::Bin::new(None);
|
||||
let bin = gst::Bin::default();
|
||||
|
||||
let source = match source {
|
||||
Source::Uri(ref uri) => {
|
||||
|
@ -1104,7 +1104,7 @@ impl FallbackSrc {
|
|||
None => return None,
|
||||
};
|
||||
|
||||
let bin = gst::Bin::new(None);
|
||||
let bin = gst::Bin::default();
|
||||
|
||||
bin.add(&source).unwrap();
|
||||
|
||||
|
@ -1585,7 +1585,7 @@ impl FallbackSrc {
|
|||
return imagefreeze;
|
||||
}
|
||||
|
||||
let bin = gst::Bin::new(None);
|
||||
let bin = gst::Bin::default();
|
||||
let videoconvert = gst::ElementFactory::make("videoconvert")
|
||||
.name("video_videoconvert")
|
||||
.build()
|
||||
|
@ -1633,7 +1633,7 @@ impl FallbackSrc {
|
|||
.expect("No identity found");
|
||||
}
|
||||
|
||||
let bin = gst::Bin::new(None);
|
||||
let bin = gst::Bin::default();
|
||||
let videoconvert = gst::ElementFactory::make("videoconvert")
|
||||
.name("video_videoconvert")
|
||||
.build()
|
||||
|
@ -1681,7 +1681,7 @@ impl FallbackSrc {
|
|||
.expect("No identity found");
|
||||
}
|
||||
|
||||
let bin = gst::Bin::new(None);
|
||||
let bin = gst::Bin::default();
|
||||
let audioconvert = gst::ElementFactory::make("audioconvert")
|
||||
.name("audio_audioconvert")
|
||||
.build()
|
||||
|
|
|
@ -464,7 +464,7 @@ fn setup_pipeline(
|
|||
|
||||
let clock = gst_check::TestClock::new();
|
||||
clock.set_time(gst::ClockTime::ZERO);
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
// Running time 0 in our pipeline is going to be clock time 1s. All
|
||||
// clock ids before 1s are used for signalling to our clock advancing
|
||||
|
@ -473,23 +473,20 @@ fn setup_pipeline(
|
|||
pipeline.set_base_time(gst::ClockTime::SECOND);
|
||||
pipeline.set_start_time(gst::ClockTime::NONE);
|
||||
|
||||
let src = gst::ElementFactory::make("appsrc")
|
||||
let src = gst_app::AppSrc::builder()
|
||||
.name("src")
|
||||
.build()
|
||||
.unwrap()
|
||||
.downcast::<gst_app::AppSrc>()
|
||||
.unwrap();
|
||||
src.set_is_live(true);
|
||||
src.set_format(gst::Format::Time);
|
||||
src.set_min_latency(LATENCY.nseconds() as i64);
|
||||
src.set_caps(Some(
|
||||
&gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::Argb)
|
||||
.width(320)
|
||||
.height(240)
|
||||
.framerate((0, 1).into())
|
||||
.build(),
|
||||
));
|
||||
.is_live(true)
|
||||
.format(gst::Format::Time)
|
||||
.min_latency(LATENCY.nseconds() as i64)
|
||||
.caps(
|
||||
&gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::Argb)
|
||||
.width(320)
|
||||
.height(240)
|
||||
.framerate((0, 1).into())
|
||||
.build(),
|
||||
)
|
||||
.build();
|
||||
|
||||
let switch = gst::ElementFactory::make("fallbackswitch")
|
||||
.name("switch")
|
||||
|
@ -504,13 +501,7 @@ fn setup_pipeline(
|
|||
switch.set_property("auto-switch", auto_switch);
|
||||
}
|
||||
|
||||
let sink = gst::ElementFactory::make("appsink")
|
||||
.name("sink")
|
||||
.build()
|
||||
.unwrap()
|
||||
.downcast::<gst_app::AppSink>()
|
||||
.unwrap();
|
||||
sink.set_sync(false);
|
||||
let sink = gst_app::AppSink::builder().name("sink").sync(false).build();
|
||||
|
||||
let queue = gst::ElementFactory::make("queue").build().unwrap();
|
||||
|
||||
|
@ -525,23 +516,20 @@ fn setup_pipeline(
|
|||
sink_pad.set_property("priority", 0u32);
|
||||
|
||||
if let Some(live) = with_live_fallback {
|
||||
let fallback_src = gst::ElementFactory::make("appsrc")
|
||||
let fallback_src = gst_app::AppSrc::builder()
|
||||
.name("fallback-src")
|
||||
.build()
|
||||
.unwrap()
|
||||
.downcast::<gst_app::AppSrc>()
|
||||
.unwrap();
|
||||
fallback_src.set_is_live(live);
|
||||
fallback_src.set_format(gst::Format::Time);
|
||||
fallback_src.set_min_latency(LATENCY.nseconds() as i64);
|
||||
fallback_src.set_caps(Some(
|
||||
&gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::Argb)
|
||||
.width(160)
|
||||
.height(120)
|
||||
.framerate((0, 1).into())
|
||||
.build(),
|
||||
));
|
||||
.is_live(live)
|
||||
.format(gst::Format::Time)
|
||||
.min_latency(LATENCY.nseconds() as i64)
|
||||
.caps(
|
||||
&gst_video::VideoCapsBuilder::new()
|
||||
.format(gst_video::VideoFormat::Argb)
|
||||
.width(160)
|
||||
.height(120)
|
||||
.framerate((0, 1).into())
|
||||
.build(),
|
||||
)
|
||||
.build();
|
||||
|
||||
pipeline.add(&fallback_src).unwrap();
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ fn create_pipeline() -> (
|
|||
gst::Element,
|
||||
gst::Element,
|
||||
) {
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let video_src = gst::ElementFactory::make("videotestsrc")
|
||||
.property("is-live", true)
|
||||
|
|
|
@ -275,7 +275,7 @@ fn test_create_pads() {
|
|||
fn test_one_stream_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -307,7 +307,7 @@ fn test_one_stream_open() {
|
|||
fn test_one_stream_gaps_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -340,7 +340,7 @@ fn test_one_stream_gaps_open() {
|
|||
fn test_one_stream_close_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -374,7 +374,7 @@ fn test_one_stream_close_open() {
|
|||
fn test_one_stream_open_close() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -409,7 +409,7 @@ fn test_one_stream_open_close() {
|
|||
fn test_one_stream_open_close_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -453,7 +453,7 @@ fn test_one_stream_open_close_open() {
|
|||
fn test_two_stream_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -506,7 +506,7 @@ fn test_two_stream_open() {
|
|||
fn test_two_stream_open_shift() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -563,7 +563,7 @@ fn test_two_stream_open_shift() {
|
|||
fn test_two_stream_open_shift_main() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -628,7 +628,7 @@ fn test_two_stream_open_shift_main() {
|
|||
fn test_two_stream_open_close() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -697,7 +697,7 @@ fn test_two_stream_open_close() {
|
|||
fn test_two_stream_close_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -766,7 +766,7 @@ fn test_two_stream_close_open() {
|
|||
fn test_two_stream_open_close_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -860,7 +860,7 @@ fn test_two_stream_open_close_open() {
|
|||
fn test_two_stream_open_close_open_gaps() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -960,7 +960,7 @@ fn test_two_stream_open_close_open_gaps() {
|
|||
fn test_two_stream_close_open_close_delta() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ fn test_two_stream_close_open_close_delta() {
|
|||
fn test_three_stream_open_close_open() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -1173,7 +1173,7 @@ fn test_three_stream_open_close_open() {
|
|||
fn test_two_stream_main_eos() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -1248,7 +1248,7 @@ fn test_two_stream_main_eos() {
|
|||
fn test_two_stream_secondary_eos_first() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -1316,7 +1316,7 @@ fn test_two_stream_secondary_eos_first() {
|
|||
fn test_three_stream_main_eos() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -1417,7 +1417,7 @@ fn test_three_stream_main_eos() {
|
|||
fn test_three_stream_main_and_second_eos() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
@ -1518,7 +1518,7 @@ fn test_three_stream_main_and_second_eos() {
|
|||
fn test_three_stream_secondary_eos_first() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let togglerecord = gst::ElementFactory::make("togglerecord").build().unwrap();
|
||||
pipeline.add(&togglerecord).unwrap();
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ struct Opt {
|
|||
}
|
||||
|
||||
fn create_pipeline(uris: Vec<String>, iterations: u32) -> anyhow::Result<gst::Pipeline> {
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let playlist = gst::ElementFactory::make("uriplaylistbin")
|
||||
.property("uris", &uris)
|
||||
.property("iterations", &iterations)
|
||||
|
|
|
@ -85,7 +85,7 @@ fn test(
|
|||
|
||||
let uris: Vec<String> = medias.iter().map(|t| t.uri.clone()).collect();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let playlist = gst::ElementFactory::make("uriplaylistbin")
|
||||
.property("uris", &uris)
|
||||
.property("iterations", &iterations)
|
||||
|
|
|
@ -25,7 +25,7 @@ fn init() {
|
|||
fn test_cdgdec() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(Some("cdgdec-test"));
|
||||
let pipeline = gst::Pipeline::builder().name("cdgdec-test").build();
|
||||
|
||||
let input_path = {
|
||||
let mut r = PathBuf::new();
|
||||
|
@ -50,14 +50,14 @@ fn test_cdgdec() {
|
|||
|
||||
let parse = gst::ElementFactory::make("cdgparse").build().unwrap();
|
||||
let dec = gst::ElementFactory::make("cdgdec").build().unwrap();
|
||||
let sink = gst::ElementFactory::make("appsink").build().unwrap();
|
||||
let sink = gst_app::AppSink::builder().build();
|
||||
|
||||
pipeline
|
||||
.add_many(&[&filesrc, &parse, &dec, &sink])
|
||||
.add_many(&[&filesrc, &parse, &dec, sink.upcast_ref()])
|
||||
.expect("failed to add elements to the pipeline");
|
||||
gst::Element::link_many(&[&filesrc, &parse, &dec, &sink]).expect("failed to link the elements");
|
||||
gst::Element::link_many(&[&filesrc, &parse, &dec, sink.upcast_ref()])
|
||||
.expect("failed to link the elements");
|
||||
|
||||
let sink = sink.downcast::<gst_app::AppSink>().unwrap();
|
||||
sink.set_callbacks(
|
||||
gst_app::AppSinkCallbacks::builder()
|
||||
// Add a handler to the "new-sample" signal.
|
||||
|
|
|
@ -442,8 +442,8 @@ impl TranscriberBin {
|
|||
}
|
||||
|
||||
fn build_state(&self) -> Result<State, Error> {
|
||||
let internal_bin = gst::Bin::new(Some("internal"));
|
||||
let transcription_bin = gst::Bin::new(Some("transcription-bin"));
|
||||
let internal_bin = gst::Bin::builder().name("internal").build();
|
||||
let transcription_bin = gst::Bin::builder().name("transcription-bin").build();
|
||||
let audio_tee = gst::ElementFactory::make("tee")
|
||||
// Protect passthrough enable (and resulting dynamic reconfigure)
|
||||
// from non-streaming thread
|
||||
|
|
|
@ -6,7 +6,7 @@ use gtk::{gdk, gio, glib};
|
|||
use std::cell::RefCell;
|
||||
|
||||
fn create_ui(app: >k::Application) {
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let src = gst::ElementFactory::make("videotestsrc").build().unwrap();
|
||||
|
||||
let overlay = gst::ElementFactory::make("clockoverlay")
|
||||
|
|
|
@ -21,7 +21,7 @@ fn init() {
|
|||
#[test]
|
||||
fn test_red_color() {
|
||||
init();
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
|
||||
let src = gst::ElementFactory::make("videotestsrc")
|
||||
.property_from_str("pattern", "red")
|
||||
|
|
|
@ -60,7 +60,7 @@ fn test_can_find_similar_frames() {
|
|||
|
||||
let max_distance = 0.0f64;
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
setup_pipeline(
|
||||
&pipeline,
|
||||
"red",
|
||||
|
@ -106,7 +106,7 @@ fn test_can_find_similar_frames() {
|
|||
fn test_do_not_send_message_when_image_not_found() {
|
||||
init();
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
setup_pipeline(&pipeline, "snow", "red", 0f64, HashAlgorithm::Blockhash);
|
||||
|
||||
pipeline.set_state(gst::State::Playing).unwrap();
|
||||
|
@ -145,7 +145,7 @@ fn test_use_dssim_to_find_similar_frames() {
|
|||
|
||||
let max_distance = 0.0f64;
|
||||
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
let pipeline = gst::Pipeline::default();
|
||||
setup_pipeline(&pipeline, "red", "red", max_distance, HashAlgorithm::Dssim);
|
||||
|
||||
pipeline.set_state(gst::State::Playing).unwrap();
|
||||
|
|
Loading…
Reference in a new issue