diff options
author | Guillaume Desmottes <guillaume.desmottes@onestream.live> | 2023-12-04 17:54:00 +0300 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@onestream.live> | 2023-12-04 17:58:21 +0300 |
commit | 6dfd1c1496ff710a806e4b0a5f30a83ab6b7fe40 (patch) | |
tree | e4ae83c2209dfd6f875e76130f44bc39adc207ad | |
parent | c7f961cc2216f24e282ed81dbed9be7d29d5ecd0 (diff) |
use new debug and parse API
Changes from https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1355
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1403>
-rw-r--r-- | audio/audiofx/examples/hrtfrender.rs | 2 | ||||
-rw-r--r-- | audio/audiofx/tests/audioloudnorm.rs | 4 | ||||
-rw-r--r-- | audio/csound/examples/effect_example.rs | 4 | ||||
-rw-r--r-- | generic/inter/examples/basic.rs | 4 | ||||
-rw-r--r-- | generic/inter/examples/plug-and-play.rs | 3 | ||||
-rw-r--r-- | mux/fmp4/examples/dash_vod.rs | 2 | ||||
-rw-r--r-- | mux/mp4/tests/tests.rs | 2 | ||||
-rw-r--r-- | net/webrtc/examples/webrtcsink-stats-server.rs | 2 | ||||
-rw-r--r-- | net/webrtc/src/webrtcsink/imp.rs | 2 | ||||
-rw-r--r-- | utils/fallbackswitch/examples/gtk_fallbackswitch.rs | 4 | ||||
-rw-r--r-- | utils/livesync/examples/gtk_livesync.rs | 2 | ||||
-rw-r--r-- | utils/tracers/src/pipeline_snapshot/imp.rs | 10 | ||||
-rw-r--r-- | utils/uriplaylistbin/examples/playlist.rs | 4 | ||||
-rw-r--r-- | video/ffv1/tests/ffv1dec.rs | 2 | ||||
-rw-r--r-- | video/gif/examples/testvideosrc2gif.rs | 2 | ||||
-rw-r--r-- | video/png/examples/pngenc.rs | 2 |
16 files changed, 23 insertions, 28 deletions
diff --git a/audio/audiofx/examples/hrtfrender.rs b/audio/audiofx/examples/hrtfrender.rs index 98acc158..cc156e50 100644 --- a/audio/audiofx/examples/hrtfrender.rs +++ b/audio/audiofx/examples/hrtfrender.rs @@ -36,7 +36,7 @@ fn run() -> Result<(), Error> { let uri = &args[1]; let hrir = &args[2]; - let pipeline = gst::parse_launch(&format!( + let pipeline = gst::parse::launch(&format!( "uridecodebin uri={uri} ! audioconvert ! audio/x-raw,channels=1 ! hrtfrender hrir-file={hrir} name=hrtf ! audioresample ! autoaudiosink" ))? diff --git a/audio/audiofx/tests/audioloudnorm.rs b/audio/audiofx/tests/audioloudnorm.rs index 4fd14b0f..e36055c4 100644 --- a/audio/audiofx/tests/audioloudnorm.rs +++ b/audio/audiofx/tests/audioloudnorm.rs @@ -39,7 +39,7 @@ fn run_test( }; let pipeline = if let Some(second_input) = second_input { - gst::parse_launch(&format!( + gst::parse::launch(&format!( "audiotestsrc {first_input} num-buffers={num_buffers} samplesperbuffer={samples_per_buffer} ! {format} ! audiomixer name=mixer output-buffer-duration={output_buffer_duration} ! {format} ! audioloudnorm ! appsink name=sink audiotestsrc {second_input} num-buffers={num_buffers} samplesperbuffer={samples_per_buffer} ! {format} ! mixer.", first_input = first_input, second_input = second_input, @@ -49,7 +49,7 @@ fn run_test( format = format, )) } else { - gst::parse_launch(&format!( + gst::parse::launch(&format!( "audiotestsrc {first_input} num-buffers={num_buffers} samplesperbuffer={samples_per_buffer} ! {format} ! audioloudnorm ! appsink name=sink", )) } diff --git a/audio/csound/examples/effect_example.rs b/audio/csound/examples/effect_example.rs index 39fb1af7..779b7603 100644 --- a/audio/csound/examples/effect_example.rs +++ b/audio/csound/examples/effect_example.rs @@ -75,9 +75,9 @@ const CSD: &str = " fn create_pipeline() -> Result<gst::Pipeline, Box<dyn Error>> { let pipeline = gst::Pipeline::default(); - let audio_src = gst::parse_bin_from_description(AUDIO_SRC, true)?.upcast(); + let audio_src = gst::parse::bin_from_description(AUDIO_SRC, true)?.upcast(); - let audio_sink = gst::parse_bin_from_description(AUDIO_SINK, true)?.upcast(); + let audio_sink = gst::parse::bin_from_description(AUDIO_SINK, true)?.upcast(); let csoundfilter = gst::ElementFactory::make("csoundfilter") .property("csd-text", CSD) diff --git a/generic/inter/examples/basic.rs b/generic/inter/examples/basic.rs index 1afbe8a4..cf0fdc9e 100644 --- a/generic/inter/examples/basic.rs +++ b/generic/inter/examples/basic.rs @@ -15,8 +15,8 @@ fn toplevel(obj: &gst::Object) -> gst::Object { async fn main() -> Result<(), Error> { gst::init()?; - let src_pipeline = gst::parse_launch("videotestsrc is-live=true ! intersink")?; - let sink_pipeline = gst::parse_launch("intersrc ! videoconvert ! autovideosink")?; + let src_pipeline = gst::parse::launch("videotestsrc is-live=true ! intersink")?; + let sink_pipeline = gst::parse::launch("intersrc ! videoconvert ! autovideosink")?; let mut stream = select_all([ src_pipeline.bus().unwrap().stream(), diff --git a/generic/inter/examples/plug-and-play.rs b/generic/inter/examples/plug-and-play.rs index f797e0b4..921f2423 100644 --- a/generic/inter/examples/plug-and-play.rs +++ b/generic/inter/examples/plug-and-play.rs @@ -145,8 +145,7 @@ fn monitor_pipeline(pipeline: &gst::Pipeline, base_time: gst::ClockTime) -> Resu } MessageView::StateChanged(sc) => { if msg.src() == Some(pipeline.upcast_ref()) { - gst::debug_bin_to_dot_file( - pipeline.upcast_ref::<gst::Bin>(), + pipeline.debug_to_dot_file( gst::DebugGraphDetails::all(), format!("{}-{:?}-{:?}", pipeline.name(), sc.old(), sc.current()), ); diff --git a/mux/fmp4/examples/dash_vod.rs b/mux/fmp4/examples/dash_vod.rs index 71938f4d..7f25094e 100644 --- a/mux/fmp4/examples/dash_vod.rs +++ b/mux/fmp4/examples/dash_vod.rs @@ -43,7 +43,7 @@ fn main() -> Result<(), Error> { path: PathBuf::from("dash_stream"), })); - let pipeline = gst::parse_launch("videotestsrc num-buffers=2500 ! timecodestamper ! video/x-raw,format=I420,width=1280,height=720,framerate=30/1 ! timeoverlay ! x264enc bframes=0 bitrate=2048 ! video/x-h264,profile=main ! cmafmux fragment-duration=10000000000 header-update-mode=update write-mehd=true ! appsink name=sink").unwrap().downcast::<gst::Pipeline>().unwrap(); + let pipeline = gst::parse::launch("videotestsrc num-buffers=2500 ! timecodestamper ! video/x-raw,format=I420,width=1280,height=720,framerate=30/1 ! timeoverlay ! x264enc bframes=0 bitrate=2048 ! video/x-h264,profile=main ! cmafmux fragment-duration=10000000000 header-update-mode=update write-mehd=true ! appsink name=sink").unwrap().downcast::<gst::Pipeline>().unwrap(); let sink = pipeline .by_name("sink") diff --git a/mux/mp4/tests/tests.rs b/mux/mp4/tests/tests.rs index b4d480f4..fc6e360f 100644 --- a/mux/mp4/tests/tests.rs +++ b/mux/mp4/tests/tests.rs @@ -38,7 +38,7 @@ fn test_basic() { } } - let pipeline = match gst::parse_launch( + let pipeline = match gst::parse::launch( "videotestsrc num-buffers=99 ! x264enc ! mux. \ audiotestsrc num-buffers=140 ! fdkaacenc ! mux. \ isomp4mux name=mux ! filesink name=sink \ diff --git a/net/webrtc/examples/webrtcsink-stats-server.rs b/net/webrtc/examples/webrtcsink-stats-server.rs index e82f63d4..1da38e35 100644 --- a/net/webrtc/examples/webrtcsink-stats-server.rs +++ b/net/webrtc/examples/webrtcsink-stats-server.rs @@ -127,7 +127,7 @@ async fn run(args: Args) -> Result<(), Error> { args.uri ); - let pipeline = gst::parse_launch(&pipeline_str)?; + let pipeline = gst::parse::launch(&pipeline_str)?; let ws = pipeline .downcast_ref::<gst::Bin>() .unwrap() diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index ee3e4bc1..85195da5 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -817,7 +817,7 @@ impl EncodingChainBuilder { elements.push(match self.codec.is_video() { true => make_converter_for_video_caps(&self.input_caps, &self.codec)?.upcast(), false => { - gst::parse_bin_from_description("audioresample ! audioconvert", true)?.upcast() + gst::parse::bin_from_description("audioresample ! audioconvert", true)?.upcast() } }); diff --git a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs index da8865d9..ead6d9ab 100644 --- a/utils/fallbackswitch/examples/gtk_fallbackswitch.rs +++ b/utils/fallbackswitch/examples/gtk_fallbackswitch.rs @@ -22,10 +22,10 @@ const FALLBACK_PIPELINE: &str = "videotestsrc is-live=true pattern=snow"; fn create_pipeline() -> (gst::Pipeline, gst::Pad, gst::Element) { let pipeline = gst::Pipeline::default(); - let video_src = gst::parse_bin_from_description(MAIN_PIPELINE, true) + let video_src = gst::parse::bin_from_description(MAIN_PIPELINE, true) .unwrap() .upcast(); - let fallback_video_src = gst::parse_bin_from_description(FALLBACK_PIPELINE, true) + let fallback_video_src = gst::parse::bin_from_description(FALLBACK_PIPELINE, true) .unwrap() .upcast(); diff --git a/utils/livesync/examples/gtk_livesync.rs b/utils/livesync/examples/gtk_livesync.rs index b0a77089..c30da7ab 100644 --- a/utils/livesync/examples/gtk_livesync.rs +++ b/utils/livesync/examples/gtk_livesync.rs @@ -32,7 +32,7 @@ impl Drop for DroppingProbe { } fn create_pipeline() -> gst::Pipeline { - gst::parse_launch( + gst::parse::launch( r#"videotestsrc name=vsrc is-live=1 ! video/x-raw,framerate=60/1,width=800,height=600 ! identity single-segment=1 diff --git a/utils/tracers/src/pipeline_snapshot/imp.rs b/utils/tracers/src/pipeline_snapshot/imp.rs index 9f80912a..4dd75a47 100644 --- a/utils/tracers/src/pipeline_snapshot/imp.rs +++ b/utils/tracers/src/pipeline_snapshot/imp.rs @@ -211,17 +211,13 @@ impl PipelineSnapshot { let dump_name = format!("{}{}", settings.dot_prefix, pipeline.name()); if settings.dot_ts { - gst::debug_bin_to_dot_file_with_ts( - &pipeline, + pipeline.debug_to_dot_file_with_ts( gst::DebugGraphDetails::all(), &dump_name, ); } else { - gst::debug_bin_to_dot_file( - &pipeline, - gst::DebugGraphDetails::all(), - &dump_name, - ); + pipeline + .debug_to_dot_file(gst::DebugGraphDetails::all(), &dump_name); } } } diff --git a/utils/uriplaylistbin/examples/playlist.rs b/utils/uriplaylistbin/examples/playlist.rs index 3e293d3c..a927648a 100644 --- a/utils/uriplaylistbin/examples/playlist.rs +++ b/utils/uriplaylistbin/examples/playlist.rs @@ -43,13 +43,13 @@ fn create_pipeline(uris: Vec<String>, iterations: u32) -> anyhow::Result<gst::Pi let pad_name = src_pad.name(); let sink = if pad_name.starts_with("audio") { - gst::parse_bin_from_description( + gst::parse::bin_from_description( "queue ! audioconvert ! audioresample ! autoaudiosink", true, ) .unwrap() } else if pad_name.starts_with("video") { - gst::parse_bin_from_description("queue ! videoconvert ! autovideosink", true).unwrap() + gst::parse::bin_from_description("queue ! videoconvert ! autovideosink", true).unwrap() } else { unimplemented!(); }; diff --git a/video/ffv1/tests/ffv1dec.rs b/video/ffv1/tests/ffv1dec.rs index 47410eb9..2cdf805b 100644 --- a/video/ffv1/tests/ffv1dec.rs +++ b/video/ffv1/tests/ffv1dec.rs @@ -35,7 +35,7 @@ fn test_decode(name: &str) { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); path.push(format!("tests/ffv1_v3_{name}.mkv")); - let bin = gst::parse_bin_from_description( + let bin = gst::parse::bin_from_description( &format!( "filesrc location={path:?} ! matroskademux name=m m.video_0 ! ffv1dec name=ffv1dec" ), diff --git a/video/gif/examples/testvideosrc2gif.rs b/video/gif/examples/testvideosrc2gif.rs index 4e7848b2..36ccd46f 100644 --- a/video/gif/examples/testvideosrc2gif.rs +++ b/video/gif/examples/testvideosrc2gif.rs @@ -16,7 +16,7 @@ fn main() { gst::init().unwrap(); gstgif::plugin_register_static().expect("Failed to register gif plugin"); - let pipeline = gst::parse_launch(ENCODE_PIPELINE).unwrap(); + let pipeline = gst::parse::launch(ENCODE_PIPELINE).unwrap(); let bus = pipeline.bus().unwrap(); pipeline diff --git a/video/png/examples/pngenc.rs b/video/png/examples/pngenc.rs index 0ed81975..cab7f839 100644 --- a/video/png/examples/pngenc.rs +++ b/video/png/examples/pngenc.rs @@ -17,7 +17,7 @@ fn main() { gst::init().unwrap(); gstrspng::plugin_register_static().expect("Failed to register gif plugin"); - let pipeline = gst::parse_launch(ENCODE_PIPELINE).unwrap(); + let pipeline = gst::parse::launch(ENCODE_PIPELINE).unwrap(); let bus = pipeline.bus().unwrap(); pipeline |