Rename gst::Bin traits from BinExt to GstBinExt to prevent conflicts with gtk::Bin

This commit is contained in:
Sebastian Dröge 2018-10-28 11:30:41 +00:00
parent ff6b09d301
commit 0947c8f087
6 changed files with 14 additions and 8 deletions

View file

@ -84,6 +84,7 @@ conversion_type = "scalar"
[[object]] [[object]]
name = "Gst.Bin" name = "Gst.Bin"
status = "generate" status = "generate"
trait_name = "GstBinExt"
[[object.function]] [[object.function]]
name = "add" name = "add"
[object.function.return] [object.function.return]

View file

@ -83,8 +83,13 @@ Homebrew only installs various plugins if explicitly enabled, so some extra
``` ```
$ brew install gstreamer gst-plugins-base gst-plugins-good \ $ brew install gstreamer gst-plugins-base gst-plugins-good \
gst-plugins-bad gst-plugins-ugly gst-libav gst-rtsp-server \ gst-plugins-bad gst-plugins-ugly gst-libav gst-rtsp-server \
<<<<<<< HEAD
--with-orc --with-libogg --with-opus --with-pango --with-theora \ --with-orc --with-libogg --with-opus --with-pango --with-theora \
--with-libvorbis --with-libvpx --enable-gtk3 --with-libvorbis --with-libvpx --enable-gtk3
=======
--with-orc -with-libogg --with-opus --with-pango --with-theora \
--with-libvorbis --with-libvpx
>>>>>>> Add libvpx to brew install
``` ```
If you wish to install the gstreamer-player sub-crate, make sure the If you wish to install the gstreamer-player sub-crate, make sure the

View file

@ -47,7 +47,7 @@ impl Bin {
unsafe impl Send for Bin {} unsafe impl Send for Bin {}
unsafe impl Sync for Bin {} unsafe impl Sync for Bin {}
pub trait BinExt { pub trait GstBinExt {
fn add<P: IsA<Element>>(&self, element: &P) -> Result<(), glib::error::BoolError>; fn add<P: IsA<Element>>(&self, element: &P) -> Result<(), glib::error::BoolError>;
//fn add_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); //fn add_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
@ -111,7 +111,7 @@ pub trait BinExt {
fn connect_property_message_forward_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId; fn connect_property_message_forward_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
} }
impl<O: IsA<Bin> + IsA<glib::object::Object>> BinExt for O { impl<O: IsA<Bin> + IsA<glib::object::Object>> GstBinExt for O {
fn add<P: IsA<Element>>(&self, element: &P) -> Result<(), glib::error::BoolError> { fn add<P: IsA<Element>>(&self, element: &P) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib::error::BoolError::from_glib(ffi::gst_bin_add(self.to_glib_none().0, element.to_glib_none().0), "Failed to add element") glib::error::BoolError::from_glib(ffi::gst_bin_add(self.to_glib_none().0, element.to_glib_none().0), "Failed to add element")

View file

@ -4,7 +4,7 @@
mod bin; mod bin;
pub use self::bin::Bin; pub use self::bin::Bin;
pub use self::bin::BinExt; pub use self::bin::GstBinExt;
mod buffer_pool; mod buffer_pool;
pub use self::buffer_pool::BufferPool; pub use self::buffer_pool::BufferPool;
@ -181,7 +181,7 @@ pub mod functions;
#[doc(hidden)] #[doc(hidden)]
pub mod traits { pub mod traits {
pub use super::BinExt; pub use super::GstBinExt;
pub use super::BufferPoolExt; pub use super::BufferPoolExt;
pub use super::ChildProxyExt; pub use super::ChildProxyExt;
pub use super::ClockExt; pub use super::ClockExt;

View file

@ -15,7 +15,7 @@ use glib::IsA;
use ffi; use ffi;
pub trait BinExtManual { pub trait GstBinExtManual {
fn add_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError>; fn add_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError>;
fn remove_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError>; fn remove_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError>;
@ -28,7 +28,7 @@ pub trait BinExtManual {
fn get_children(&self) -> Vec<Element>; fn get_children(&self) -> Vec<Element>;
} }
impl<O: IsA<Bin>> BinExtManual for O { impl<O: IsA<Bin>> GstBinExtManual for O {
fn add_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError> { fn add_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError> {
for e in elements { for e in elements {
unsafe { unsafe {

View file

@ -176,7 +176,7 @@ mod pad;
mod parse_context; mod parse_context;
mod proxy_pad; mod proxy_pad;
mod tag_setter; mod tag_setter;
pub use bin::BinExtManual; pub use bin::GstBinExtManual;
pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId}; pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId};
pub use element::{ pub use element::{
ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI, ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI,
@ -294,7 +294,7 @@ pub mod prelude {
pub use meta::MetaAPI; pub use meta::MetaAPI;
pub use bin::BinExtManual; pub use bin::GstBinExtManual;
pub use element::ElementExtManual; pub use element::ElementExtManual;
// OS dependent Bus extensions (also import the other plateform trait for doc) // OS dependent Bus extensions (also import the other plateform trait for doc)