forked from mirrors/gstreamer-rs
Rename ObjectExt trait to GstObjectExt
This works around a bug in the compiler with multiple traits having the same name, but being re-exported with a different one. https://github.com/gtk-rs/glib/issues/211
This commit is contained in:
parent
38496eca7d
commit
e55c7d4088
8 changed files with 14 additions and 12 deletions
|
@ -271,7 +271,8 @@ status = "generate"
|
|||
|
||||
[[object]]
|
||||
name = "Gst.Object"
|
||||
status = "generate"
|
||||
# For renaming the trait...
|
||||
status = "manual"
|
||||
[[object.function]]
|
||||
name = "set_name"
|
||||
[object.function.return]
|
||||
|
|
|
@ -2,7 +2,7 @@ extern crate gstreamer as gst;
|
|||
use gst::*;
|
||||
|
||||
extern crate glib;
|
||||
use glib::ObjectExt;
|
||||
use glib::*;
|
||||
|
||||
use std::env;
|
||||
use std::u64;
|
||||
|
|
|
@ -3,7 +3,6 @@ use gst::*;
|
|||
|
||||
extern crate glib;
|
||||
use glib::*;
|
||||
use glib::ObjectExt;
|
||||
|
||||
extern crate gtk;
|
||||
use gtk::prelude::*;
|
||||
|
|
|
@ -2,7 +2,7 @@ extern crate gstreamer as gst;
|
|||
use gst::*;
|
||||
|
||||
extern crate glib;
|
||||
use glib::ObjectExt;
|
||||
use glib::*;
|
||||
|
||||
use std::env;
|
||||
use std::u64;
|
||||
|
|
|
@ -43,10 +43,6 @@ mod ghost_pad;
|
|||
pub use self::ghost_pad::GhostPad;
|
||||
pub use self::ghost_pad::GhostPadExt;
|
||||
|
||||
mod object;
|
||||
pub use self::object::Object;
|
||||
pub use self::object::ObjectExt;
|
||||
|
||||
mod pad;
|
||||
pub use self::pad::Pad;
|
||||
pub use self::pad::PadExt;
|
||||
|
@ -218,7 +214,6 @@ pub mod traits {
|
|||
pub use super::DeviceProviderFactoryExt;
|
||||
pub use super::ElementExt;
|
||||
pub use super::GhostPadExt;
|
||||
pub use super::ObjectExt;
|
||||
pub use super::PadExt;
|
||||
pub use super::PadTemplateExt;
|
||||
pub use super::PipelineExt;
|
||||
|
|
|
@ -52,6 +52,12 @@ impl Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_name(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_plugin_get_name(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_origin(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_plugin_get_origin(self.to_glib_none().0))
|
||||
|
|
|
@ -47,7 +47,6 @@ mod auto;
|
|||
pub use auto::*;
|
||||
pub use auto::traits::*;
|
||||
pub use auto::functions::{parse_bin_from_description, parse_launch};
|
||||
pub use auto::traits::ObjectExt as GstObjectExt;
|
||||
|
||||
pub mod miniobject;
|
||||
pub use miniobject::GstRc;
|
||||
|
@ -71,6 +70,7 @@ pub use query::{Query, QueryRef, QueryView};
|
|||
pub mod event;
|
||||
pub use event::{Event, EventRef, EventView};
|
||||
|
||||
mod object;
|
||||
mod element;
|
||||
mod bin;
|
||||
mod bus;
|
||||
|
@ -81,6 +81,7 @@ mod ghost_pad;
|
|||
mod child_proxy;
|
||||
mod tag_setter;
|
||||
mod iterator;
|
||||
pub use object::{Object, GstObjectExt};
|
||||
pub use element::ElementExtManual;
|
||||
pub use bin::BinExtManual;
|
||||
pub use pad::{PadExtManual, PadProbeData, PadProbeId, PadProbeInfo, PAD_PROBE_ID_INVALID};
|
||||
|
|
|
@ -44,7 +44,7 @@ impl Object {
|
|||
unsafe impl Send for Object {}
|
||||
unsafe impl Sync for Object {}
|
||||
|
||||
pub trait ObjectExt {
|
||||
pub trait GstObjectExt {
|
||||
//fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool;
|
||||
|
||||
fn default_error<'a, P: Into<Option<&'a str>>>(&self, error: &Error, debug: P);
|
||||
|
@ -94,7 +94,7 @@ pub trait ObjectExt {
|
|||
//fn connect_deep_notify<Unsupported or ignored types>(&self, f: F) -> u64;
|
||||
}
|
||||
|
||||
impl<O: IsA<Object>> ObjectExt for O {
|
||||
impl<O: IsA<Object>> GstObjectExt for O {
|
||||
//fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool {
|
||||
// unsafe { TODO: call ffi::gst_object_add_control_binding() }
|
||||
//}
|
Loading…
Reference in a new issue