Commit 4117c01f authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Run everything through latest rustfmt-nightly

parent 1fbc5e76
...@@ -32,7 +32,8 @@ struct ErrorMessage { ...@@ -32,7 +32,8 @@ struct ErrorMessage {
src: String, src: String,
error: String, error: String,
debug: Option<String>, debug: Option<String>,
#[cause] cause: glib::Error, #[cause]
cause: glib::Error,
} }
fn create_pipeline() -> Result<gst::Pipeline, Error> { fn create_pipeline() -> Result<gst::Pipeline, Error> {
......
...@@ -28,7 +28,8 @@ struct ErrorMessage { ...@@ -28,7 +28,8 @@ struct ErrorMessage {
src: String, src: String,
error: String, error: String,
debug: Option<String>, debug: Option<String>,
#[cause] cause: glib::Error, #[cause]
cause: glib::Error,
} }
const WIDTH: usize = 320; const WIDTH: usize = 320;
......
...@@ -28,7 +28,8 @@ struct ErrorMessage { ...@@ -28,7 +28,8 @@ struct ErrorMessage {
src: String, src: String,
error: String, error: String,
debug: Option<String>, debug: Option<String>,
#[cause] cause: glib::Error, #[cause]
cause: glib::Error,
} }
fn example_main() -> Result<(), Error> { fn example_main() -> Result<(), Error> {
......
...@@ -38,7 +38,8 @@ struct ErrorMessage { ...@@ -38,7 +38,8 @@ struct ErrorMessage {
src: String, src: String,
error: String, error: String,
debug: Option<String>, debug: Option<String>,
#[cause] cause: glib::Error, #[cause]
cause: glib::Error,
} }
fn make_element<'a, P: Into<Option<&'a str>>>( fn make_element<'a, P: Into<Option<&'a str>>>(
...@@ -121,16 +122,7 @@ fn example_main() -> Result<(), Error> { ...@@ -121,16 +122,7 @@ fn example_main() -> Result<(), Error> {
let scale = make_element("videoscale", None)?; let scale = make_element("videoscale", None)?;
let filter = make_element("capsfilter", None)?; let filter = make_element("capsfilter", None)?;
pipeline.add_many(&[ pipeline.add_many(&[&src, &netsim, &rtpbin, &depay, &dec, &conv, &scale, &filter])?;
&src,
&netsim,
&rtpbin,
&depay,
&dec,
&conv,
&scale,
&filter,
])?;
gst::Element::link_many(&[&depay, &dec, &conv, &scale, &filter])?; gst::Element::link_many(&[&depay, &dec, &conv, &scale, &filter])?;
match args[1].as_str() { match args[1].as_str() {
...@@ -253,16 +245,14 @@ fn example_main() -> Result<(), Error> { ...@@ -253,16 +245,14 @@ fn example_main() -> Result<(), Error> {
match msg.view() { match msg.view() {
MessageView::Eos(..) => break, MessageView::Eos(..) => break,
MessageView::Error(err) => { MessageView::Error(err) => {
return Err( return Err(ErrorMessage {
ErrorMessage { src: msg.get_src()
src: msg.get_src() .map(|s| s.get_path_string())
.map(|s| s.get_path_string()) .unwrap_or(String::from("None")),
.unwrap_or(String::from("None")), error: err.get_error().description().into(),
error: err.get_error().description().into(), debug: err.get_debug(),
debug: err.get_debug(), cause: err.get_error(),
cause: err.get_error(), }.into());
}.into(),
);
} }
MessageView::StateChanged(s) => match msg.get_src() { MessageView::StateChanged(s) => match msg.get_src() {
Some(element) => if element == pipeline && s.get_current() == gst::State::Playing { Some(element) => if element == pipeline && s.get_current() == gst::State::Playing {
......
...@@ -35,7 +35,8 @@ struct ErrorMessage { ...@@ -35,7 +35,8 @@ struct ErrorMessage {
src: String, src: String,
error: String, error: String,
debug: Option<String>, debug: Option<String>,
#[cause] cause: glib::Error, #[cause]
cause: glib::Error,
} }
fn make_element<'a, P: Into<Option<&'a str>>>( fn make_element<'a, P: Into<Option<&'a str>>>(
...@@ -183,16 +184,14 @@ fn example_main() -> Result<(), Error> { ...@@ -183,16 +184,14 @@ fn example_main() -> Result<(), Error> {
match msg.view() { match msg.view() {
MessageView::Eos(..) => break, MessageView::Eos(..) => break,
MessageView::Error(err) => { MessageView::Error(err) => {
return Err( return Err(ErrorMessage {
ErrorMessage { src: msg.get_src()
src: msg.get_src() .map(|s| s.get_path_string())
.map(|s| s.get_path_string()) .unwrap_or(String::from("None")),
.unwrap_or(String::from("None")), error: err.get_error().description().into(),
error: err.get_error().description().into(), debug: err.get_debug(),
debug: err.get_debug(), cause: err.get_error(),
cause: err.get_error(), }.into());
}.into(),
);
} }
MessageView::StateChanged(s) => match msg.get_src() { MessageView::StateChanged(s) => match msg.get_src() {
Some(element) => if element == pipeline && s.get_current() == gst::State::Playing { Some(element) => if element == pipeline && s.get_current() == gst::State::Playing {
......
...@@ -50,7 +50,10 @@ fn main_loop() -> Result<(), Error> { ...@@ -50,7 +50,10 @@ fn main_loop() -> Result<(), Error> {
server.attach(None); server.attach(None);
println!("Stream ready at rtsp://127.0.0.1:{}/test", server.get_bound_port()); println!(
"Stream ready at rtsp://127.0.0.1:{}/test",
server.get_bound_port()
);
main_loop.run(); main_loop.run();
...@@ -62,7 +65,9 @@ fn example_main() -> Result<(), Error> { ...@@ -62,7 +65,9 @@ fn example_main() -> Result<(), Error> {
#[cfg(not(feature = "gst-rtsp-server"))] #[cfg(not(feature = "gst-rtsp-server"))]
{ {
eprintln!("Feature gst-rtsp-server is required. Please rebuild with --features gst-rtsp-server"); eprintln!(
"Feature gst-rtsp-server is required. Please rebuild with --features gst-rtsp-server"
);
std::process::exit(-1) std::process::exit(-1)
} }
......
...@@ -24,7 +24,8 @@ struct ErrorMessage { ...@@ -24,7 +24,8 @@ struct ErrorMessage {
src: String, src: String,
error: String, error: String,
debug: Option<String>, debug: Option<String>,
#[cause] cause: glib::Error, #[cause]
cause: glib::Error,
} }
fn example_main() -> Result<(), Error> { fn example_main() -> Result<(), Error> {
......
...@@ -298,8 +298,7 @@ impl glib::types::StaticType for AudioInfo { ...@@ -298,8 +298,7 @@ impl glib::types::StaticType for AudioInfo {
#[doc(hidden)] #[doc(hidden)]
impl<'a> glib::value::FromValueOptional<'a> for AudioInfo { impl<'a> glib::value::FromValueOptional<'a> for AudioInfo {
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> { unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
Option::<AudioInfo>::from_glib_none(gobject_ffi::g_value_get_boxed(value.to_glib_none().0) Option::<AudioInfo>::from_glib_none(gobject_ffi::g_value_get_boxed(value.to_glib_none().0) as *mut ffi::GstAudioInfo)
as *mut ffi::GstAudioInfo)
} }
} }
......
...@@ -46,9 +46,7 @@ impl AsMut<gst::StructureRef> for PlayerConfig { ...@@ -46,9 +46,7 @@ impl AsMut<gst::StructureRef> for PlayerConfig {
impl PlayerConfig { impl PlayerConfig {
pub fn get_position_update_interval(&self) -> u32 { pub fn get_position_update_interval(&self) -> u32 {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe { ffi::gst_player_config_get_position_update_interval(self.0.to_glib_none().0) }
ffi::gst_player_config_get_position_update_interval(self.0.to_glib_none().0)
}
} }
pub fn get_seek_accurate(&self) -> bool { pub fn get_seek_accurate(&self) -> bool {
......
...@@ -10,19 +10,19 @@ ...@@ -10,19 +10,19 @@
extern crate bitflags; extern crate bitflags;
extern crate libc; extern crate libc;
extern crate gio;
extern crate gio_sys as gio_ffi;
#[macro_use] #[macro_use]
extern crate glib; extern crate glib;
extern crate glib_sys as glib_ffi; extern crate glib_sys as glib_ffi;
extern crate gio;
extern crate gio_sys as gio_ffi;
extern crate gobject_sys as gobject_ffi; extern crate gobject_sys as gobject_ffi;
extern crate gstreamer as gst; extern crate gstreamer as gst;
extern crate gstreamer_sys as gst_ffi;
extern crate gstreamer_rtsp as gst_rtsp;
extern crate gstreamer_rtsp_sys as gst_rtsp_ffi;
extern crate gstreamer_net as gst_net; extern crate gstreamer_net as gst_net;
extern crate gstreamer_net_sys as gst_net_ffi; extern crate gstreamer_net_sys as gst_net_ffi;
extern crate gstreamer_rtsp as gst_rtsp;
extern crate gstreamer_rtsp_server_sys as ffi; extern crate gstreamer_rtsp_server_sys as ffi;
extern crate gstreamer_rtsp_sys as gst_rtsp_ffi;
extern crate gstreamer_sys as gst_ffi;
macro_rules! assert_initialized_main_thread { macro_rules! assert_initialized_main_thread {
() => ( () => (
......
...@@ -7,17 +7,36 @@ use glib::translate::*; ...@@ -7,17 +7,36 @@ use glib::translate::*;
use std::ptr; use std::ptr;
pub trait RTSPAddressPoolExtManual { pub trait RTSPAddressPoolExtManual {
fn reserve_address(&self, ip_address: &str, port: u32, n_ports: u32, ttl: u32) -> Result<RTSPAddress, RTSPAddressPoolResult>; fn reserve_address(
&self,
ip_address: &str,
port: u32,
n_ports: u32,
ttl: u32,
) -> Result<RTSPAddress, RTSPAddressPoolResult>;
} }
impl<O: IsA<RTSPAddressPool>> RTSPAddressPoolExtManual for O { impl<O: IsA<RTSPAddressPool>> RTSPAddressPoolExtManual for O {
fn reserve_address(&self, ip_address: &str, port: u32, n_ports: u32, ttl: u32) -> Result<RTSPAddress, RTSPAddressPoolResult> { fn reserve_address(
&self,
ip_address: &str,
port: u32,
n_ports: u32,
ttl: u32,
) -> Result<RTSPAddress, RTSPAddressPoolResult> {
unsafe { unsafe {
let mut address = ptr::null_mut(); let mut address = ptr::null_mut();
let ret = from_glib(ffi::gst_rtsp_address_pool_reserve_address(self.to_glib_none().0, ip_address.to_glib_none().0, port, n_ports, ttl, &mut address)); let ret = from_glib(ffi::gst_rtsp_address_pool_reserve_address(
self.to_glib_none().0,
ip_address.to_glib_none().0,
port,
n_ports,
ttl,
&mut address,
));
match ret { match ret {
RTSPAddressPoolResult::Ok => Ok(from_glib_full(address)), RTSPAddressPoolResult::Ok => Ok(from_glib_full(address)),
_ => Err(ret) _ => Err(ret),
} }
} }
} }
......
...@@ -14,7 +14,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExtManual for O { ...@@ -14,7 +14,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExtManual for O {
let context = context.into(); let context = context.into();
let context = context.to_glib_none(); let context = context.to_glib_none();
unsafe { unsafe {
from_glib(ffi::gst_rtsp_client_attach(self.to_glib_none().0, context.0)) from_glib(ffi::gst_rtsp_client_attach(
self.to_glib_none().0,
context.0,
))
} }
} }
} }
...@@ -14,7 +14,10 @@ impl<O: IsA<RTSPServer>> RTSPServerExtManual for O { ...@@ -14,7 +14,10 @@ impl<O: IsA<RTSPServer>> RTSPServerExtManual for O {
let context = context.into(); let context = context.into();
let context = context.to_glib_none(); let context = context.to_glib_none();
unsafe { unsafe {
from_glib(ffi::gst_rtsp_server_attach(self.to_glib_none().0, context.0)) from_glib(ffi::gst_rtsp_server_attach(
self.to_glib_none().0,
context.0,
))
} }
} }
} }
...@@ -50,7 +50,7 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExtManual for O { ...@@ -50,7 +50,7 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExtManual for O {
func: F, func: F,
) -> glib::Source ) -> glib::Source
where where
F: FnMut(&RTSPSessionPool) -> Continue + Send + 'static F: FnMut(&RTSPSessionPool) -> Continue + Send + 'static,
{ {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {
......
...@@ -15,10 +15,10 @@ extern crate glib; ...@@ -15,10 +15,10 @@ extern crate glib;
extern crate glib_sys as glib_ffi; extern crate glib_sys as glib_ffi;
extern crate gobject_sys as gobject_ffi; extern crate gobject_sys as gobject_ffi;
extern crate gstreamer as gst; extern crate gstreamer as gst;
extern crate gstreamer_sys as gst_ffi; extern crate gstreamer_rtsp_sys as ffi;
extern crate gstreamer_sdp as gst_sdp; extern crate gstreamer_sdp as gst_sdp;
extern crate gstreamer_sdp_sys as gst_sdp_ffi; extern crate gstreamer_sdp_sys as gst_sdp_ffi;
extern crate gstreamer_rtsp_sys as ffi; extern crate gstreamer_sys as gst_ffi;
macro_rules! assert_initialized_main_thread { macro_rules! assert_initialized_main_thread {
() => ( () => (
......
...@@ -13,8 +13,8 @@ extern crate glib; ...@@ -13,8 +13,8 @@ extern crate glib;
extern crate glib_sys as glib_ffi; extern crate glib_sys as glib_ffi;
extern crate gobject_sys as gobject_ffi; extern crate gobject_sys as gobject_ffi;
extern crate gstreamer as gst; extern crate gstreamer as gst;
extern crate gstreamer_sys as gst_ffi;
extern crate gstreamer_sdp_sys as ffi; extern crate gstreamer_sdp_sys as ffi;
extern crate gstreamer_sys as gst_ffi;
macro_rules! skip_assert_initialized { macro_rules! skip_assert_initialized {
() => ( () => (
......
...@@ -16,8 +16,8 @@ extern crate glib_sys as glib_ffi; ...@@ -16,8 +16,8 @@ extern crate glib_sys as glib_ffi;
extern crate gobject_sys as gobject_ffi; extern crate gobject_sys as gobject_ffi;
extern crate gstreamer as gst; extern crate gstreamer as gst;
extern crate gstreamer_base as gst_base; extern crate gstreamer_base as gst_base;
extern crate gstreamer_sys as gst_ffi;
extern crate gstreamer_base_sys as gst_base_ffi; extern crate gstreamer_base_sys as gst_base_ffi;
extern crate gstreamer_sys as gst_ffi;
extern crate gstreamer_video_sys as ffi; extern crate gstreamer_video_sys as ffi;
macro_rules! assert_initialized_main_thread { macro_rules! assert_initialized_main_thread {
......
...@@ -395,7 +395,10 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> { ...@@ -395,7 +395,10 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
self.0.id self.0.id
} }
pub fn copy(&self, dest: &mut VideoFrameRef<&mut gst::BufferRef>) -> Result<(), glib::BoolError> { pub fn copy(
&self,
dest: &mut VideoFrameRef<&mut gst::BufferRef>,
) -> Result<(), glib::BoolError> {
unsafe { unsafe {
let res: bool = from_glib(ffi::gst_video_frame_copy(&mut dest.0, &self.0)); let res: bool = from_glib(ffi::gst_video_frame_copy(&mut dest.0, &self.0));
if res { if res {
......
...@@ -26,7 +26,8 @@ pub enum VideoColorRange { ...@@ -26,7 +26,8 @@ pub enum VideoColorRange {
Unknown, Unknown,
Range0255, Range0255,
Range16235, Range16235,
#[doc(hidden)] __Unknown(i32), #[doc(hidden)]
__Unknown(i32),
} }
#[doc(hidden)] #[doc(hidden)]
...@@ -205,7 +206,8 @@ pub struct VideoInfoBuilder<'a> { ...@@ -205,7 +206,8 @@ pub struct VideoInfoBuilder<'a> {
stride: Option<&'a [i32]>, stride: Option<&'a [i32]>,
multiview_mode: Option<::VideoMultiviewMode>, multiview_mode: Option<::VideoMultiviewMode>,
multiview_flags: Option<::VideoMultiviewFlags>, multiview_flags: Option<::VideoMultiviewFlags>,
#[cfg(any(feature = "v1_12", feature = "dox"))] field_order: Option<::VideoFieldOrder>, #[cfg(any(feature = "v1_12", feature = "dox"))]
field_order: Option<::VideoFieldOrder>,
} }
impl<'a> VideoInfoBuilder<'a> { impl<'a> VideoInfoBuilder<'a> {
...@@ -636,8 +638,7 @@ impl glib::types::StaticType for VideoInfo { ...@@ -636,8 +638,7 @@ impl glib::types::StaticType for VideoInfo {
#[doc(hidden)] #[doc(hidden)]
impl<'a> glib::value::FromValueOptional<'a> for VideoInfo { impl<'a> glib::value::FromValueOptional<'a> for VideoInfo {
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> { unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
Option::<VideoInfo>::from_glib_none(gobject_ffi::g_value_get_boxed(value.to_glib_none().0) Option::<VideoInfo>::from_glib_none(gobject_ffi::g_value_get_boxed(value.to_glib_none().0) as *mut ffi::GstVideoInfo)
as *mut ffi::GstVideoInfo)
} }
} }
......
...@@ -157,9 +157,7 @@ impl GstRc<BufferRef> { ...@@ -157,9 +157,7 @@ impl GstRc<BufferRef> {
pub fn append(buffer: Self, other: Self) -> Self { pub fn append(buffer: Self, other: Self) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe { from_glib_full(ffi::gst_buffer_append(buffer.into_ptr(), other.into_ptr())) }
from_glib_full(ffi::gst_buffer_append(buffer.into_ptr(), other.into_ptr()))
}
} }
} }
...@@ -172,9 +170,8 @@ impl Default for GstRc<BufferRef> { ...@@ -172,9 +170,8 @@ impl Default for GstRc<BufferRef> {
impl BufferRef { impl BufferRef {
pub fn map_readable(&self) -> Option<BufferMap<Readable>> { pub fn map_readable(&self) -> Option<BufferMap<Readable>> {
let mut map_info: ffi::GstMapInfo = unsafe { mem::zeroed() }; let mut map_info: ffi::GstMapInfo = unsafe { mem::zeroed() };
let res = unsafe { let res =
ffi::gst_buffer_map(self.as_mut_ptr(), &mut map_info, ffi::GST_MAP_READ) unsafe { ffi::gst_buffer_map(self.as_mut_ptr(), &mut map_info, ffi::GST_MAP_READ) };
};
if res == glib_ffi::GTRUE { if res == glib_ffi::GTRUE {
Some(BufferMap { Some(BufferMap {
buffer: self, buffer: self,
...@@ -385,10 +382,7 @@ impl ToOwned for BufferRef { ...@@ -385,10 +382,7 @@ impl ToOwned for BufferRef {
type Owned = GstRc<BufferRef>; type Owned = GstRc<BufferRef>;
fn to_owned(&self) -> GstRc<BufferRef> { fn to_owned(&self) -> GstRc<BufferRef> {
unsafe { unsafe { from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _) as *mut _) }
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
as *mut _)
}
} }
} }
...@@ -440,9 +434,7 @@ impl<'a, T> BufferMap<'a, T> { ...@@ -440,9 +434,7 @@ impl<'a, T> BufferMap<'a, T> {
impl<'a> BufferMap<'a, Writable> { impl<'a> BufferMap<'a, Writable> {
pub fn as_mut_slice(&mut self) -> &mut [u8] { pub fn as_mut_slice(&mut self) -> &mut [u8] {
unsafe { unsafe { slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size) }
slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size)
}
} }
} }
...@@ -521,9 +513,7 @@ impl<T> MappedBuffer<T> { ...@@ -521,9 +513,7 @@ impl<T> MappedBuffer<T> {
impl MappedBuffer<Writable> { impl MappedBuffer<Writable> {
pub fn as_mut_slice(&mut self) -> &mut [u8] { pub fn as_mut_slice(&mut self) -> &mut [u8] {
unsafe { unsafe { slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size) }
slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size)
}
} }
} }
......
...@@ -88,10 +88,7 @@ impl ToOwned for BufferListRef { ...@@ -88,10 +88,7 @@ impl ToOwned for BufferListRef {
type Owned = GstRc<BufferListRef>; type Owned = GstRc<BufferListRef>;
fn to_owned(&self) -> GstRc<BufferListRef> { fn to_owned(&self) -> GstRc<BufferListRef> {
unsafe { unsafe { from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _) as *mut _) }
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
as *mut _)
}
} }
} }
......
...@@ -132,9 +132,7 @@ impl Bus { ...@@ -132,9 +132,7 @@ impl Bus {
} }
pub fn unset_sync_handler(&self) { pub fn unset_sync_handler(&self) {
unsafe { unsafe { ffi::gst_bus_set_sync_handler(self.to_glib_none().0, None, ptr::null_mut(), None) }
ffi::gst_bus_set_sync_handler(self.to_glib_none().0, None, ptr::null_mut(), None)
}
} }
} }
......
...@@ -359,10 +359,7 @@ impl ToOwned for CapsRef { ...@@ -359,10 +359,7 @@ impl ToOwned for CapsRef {
type Owned = GstRc<CapsRef>; type Owned = GstRc<CapsRef>;
fn to_owned(&self) -> GstRc<CapsRef> { fn to_owned(&self) -> GstRc<CapsRef> {
unsafe { unsafe { from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _) as *mut _) }
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
as *mut _)
}
} }
} }
......
...@@ -59,9 +59,7 @@ impl ContextRef { ...@@ -59,9 +59,7 @@ impl ContextRef {
} }
pub fn get_structure(&self) -> &StructureRef { pub fn get_structure(&self) -> &StructureRef {
unsafe { unsafe { StructureRef::from_glib_borrow(ffi::gst_context_get_structure(self.as_mut_ptr())) }
StructureRef::from_glib_borrow(ffi::gst_context_get_structure(self.as_mut_ptr()))
}
} }
pub fn get_mut_structure(&mut self) -> &mut StructureRef { pub fn get_mut_structure(&mut self) -> &mut StructureRef {
...@@ -92,10 +90,7 @@ impl ToOwned for ContextRef { ...@@ -92,10 +90,7 @@ impl ToOwned for ContextRef {
type Owned = GstRc<ContextRef>; type Owned = GstRc<ContextRef>;
fn to_owned(&self) -> GstRc<ContextRef> { fn to_owned(&self) -> GstRc<ContextRef> {
unsafe { unsafe { from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _) as *mut _) }
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
as *mut _)
}
} }
} }
......
...@@ -454,10 +454,7 @@ impl ToOwned for EventRef { ...@@ -454,10 +454,7 @@ impl ToOwned for EventRef {
type Owned = GstRc<EventRef>; type Owned = GstRc<EventRef>;
fn to_owned(&self) -> GstRc<EventRef> { fn to_owned(&self) -> GstRc<EventRef> {
unsafe { unsafe { from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _) as *mut _) }
from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)