diff options
author | Vivia Nikolaidou <vivia@ahiru.eu> | 2022-10-13 21:02:04 +0300 |
---|---|---|
committer | Vivia Nikolaidou <vivia@ahiru.eu> | 2022-10-13 22:24:57 +0300 |
commit | f11b0fa5eb0d294f09d4dda7a052cf647f254688 (patch) | |
tree | 6c3bd1726dc87c6a7d97f2804e1423f4c33acf72 /video | |
parent | 862c2af1d9e81743f659609552ad4d409fb9c1fb (diff) |
plugins, examples, tutorials: Use AudioCapsBuilder and VideoCapsBuilder
Simplify caps creation code
Diffstat (limited to 'video')
-rw-r--r-- | video/cdg/src/cdgdec/imp.rs | 10 | ||||
-rw-r--r-- | video/gtk4/examples/gtksink.rs | 6 | ||||
-rw-r--r-- | video/webp/src/dec/imp.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/video/cdg/src/cdgdec/imp.rs b/video/cdg/src/cdgdec/imp.rs index 469c0976..6656bc53 100644 --- a/video/cdg/src/cdgdec/imp.rs +++ b/video/cdg/src/cdgdec/imp.rs @@ -66,11 +66,11 @@ impl ElementImpl for CdgDec { ) .unwrap(); - let src_caps = gst::Caps::builder("video/x-raw") - .field("format", gst_video::VideoFormat::Rgba.to_str()) - .field("width", CDG_WIDTH as i32) - .field("height", CDG_HEIGHT as i32) - .field("framerate", gst::Fraction::new(0, 1)) + let src_caps = gst_video::VideoCapsBuilder::new() + .format(gst_video::VideoFormat::Rgba) + .width(CDG_WIDTH as i32) + .height(CDG_HEIGHT as i32) + .framerate(gst::Fraction::new(0, 1)) .build(); let src_pad_template = gst::PadTemplate::new( "src", diff --git a/video/gtk4/examples/gtksink.rs b/video/gtk4/examples/gtksink.rs index eba0c94d..530b1812 100644 --- a/video/gtk4/examples/gtksink.rs +++ b/video/gtk4/examples/gtksink.rs @@ -18,9 +18,9 @@ fn create_ui(app: >k::Application) { pipeline.add_many(&[&src, &overlay, &sink]).unwrap(); src.link_filtered( &overlay, - &gst::Caps::builder("video/x-raw") - .field("width", 640) - .field("height", 480) + &gst_video::VideoCapsBuilder::new() + .width(640) + .height(480) .build(), ) .unwrap(); diff --git a/video/webp/src/dec/imp.rs b/video/webp/src/dec/imp.rs index e9f327d8..277f5692 100644 --- a/video/webp/src/dec/imp.rs +++ b/video/webp/src/dec/imp.rs @@ -343,8 +343,8 @@ impl ElementImpl for WebPDec { ) .unwrap(); - let caps = gst::Caps::builder("video/x-raw") - .field("format", "RGBA") + let caps = gst_video::VideoCapsBuilder::new() + .format(gst_video::VideoFormat::Rgba) .build(); let src_pad_template = gst::PadTemplate::new( |