From a649e7dead9c6deb8c43a55fd9c40bc1918ac850 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 1 Dec 2023 16:53:44 +0100 Subject: [PATCH] gstreamer: move parse_* functions to their own module Better namespacing so the API is more Rust-y. Part-of: --- examples/src/bin/custom_events.rs | 2 +- examples/src/bin/debug_ringbuffer.rs | 2 +- examples/src/bin/events.rs | 2 +- examples/src/bin/futures.rs | 2 +- examples/src/bin/glib-futures.rs | 2 +- examples/src/bin/launch.rs | 27 +++-- examples/src/bin/launch_glib_main.rs | 2 +- examples/src/bin/pad_probes.rs | 2 +- examples/src/bin/queries.rs | 2 +- examples/src/bin/tagsetter.rs | 2 +- examples/src/bin/thumbnail.rs | 2 +- examples/src/bin/video_converter.rs | 2 +- examples/src/bin/zoom.rs | 2 +- gstreamer-utils/src/streamproducer.rs | 4 +- gstreamer/src/functions.rs | 127 +-------------------- gstreamer/src/lib.rs | 2 + gstreamer/src/parse.rs | 137 +++++++++++++++++++++++ tutorials/src/bin/basic-tutorial-1.rs | 2 +- tutorials/src/bin/basic-tutorial-12.rs | 2 +- tutorials/src/bin/basic-tutorial-13.rs | 2 +- tutorials/src/bin/playback-tutorial-3.rs | 2 +- tutorials/src/bin/playback-tutorial-5.rs | 2 +- tutorials/src/bin/playback-tutorial-6.rs | 2 +- tutorials/src/bin/playback-tutorial-7.rs | 2 +- 24 files changed, 177 insertions(+), 158 deletions(-) create mode 100644 gstreamer/src/parse.rs diff --git a/examples/src/bin/custom_events.rs b/examples/src/bin/custom_events.rs index b1d61773a..3e8be3430 100644 --- a/examples/src/bin/custom_events.rs +++ b/examples/src/bin/custom_events.rs @@ -48,7 +48,7 @@ fn example_main() { let main_loop = glib::MainLoop::new(None, false); // This creates a pipeline by parsing the gst-launch pipeline syntax. - let pipeline = gst::parse_launch( + let pipeline = gst::parse::launch( "audiotestsrc name=src ! queue max-size-time=2000000000 ! fakesink name=sink sync=true", ) .unwrap(); diff --git a/examples/src/bin/debug_ringbuffer.rs b/examples/src/bin/debug_ringbuffer.rs index fc59ef3d9..04befbefd 100644 --- a/examples/src/bin/debug_ringbuffer.rs +++ b/examples/src/bin/debug_ringbuffer.rs @@ -27,7 +27,7 @@ fn example_main() { let mut context = gst::ParseContext::new(); let pipeline = - match gst::parse_launch_full(pipeline_str, Some(&mut context), gst::ParseFlags::empty()) { + match gst::parse::launch_full(pipeline_str, Some(&mut context), gst::ParseFlags::empty()) { Ok(pipeline) => pipeline, Err(err) => { if let Some(gst::ParseError::NoSuchElement) = err.kind::() { diff --git a/examples/src/bin/events.rs b/examples/src/bin/events.rs index b76f6a081..ceabfa20f 100644 --- a/examples/src/bin/events.rs +++ b/examples/src/bin/events.rs @@ -30,7 +30,7 @@ fn example_main() { let main_loop = glib::MainLoop::new(None, false); // This creates a pipeline by parsing the gst-launch pipeline syntax. - let pipeline = gst::parse_launch("audiotestsrc ! fakesink").unwrap(); + let pipeline = gst::parse::launch("audiotestsrc ! fakesink").unwrap(); let bus = pipeline.bus().unwrap(); pipeline diff --git a/examples/src/bin/futures.rs b/examples/src/bin/futures.rs index 3b9fc76fc..37f00a3ce 100644 --- a/examples/src/bin/futures.rs +++ b/examples/src/bin/futures.rs @@ -42,7 +42,7 @@ fn example_main() { gst::init().unwrap(); // Create a pipeline from the launch-syntax given on the cli. - let pipeline = gst::parse_launch(&pipeline_str).unwrap(); + let pipeline = gst::parse::launch(&pipeline_str).unwrap(); let bus = pipeline.bus().unwrap(); pipeline diff --git a/examples/src/bin/glib-futures.rs b/examples/src/bin/glib-futures.rs index 4d0c2f6b9..313a0297b 100644 --- a/examples/src/bin/glib-futures.rs +++ b/examples/src/bin/glib-futures.rs @@ -42,7 +42,7 @@ fn example_main() { gst::init().unwrap(); // Create a pipeline from the launch-syntax given on the cli. - let pipeline = gst::parse_launch(&pipeline_str).unwrap(); + let pipeline = gst::parse::launch(&pipeline_str).unwrap(); let bus = pipeline.bus().unwrap(); pipeline diff --git a/examples/src/bin/launch.rs b/examples/src/bin/launch.rs index 29daf4a2f..2c7525c2e 100644 --- a/examples/src/bin/launch.rs +++ b/examples/src/bin/launch.rs @@ -26,19 +26,22 @@ fn example_main() { // Especially GUIs should probably handle this case, to tell users that they need to // install the corresponding gstreamer plugins. let mut context = gst::ParseContext::new(); - let pipeline = - match gst::parse_launch_full(&pipeline_str, Some(&mut context), gst::ParseFlags::empty()) { - Ok(pipeline) => pipeline, - Err(err) => { - if let Some(gst::ParseError::NoSuchElement) = err.kind::() { - println!("Missing element(s): {:?}", context.missing_elements()); - } else { - println!("Failed to parse pipeline: {err}"); - } - - process::exit(-1) + let pipeline = match gst::parse::launch_full( + &pipeline_str, + Some(&mut context), + gst::ParseFlags::empty(), + ) { + Ok(pipeline) => pipeline, + Err(err) => { + if let Some(gst::ParseError::NoSuchElement) = err.kind::() { + println!("Missing element(s): {:?}", context.missing_elements()); + } else { + println!("Failed to parse pipeline: {err}"); } - }; + + process::exit(-1) + } + }; let bus = pipeline.bus().unwrap(); pipeline diff --git a/examples/src/bin/launch_glib_main.rs b/examples/src/bin/launch_glib_main.rs index 55859b96d..90c36a797 100644 --- a/examples/src/bin/launch_glib_main.rs +++ b/examples/src/bin/launch_glib_main.rs @@ -24,7 +24,7 @@ fn example_main() { let main_loop = glib::MainLoop::new(None, false); // Let GStreamer create a pipeline from the parsed launch syntax on the cli. - let pipeline = gst::parse_launch(&pipeline_str).unwrap(); + let pipeline = gst::parse::launch(&pipeline_str).unwrap(); let bus = pipeline.bus().unwrap(); pipeline diff --git a/examples/src/bin/pad_probes.rs b/examples/src/bin/pad_probes.rs index 624a232a3..16c1b88af 100644 --- a/examples/src/bin/pad_probes.rs +++ b/examples/src/bin/pad_probes.rs @@ -22,7 +22,7 @@ fn example_main() { // Parse the pipeline we want to probe from a static in-line string. // Here we give our audiotestsrc a name, so we can retrieve that element // from the resulting pipeline. - let pipeline = gst::parse_launch(&format!( + let pipeline = gst::parse::launch(&format!( "audiotestsrc name=src ! audio/x-raw,format={},channels=1 ! fakesink", gst_audio::AUDIO_FORMAT_S16 )) diff --git a/examples/src/bin/queries.rs b/examples/src/bin/queries.rs index 461629646..5b74257bd 100644 --- a/examples/src/bin/queries.rs +++ b/examples/src/bin/queries.rs @@ -28,7 +28,7 @@ fn example_main() { let main_loop = glib::MainLoop::new(None, false); // Let GStreamer create a pipeline from the parsed launch syntax on the cli. - let pipeline = gst::parse_launch(&pipeline_str).unwrap(); + let pipeline = gst::parse::launch(&pipeline_str).unwrap(); let bus = pipeline.bus().unwrap(); pipeline diff --git a/examples/src/bin/tagsetter.rs b/examples/src/bin/tagsetter.rs index 25c6ce06d..0f8c066b3 100644 --- a/examples/src/bin/tagsetter.rs +++ b/examples/src/bin/tagsetter.rs @@ -42,7 +42,7 @@ fn example_main() -> Result<(), Error> { // Parse the pipeline we want to probe from a static in-line string. let mut context = gst::ParseContext::new(); - let pipeline = match gst::parse_launch_full( + let pipeline = match gst::parse::launch_full( "audiotestsrc wave=white-noise num-buffers=100 ! flacenc ! filesink location=test.flac", Some(&mut context), gst::ParseFlags::empty(), diff --git a/examples/src/bin/thumbnail.rs b/examples/src/bin/thumbnail.rs index 3d833f506..9d860bb0f 100644 --- a/examples/src/bin/thumbnail.rs +++ b/examples/src/bin/thumbnail.rs @@ -27,7 +27,7 @@ fn create_pipeline(uri: String, out_path: std::path::PathBuf) -> Result() diff --git a/examples/src/bin/video_converter.rs b/examples/src/bin/video_converter.rs index 4b129c4da..7a88cd64d 100644 --- a/examples/src/bin/video_converter.rs +++ b/examples/src/bin/video_converter.rs @@ -11,7 +11,7 @@ fn example_main() { gst::init().unwrap(); // This creates a pipeline by parsing the gst-launch pipeline syntax. - let pipeline = gst::parse_launch( + let pipeline = gst::parse::launch( "videotestsrc name=src ! video/x-raw,width=640,height=480 ! compositor0.sink_0 \ compositor ! video/x-raw,width=1280,height=720 ! videoconvert ! autovideosink", ) diff --git a/examples/src/bin/zoom.rs b/examples/src/bin/zoom.rs index 59b4802f9..b2d438b32 100644 --- a/examples/src/bin/zoom.rs +++ b/examples/src/bin/zoom.rs @@ -83,7 +83,7 @@ fn example_main() { gst::init().unwrap(); - let pipeline = gst::parse_launch(&format!( + let pipeline = gst::parse::launch(&format!( "compositor name=mix background=1 sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0 sink_0::width={WIDTH} sink_0::height={HEIGHT} ! xvimagesink \ videotestsrc name=src ! video/x-raw,framerate=30/1,width={WIDTH},height={HEIGHT},pixel-aspect-ratio=1/1 ! queue ! mix.sink_0" )).unwrap().downcast::().unwrap(); diff --git a/gstreamer-utils/src/streamproducer.rs b/gstreamer-utils/src/streamproducer.rs index 89edcb965..1b656f9a9 100644 --- a/gstreamer-utils/src/streamproducer.rs +++ b/gstreamer-utils/src/streamproducer.rs @@ -646,7 +646,7 @@ mod tests { StreamProducer, ) { let producer_pipe = - gst::parse_launch("appsrc name=producer_src ! appsink name=producer_sink") + gst::parse::launch("appsrc name=producer_src ! appsink name=producer_sink") .unwrap() .downcast::() .unwrap(); @@ -678,7 +678,7 @@ mod tests { impl Consumer { fn new(id: &str) -> Self { - let pipeline = gst::parse_launch(&format!("appsrc name={id} ! appsink name=sink")) + let pipeline = gst::parse::launch(&format!("appsrc name={id} ! appsink name=sink")) .unwrap() .downcast::() .unwrap(); diff --git a/gstreamer/src/functions.rs b/gstreamer/src/functions.rs index 0afbcccd0..ce3407a8a 100644 --- a/gstreamer/src/functions.rs +++ b/gstreamer/src/functions.rs @@ -2,125 +2,17 @@ use std::ptr; -use glib::{prelude::*, translate::*}; +use glib::translate::*; #[cfg(feature = "v1_18")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))] use crate::Tracer; -use crate::{Bin, Element, Object, ParseContext, ParseFlags}; // import only functions which do not have their own module as namespace pub use crate::auto::functions::{ - main_executable_path, parse_bin_from_description, parse_launch, parse_launchv, update_registry, - util_get_timestamp, version, version_string, + main_executable_path, update_registry, util_get_timestamp, version, version_string, }; -pub fn parse_bin_from_description_with_name( - bin_description: &str, - ghost_unlinked_pads: bool, - bin_name: &str, -) -> Result { - skip_assert_initialized!(); - let bin = parse_bin_from_description(bin_description, ghost_unlinked_pads)?; - if !bin_name.is_empty() { - let obj = bin.clone().upcast::(); - unsafe { - ffi::gst_object_set_name(obj.to_glib_none().0, bin_name.to_glib_none().0); - } - } - Ok(bin) -} - -#[doc(alias = "gst_parse_bin_from_description_full")] -pub fn parse_bin_from_description_full( - bin_description: &str, - ghost_unlinked_pads: bool, - mut context: Option<&mut ParseContext>, - flags: ParseFlags, -) -> Result { - skip_assert_initialized!(); - unsafe { - let mut error = ptr::null_mut(); - let ret = ffi::gst_parse_bin_from_description_full( - bin_description.to_glib_none().0, - ghost_unlinked_pads.into_glib(), - context.to_glib_none_mut().0, - flags.into_glib(), - &mut error, - ); - if error.is_null() { - Ok(from_glib_none(ret)) - } else { - Err(from_glib_full(error)) - } - } -} - -pub fn parse_bin_from_description_with_name_full( - bin_description: &str, - ghost_unlinked_pads: bool, - bin_name: &str, - context: Option<&mut ParseContext>, - flags: ParseFlags, -) -> Result { - skip_assert_initialized!(); - let bin = - parse_bin_from_description_full(bin_description, ghost_unlinked_pads, context, flags)?; - if !bin_name.is_empty() { - let obj = bin.clone().upcast::(); - unsafe { - ffi::gst_object_set_name(obj.to_glib_none().0, bin_name.to_glib_none().0); - } - } - Ok(bin) -} - -#[doc(alias = "gst_parse_launch_full")] -pub fn parse_launch_full( - pipeline_description: &str, - mut context: Option<&mut ParseContext>, - flags: ParseFlags, -) -> Result { - assert_initialized_main_thread!(); - unsafe { - let mut error = ptr::null_mut(); - let ret = ffi::gst_parse_launch_full( - pipeline_description.to_glib_none().0, - context.to_glib_none_mut().0, - flags.into_glib(), - &mut error, - ); - if error.is_null() { - Ok(from_glib_none(ret)) - } else { - Err(from_glib_full(error)) - } - } -} - -#[doc(alias = "gst_parse_launchv_full")] -pub fn parse_launchv_full( - argv: &[&str], - mut context: Option<&mut ParseContext>, - flags: ParseFlags, -) -> Result { - assert_initialized_main_thread!(); - unsafe { - let mut error = ptr::null_mut(); - let ret = ffi::gst_parse_launchv_full( - argv.to_glib_none().0, - context.to_glib_none_mut().0, - flags.into_glib(), - &mut error, - ); - if error.is_null() { - Ok(from_glib_none(ret)) - } else { - Err(from_glib_full(error)) - } - } -} - #[doc(alias = "gst_calculate_linear_regression")] pub fn calculate_linear_regression( xy: &[(u64, u64)], @@ -181,7 +73,6 @@ pub fn active_tracers() -> glib::List { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; #[test] fn test_calculate_linear_regression() { @@ -197,18 +88,4 @@ mod tests { calculate_linear_regression(&values, Some(&mut temp)).unwrap(); assert_eq!((m_num, m_denom, b, xbase), (10, 10, 3, 3)); } - - #[test] - fn test_parse_bin_from_description_with_name() { - crate::init().unwrap(); - - let bin = - parse_bin_from_description_with_name("fakesrc ! fakesink", false, "all_fake").unwrap(); - let name = bin.name(); - assert_eq!(name, "all_fake"); - - let bin = parse_bin_from_description_with_name("fakesrc ! fakesink", false, "").unwrap(); - let name = bin.name(); - assert_ne!(name, ""); - } } diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index 62c9117cc..c41cd2b4a 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -259,6 +259,8 @@ pub use crate::functions::*; mod utils; pub use crate::utils::ObjectLockGuard; +pub mod parse; + #[cfg(feature = "v1_18")] mod gtype; diff --git a/gstreamer/src/parse.rs b/gstreamer/src/parse.rs new file mode 100644 index 000000000..59a8bf46e --- /dev/null +++ b/gstreamer/src/parse.rs @@ -0,0 +1,137 @@ +// Take a look at the license at the top of the repository in the LICENSE file. + +use std::ptr; + +use glib::{prelude::*, translate::*}; + +use crate::{Bin, Element, Object, ParseContext, ParseFlags}; + +pub use crate::auto::functions::parse_bin_from_description as bin_from_description; +pub use crate::auto::functions::parse_launch as launch; +pub use crate::auto::functions::parse_launchv as launchv; + +#[doc(alias = "gst_parse_bin_from_description_full")] +pub fn bin_from_description_with_name( + bin_description: &str, + ghost_unlinked_pads: bool, + bin_name: &str, +) -> Result { + skip_assert_initialized!(); + let bin = bin_from_description(bin_description, ghost_unlinked_pads)?; + if !bin_name.is_empty() { + let obj = bin.clone().upcast::(); + unsafe { + ffi::gst_object_set_name(obj.to_glib_none().0, bin_name.to_glib_none().0); + } + } + Ok(bin) +} + +#[doc(alias = "gst_parse_bin_from_description_full")] +pub fn bin_from_description_full( + bin_description: &str, + ghost_unlinked_pads: bool, + mut context: Option<&mut ParseContext>, + flags: ParseFlags, +) -> Result { + skip_assert_initialized!(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::gst_parse_bin_from_description_full( + bin_description.to_glib_none().0, + ghost_unlinked_pads.into_glib(), + context.to_glib_none_mut().0, + flags.into_glib(), + &mut error, + ); + if error.is_null() { + Ok(from_glib_none(ret)) + } else { + Err(from_glib_full(error)) + } + } +} + +#[doc(alias = "gst_parse_bin_from_description_full")] +pub fn bin_from_description_with_name_full( + bin_description: &str, + ghost_unlinked_pads: bool, + bin_name: &str, + context: Option<&mut ParseContext>, + flags: ParseFlags, +) -> Result { + skip_assert_initialized!(); + let bin = bin_from_description_full(bin_description, ghost_unlinked_pads, context, flags)?; + if !bin_name.is_empty() { + let obj = bin.clone().upcast::(); + unsafe { + ffi::gst_object_set_name(obj.to_glib_none().0, bin_name.to_glib_none().0); + } + } + Ok(bin) +} + +#[doc(alias = "gst_parse_launch_full")] +pub fn launch_full( + pipeline_description: &str, + mut context: Option<&mut ParseContext>, + flags: ParseFlags, +) -> Result { + assert_initialized_main_thread!(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::gst_parse_launch_full( + pipeline_description.to_glib_none().0, + context.to_glib_none_mut().0, + flags.into_glib(), + &mut error, + ); + if error.is_null() { + Ok(from_glib_none(ret)) + } else { + Err(from_glib_full(error)) + } + } +} + +#[doc(alias = "gst_parse_launchv_full")] +pub fn launchv_full( + argv: &[&str], + mut context: Option<&mut ParseContext>, + flags: ParseFlags, +) -> Result { + assert_initialized_main_thread!(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::gst_parse_launchv_full( + argv.to_glib_none().0, + context.to_glib_none_mut().0, + flags.into_glib(), + &mut error, + ); + if error.is_null() { + Ok(from_glib_none(ret)) + } else { + Err(from_glib_full(error)) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::prelude::*; + + #[test] + fn test_parse_bin_from_description_with_name() { + crate::init().unwrap(); + + let bin = bin_from_description_with_name("fakesrc ! fakesink", false, "all_fake").unwrap(); + let name = bin.name(); + assert_eq!(name, "all_fake"); + + let bin = bin_from_description_with_name("fakesrc ! fakesink", false, "").unwrap(); + let name = bin.name(); + assert_ne!(name, ""); + } +} diff --git a/tutorials/src/bin/basic-tutorial-1.rs b/tutorials/src/bin/basic-tutorial-1.rs index a627ef0eb..ea4c2724c 100644 --- a/tutorials/src/bin/basic-tutorial-1.rs +++ b/tutorials/src/bin/basic-tutorial-1.rs @@ -9,7 +9,7 @@ fn tutorial_main() { // Build the pipeline let uri = "https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm"; - let pipeline = gst::parse_launch(&format!("playbin uri={uri}")).unwrap(); + let pipeline = gst::parse::launch(&format!("playbin uri={uri}")).unwrap(); // Start playing pipeline diff --git a/tutorials/src/bin/basic-tutorial-12.rs b/tutorials/src/bin/basic-tutorial-12.rs index 42e3b87bf..2dec8c575 100644 --- a/tutorials/src/bin/basic-tutorial-12.rs +++ b/tutorials/src/bin/basic-tutorial-12.rs @@ -12,7 +12,7 @@ fn tutorial_main() -> Result<(), Error> { // Build the pipeline let uri = "https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm"; - let pipeline = gst::parse_launch(&format!("playbin uri={uri}"))?; + let pipeline = gst::parse::launch(&format!("playbin uri={uri}"))?; // Start playing let res = pipeline.set_state(gst::State::Playing)?; diff --git a/tutorials/src/bin/basic-tutorial-13.rs b/tutorials/src/bin/basic-tutorial-13.rs index 34cb8c8bd..92f0aab88 100644 --- a/tutorials/src/bin/basic-tutorial-13.rs +++ b/tutorials/src/bin/basic-tutorial-13.rs @@ -122,7 +122,7 @@ USAGE: Choose one of the following options, then press enter: // Build the pipeline. let uri = "https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm"; - let pipeline = gst::parse_launch(&format!("playbin uri={uri}"))?; + let pipeline = gst::parse::launch(&format!("playbin uri={uri}"))?; // Start playing. let _ = pipeline.set_state(State::Playing)?; diff --git a/tutorials/src/bin/playback-tutorial-3.rs b/tutorials/src/bin/playback-tutorial-3.rs index f16693910..19d9a2f01 100644 --- a/tutorials/src/bin/playback-tutorial-3.rs +++ b/tutorials/src/bin/playback-tutorial-3.rs @@ -46,7 +46,7 @@ fn tutorial_main() -> Result<(), Error> { gst::init().unwrap(); // Create the playbin element - let pipeline = gst::parse_launch("playbin uri=appsrc://").unwrap(); + let pipeline = gst::parse::launch("playbin uri=appsrc://").unwrap(); // This part is called when playbin has created the appsrc element, // so we have a chance to configure it. diff --git a/tutorials/src/bin/playback-tutorial-5.rs b/tutorials/src/bin/playback-tutorial-5.rs index 7f7454cf6..e0b16129a 100644 --- a/tutorials/src/bin/playback-tutorial-5.rs +++ b/tutorials/src/bin/playback-tutorial-5.rs @@ -110,7 +110,7 @@ fn tutorial_main() -> Result<(), Error> { thread::spawn(move || handle_keyboard(ready_tx)); // Build the pipeline - let pipeline = gst::parse_launch( + let pipeline = gst::parse::launch( "playbin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm", )?; diff --git a/tutorials/src/bin/playback-tutorial-6.rs b/tutorials/src/bin/playback-tutorial-6.rs index 450a4da1e..73465959c 100644 --- a/tutorials/src/bin/playback-tutorial-6.rs +++ b/tutorials/src/bin/playback-tutorial-6.rs @@ -45,7 +45,7 @@ fn tutorial_main() -> Result<(), Error> { let vis_plugin = vis_factory.create().build().unwrap(); // Build the pipeline - let pipeline = gst::parse_launch("playbin uri=http://radio.hbr1.com:19800/ambient.ogg")?; + let pipeline = gst::parse::launch("playbin uri=http://radio.hbr1.com:19800/ambient.ogg")?; // Set the visualization flag let flags = pipeline.property_value("flags"); diff --git a/tutorials/src/bin/playback-tutorial-7.rs b/tutorials/src/bin/playback-tutorial-7.rs index c7f858cc2..f26f21b07 100644 --- a/tutorials/src/bin/playback-tutorial-7.rs +++ b/tutorials/src/bin/playback-tutorial-7.rs @@ -9,7 +9,7 @@ fn tutorial_main() -> Result<(), Error> { gst::init()?; // Build the pipeline - let pipeline = gst::parse_launch( + let pipeline = gst::parse::launch( "playbin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm", )?;