mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 03:21:00 +00:00
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>
This commit is contained in:
parent
c7f961cc22
commit
6dfd1c1496
16 changed files with 23 additions and 28 deletions
|
@ -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"
|
||||
))?
|
||||
|
|
|
@ -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",
|
||||
))
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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()),
|
||||
);
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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!();
|
||||
};
|
||||
|
|
|
@ -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"
|
||||
),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue