forked from mirrors/gstreamer-rs
pbutils/encoding_profile: Make the profile builder new()
functions private and use the builder()
functions on the main types
Also don't re-export the builder types at the crate root. Fewer types to juggle in application code.
This commit is contained in:
parent
9e1fb4570f
commit
06916b23c7
2 changed files with 9 additions and 10 deletions
|
@ -410,7 +410,7 @@ pub struct EncodingAudioProfileBuilder<'a> {
|
||||||
declare_encoding_profile_builder_common!(EncodingAudioProfileBuilder);
|
declare_encoding_profile_builder_common!(EncodingAudioProfileBuilder);
|
||||||
|
|
||||||
impl<'a> EncodingAudioProfileBuilder<'a> {
|
impl<'a> EncodingAudioProfileBuilder<'a> {
|
||||||
pub fn new() -> Self {
|
fn new() -> Self {
|
||||||
EncodingAudioProfileBuilder {
|
EncodingAudioProfileBuilder {
|
||||||
base: EncodingProfileBuilderCommonData::new(),
|
base: EncodingProfileBuilderCommonData::new(),
|
||||||
restriction: None,
|
restriction: None,
|
||||||
|
@ -451,7 +451,7 @@ pub struct EncodingVideoProfileBuilder<'a> {
|
||||||
declare_encoding_profile_builder_common!(EncodingVideoProfileBuilder);
|
declare_encoding_profile_builder_common!(EncodingVideoProfileBuilder);
|
||||||
|
|
||||||
impl<'a> EncodingVideoProfileBuilder<'a> {
|
impl<'a> EncodingVideoProfileBuilder<'a> {
|
||||||
pub fn new() -> Self {
|
fn new() -> Self {
|
||||||
EncodingVideoProfileBuilder {
|
EncodingVideoProfileBuilder {
|
||||||
base: EncodingProfileBuilderCommonData::new(),
|
base: EncodingProfileBuilderCommonData::new(),
|
||||||
restriction: None,
|
restriction: None,
|
||||||
|
@ -507,7 +507,7 @@ pub struct EncodingContainerProfileBuilder<'a> {
|
||||||
declare_encoding_profile_builder_common!(EncodingContainerProfileBuilder);
|
declare_encoding_profile_builder_common!(EncodingContainerProfileBuilder);
|
||||||
|
|
||||||
impl<'a> EncodingContainerProfileBuilder<'a> {
|
impl<'a> EncodingContainerProfileBuilder<'a> {
|
||||||
pub fn new() -> Self {
|
fn new() -> Self {
|
||||||
EncodingContainerProfileBuilder {
|
EncodingContainerProfileBuilder {
|
||||||
base: EncodingProfileBuilderCommonData::new(),
|
base: EncodingProfileBuilderCommonData::new(),
|
||||||
profiles: Vec::new(),
|
profiles: Vec::new(),
|
||||||
|
@ -576,7 +576,7 @@ mod tests {
|
||||||
|
|
||||||
let restriction = gst::Caps::new_simple("audio/x-raw", &[("format", &"S32LE")]);
|
let restriction = gst::Caps::new_simple("audio/x-raw", &[("format", &"S32LE")]);
|
||||||
|
|
||||||
let audio_profile = EncodingAudioProfileBuilder::new()
|
let audio_profile = EncodingAudioProfile::builder()
|
||||||
.name(AUDIO_PROFILE_NAME)
|
.name(AUDIO_PROFILE_NAME)
|
||||||
.description(AUDIO_PROFILE_DESCRIPTION)
|
.description(AUDIO_PROFILE_DESCRIPTION)
|
||||||
.format(&caps)
|
.format(&caps)
|
||||||
|
@ -615,7 +615,7 @@ mod tests {
|
||||||
|
|
||||||
let restriction = gst::Caps::new_simple("video/x-raw", &[("format", &"RGBA")]);
|
let restriction = gst::Caps::new_simple("video/x-raw", &[("format", &"RGBA")]);
|
||||||
|
|
||||||
let video_profile = EncodingVideoProfileBuilder::new()
|
let video_profile = EncodingVideoProfile::builder()
|
||||||
.name(VIDEO_PROFILE_NAME)
|
.name(VIDEO_PROFILE_NAME)
|
||||||
.description(VIDEO_PROFILE_DESCRIPTION)
|
.description(VIDEO_PROFILE_DESCRIPTION)
|
||||||
.format(&caps)
|
.format(&caps)
|
||||||
|
@ -661,20 +661,20 @@ mod tests {
|
||||||
let video_caps = gst::Caps::new_simple("video/x-raw", &[]);
|
let video_caps = gst::Caps::new_simple("video/x-raw", &[]);
|
||||||
let audio_caps = gst::Caps::new_simple("audio/x-raw", &[]);
|
let audio_caps = gst::Caps::new_simple("audio/x-raw", &[]);
|
||||||
|
|
||||||
let video_profile = EncodingVideoProfileBuilder::new()
|
let video_profile = EncodingVideoProfile::builder()
|
||||||
.name(VIDEO_PROFILE_NAME)
|
.name(VIDEO_PROFILE_NAME)
|
||||||
.description(VIDEO_PROFILE_DESCRIPTION)
|
.description(VIDEO_PROFILE_DESCRIPTION)
|
||||||
.format(&video_caps)
|
.format(&video_caps)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let audio_profile = EncodingAudioProfileBuilder::new()
|
let audio_profile = EncodingAudioProfile::builder()
|
||||||
.name(AUDIO_PROFILE_NAME)
|
.name(AUDIO_PROFILE_NAME)
|
||||||
.description(AUDIO_PROFILE_DESCRIPTION)
|
.description(AUDIO_PROFILE_DESCRIPTION)
|
||||||
.format(&audio_caps)
|
.format(&audio_caps)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let profile = EncodingContainerProfileBuilder::new()
|
let profile = EncodingContainerProfile::builder()
|
||||||
.name(CONTAINER_PROFILE_NAME)
|
.name(CONTAINER_PROFILE_NAME)
|
||||||
.description(CONTAINER_PROFILE_DESCRIPTION)
|
.description(CONTAINER_PROFILE_DESCRIPTION)
|
||||||
.format(&container_caps)
|
.format(&container_caps)
|
||||||
|
|
|
@ -44,8 +44,7 @@ pub mod discoverer_stream_info;
|
||||||
mod discoverer_video_info;
|
mod discoverer_video_info;
|
||||||
pub use crate::discoverer_video_info::*;
|
pub use crate::discoverer_video_info::*;
|
||||||
|
|
||||||
mod encoding_profile;
|
pub mod encoding_profile;
|
||||||
pub use crate::encoding_profile::*;
|
|
||||||
|
|
||||||
pub mod functions;
|
pub mod functions;
|
||||||
pub use crate::functions::*;
|
pub use crate::functions::*;
|
||||||
|
|
Loading…
Reference in a new issue