Commit 382138b7 authored by Thiago Santos's avatar Thiago Santos Committed by Sebastian Dröge

More encoding_profile binding improvements

- enable is_equal function again (unsure why it was disabled)
- remove restriction-caps property, encoding-profile objects are
immutable
- remove cast need by using IsA<EncodingProfile> in parameters and
returning the correct type of encodingprofile subclass from the build()
functions. It used a internal hack for storing those IsA objects in
order to keep the API clean and ready to be used, this should be sorted
out as soon as we figure out how to store them in the buidlers.
- encodebin example: remove Result error propagation when it is caused
by programming mistakes. A panic will happen in those cases.
- run rustfmt
parent 43235969
......@@ -145,11 +145,8 @@ trait = false
[[object]]
name = "GstPbutils.EncodingProfile"
status = "generate"
[[object.function]]
name = "is_equal"
ignore = true
# Ignore all setters, making it imutable. A builder will be provided.
# Ignore all setters, making it immutable. A builder will be provided.
[[object.function]]
name = "new"
ignore = true
......@@ -172,11 +169,16 @@ status = "generate"
[object.function.return]
nullable = false
[[object.property]]
name = "restriction-caps"
# encodingprofile is immutable after constructed
ignore = true
[[object]]
name = "GstPbutils.EncodingContainerProfile"
status = "generate"
# Make it imutable, only able to be constructed for a builder
# Make it immutable, only able to be constructed for a builder
[[object.function]]
name = "new"
ignore = true
......@@ -211,7 +213,7 @@ status = "generate"
name = "GstPbutils.EncodingAudioProfile"
status = "generate"
trait = false
# Ignore all setters, making it imutable. A builder will be provided.
# Ignore all setters, making it immutable. A builder will be provided.
[[object.function]]
name = "new"
ignore = true
......@@ -223,7 +225,7 @@ trait = false
name = "GstPbutils.EncodingVideoProfile"
status = "generate"
trait = false
# Ignore all setters, making it imutable. A builder will be provided.
# Ignore all setters, making it immutable. A builder will be provided.
[[object.function]]
name = "new"
ignore = true
......
......@@ -58,11 +58,11 @@ fn configure_encodebin(encodebin: &gst::Element) -> Result<(), Error> {
"video/x-matroska",
&[],
))
.add_profile(&(video_profile.upcast()))
.add_profile(&(audio_profile.upcast()))
.add_profile(&(video_profile))
.add_profile(&(audio_profile))
.build()?;
encodebin.set_property("profile", &container_profile)?;
encodebin.set_property("profile", &container_profile).expect("set profile property failed");
Ok(())
}
......@@ -87,12 +87,12 @@ fn example_main() -> Result<(), Error> {
let encodebin = gst::ElementFactory::make("encodebin", None).ok_or(MissingElement("encodebin"))?;
let sink = gst::ElementFactory::make("filesink", None).ok_or(MissingElement("filesink"))?;
src.set_property("uri", &uri)?;
sink.set_property("location", &output_file)?;
src.set_property("uri", &uri).expect("setting URI Property failed");
sink.set_property("location", &output_file).expect("setting location property failed");
configure_encodebin(&encodebin)?;
pipeline.add_many(&[&src, &encodebin, &sink])?;
pipeline.add_many(&[&src, &encodebin, &sink]).expect("failed to add elements to pipeline");
gst::Element::link_many(&[&encodebin, &sink])?;
// Need to move a new reference into the closure
......@@ -122,7 +122,7 @@ fn example_main() -> Result<(), Error> {
}
};
let insert_sink = |is_audio, is_video| -> Result<(), Error> {
let link_to_encodebin = |is_audio, is_video| -> Result<(), Error> {
if is_audio {
let queue =
gst::ElementFactory::make("queue", None).ok_or(MissingElement("queue"))?;
......@@ -132,7 +132,7 @@ fn example_main() -> Result<(), Error> {
.ok_or(MissingElement("audioresample"))?;
let elements = &[&queue, &convert, &resample];
pipeline.add_many(elements)?;
pipeline.add_many(elements).expect("failed to add audio elements to pipeline");
gst::Element::link_many(elements)?;
let enc_sink_pad = encodebin.get_request_pad("audio_%u").expect("Could not get audio pad from encodebin");
......@@ -154,7 +154,7 @@ fn example_main() -> Result<(), Error> {
.ok_or(MissingElement("videoscale"))?;
let elements = &[&queue, &convert, &scale];
pipeline.add_many(elements)?;
pipeline.add_many(elements).expect("failed to add video elements to pipeline");
gst::Element::link_many(elements)?;
let enc_sink_pad = encodebin.get_request_pad("video_%u").expect("Could not get video pad from encodebin");
......@@ -172,7 +172,7 @@ fn example_main() -> Result<(), Error> {
Ok(())
};
if let Err(err) = insert_sink(is_audio, is_video) {
if let Err(err) = link_to_encodebin(is_audio, is_video) {
#[cfg(feature = "v1_10")]
gst_element_error!(
dbin,
......
......@@ -19,6 +19,26 @@ use std::mem::transmute;
use std::ptr;
glib_wrapper! {
/// The `Discoverer` is a utility object which allows to get as much
/// information as possible from one or many URIs.
///
/// It provides two APIs, allowing usage in blocking or non-blocking mode.
///
/// The blocking mode just requires calling `Discoverer::discover_uri`
/// with the URI one wishes to discover.
///
/// The non-blocking mode requires a running `glib::MainLoop` iterating a
/// `glib::MainContext`, where one connects to the various signals, appends the
/// URIs to be processed (through `Discoverer::discover_uri_async`) and then
/// asks for the discovery to begin (through `Discoverer::start`).
/// By default this will use the GLib default main context unless you have
/// set a custom context using `glib::MainContext::push_thread_default`.
///
/// All the information is returned in a `DiscovererInfo` structure.
///
/// # Implements
///
/// [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
pub struct Discoverer(Object<ffi::GstDiscoverer, ffi::GstDiscovererClass>);
match fn {
......@@ -27,6 +47,17 @@ glib_wrapper! {
}
impl Discoverer {
/// Creates a new `Discoverer` with the provided timeout.
/// ## `timeout`
/// timeout per file, in nanoseconds. Allowed are values between
/// one second (`GST_SECOND`) and one hour (3600 * `GST_SECOND`)
///
/// # Returns
///
/// The new `Discoverer`.
/// If an error occurred when creating the discoverer, `err` will be set
/// accordingly and `None` will be returned. If `err` is set, the caller must
/// free it when no longer needed using `glib::Error::free`.
pub fn new(timeout: gst::ClockTime) -> Result<Discoverer, Error> {
assert_initialized_main_thread!();
unsafe {
......
......@@ -11,6 +11,11 @@ use std::mem;
use std::ptr;
glib_wrapper! {
/// `DiscovererStreamInfo` specific to audio streams.
///
/// # Implements
///
/// [`DiscovererStreamInfoExt`](trait.DiscovererStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
pub struct DiscovererAudioInfo(Object<ffi::GstDiscovererAudioInfo>): DiscovererStreamInfo;
match fn {
......@@ -19,12 +24,25 @@ glib_wrapper! {
}
impl DiscovererAudioInfo {
///
/// # Returns
///
/// the average or nominal bitrate of the stream in bits/second.
pub fn get_bitrate(&self) -> u32 {
unsafe {
ffi::gst_discoverer_audio_info_get_bitrate(self.to_glib_none().0)
}
}
///
/// Feature: `v1_14`
///
///
/// # Returns
///
/// the channel-mask of the stream, refer to
/// `gst_audio_channel_positions_from_mask` for more
/// information.
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn get_channel_mask(&self) -> u64 {
unsafe {
......@@ -32,30 +50,50 @@ impl DiscovererAudioInfo {
}
}
///
/// # Returns
///
/// the number of channels in the stream.
pub fn get_channels(&self) -> u32 {
unsafe {
ffi::gst_discoverer_audio_info_get_channels(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the number of bits used per sample in each channel.
pub fn get_depth(&self) -> u32 {
unsafe {
ffi::gst_discoverer_audio_info_get_depth(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the language of the stream, or NULL if unknown.
pub fn get_language(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_discoverer_audio_info_get_language(self.to_glib_none().0))
}
}
///
/// # Returns
///
/// the maximum bitrate of the stream in bits/second.
pub fn get_max_bitrate(&self) -> u32 {
unsafe {
ffi::gst_discoverer_audio_info_get_max_bitrate(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the sample rate of the stream in Hertz.
pub fn get_sample_rate(&self) -> u32 {
unsafe {
ffi::gst_discoverer_audio_info_get_sample_rate(self.to_glib_none().0)
......
......@@ -11,6 +11,11 @@ use std::mem;
use std::ptr;
glib_wrapper! {
/// `DiscovererStreamInfo` specific to container streams.
///
/// # Implements
///
/// [`DiscovererStreamInfoExt`](trait.DiscovererStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
pub struct DiscovererContainerInfo(Object<ffi::GstDiscovererContainerInfo>): DiscovererStreamInfo;
match fn {
......@@ -19,6 +24,12 @@ glib_wrapper! {
}
impl DiscovererContainerInfo {
///
/// # Returns
///
/// the list of
/// `DiscovererStreamInfo` this container stream offers.
/// Free with `DiscovererStreamInfo::list_free` after usage.
pub fn get_streams(&self) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_discoverer_container_info_get_streams(self.to_glib_none().0))
......
......@@ -16,6 +16,11 @@ use std::mem;
use std::ptr;
glib_wrapper! {
/// Structure containing the information of a URI analyzed by `Discoverer`.
///
/// # Implements
///
/// [`DiscovererInfoExt`](trait.DiscovererInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
pub struct DiscovererInfo(Object<ffi::GstDiscovererInfo>);
match fn {
......@@ -24,6 +29,14 @@ glib_wrapper! {
}
impl DiscovererInfo {
/// Parses a `glib::Variant` as produced by `DiscovererInfoExt::to_variant`
/// back to a `DiscovererInfo`.
/// ## `variant`
/// A `glib::Variant` to deserialize into a `DiscovererInfo`.
///
/// # Returns
///
/// A newly-allocated `DiscovererInfo`.
pub fn from_variant(variant: &glib::Variant) -> Option<DiscovererInfo> {
assert_initialized_main_thread!();
unsafe {
......@@ -35,42 +48,167 @@ impl DiscovererInfo {
unsafe impl Send for DiscovererInfo {}
unsafe impl Sync for DiscovererInfo {}
/// Trait containing all `DiscovererInfo` methods.
///
/// # Implementors
///
/// [`DiscovererInfo`](struct.DiscovererInfo.html)
pub trait DiscovererInfoExt {
///
/// # Returns
///
/// A copy of the `DiscovererInfo`
fn copy(&self) -> DiscovererInfo;
/// Finds all the `DiscovererAudioInfo` contained in `self`
///
/// # Returns
///
/// A `glib::List` of
/// matching `DiscovererStreamInfo`. The caller should free it with
/// `DiscovererStreamInfo::list_free`.
fn get_audio_streams(&self) -> Vec<DiscovererStreamInfo>;
/// Finds all the `DiscovererContainerInfo` contained in `self`
///
/// # Returns
///
/// A `glib::List` of
/// matching `DiscovererStreamInfo`. The caller should free it with
/// `DiscovererStreamInfo::list_free`.
fn get_container_streams(&self) -> Vec<DiscovererStreamInfo>;
///
/// # Returns
///
/// the duration of the URI in `gst::ClockTime` (nanoseconds).
fn get_duration(&self) -> gst::ClockTime;
///
/// Feature: `v1_14`
///
///
/// # Returns
///
/// whether the URI is live.
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn get_live(&self) -> bool;
///
/// # Deprecated
///
/// This functions is deprecated since version 1.4, use
/// `DiscovererInfoExt::get_missing_elements_installer_details`
///
/// # Returns
///
/// Miscellaneous information stored as a `gst::Structure`
/// (for example: information about missing plugins). If you wish to use the
/// `gst::Structure` after the life-time of `self`, you will need to copy it.
fn get_misc(&self) -> Option<gst::Structure>;
/// Get the installer details for missing elements
///
/// # Returns
///
/// An array of strings
/// containing informations about how to install the various missing elements
/// for `self` to be usable. If you wish to use the strings after the life-time
/// of `self`, you will need to copy them.
fn get_missing_elements_installer_details(&self) -> Vec<String>;
///
/// # Returns
///
/// the result of the discovery as a `DiscovererResult`.
fn get_result(&self) -> DiscovererResult;
///
/// # Returns
///
/// the whether the URI is seekable.
fn get_seekable(&self) -> bool;
///
/// # Returns
///
/// the structure (or topology) of the URI as a
/// `DiscovererStreamInfo`.
/// This structure can be traversed to see the original hierarchy. Unref with
/// `gst_discoverer_stream_info_unref` after usage.
fn get_stream_info(&self) -> Option<DiscovererStreamInfo>;
///
/// # Returns
///
/// the list of
/// all streams contained in the `info`. Free after usage
/// with `DiscovererStreamInfo::list_free`.
fn get_stream_list(&self) -> Vec<DiscovererStreamInfo>;
/// Finds the `DiscovererStreamInfo` contained in `self` that match the
/// given `streamtype`.
/// ## `streamtype`
/// a `glib::Type` derived from `DiscovererStreamInfo`
///
/// # Returns
///
/// A `glib::List` of
/// matching `DiscovererStreamInfo`. The caller should free it with
/// `DiscovererStreamInfo::list_free`.
fn get_streams(&self, streamtype: glib::types::Type) -> Vec<DiscovererStreamInfo>;
/// Finds all the `DiscovererSubtitleInfo` contained in `self`
///
/// # Returns
///
/// A `glib::List` of
/// matching `DiscovererStreamInfo`. The caller should free it with
/// `DiscovererStreamInfo::list_free`.
fn get_subtitle_streams(&self) -> Vec<DiscovererStreamInfo>;
///
/// # Returns
///
/// all tags contained in the URI. If you wish to use
/// the tags after the life-time of `self`, you will need to copy them.
fn get_tags(&self) -> Option<gst::TagList>;
///
/// # Returns
///
/// TOC contained in the URI. If you wish to use
/// the TOC after the life-time of `self`, you will need to copy it.
fn get_toc(&self) -> Option<gst::Toc>;
///
/// # Returns
///
/// the URI to which this information corresponds to.
/// Copy it if you wish to use it after the life-time of `self`.
fn get_uri(&self) -> Option<String>;
/// Finds all the `DiscovererVideoInfo` contained in `self`
///
/// # Returns
///
/// A `glib::List` of
/// matching `DiscovererStreamInfo`. The caller should free it with
/// `DiscovererStreamInfo::list_free`.
fn get_video_streams(&self) -> Vec<DiscovererStreamInfo>;
/// Serializes `self` to a `glib::Variant` that can be parsed again
/// through `DiscovererInfo::from_variant`.
///
/// Note that any `gst::Toc` (s) that might have been discovered will not be serialized
/// for now.
/// ## `flags`
/// A combination of `DiscovererSerializeFlags` to specify
/// what needs to be serialized.
///
/// # Returns
///
/// A newly-allocated `glib::Variant` representing `self`.
fn to_variant(&self, flags: DiscovererSerializeFlags) -> Option<glib::Variant>;
}
......
......@@ -12,6 +12,25 @@ use std::mem;
use std::ptr;
glib_wrapper! {
/// Base structure for information concerning a media stream. Depending on the
/// stream type, one can find more media-specific information in
/// `DiscovererAudioInfo`, `DiscovererVideoInfo`, and
/// `DiscovererContainerInfo`.
///
/// The `DiscovererStreamInfo` represents the topology of the stream. Siblings
/// can be iterated over with `DiscovererStreamInfoExt::get_next` and
/// `DiscovererStreamInfoExt::get_previous`. Children (sub-streams) of a
/// stream can be accessed using the `DiscovererContainerInfo` API.
///
/// As a simple example, if you run `Discoverer` on an AVI file with one audio
/// and one video stream, you will get a `DiscovererContainerInfo`
/// corresponding to the AVI container, which in turn will have a
/// `DiscovererAudioInfo` sub-stream and a `DiscovererVideoInfo` sub-stream
/// for the audio and video streams respectively.
///
/// # Implements
///
/// [`DiscovererStreamInfoExt`](trait.DiscovererStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
pub struct DiscovererStreamInfo(Object<ffi::GstDiscovererStreamInfo>);
match fn {
......@@ -22,21 +41,74 @@ glib_wrapper! {
unsafe impl Send for DiscovererStreamInfo {}
unsafe impl Sync for DiscovererStreamInfo {}
/// Trait containing all `DiscovererStreamInfo` methods.
///
/// # Implementors
///
/// [`DiscovererAudioInfo`](struct.DiscovererAudioInfo.html), [`DiscovererContainerInfo`](struct.DiscovererContainerInfo.html), [`DiscovererStreamInfo`](struct.DiscovererStreamInfo.html), [`DiscovererSubtitleInfo`](struct.DiscovererSubtitleInfo.html), [`DiscovererVideoInfo`](struct.DiscovererVideoInfo.html)
pub trait DiscovererStreamInfoExt {
///
/// # Returns
///
/// the `gst::Caps` of the stream. Unref with
/// `gst_caps_unref` after usage.
fn get_caps(&self) -> Option<gst::Caps>;
///
/// # Deprecated
///
/// This functions is deprecated since version 1.4, use
/// `DiscovererInfoExt::get_missing_elements_installer_details`
///
/// # Returns
///
/// additional information regarding the stream (for
/// example codec version, profile, etc..). If you wish to use the `gst::Structure`
/// after the life-time of `self` you will need to copy it.
fn get_misc(&self) -> Option<gst::Structure>;
///
/// # Returns
///
/// the next `DiscovererStreamInfo` in a chain. `None`
/// for final streams.
/// Unref with `gst_discoverer_stream_info_unref` after usage.
fn get_next(&self) -> Option<DiscovererStreamInfo>;
///
/// # Returns
///
/// the previous `DiscovererStreamInfo` in a chain.
/// `None` for starting points. Unref with `gst_discoverer_stream_info_unref`
/// after usage.
fn get_previous(&self) -> Option<DiscovererStreamInfo>;
///
/// # Returns
///
/// the stream ID of this stream. If you wish to
/// use the stream ID after the life-time of `self` you will need to copy it.
fn get_stream_id(&self) -> Option<String>;
///
/// # Returns
///
/// a human readable name for the stream type of the given `self` (ex : "audio",
/// "container",...).
fn get_stream_type_nick(&self) -> String;
///
/// # Returns
///
/// the tags contained in this stream. If you wish to
/// use the tags after the life-time of `self` you will need to copy them.
fn get_tags(&self) -> Option<gst::TagList>;
///
/// # Returns
///
/// the TOC contained in this stream. If you wish to
/// use the TOC after the life-time of `self` you will need to copy it.
fn get_toc(&self) -> Option<gst::Toc>;
}
......
......@@ -11,6 +11,12 @@ use std::mem;
use std::ptr;
glib_wrapper! {
/// `DiscovererStreamInfo` specific to subtitle streams (this includes text and
/// image based ones).
///
/// # Implements
///
/// [`DiscovererStreamInfoExt`](trait.DiscovererStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
pub struct DiscovererSubtitleInfo(Object<ffi::GstDiscovererSubtitleInfo>): DiscovererStreamInfo;
match fn {
......@@ -19,6 +25,10 @@ glib_wrapper! {
}
impl DiscovererSubtitleInfo {
///
/// # Returns
///
/// the language of the stream, or NULL if unknown.
pub fn get_language(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_discoverer_subtitle_info_get_language(self.to_glib_none().0))
......
......@@ -11,6 +11,11 @@ use std::mem;
use std::ptr;
glib_wrapper! {
/// `DiscovererStreamInfo` specific to video streams (this includes images).
///
/// # Implements
///
/// [`DiscovererStreamInfoExt`](trait.DiscovererStreamInfoExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html)
pub struct DiscovererVideoInfo(Object<ffi::GstDiscovererVideoInfo>): DiscovererStreamInfo;
match fn {
......@@ -19,42 +24,71 @@ glib_wrapper! {
}
impl DiscovererVideoInfo {
///
/// # Returns
///
/// the average or nominal bitrate of the video stream in bits/second.
pub fn get_bitrate(&self) -> u32 {
unsafe {
ffi::gst_discoverer_video_info_get_bitrate(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the depth in bits of the video stream.
pub fn get_depth(&self) -> u32 {
unsafe {
ffi::gst_discoverer_video_info_get_depth(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the height of the video stream in pixels.
pub fn get_height(&self) -> u32 {
unsafe {
ffi::gst_discoverer_video_info_get_height(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the maximum bitrate of the video stream in bits/second.
pub fn get_max_bitrate(&self) -> u32 {
unsafe {
ffi::gst_discoverer_video_info_get_max_bitrate(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the width of the video stream in pixels.
pub fn get_width(&self) -> u32 {
unsafe {
ffi::gst_discoverer_video_info_get_width(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// `true` if the video stream corresponds to an image (i.e. only contains
/// one frame).
pub fn is_image(&self) -> bool {
unsafe {
from_glib(ffi::gst_discoverer_video_info_is_image(self.to_glib_none().0))
}
}
///
/// # Returns
///
/// `true` if the stream is interlaced, else `false`.
pub fn is_interlaced(&self) -> bool {
unsafe {
from_glib(ffi::gst_discoverer_video_info_is_interlaced(self.to_glib_none().0))
......
......@@ -4,20 +4,12 @@
use DiscovererInfo;
use ffi;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use gst;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
......@@ -78,14 +70,10 @@ pub trait EncodingProfileExt {
fn is_enabled(&self) -> bool;
fn get_property_restriction_caps(&self) -> Option<gst::Caps>;
fn set_property_restriction_caps(&self, restriction_caps: Option<&gst::Caps>);
fn connect_property_restriction_caps_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn is_equal<P: IsA<EncodingProfile>>(&self, b: &P) -> bool;
}
impl<O: IsA<EncodingProfile> + IsA<glib::object::Object>> EncodingProfileExt for O {
impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
fn copy(&self) -> EncodingProfile {
unsafe {
from_glib_full(ffi::gst_encoding_profile_copy(self.to_glib_none().0))
......@@ -164,31 +152,9 @@ impl<O: IsA<EncodingProfile> + IsA<glib::object::Object>> EncodingProfileExt for
}
}
fn get_property_restriction_caps(&self) -> Option<gst::Caps> {
unsafe {
let mut value = Value::from_type(<gst::Caps as StaticType>::static_type());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "restriction-caps".to_glib_none().0, value.to_glib_none_mut().0);
value.get()
}
}
fn set_property_restriction_caps(&self, restriction_caps: Option<&gst::Caps>) {
fn is_equal<P: IsA<EncodingProfile>>(&self, b: &P) -> bool {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "restriction-caps".to_glib_none().0, Value::from(restriction_caps).to_glib_none().0);
from_glib(ffi