Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivia Nikolaidou <vivia@ahiru.eu>2022-07-22 14:07:49 +0300
committerVivia Nikolaidou <vivia@ahiru.eu>2022-08-09 22:01:10 +0300
commit247702b76d645c1ccdebe5727b31d461ec7bd598 (patch)
tree38efed0c404cc2d61d972e7b6a17f451ae56b16a /video/rav1e
parentfb7929dda68bcf091811750eebe26a8ff1c10c0d (diff)
video: Use gst_video::VideoCapsBuilder in some plugins
Simplify caps creation codes
Diffstat (limited to 'video/rav1e')
-rw-r--r--video/rav1e/src/rav1enc/imp.rs38
1 files changed, 13 insertions, 25 deletions
diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs
index 429e7e20e..d748b3446 100644
--- a/video/rav1e/src/rav1enc/imp.rs
+++ b/video/rav1e/src/rav1enc/imp.rs
@@ -553,31 +553,19 @@ impl ElementImpl for Rav1Enc {
fn pad_templates() -> &'static [gst::PadTemplate] {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| {
- let sink_caps = gst::Caps::builder("video/x-raw")
- .field(
- "format",
- gst::List::new([
- gst_video::VideoFormat::I420.to_str(),
- gst_video::VideoFormat::Y42b.to_str(),
- gst_video::VideoFormat::Y444.to_str(),
- gst_video::VideoFormat::I42010le.to_str(),
- gst_video::VideoFormat::I42210le.to_str(),
- gst_video::VideoFormat::Y44410le.to_str(),
- gst_video::VideoFormat::I42012le.to_str(),
- gst_video::VideoFormat::I42212le.to_str(),
- gst_video::VideoFormat::Y44412le.to_str(),
- gst_video::VideoFormat::Gray8.to_str(),
- ]),
- )
- .field("width", gst::IntRange::new(1, std::i32::MAX))
- .field("height", gst::IntRange::new(1, std::i32::MAX))
- .field(
- "framerate",
- gst::FractionRange::new(
- gst::Fraction::new(0, 1),
- gst::Fraction::new(std::i32::MAX, 1),
- ),
- )
+ let sink_caps = gst_video::VideoCapsBuilder::new()
+ .format_list([
+ gst_video::VideoFormat::I420,
+ gst_video::VideoFormat::Y42b,
+ gst_video::VideoFormat::Y444,
+ gst_video::VideoFormat::I42010le,
+ gst_video::VideoFormat::I42210le,
+ gst_video::VideoFormat::Y44410le,
+ gst_video::VideoFormat::I42012le,
+ gst_video::VideoFormat::I42212le,
+ gst_video::VideoFormat::Y44412le,
+ gst_video::VideoFormat::Gray8,
+ ])
.build();
let sink_pad_template = gst::PadTemplate::new(
"sink",