From e3ad1918dc39b78c40b3b978226916610d47611d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 13 Dec 2022 11:28:00 +0200 Subject: [PATCH] Fix various new clippy warnings Part-of: --- examples/build.rs | 2 +- examples/src/bin/fd_allocator.rs | 8 ++-- gstreamer-audio/src/audio_buffer.rs | 4 +- gstreamer-audio/src/audio_channel_position.rs | 18 ++++----- gstreamer-audio/src/audio_info.rs | 2 +- gstreamer-gl/src/gl_video_frame.rs | 2 +- gstreamer-net/src/ptp_clock.rs | 2 +- gstreamer-play/src/play_video_info.rs | 2 +- gstreamer-player/src/player_video_info.rs | 2 +- gstreamer-rtp/src/rtp_buffer.rs | 1 - gstreamer-sdp/src/sdp_bandwidth.rs | 2 +- gstreamer-sdp/src/sdp_connection.rs | 4 +- gstreamer-video/src/functions.rs | 4 +- gstreamer-video/src/video_format.rs | 2 +- gstreamer/src/bufferlist.rs | 2 +- gstreamer/src/date_time_serde.rs | 2 +- gstreamer/src/element.rs | 2 +- gstreamer/src/element_factory_type.rs | 40 +++++++++---------- gstreamer/src/format/specific.rs | 2 +- gstreamer/src/pad.rs | 4 +- gstreamer/src/stream_collection.rs | 2 +- gstreamer/src/structure.rs | 4 +- gstreamer/src/structure_serde.rs | 2 +- gstreamer/src/subclass/tracer.rs | 10 ++--- 24 files changed, 62 insertions(+), 63 deletions(-) diff --git a/examples/build.rs b/examples/build.rs index b6fa6e49c..d447680a8 100644 --- a/examples/build.rs +++ b/examples/build.rs @@ -1,7 +1,7 @@ #[cfg(feature = "gl")] fn generate_gl_bindings() { let dest = std::path::PathBuf::from(&std::env::var("OUT_DIR").unwrap()); - let mut file = std::fs::File::create(&dest.join("test_gl_bindings.rs")).unwrap(); + let mut file = std::fs::File::create(dest.join("test_gl_bindings.rs")).unwrap(); gl_generator::Registry::new( gl_generator::Api::Gles2, (3, 0), diff --git a/examples/src/bin/fd_allocator.rs b/examples/src/bin/fd_allocator.rs index 93d632d5c..4a458226c 100644 --- a/examples/src/bin/fd_allocator.rs +++ b/examples/src/bin/fd_allocator.rs @@ -370,7 +370,7 @@ mod video_filter { } } mod imp { - use std::{cmp, mem::ManuallyDrop, os::unix::prelude::FromRawFd}; + use std::{mem::ManuallyDrop, os::unix::prelude::FromRawFd}; use anyhow::Error; use gst::{subclass::prelude::*, PadDirection, PadPresence, PadTemplate}; @@ -430,9 +430,9 @@ mod video_filter { let mut mmap = MmapMut::map_mut(mfd.as_file())?; for pixel in mmap.chunks_exact_mut(4) { - pixel[0] = cmp::max(0, cmp::min(255, (pixel[0] as f64 * factor) as u8)); - pixel[1] = cmp::max(0, cmp::min(255, (pixel[1] as f64 * factor) as u8)); - pixel[2] = cmp::max(0, cmp::min(255, (pixel[2] as f64 * factor) as u8)); + pixel[0] = (pixel[0] as f64 * factor).clamp(0.0, 255.0) as u8; + pixel[1] = (pixel[1] as f64 * factor).clamp(0.0, 255.0) as u8; + pixel[2] = (pixel[2] as f64 * factor).clamp(0.0, 255.0) as u8; } } diff --git a/gstreamer-audio/src/audio_buffer.rs b/gstreamer-audio/src/audio_buffer.rs index 1a8946b22..d7c03b9d7 100644 --- a/gstreamer-audio/src/audio_buffer.rs +++ b/gstreamer-audio/src/audio_buffer.rs @@ -92,7 +92,7 @@ impl AudioBuffer { } pub fn plane_size(&self) -> usize { - (self.n_samples() as usize * self.sample_stride() as usize * self.channels() as usize) + (self.n_samples() * self.sample_stride() as usize * self.channels() as usize) / self.n_planes() as usize } @@ -330,7 +330,7 @@ impl AudioBufferRef { } pub fn plane_size(&self) -> usize { - (self.n_samples() as usize * self.sample_stride() as usize * self.channels() as usize) + (self.n_samples() * self.sample_stride() as usize * self.channels() as usize) / self.n_planes() as usize } diff --git a/gstreamer-audio/src/audio_channel_position.rs b/gstreamer-audio/src/audio_channel_position.rs index c9bf00ce2..425cfb89b 100644 --- a/gstreamer-audio/src/audio_channel_position.rs +++ b/gstreamer-audio/src/audio_channel_position.rs @@ -29,7 +29,7 @@ impl AudioChannelPosition { } let positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= len as usize { + if i >= len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { positions[i].into_glib() @@ -95,7 +95,7 @@ impl AudioChannelPosition { let len = positions.len(); let mut positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= len as usize { + if i >= len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { positions[i].into_glib() @@ -139,7 +139,7 @@ impl AudioChannelPosition { let len = positions.len(); let positions_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= len as usize { + if i >= len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { positions[i].into_glib() @@ -174,7 +174,7 @@ pub fn buffer_reorder_channels( let to_len = to.len(); let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= from_len as usize { + if i >= from_len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { from[i].into_glib() @@ -182,7 +182,7 @@ pub fn buffer_reorder_channels( }); let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= to_len as usize { + if i >= to_len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { to[i].into_glib() @@ -224,7 +224,7 @@ pub fn reorder_channels( let to_len = to.len(); let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= from_len as usize { + if i >= from_len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { from[i].into_glib() @@ -232,7 +232,7 @@ pub fn reorder_channels( }); let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= to_len as usize { + if i >= to_len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { to[i].into_glib() @@ -274,7 +274,7 @@ pub fn channel_reorder_map( let to_len = to.len(); let from_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= from_len as usize { + if i >= from_len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { from[i].into_glib() @@ -282,7 +282,7 @@ pub fn channel_reorder_map( }); let to_raw: [ffi::GstAudioChannelPosition; 64] = std::array::from_fn(|i| { - if i >= to_len as usize { + if i >= to_len { ffi::GST_AUDIO_CHANNEL_POSITION_INVALID } else { to[i].into_glib() diff --git a/gstreamer-audio/src/audio_info.rs b/gstreamer-audio/src/audio_info.rs index 57cf26a19..d31bc394d 100644 --- a/gstreamer-audio/src/audio_info.rs +++ b/gstreamer-audio/src/audio_info.rs @@ -255,7 +255,7 @@ impl AudioInfo { } pub fn bps(&self) -> u32 { - (self.format_info().depth() as u32) >> 3 + self.format_info().depth() >> 3 } pub fn depth(&self) -> u32 { diff --git a/gstreamer-gl/src/gl_video_frame.rs b/gstreamer-gl/src/gl_video_frame.rs index fb9c9a6dc..badfcb160 100644 --- a/gstreamer-gl/src/gl_video_frame.rs +++ b/gstreamer-gl/src/gl_video_frame.rs @@ -154,6 +154,6 @@ fn buffer_n_gl_memory(buffer: &gst::BufferRef) -> Option { return None; } } - Some(num as u32) + Some(num) } } diff --git a/gstreamer-net/src/ptp_clock.rs b/gstreamer-net/src/ptp_clock.rs index 32eb06557..ef7337980 100644 --- a/gstreamer-net/src/ptp_clock.rs +++ b/gstreamer-net/src/ptp_clock.rs @@ -88,7 +88,7 @@ impl PtpClock { ); assert_ne!(id, 0); - PtpStatisticsCallback(NonZeroU64::new_unchecked(id as u64)) + PtpStatisticsCallback(NonZeroU64::new_unchecked(id as _)) } } } diff --git a/gstreamer-play/src/play_video_info.rs b/gstreamer-play/src/play_video_info.rs index 3270066cc..e6dde3ed0 100644 --- a/gstreamer-play/src/play_video_info.rs +++ b/gstreamer-play/src/play_video_info.rs @@ -16,7 +16,7 @@ impl PlayVideoInfo { fps_n.as_mut_ptr(), fps_d.as_mut_ptr(), ); - (fps_n.assume_init() as i32, fps_d.as_mut_ptr() as i32).into() + (fps_n.assume_init(), fps_d.assume_init()).into() } } diff --git a/gstreamer-player/src/player_video_info.rs b/gstreamer-player/src/player_video_info.rs index f6b501ef5..0bf352b55 100644 --- a/gstreamer-player/src/player_video_info.rs +++ b/gstreamer-player/src/player_video_info.rs @@ -16,7 +16,7 @@ impl PlayerVideoInfo { fps_n.as_mut_ptr(), fps_d.as_mut_ptr(), ); - (fps_n.assume_init() as i32, fps_d.as_mut_ptr() as i32).into() + (fps_n.assume_init(), fps_d.assume_init()).into() } } diff --git a/gstreamer-rtp/src/rtp_buffer.rs b/gstreamer-rtp/src/rtp_buffer.rs index 8aff5c063..84aa6932e 100644 --- a/gstreamer-rtp/src/rtp_buffer.rs +++ b/gstreamer-rtp/src/rtp_buffer.rs @@ -265,7 +265,6 @@ impl<'a, T> RTPBuffer<'a, T> { pub fn payload_size(&self) -> u32 { unsafe { ffi::gst_rtp_buffer_get_payload_len(glib::translate::mut_override(&self.rtp_buffer)) - as u32 } } diff --git a/gstreamer-sdp/src/sdp_bandwidth.rs b/gstreamer-sdp/src/sdp_bandwidth.rs index b6258d455..3aa7524e6 100644 --- a/gstreamer-sdp/src/sdp_bandwidth.rs +++ b/gstreamer-sdp/src/sdp_bandwidth.rs @@ -34,7 +34,7 @@ impl SDPBandwidth { } pub fn value(&self) -> u32 { - self.0.bandwidth as u32 + self.0.bandwidth } } diff --git a/gstreamer-sdp/src/sdp_connection.rs b/gstreamer-sdp/src/sdp_connection.rs index 2fda9784a..afdd2e560 100644 --- a/gstreamer-sdp/src/sdp_connection.rs +++ b/gstreamer-sdp/src/sdp_connection.rs @@ -61,11 +61,11 @@ impl SDPConnection { } pub fn ttl(&self) -> u32 { - self.0.ttl as u32 + self.0.ttl } pub fn addr_number(&self) -> u32 { - self.0.addr_number as u32 + self.0.addr_number } } diff --git a/gstreamer-video/src/functions.rs b/gstreamer-video/src/functions.rs index 7a1bf6d9d..b6747b856 100644 --- a/gstreamer-video/src/functions.rs +++ b/gstreamer-video/src/functions.rs @@ -186,8 +186,8 @@ pub fn guess_framerate(duration: gst::ClockTime) -> Option { )); if res { Some(gst::Fraction::new( - dest_n.assume_init() as i32, - dest_d.assume_init() as i32, + dest_n.assume_init(), + dest_d.assume_init(), )) } else { None diff --git a/gstreamer-video/src/video_format.rs b/gstreamer-video/src/video_format.rs index 7979fb84c..6970fde31 100644 --- a/gstreamer-video/src/video_format.rs +++ b/gstreamer-video/src/video_format.rs @@ -350,7 +350,7 @@ impl Iterator for VideoFormatIterator { return (0, Some(0)); } - let remaining = (self.len - self.idx) as usize; + let remaining = self.len - self.idx; (remaining, Some(remaining)) } diff --git a/gstreamer/src/bufferlist.rs b/gstreamer/src/bufferlist.rs index a17a0e2ea..ab7a9cc09 100644 --- a/gstreamer/src/bufferlist.rs +++ b/gstreamer/src/bufferlist.rs @@ -89,7 +89,7 @@ impl BufferListRef { #[doc(alias = "gst_buffer_list_calculate_size")] pub fn calculate_size(&self) -> usize { - unsafe { ffi::gst_buffer_list_calculate_size(self.as_mut_ptr()) as usize } + unsafe { ffi::gst_buffer_list_calculate_size(self.as_mut_ptr()) } } pub fn is_empty(&self) -> bool { diff --git a/gstreamer/src/date_time_serde.rs b/gstreamer/src/date_time_serde.rs index 2598c3b97..9601a71a9 100644 --- a/gstreamer/src/date_time_serde.rs +++ b/gstreamer/src/date_time_serde.rs @@ -67,7 +67,7 @@ impl Serialize for Date { fn serialize(&self, serializer: S) -> Result { DateTimeVariants::YMD( self.0.year() as i32, - self.0.month().into_glib() as i32, + self.0.month().into_glib(), self.0.day() as i32, ) .serialize(serializer) diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index f5e625d60..d0c0193a4 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -106,7 +106,7 @@ impl FromGlib for NotifyWatchId { unsafe fn from_glib(val: libc::c_ulong) -> NotifyWatchId { skip_assert_initialized!(); assert_ne!(val, 0); - NotifyWatchId(NonZeroU64::new_unchecked(val as u64)) + NotifyWatchId(NonZeroU64::new_unchecked(val as _)) } } diff --git a/gstreamer/src/element_factory_type.rs b/gstreamer/src/element_factory_type.rs index e1d655415..6f6e6c841 100644 --- a/gstreamer/src/element_factory_type.rs +++ b/gstreamer/src/element_factory_type.rs @@ -7,47 +7,47 @@ bitflags! { #[doc(alias = "GstElementFactoryListType")] pub struct ElementFactoryType: u64 { #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DECODER")] - const DECODER = ffi::GST_ELEMENT_FACTORY_TYPE_DECODER as u64; + const DECODER = ffi::GST_ELEMENT_FACTORY_TYPE_DECODER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_ENCODER")] - const ENCODER = ffi::GST_ELEMENT_FACTORY_TYPE_ENCODER as u64; + const ENCODER = ffi::GST_ELEMENT_FACTORY_TYPE_ENCODER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_SINK")] - const SINK = ffi::GST_ELEMENT_FACTORY_TYPE_SINK as u64; + const SINK = ffi::GST_ELEMENT_FACTORY_TYPE_SINK; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_SRC")] - const SRC = ffi::GST_ELEMENT_FACTORY_TYPE_SRC as u64; + const SRC = ffi::GST_ELEMENT_FACTORY_TYPE_SRC; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MUXER")] - const MUXER = ffi::GST_ELEMENT_FACTORY_TYPE_MUXER as u64; + const MUXER = ffi::GST_ELEMENT_FACTORY_TYPE_MUXER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DEMUXER")] - const DEMUXER = ffi::GST_ELEMENT_FACTORY_TYPE_DEMUXER as u64; + const DEMUXER = ffi::GST_ELEMENT_FACTORY_TYPE_DEMUXER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_PARSER")] - const PARSER = ffi::GST_ELEMENT_FACTORY_TYPE_PARSER as u64; + const PARSER = ffi::GST_ELEMENT_FACTORY_TYPE_PARSER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_PAYLOADER")] - const PAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_PAYLOADER as u64; + const PAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_PAYLOADER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER")] - const DEPAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER as u64; + const DEPAYLOADER = ffi::GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_FORMATTER")] - const FORMATTER = ffi::GST_ELEMENT_FACTORY_TYPE_FORMATTER as u64; + const FORMATTER = ffi::GST_ELEMENT_FACTORY_TYPE_FORMATTER; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_DECRYPTOR")] - const DECRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_DECRYPTOR as u64; + const DECRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_DECRYPTOR; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR")] - const ENCRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR as u64; + const ENCRYPTOR = ffi::GST_ELEMENT_FACTORY_TYPE_ENCRYPTOR; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_HARDWARE")] - const HARDWARE = ffi::GST_ELEMENT_FACTORY_TYPE_HARDWARE as u64; + const HARDWARE = ffi::GST_ELEMENT_FACTORY_TYPE_HARDWARE; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO")] - const MEDIA_VIDEO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO as u64; + const MEDIA_VIDEO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO")] - const MEDIA_AUDIO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO as u64; + const MEDIA_AUDIO = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE")] - const MEDIA_IMAGE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE as u64; + const MEDIA_IMAGE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE")] - const MEDIA_SUBTITLE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE as u64; + const MEDIA_SUBTITLE = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA")] - const MEDIA_METADATA = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA as u64; + const MEDIA_METADATA = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_ANY")] - const ANY = ffi::GST_ELEMENT_FACTORY_TYPE_ANY as u64; + const ANY = ffi::GST_ELEMENT_FACTORY_TYPE_ANY; #[doc(alias = "GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY")] - const MEDIA_ANY = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY as u64; + const MEDIA_ANY = ffi::GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY; const VIDEO_ENCODER = Self::ENCODER.bits | Self::MEDIA_VIDEO.bits | Self::MEDIA_IMAGE.bits; const AUDIO_ENCODER = Self::ENCODER.bits | Self::MEDIA_AUDIO.bits; diff --git a/gstreamer/src/format/specific.rs b/gstreamer/src/format/specific.rs index 6327a8a24..186d85815 100644 --- a/gstreamer/src/format/specific.rs +++ b/gstreamer/src/format/specific.rs @@ -325,7 +325,7 @@ impl FormattedValue for Option { impl FormattedValueFullRange for Option { unsafe fn from_raw(format: Format, value: i64) -> Self { debug_assert_eq!(format, Format::Percent); - Percent::try_from_glib(value as i64).ok() + Percent::try_from_glib(value).ok() } } diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 47951bce6..3850a05fc 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -46,7 +46,7 @@ impl FromGlib for PadProbeId { unsafe fn from_glib(val: libc::c_ulong) -> PadProbeId { skip_assert_initialized!(); assert_ne!(val, 0); - PadProbeId(NonZeroU64::new_unchecked(val as u64)) + PadProbeId(NonZeroU64::new_unchecked(val as _)) } } @@ -1097,7 +1097,7 @@ unsafe fn create_probe_info<'a>( let flow_res = try_from_glib((*info).ABI.abi.flow_ret); let info = PadProbeInfo { mask: from_glib((*info).type_), - id: Some(PadProbeId(NonZeroU64::new_unchecked((*info).id as u64))), + id: Some(PadProbeId(NonZeroU64::new_unchecked((*info).id as _))), offset: (*info).offset, size: (*info).size, data: if (*info).data.is_null() { diff --git a/gstreamer/src/stream_collection.rs b/gstreamer/src/stream_collection.rs index 661241f8e..5d64b574a 100644 --- a/gstreamer/src/stream_collection.rs +++ b/gstreamer/src/stream_collection.rs @@ -23,7 +23,7 @@ impl<'a> Iter<'a> { Iter { collection, idx: 0, - size: collection.len() as usize, + size: collection.len(), } } } diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index ba5c2b650..621bf3d2f 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -1126,7 +1126,7 @@ mod tests { let s = Structure::builder("test") .field("f1", "abc") - .field("f2", &String::from("bcd")) + .field("f2", String::from("bcd")) .field("f3", 123i32) .build(); @@ -1167,7 +1167,7 @@ mod tests { let s = Structure::builder("test") .field("f1", "abc") - .field("f2", &String::from("bcd")) + .field("f2", String::from("bcd")) .field("f3", 123i32) .build(); diff --git a/gstreamer/src/structure_serde.rs b/gstreamer/src/structure_serde.rs index 18cf1e937..25ea9fbe0 100644 --- a/gstreamer/src/structure_serde.rs +++ b/gstreamer/src/structure_serde.rs @@ -177,7 +177,7 @@ mod tests { let s = Structure::builder("test") .field("f1", "abc") - .field("f2", &String::from("bcd")) + .field("f2", String::from("bcd")) .field("f3", 123i32) .field("fraction", Fraction::new(1, 2)) .field("date", Date::from_dmy(19, DateMonth::August, 2019).unwrap()) diff --git a/gstreamer/src/subclass/tracer.rs b/gstreamer/src/subclass/tracer.rs index 65e1ad800..dfd867788 100644 --- a/gstreamer/src/subclass/tracer.rs +++ b/gstreamer/src/subclass/tracer.rs @@ -202,11 +202,11 @@ define_tracer_hooks! { }; MiniObjectReffed("mini-object-reffed") = |this, ts, o: *mut ffi::GstMiniObject, rc: libc::c_int| { let o = MiniObject::from_glib_borrow(o); - this.mini_object_reffed(ts, &o, rc as i32) + this.mini_object_reffed(ts, &o, rc) }; MiniObjectUnreffed("mini-object-unreffed") = |this, ts, o: *mut ffi::GstMiniObject, rc: libc::c_int| { let o = MiniObject::from_glib_borrow(o); - this.mini_object_unreffed(ts, &o, rc as i32) + this.mini_object_unreffed(ts, &o, rc) }; ObjectCreated("object-created") = |this, ts, o: *mut ffi::GstObject| { let o = Object::from_glib_borrow(o); @@ -218,11 +218,11 @@ define_tracer_hooks! { }; ObjectReffed("object-reffed") = |this, ts, o: *mut ffi::GstObject, rc: libc::c_int| { let o = Object::from_glib_borrow(o); - this.object_reffed(ts, &o, rc as i32) + this.object_reffed(ts, &o, rc) }; ObjectUnreffed("object-unreffed") = |this, ts, o: *mut ffi::GstObject, rc: libc::c_int| { let o = Object::from_glib_borrow(o); - this.object_unreffed(ts, &o, rc as i32) + this.object_unreffed(ts, &o, rc) }; PadLinkPost("pad-link-post") = |this, ts, src: *mut ffi::GstPad, sink: *mut ffi::GstPad, r: ffi::GstPadLinkReturn| { let src = Pad::from_glib_borrow(src); @@ -248,7 +248,7 @@ define_tracer_hooks! { }; PadPullRangePre("pad-pull-range-pre") = |this, ts, p: *mut ffi::GstPad, o: u64, s: libc::c_uint| { let p = Pad::from_glib_borrow(p); - this.pad_pull_range_pre(ts, &p, o, s as u32) + this.pad_pull_range_pre(ts, &p, o, s) }; PadPushEventPost("pad-push-event-post") = |this, ts, p: *mut ffi::GstPad, r: glib::ffi::gboolean| { let p = Pad::from_glib_borrow(p);