pbutils: encoding_profile: remove get_restriction() from Container API

Same rationale as the preceding commit, restriction isn't meant to be
used with container profiles.
This commit is contained in:
Guillaume Desmottes 2020-02-26 10:23:32 +05:30
parent 745aee629b
commit 50234bb5e6
4 changed files with 21 additions and 12 deletions

View file

@ -170,6 +170,10 @@ status = "generate"
pattern = "set_.*" pattern = "set_.*"
ignore = true ignore = true
[[object.function]]
pattern = "get_restriction"
ignore = true
[[object.function]] [[object.function]]
name = "copy" name = "copy"
[object.function.return] [object.function.return]

View file

@ -72,8 +72,6 @@ pub trait EncodingProfileExt: 'static {
fn get_preset_name(&self) -> Option<GString>; fn get_preset_name(&self) -> Option<GString>;
fn get_restriction(&self) -> Option<gst::Caps>;
fn get_type_nick(&self) -> Option<GString>; fn get_type_nick(&self) -> Option<GString>;
fn is_enabled(&self) -> bool; fn is_enabled(&self) -> bool;
@ -163,14 +161,6 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
} }
} }
fn get_restriction(&self) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_restriction(
self.as_ref().to_glib_none().0,
))
}
}
fn get_type_nick(&self) -> Option<GString> { fn get_type_nick(&self) -> Option<GString> {
unsafe { unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_type_nick( from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_type_nick(

View file

@ -121,6 +121,10 @@ trait EncodingProfileHasRestrictionSetter {
fn set_restriction(&self, restriction: Option<&gst::Caps>); fn set_restriction(&self, restriction: Option<&gst::Caps>);
} }
pub trait EncodingProfileHasRestrictionGetter {
fn get_restriction(&self) -> Option<gst::Caps>;
}
macro_rules! declare_encoding_profile_has_restriction( macro_rules! declare_encoding_profile_has_restriction(
($name:ident) => { ($name:ident) => {
impl EncodingProfileHasRestrictionSetter for $name { impl EncodingProfileHasRestrictionSetter for $name {
@ -140,6 +144,18 @@ macro_rules! declare_encoding_profile_has_restriction(
} }
} }
} }
impl EncodingProfileHasRestrictionGetter for $name {
fn get_restriction(&self) -> Option<gst::Caps> {
let profile: &EncodingProfile = glib::object::Cast::upcast_ref(self);
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_restriction(
profile.to_glib_none().0,
))
}
}
}
} }
); );
@ -660,7 +676,6 @@ mod tests {
assert_eq!(profile.get_format(), container_caps); assert_eq!(profile.get_format(), container_caps);
assert_eq!(profile.get_preset().unwrap(), PRESET); assert_eq!(profile.get_preset().unwrap(), PRESET);
assert_eq!(profile.get_preset_name().unwrap(), PRESET_NAME); assert_eq!(profile.get_preset_name().unwrap(), PRESET_NAME);
assert_eq!(profile.get_restriction(), None);
assert_eq!(profile.get_presence(), PRESENCE); assert_eq!(profile.get_presence(), PRESENCE);
assert_eq!(profile.get_allow_dynamic_output(), ALLOW_DYNAMIC_OUTPUT); assert_eq!(profile.get_allow_dynamic_output(), ALLOW_DYNAMIC_OUTPUT);
assert_eq!(profile.is_enabled(), ENABLED); assert_eq!(profile.is_enabled(), ENABLED);

View file

@ -66,7 +66,7 @@ pub mod prelude {
pub use gst::prelude::*; pub use gst::prelude::*;
pub use auto::traits::*; pub use auto::traits::*;
pub use encoding_profile::EncodingProfileBuilder; pub use encoding_profile::{EncodingProfileBuilder, EncodingProfileHasRestrictionGetter};
pub use functions::CodecTag; pub use functions::CodecTag;
} }