diff --git a/gstreamer-audio/src/audio_converter.rs b/gstreamer-audio/src/audio_converter.rs index 05b00a13e..cb36b7399 100644 --- a/gstreamer-audio/src/audio_converter.rs +++ b/gstreamer-audio/src/audio_converter.rs @@ -126,7 +126,7 @@ impl AudioConverterConfig { .unwrap_or(crate::AudioResamplerMethod::BlackmanNuttall) } - pub fn set_mix_matrix>(&mut self, v: &[T]) { + pub fn set_mix_matrix(&mut self, v: &[impl AsRef<[f32]>]) { let length = v.get(0).map(|v| v.as_ref().len()).unwrap_or(0); let array = gst::Array::from_owned( v.iter() diff --git a/gstreamer-base/src/functions.rs b/gstreamer-base/src/functions.rs index 7a9938731..ac3d7063f 100644 --- a/gstreamer-base/src/functions.rs +++ b/gstreamer-base/src/functions.rs @@ -5,9 +5,9 @@ use glib::translate::*; use std::mem; #[doc(alias = "gst_type_find_helper_for_data")] -pub fn type_find_helper_for_data, R: AsRef<[u8]>>( - obj: Option<&P>, - data: R, +pub fn type_find_helper_for_data( + obj: Option<&impl IsA>, + data: impl AsRef<[u8]>, ) -> Result<(gst::Caps, gst::TypeFindProbability), glib::error::BoolError> { assert_initialized_main_thread!(); unsafe { @@ -31,9 +31,9 @@ pub fn type_find_helper_for_data, R: AsRef<[u8]>>( #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[doc(alias = "gst_type_find_helper_for_data_with_extension")] -pub fn type_find_helper_for_data_with_extension, R: AsRef<[u8]>>( - obj: Option<&P>, - data: R, +pub fn type_find_helper_for_data_with_extension( + obj: Option<&impl IsA>, + data: impl AsRef<[u8]>, extension: Option<&str>, ) -> Result<(gst::Caps, gst::TypeFindProbability), glib::error::BoolError> { assert_initialized_main_thread!(); diff --git a/gstreamer-check/src/harness.rs b/gstreamer-check/src/harness.rs index 99e372b34..6aaa39cd2 100644 --- a/gstreamer-check/src/harness.rs +++ b/gstreamer-check/src/harness.rs @@ -197,7 +197,7 @@ impl Harness { } #[doc(alias = "gst_harness_dump_to_file")] - pub fn dump_to_file>(&mut self, filename: P) { + pub fn dump_to_file(&mut self, filename: impl AsRef) { let filename = filename.as_ref(); unsafe { ffi::gst_harness_dump_to_file(self.0.as_ptr(), filename.to_glib_none().0); diff --git a/gstreamer/src/bin.rs b/gstreamer/src/bin.rs index 8c1d84289..0b8bad588 100644 --- a/gstreamer/src/bin.rs +++ b/gstreamer/src/bin.rs @@ -44,15 +44,15 @@ pub trait GstBinExtManual: 'static { fn children(&self) -> Vec; fn debug_to_dot_data(&self, details: crate::DebugGraphDetails) -> GString; - fn debug_to_dot_file>( + fn debug_to_dot_file( &self, details: crate::DebugGraphDetails, - file_name: Q, + file_name: impl AsRef, ); - fn debug_to_dot_file_with_ts>( + fn debug_to_dot_file_with_ts( &self, details: crate::DebugGraphDetails, - file_name: Q, + file_name: impl AsRef, ); fn set_bin_flags(&self, flags: BinFlags); @@ -166,18 +166,18 @@ impl> GstBinExtManual for O { crate::debug_bin_to_dot_data(self, details) } - fn debug_to_dot_file>( + fn debug_to_dot_file( &self, details: crate::DebugGraphDetails, - file_name: Q, + file_name: impl AsRef, ) { crate::debug_bin_to_dot_file(self, details, file_name) } - fn debug_to_dot_file_with_ts>( + fn debug_to_dot_file_with_ts( &self, details: crate::DebugGraphDetails, - file_name: Q, + file_name: impl AsRef, ) { crate::debug_bin_to_dot_file_with_ts(self, details, file_name) } diff --git a/gstreamer/src/stream_collection.rs b/gstreamer/src/stream_collection.rs index cb3faa68b..011be8741 100644 --- a/gstreamer/src/stream_collection.rs +++ b/gstreamer/src/stream_collection.rs @@ -74,7 +74,7 @@ impl StreamCollectionBuilder { self } - pub fn streams>(self, streams: &[S]) -> Self { + pub fn streams(self, streams: &[impl AsRef]) -> Self { for stream in streams { unsafe { ffi::gst_stream_collection_add_stream( diff --git a/gstreamer/src/value.rs b/gstreamer/src/value.rs index 358c915ad..beece920d 100644 --- a/gstreamer/src/value.rs +++ b/gstreamer/src/value.rs @@ -634,7 +634,7 @@ impl<'a> Array<'a> { Array(values.iter().map(|v| v.to_send_value()).collect()) } - pub fn from_borrowed>(values: &'a T) -> Self { + pub fn from_borrowed(values: &'a impl AsRef<[glib::SendValue]>) -> Self { assert_initialized_main_thread!(); Array(Cow::Borrowed(values.as_ref())) @@ -728,7 +728,7 @@ impl<'a> List<'a> { List(values.iter().map(|v| v.to_send_value()).collect()) } - pub fn from_borrowed>(values: &'a T) -> Self { + pub fn from_borrowed(values: &'a impl AsRef<[glib::SendValue]>) -> Self { assert_initialized_main_thread!(); List(Cow::Borrowed(values.as_ref()))