plugins: Use .into() instead of gst::Fraction::new() where applicable

This commit is contained in:
Vivia Nikolaidou 2022-10-14 17:32:43 +03:00
parent 0ab965335f
commit 9b1361b538
6 changed files with 7 additions and 7 deletions

View file

@ -430,7 +430,7 @@ impl VideoStream {
.format(gst_video::VideoFormat::I420)
.width(self.width as i32)
.height(self.height as i32)
.framerate(gst::Fraction::new(30, 1))
.framerate(30.into())
.build(),
);

View file

@ -325,7 +325,7 @@ impl VideoStream {
.format(gst_video::VideoFormat::I420)
.width(self.width as i32)
.height(self.height as i32)
.framerate(gst::Fraction::new(30, 1))
.framerate(30.into())
.build(),
);

View file

@ -534,7 +534,7 @@ fn setup_pipeline(
.format(gst_video::VideoFormat::Argb)
.width(320)
.height(240)
.framerate(gst::Fraction::new(0, 1))
.framerate((0, 1).into())
.build(),
);
@ -579,7 +579,7 @@ fn setup_pipeline(
.format(gst_video::VideoFormat::Argb)
.width(160)
.height(120)
.framerate(gst::Fraction::new(0, 1))
.framerate((0, 1).into())
.build(),
);

View file

@ -105,7 +105,7 @@ fn setup_sender_receiver(
.format(gst_video::VideoFormat::Argb)
.width(320)
.height(240)
.framerate(gst::Fraction::new(50, 1))
.framerate(50.into())
.build()
} else {
gst_audio::AudioCapsBuilder::new_interleaved()

View file

@ -70,7 +70,7 @@ impl ElementImpl for CdgDec {
.format(gst_video::VideoFormat::Rgba)
.width(CDG_WIDTH as i32)
.height(CDG_HEIGHT as i32)
.framerate(gst::Fraction::new(0, 1))
.framerate((0, 1).into())
.build();
let src_pad_template = gst::PadTemplate::new(
"src",

View file

@ -218,7 +218,7 @@ impl ElementImpl for GifEnc {
let sink_caps = gst_video::VideoCapsBuilder::new()
.format_list([VideoFormat::Rgb, VideoFormat::Rgba])
// frame-delay timing in gif is a multiple of 10ms -> max 100fps
.framerate_range(gst::Fraction::new(1, 1)..gst::Fraction::new(100, 1))
.framerate_range(gst::Fraction::from(1)..gst::Fraction::from(100))
.build();
let sink_pad_template = gst::PadTemplate::new(
"sink",