forked from mirrors/gstreamer-rs
Implement ToOwned for Message/Event/QueryRef
This commit is contained in:
parent
1576ff6c32
commit
c57d5523d2
3 changed files with 33 additions and 0 deletions
|
@ -372,6 +372,17 @@ impl glib::types::StaticType for EventRef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ToOwned for EventRef {
|
||||||
|
type Owned = GstRc<EventRef>;
|
||||||
|
|
||||||
|
fn to_owned(&self) -> GstRc<EventRef> {
|
||||||
|
unsafe {
|
||||||
|
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
|
||||||
|
as *mut _)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub enum EventView<'a> {
|
pub enum EventView<'a> {
|
||||||
FlushStart(FlushStart<'a>),
|
FlushStart(FlushStart<'a>),
|
||||||
FlushStop(FlushStop<'a>),
|
FlushStop(FlushStop<'a>),
|
||||||
|
|
|
@ -346,6 +346,17 @@ impl glib::types::StaticType for MessageRef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ToOwned for MessageRef {
|
||||||
|
type Owned = GstRc<MessageRef>;
|
||||||
|
|
||||||
|
fn to_owned(&self) -> GstRc<MessageRef> {
|
||||||
|
unsafe {
|
||||||
|
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
|
||||||
|
as *mut _)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub enum MessageView<'a> {
|
pub enum MessageView<'a> {
|
||||||
Eos(Eos<'a>),
|
Eos(Eos<'a>),
|
||||||
Error(Error<'a>),
|
Error(Error<'a>),
|
||||||
|
|
|
@ -182,6 +182,17 @@ impl glib::types::StaticType for QueryRef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ToOwned for QueryRef {
|
||||||
|
type Owned = GstRc<QueryRef>;
|
||||||
|
|
||||||
|
fn to_owned(&self) -> GstRc<QueryRef> {
|
||||||
|
unsafe {
|
||||||
|
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
|
||||||
|
as *mut _)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub enum QueryView<T> {
|
pub enum QueryView<T> {
|
||||||
Position(Position<T>),
|
Position(Position<T>),
|
||||||
Duration(Duration<T>),
|
Duration(Duration<T>),
|
||||||
|
|
Loading…
Reference in a new issue