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

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivia Nikolaidou <vivia@ahiru.eu>2022-10-13 21:02:04 +0300
committerVivia Nikolaidou <vivia@ahiru.eu>2022-10-13 22:24:57 +0300
commitf11b0fa5eb0d294f09d4dda7a052cf647f254688 (patch)
tree6c3bd1726dc87c6a7d97f2804e1423f4c33acf72 /generic
parent862c2af1d9e81743f659609552ad4d409fb9c1fb (diff)
plugins, examples, tutorials: Use AudioCapsBuilder and VideoCapsBuilder
Simplify caps creation code
Diffstat (limited to 'generic')
-rw-r--r--generic/fmp4/examples/hls_live.rs10
-rw-r--r--generic/fmp4/examples/hls_vod.rs14
2 files changed, 11 insertions, 13 deletions
diff --git a/generic/fmp4/examples/hls_live.rs b/generic/fmp4/examples/hls_live.rs
index 4c8a1911..275ac08f 100644
--- a/generic/fmp4/examples/hls_live.rs
+++ b/generic/fmp4/examples/hls_live.rs
@@ -426,11 +426,11 @@ impl VideoStream {
raw_capsfilter.set_property(
"caps",
- gst::Caps::builder("video/x-raw")
- .field("format", "I420")
- .field("width", self.width)
- .field("height", self.height)
- .field("framerate", gst::Fraction::new(30, 1))
+ gst_video::VideoCapsBuilder::new()
+ .format(gst_video::VideoFormat::I420)
+ .width(self.width as i32)
+ .height(self.height as i32)
+ .framerate(gst::Fraction::new(30, 1))
.build(),
);
diff --git a/generic/fmp4/examples/hls_vod.rs b/generic/fmp4/examples/hls_vod.rs
index d90bc5f5..0a7aa720 100644
--- a/generic/fmp4/examples/hls_vod.rs
+++ b/generic/fmp4/examples/hls_vod.rs
@@ -321,11 +321,11 @@ impl VideoStream {
raw_capsfilter.set_property(
"caps",
- gst::Caps::builder("video/x-raw")
- .field("format", "I420")
- .field("width", self.width)
- .field("height", self.height)
- .field("framerate", gst::Fraction::new(30, 1))
+ gst_video::VideoCapsBuilder::new()
+ .format(gst_video::VideoFormat::I420)
+ .width(self.width as i32)
+ .height(self.height as i32)
+ .framerate(gst::Fraction::new(30, 1))
.build(),
);
@@ -375,9 +375,7 @@ impl AudioStream {
src.set_property_from_str("wave", &self.wave);
raw_capsfilter.set_property(
"caps",
- gst::Caps::builder("audio/x-raw")
- .field("rate", 44100)
- .build(),
+ gst_audio::AudioCapsBuilder::new().rate(44100).build(),
);
mux.set_property("fragment-duration", gst::ClockTime::from_mseconds(2500));