mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
audio, video: Default values in caps builders
AudioCapsBuilder::new() will have the default values for rate/channels/layout/format. Similarly, VideoCapsBuilder::new() will have the default values for format/width/height/framerate.
This commit is contained in:
parent
751a5b4788
commit
7a9537c0fd
2 changed files with 12 additions and 2 deletions
|
@ -11,7 +11,12 @@ pub struct AudioCapsBuilder<T> {
|
|||
impl AudioCapsBuilder<gst::caps::NoFeature> {
|
||||
pub fn new() -> Self {
|
||||
let builder = Caps::builder("audio/x-raw");
|
||||
AudioCapsBuilder { builder }
|
||||
let builder = AudioCapsBuilder { builder };
|
||||
builder
|
||||
.rate_range(..)
|
||||
.channels_range(..)
|
||||
.layout_list([AudioLayout::Interleaved, AudioLayout::NonInterleaved])
|
||||
.format_list(AudioFormat::iter_raw())
|
||||
}
|
||||
|
||||
pub fn any_features(self) -> AudioCapsBuilder<gst::caps::HasFeatures> {
|
||||
|
|
|
@ -11,7 +11,12 @@ pub struct VideoCapsBuilder<T> {
|
|||
impl VideoCapsBuilder<gst::caps::NoFeature> {
|
||||
pub fn new() -> Self {
|
||||
let builder = Caps::builder("video/x-raw");
|
||||
VideoCapsBuilder { builder }
|
||||
let builder = VideoCapsBuilder { builder };
|
||||
builder
|
||||
.format_list(VideoFormat::iter_raw())
|
||||
.width_range(..)
|
||||
.height_range(..)
|
||||
.framerate_range(..)
|
||||
}
|
||||
|
||||
pub fn any_features(self) -> VideoCapsBuilder<gst::caps::HasFeatures> {
|
||||
|
|
Loading…
Reference in a new issue