Commit e1d134c4 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Run everything through latest rustfmt-nightly

parent 9a6713b9
...@@ -11,10 +11,10 @@ extern crate libc; ...@@ -11,10 +11,10 @@ extern crate libc;
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_base as gst_base;
extern crate gstreamer_app_sys as ffi; extern crate gstreamer_app_sys as ffi;
extern crate gstreamer_sys as gst_ffi; extern crate gstreamer_base as gst_base;
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;
#[macro_use] #[macro_use]
extern crate glib; extern crate glib;
......
...@@ -264,8 +264,8 @@ impl glib::value::SetValue for AudioFormatInfo { ...@@ -264,8 +264,8 @@ impl glib::value::SetValue for AudioFormatInfo {
unsafe fn set_value(value: &mut glib::Value, this: &Self) { unsafe fn set_value(value: &mut glib::Value, this: &Self) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstAudioFormatInfo>::to_glib_none(this).0 as glib::translate::ToGlibPtr::<*const ffi::GstAudioFormatInfo>::to_glib_none(this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
...@@ -275,8 +275,8 @@ impl glib::value::SetValueOptional for AudioFormatInfo { ...@@ -275,8 +275,8 @@ impl glib::value::SetValueOptional for AudioFormatInfo {
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) { unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstAudioFormatInfo>::to_glib_none(&this).0 as glib::translate::ToGlibPtr::<*const ffi::GstAudioFormatInfo>::to_glib_none(&this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
......
...@@ -281,9 +281,8 @@ impl glib::types::StaticType for AudioInfo { ...@@ -281,9 +281,8 @@ 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( Option::<AudioInfo>::from_glib_none(gobject_ffi::g_value_get_boxed(value.to_glib_none().0)
gobject_ffi::g_value_get_boxed(value.to_glib_none().0) as *mut ffi::GstAudioInfo, as *mut ffi::GstAudioInfo)
)
} }
} }
...@@ -292,8 +291,8 @@ impl glib::value::SetValue for AudioInfo { ...@@ -292,8 +291,8 @@ impl glib::value::SetValue for AudioInfo {
unsafe fn set_value(value: &mut glib::Value, this: &Self) { unsafe fn set_value(value: &mut glib::Value, this: &Self) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstAudioInfo>::to_glib_none(this).0 as glib::translate::ToGlibPtr::<*const ffi::GstAudioInfo>::to_glib_none(this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
...@@ -303,8 +302,8 @@ impl glib::value::SetValueOptional for AudioInfo { ...@@ -303,8 +302,8 @@ impl glib::value::SetValueOptional for AudioInfo {
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) { unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstAudioInfo>::to_glib_none(&this).0 as glib::translate::ToGlibPtr::<*const ffi::GstAudioInfo>::to_glib_none(&this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
......
...@@ -32,9 +32,7 @@ glib_wrapper! { ...@@ -32,9 +32,7 @@ glib_wrapper! {
impl FlowCombiner { impl FlowCombiner {
pub fn new() -> FlowCombiner { pub fn new() -> FlowCombiner {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe { from_glib_full(ffi::gst_flow_combiner_new()) }
from_glib_full(ffi::gst_flow_combiner_new())
}
} }
pub fn add_pad<P: IsA<gst::Pad>>(&self, pad: &P) { pub fn add_pad<P: IsA<gst::Pad>>(&self, pad: &P) {
...@@ -63,13 +61,24 @@ impl FlowCombiner { ...@@ -63,13 +61,24 @@ impl FlowCombiner {
pub fn update_flow(&self, fret: gst::FlowReturn) -> gst::FlowReturn { pub fn update_flow(&self, fret: gst::FlowReturn) -> gst::FlowReturn {
unsafe { unsafe {
from_glib(ffi::gst_flow_combiner_update_flow(self.to_glib_none().0, fret.to_glib())) from_glib(ffi::gst_flow_combiner_update_flow(
self.to_glib_none().0,
fret.to_glib(),
))
} }
} }
pub fn update_pad_flow<P: IsA<gst::Pad>>(&self, pad: &P, fret: gst::FlowReturn) -> gst::FlowReturn { pub fn update_pad_flow<P: IsA<gst::Pad>>(
&self,
pad: &P,
fret: gst::FlowReturn,
) -> gst::FlowReturn {
unsafe { unsafe {
from_glib(ffi::gst_flow_combiner_update_pad_flow(self.to_glib_none().0, pad.to_glib_none().0, fret.to_glib())) from_glib(ffi::gst_flow_combiner_update_pad_flow(
self.to_glib_none().0,
pad.to_glib_none().0,
fret.to_glib(),
))
} }
} }
} }
......
...@@ -20,8 +20,8 @@ impl PlayerGMainContextSignalDispatcher { ...@@ -20,8 +20,8 @@ impl PlayerGMainContextSignalDispatcher {
let application_context = application_context.to_glib_none(); let application_context = application_context.to_glib_none();
unsafe { unsafe {
from_glib_full( from_glib_full(
ffi::gst_player_g_main_context_signal_dispatcher_new(application_context.0) as ffi::gst_player_g_main_context_signal_dispatcher_new(application_context.0)
*mut ffi::GstPlayerGMainContextSignalDispatcher, as *mut ffi::GstPlayerGMainContextSignalDispatcher,
) )
} }
} }
......
...@@ -60,8 +60,8 @@ impl< ...@@ -60,8 +60,8 @@ impl<
O: IsA<PlayerVideoOverlayVideoRenderer> + IsA<glib::object::Object>, O: IsA<PlayerVideoOverlayVideoRenderer> + IsA<glib::object::Object>,
> PlayerVideoOverlayVideoRendererExtManual for O { > PlayerVideoOverlayVideoRendererExtManual for O {
unsafe fn get_window_handle(&self) -> uintptr_t { unsafe fn get_window_handle(&self) -> uintptr_t {
ffi::gst_player_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0) as ffi::gst_player_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0)
uintptr_t as uintptr_t
} }
unsafe fn set_window_handle(&self, window_handle: uintptr_t) { unsafe fn set_window_handle(&self, window_handle: uintptr_t) {
......
...@@ -248,8 +248,8 @@ impl VideoFrame<Writable> { ...@@ -248,8 +248,8 @@ impl VideoFrame<Writable> {
info.to_glib_none().0 as *mut _, info.to_glib_none().0 as *mut _,
buffer.to_glib_none().0, buffer.to_glib_none().0,
mem::transmute( mem::transmute(
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF.bits() | gst_ffi::GST_MAP_READ.bits() | ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF.bits() | gst_ffi::GST_MAP_READ.bits()
gst_ffi::GST_MAP_WRITE.bits(), | gst_ffi::GST_MAP_WRITE.bits(),
), ),
)); ));
...@@ -277,8 +277,8 @@ impl VideoFrame<Writable> { ...@@ -277,8 +277,8 @@ impl VideoFrame<Writable> {
buffer.to_glib_none().0, buffer.to_glib_none().0,
id, id,
mem::transmute( mem::transmute(
ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF.bits() | gst_ffi::GST_MAP_READ.bits() | ffi::GST_VIDEO_FRAME_MAP_FLAG_NO_REF.bits() | gst_ffi::GST_MAP_READ.bits()
gst_ffi::GST_MAP_WRITE.bits(), | gst_ffi::GST_MAP_WRITE.bits(),
), ),
)); ));
......
...@@ -596,9 +596,8 @@ impl glib::types::StaticType for VideoInfo { ...@@ -596,9 +596,8 @@ 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( Option::<VideoInfo>::from_glib_none(gobject_ffi::g_value_get_boxed(value.to_glib_none().0)
gobject_ffi::g_value_get_boxed(value.to_glib_none().0) as *mut ffi::GstVideoInfo, as *mut ffi::GstVideoInfo)
)
} }
} }
...@@ -607,8 +606,8 @@ impl glib::value::SetValue for VideoInfo { ...@@ -607,8 +606,8 @@ impl glib::value::SetValue for VideoInfo {
unsafe fn set_value(value: &mut glib::Value, this: &Self) { unsafe fn set_value(value: &mut glib::Value, this: &Self) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstVideoInfo>::to_glib_none(this).0 as glib::translate::ToGlibPtr::<*const ffi::GstVideoInfo>::to_glib_none(this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
...@@ -618,8 +617,8 @@ impl glib::value::SetValueOptional for VideoInfo { ...@@ -618,8 +617,8 @@ impl glib::value::SetValueOptional for VideoInfo {
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) { unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstVideoInfo>::to_glib_none(&this).0 as glib::translate::ToGlibPtr::<*const ffi::GstVideoInfo>::to_glib_none(&this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
......
...@@ -11,7 +11,7 @@ use Element; ...@@ -11,7 +11,7 @@ use Element;
use glib; use glib;
use glib::IsA; use glib::IsA;
use glib::translate::{from_glib, from_glib_full, ToGlibPtr, ToGlib}; use glib::translate::{from_glib, from_glib_full, ToGlib, ToGlibPtr};
use ffi; use ffi;
...@@ -60,37 +60,30 @@ impl<O: IsA<Bin>> BinExtManual for O { ...@@ -60,37 +60,30 @@ impl<O: IsA<Bin>> BinExtManual for O {
fn iterate_all_by_interface(&self, iface: glib::types::Type) -> ::Iterator<Element> { fn iterate_all_by_interface(&self, iface: glib::types::Type) -> ::Iterator<Element> {
unsafe { unsafe {
from_glib_full(ffi::gst_bin_iterate_all_by_interface(self.to_glib_none().0, iface.to_glib())) from_glib_full(ffi::gst_bin_iterate_all_by_interface(
self.to_glib_none().0,
iface.to_glib(),
))
} }
} }
fn iterate_elements(&self) -> ::Iterator<Element> { fn iterate_elements(&self) -> ::Iterator<Element> {
unsafe { unsafe { from_glib_full(ffi::gst_bin_iterate_elements(self.to_glib_none().0)) }
from_glib_full(ffi::gst_bin_iterate_elements(self.to_glib_none().0))
}
} }
fn iterate_recurse(&self) -> ::Iterator<Element> { fn iterate_recurse(&self) -> ::Iterator<Element> {
unsafe { unsafe { from_glib_full(ffi::gst_bin_iterate_recurse(self.to_glib_none().0)) }
from_glib_full(ffi::gst_bin_iterate_recurse(self.to_glib_none().0))
}
} }
fn iterate_sinks(&self) -> ::Iterator<Element> { fn iterate_sinks(&self) -> ::Iterator<Element> {
unsafe { unsafe { from_glib_full(ffi::gst_bin_iterate_sinks(self.to_glib_none().0)) }
from_glib_full(ffi::gst_bin_iterate_sinks(self.to_glib_none().0))
}
} }
fn iterate_sorted(&self) -> ::Iterator<Element> { fn iterate_sorted(&self) -> ::Iterator<Element> {
unsafe { unsafe { from_glib_full(ffi::gst_bin_iterate_sorted(self.to_glib_none().0)) }
from_glib_full(ffi::gst_bin_iterate_sorted(self.to_glib_none().0))
}
} }
fn iterate_sources(&self) -> ::Iterator<Element> { fn iterate_sources(&self) -> ::Iterator<Element> {
unsafe { unsafe { from_glib_full(ffi::gst_bin_iterate_sources(self.to_glib_none().0)) }
from_glib_full(ffi::gst_bin_iterate_sources(self.to_glib_none().0))
}
} }
} }
...@@ -334,8 +334,8 @@ impl ToOwned for BufferRef { ...@@ -334,8 +334,8 @@ impl ToOwned for 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 from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
*mut _) as *mut _)
} }
} }
} }
......
...@@ -88,8 +88,8 @@ impl ToOwned for BufferListRef { ...@@ -88,8 +88,8 @@ impl ToOwned for 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 from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
*mut _) as *mut _)
} }
} }
} }
......
...@@ -357,8 +357,8 @@ impl ToOwned for CapsRef { ...@@ -357,8 +357,8 @@ impl ToOwned for 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 from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
*mut _) as *mut _)
} }
} }
} }
......
...@@ -81,8 +81,8 @@ impl ToOwned for ContextRef { ...@@ -81,8 +81,8 @@ impl ToOwned for 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 from_glib_full(ffi::gst_mini_object_copy(self.as_ptr() as *const _)
*mut _) as *mut _)
} }
} }
} }
......
...@@ -23,8 +23,8 @@ pub trait DeviceProviderExtManual { ...@@ -23,8 +23,8 @@ pub trait DeviceProviderExtManual {
impl<O: IsA<DeviceProvider>> DeviceProviderExtManual for O { impl<O: IsA<DeviceProvider>> DeviceProviderExtManual for O {
fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> { fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> {
unsafe { unsafe {
let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class as let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class
*mut ffi::GstDeviceProviderClass; as *mut ffi::GstDeviceProviderClass;
let ptr = ffi::gst_device_provider_class_get_metadata(klass, key.to_glib_none().0); let ptr = ffi::gst_device_provider_class_get_metadata(klass, key.to_glib_none().0);
......
...@@ -10,7 +10,7 @@ use Element; ...@@ -10,7 +10,7 @@ use Element;
use glib; use glib;
use glib::IsA; use glib::IsA;
use glib::translate::{from_glib, from_glib_none, from_glib_full, FromGlibPtrContainer, ToGlibPtr}; use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrContainer, ToGlibPtr};
use QueryRef; use QueryRef;
use Event; use Event;
use Pad; use Pad;
...@@ -115,8 +115,8 @@ impl<O: IsA<Element>> ElementExtManual for O { ...@@ -115,8 +115,8 @@ impl<O: IsA<Element>> ElementExtManual for O {
fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> { fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> {
unsafe { unsafe {
let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class as let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class
*mut ffi::GstElementClass; as *mut ffi::GstElementClass;
let ptr = ffi::gst_element_class_get_metadata(klass, key.to_glib_none().0); let ptr = ffi::gst_element_class_get_metadata(klass, key.to_glib_none().0);
...@@ -130,8 +130,8 @@ impl<O: IsA<Element>> ElementExtManual for O { ...@@ -130,8 +130,8 @@ impl<O: IsA<Element>> ElementExtManual for O {
fn get_pad_template(&self, name: &str) -> Option<PadTemplate> { fn get_pad_template(&self, name: &str) -> Option<PadTemplate> {
unsafe { unsafe {
let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class as let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class
*mut ffi::GstElementClass; as *mut ffi::GstElementClass;
from_glib_none(ffi::gst_element_class_get_pad_template( from_glib_none(ffi::gst_element_class_get_pad_template(
klass, klass,
...@@ -142,8 +142,8 @@ impl<O: IsA<Element>> ElementExtManual for O { ...@@ -142,8 +142,8 @@ impl<O: IsA<Element>> ElementExtManual for O {
fn get_pad_template_list(&self) -> Vec<PadTemplate> { fn get_pad_template_list(&self) -> Vec<PadTemplate> {
unsafe { unsafe {
let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class as let klass = (*(self.to_glib_none().0 as *mut gobject_ffi::GTypeInstance)).g_class
*mut ffi::GstElementClass; as *mut ffi::GstElementClass;
FromGlibPtrContainer::from_glib_none( FromGlibPtrContainer::from_glib_none(
ffi::gst_element_class_get_pad_template_list(klass), ffi::gst_element_class_get_pad_template_list(klass),
...@@ -217,21 +217,15 @@ impl<O: IsA<Element>> ElementExtManual for O { ...@@ -217,21 +217,15 @@ impl<O: IsA<Element>> ElementExtManual for O {
} }
fn iterate_pads(&self) -> ::Iterator<Pad> { fn iterate_pads(&self) -> ::Iterator<Pad> {
unsafe { unsafe { from_glib_full(ffi::gst_element_iterate_pads(self.to_glib_none().0)) }
from_glib_full(ffi::gst_element_iterate_pads(self.to_glib_none().0))
}
} }
fn iterate_sink_pads(&self) -> ::Iterator<Pad> { fn iterate_sink_pads(&self) -> ::Iterator<Pad> {
unsafe { unsafe { from_glib_full(ffi::gst_element_iterate_sink_pads(self.to_glib_none().0)) }
from_glib_full(ffi::gst_element_iterate_sink_pads(self.to_glib_none().0))
}
} }
fn iterate_src_pads(&self) -> ::Iterator<Pad> { fn iterate_src_pads(&self) -> ::Iterator<Pad> {
unsafe { unsafe { from_glib_full(ffi::gst_element_iterate_src_pads(self.to_glib_none().0)) }
from_glib_full(ffi::gst_element_iterate_src_pads(self.to_glib_none().0))
}
} }
} }
......
...@@ -498,8 +498,8 @@ impl<T: 'static> glib::value::SetValue for Iterator<T> { ...@@ -498,8 +498,8 @@ impl<T: 'static> glib::value::SetValue for Iterator<T> {
unsafe fn set_value(value: &mut glib::Value, this: &Self) { unsafe fn set_value(value: &mut glib::Value, this: &Self) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstIterator>::to_glib_none(this).0 as glib::translate::ToGlibPtr::<*const ffi::GstIterator>::to_glib_none(this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
...@@ -509,8 +509,8 @@ impl<T: 'static> glib::value::SetValueOptional for Iterator<T> { ...@@ -509,8 +509,8 @@ impl<T: 'static> glib::value::SetValueOptional for Iterator<T> {
unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) { unsafe fn set_value_optional(value: &mut glib::Value, this: Option<&Self>) {
gobject_ffi::g_value_set_boxed( gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
glib::translate::ToGlibPtr::<*const ffi::GstIterator>::to_glib_none(&this).0 as glib::translate::ToGlibPtr::<*const ffi::GstIterator>::to_glib_none(&this).0
glib_ffi::gpointer, as glib_ffi::gpointer,
) )
} }
} }
......
...@@ -2315,8 +2315,7 @@ pub struct RedirectBuilder<'a> { ...@@ -2315,8 +2315,7 @@ pub struct RedirectBuilder<'a> {
tag_list: Option<&'a TagList>, tag_list: Option<&'a TagList>,
entry_struct: Option<Structure>, entry_struct: Option<Structure>,
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
entries: entries: Option<&'a [(&'a str, Option<&'a TagList>, Option<&'a Structure>)]>,
Option<&'a [(&'a str, Option<&'a TagList>, Option<&'a Structure>)]>,
} }
#[cfg(feature = "v1_10")] #[cfg(feature = "v1_10")]
impl<'a> RedirectBuilder<'a> { impl<'a> RedirectBuilder<'a> {
......
...@@ -67,8 +67,8 @@ impl<T: MiniObject> GstRc<T> { ...@@ -67,8 +67,8 @@ impl<T: MiniObject> GstRc<T> {
} }
self.obj = T::from_mut_ptr( self.obj = T::from_mut_ptr(
ffi::gst_mini_object_make_writable(self.as_mut_ptr() as *mut ffi::GstMiniObject) as ffi::gst_mini_object_make_writable(self.as_mut_ptr() as *mut ffi::GstMiniObject)
*mut T::GstType, as *mut T::GstType,
); );
assert!(self.is_writable()); assert!(self.is_writable());
...@@ -194,8 +194,8 @@ where ...@@ -194,8 +194,8 @@ where
fn copy(&self) -> GstRc<Self> { fn copy(&self) -> GstRc<Self> {
unsafe { unsafe {
GstRc::from_glib_full( GstRc::from_glib_full(
ffi::gst_mini_object_copy(self.as_ptr() as *const ffi::GstMiniObject) as ffi::gst_mini_object_copy(self.as_ptr() as *const ffi::GstMiniObject)
*const Self::GstType, as *const Self::GstType,
) )
} }
} }
...@@ -261,8 +261,8 @@ impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstT ...@@ -261,8 +261,8 @@ impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstT
let v: Vec<_> = t.iter().map(|s| s.to_glib_none()).collect(); let v: Vec<_> = t.iter().map(|s| s.to_glib_none()).collect();
let v_ptr = unsafe { let v_ptr = unsafe {
let v_ptr = glib_ffi::g_malloc0(mem::size_of::<*mut T::GstType>() * t.len() + 1) as let v_ptr = glib_ffi::g_malloc0(mem::size_of::<*mut T::GstType>() * t.len() + 1)
*mut *mut T::GstType; as *mut *mut T::GstType;
for (i, s) in v.iter().enumerate() { for (i, s) in v.iter().enumerate() {
ptr::write(v_ptr.offset(i as isize), s.0); ptr::write(v_ptr.offset(i as isize), s.0);
...@@ -277,8 +277,8 @@ impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstT ...@@ -277,8 +277,8 @@ impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstT
fn to_glib_full_from_slice(t: &[GstRc<T>]) -> *mut *mut T::GstType { fn to_glib_full_from_slice(t: &[GstRc<T>]) -> *mut *mut T::GstType {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {
let v_ptr = glib_ffi::g_malloc0(mem::size_of::<*mut T::GstType>() * t.len() + 1) as let v_ptr = glib_ffi::g_malloc0(mem::size_of::<*mut T::GstType>() * t.len() + 1)
*mut *mut T::GstType; as *mut *mut T::GstType;
for (i, s) in t.iter().enumerate() { for (i, s) in t.iter().enumerate() {
ptr::write(v_ptr.offset(i as isize), s.to_glib_full()); ptr::write(v_ptr.offset(i as isize), s.to_glib_full());
......
...@@ -25,7 +25,7 @@ use std::cell::RefCell; ...@@ -25,7 +25,7 @@ use std::cell::RefCell;
use glib; use glib;
use glib::{IsA, StaticType}; use glib::{IsA, StaticType};
use glib::translate::{mut_override, from_glib, from_glib_borrow, from_glib_full, from_glib_none, use glib::translate::{from_glib, from_glib_borrow, from_glib_full, from_glib_none, mut_override,
FromGlib, ToGlib, ToGlibPtr}; FromGlib, ToGlib, ToGlibPtr};
use glib::source::CallbackGuard; use glib::source::CallbackGuard;
use glib_ffi; use glib_ffi;
...@@ -40,7 +40,10 @@ impl Pad { ...@@ -40,7 +40,10 @@ impl Pad {
pub fn new_from_static_template(templ: &StaticPadTemplate, name: &str) -> Pad { pub fn new_from_static_template(templ: &StaticPadTemplate, name: &str) -> Pad {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_none(ffi::gst_pad_new_from_static_template(mut_override(templ.to_glib_none().0), name.to_glib_none().0)) from_glib_none(ffi::gst_pad_new_from_static_template(
mut_override(templ.to_glib_none().0),
name.to_glib_none().0,
))
} }
} }
} }
......