mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 04:51:09 +00:00
Implement ToOwned for Message/Event/QueryRef
This commit is contained in:
parent
6f09e5c791
commit
bc991708e5
3 changed files with 33 additions and 0 deletions
|
@ -307,6 +307,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>),
|
||||||
|
|
|
@ -342,6 +342,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