From c215acb7f9dc1d6cbfccc8393e87287339b6bbeb Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 13 Nov 2020 23:37:26 +0100 Subject: [PATCH] audio,video: Delete manual implementations for now-autogenerated enum funcs --- gstreamer-video/src/video_format.rs | 6 -- gstreamer-video/src/video_info.rs | 90 ----------------------------- 2 files changed, 96 deletions(-) diff --git a/gstreamer-video/src/video_format.rs b/gstreamer-video/src/video_format.rs index a6f976856..81ae11ba1 100644 --- a/gstreamer-video/src/video_format.rs +++ b/gstreamer-video/src/video_format.rs @@ -289,12 +289,6 @@ impl ToGlib for VideoEndianness { } impl crate::VideoFormat { - pub fn from_fourcc(fourcc: u32) -> crate::VideoFormat { - assert_initialized_main_thread!(); - - unsafe { from_glib(ffi::gst_video_format_from_fourcc(fourcc)) } - } - pub fn from_masks( depth: u32, bpp: u32, diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index bff87a301..327400425 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -203,96 +203,6 @@ impl fmt::Display for crate::VideoChromaSite { } } -impl crate::VideoTransferFunction { - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - pub fn from_iso(iso: u32) -> Result { - assert_initialized_main_thread!(); - - unsafe { - let value = from_glib(ffi::gst_video_transfer_function_from_iso(iso)); - match value { - crate::VideoTransferFunction::__Unknown(_) => { - Err(glib::glib_bool_error!("Invalid ISO value")) - } - _ => Ok(value), - } - } - } - - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - pub fn to_iso(&self) -> u32 { - unsafe { ffi::gst_video_transfer_function_to_iso(self.to_glib()) } - } - - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - pub fn is_equivalent( - &self, - from_bpp: u32, - to_func: crate::VideoTransferFunction, - to_bpp: u32, - ) -> bool { - unsafe { - from_glib(ffi::gst_video_transfer_function_is_equivalent( - self.to_glib(), - from_bpp, - to_func.to_glib(), - to_bpp, - )) - } - } -} - -impl crate::VideoColorMatrix { - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - pub fn from_iso(iso: u32) -> Result { - assert_initialized_main_thread!(); - - unsafe { - let value = from_glib(ffi::gst_video_color_matrix_from_iso(iso)); - match value { - crate::VideoColorMatrix::__Unknown(_) => { - Err(glib::glib_bool_error!("Invalid ISO value")) - } - _ => Ok(value), - } - } - } - - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - pub fn to_iso(&self) -> u32 { - unsafe { ffi::gst_video_color_matrix_to_iso(self.to_glib()) } - } -} - -impl crate::VideoColorPrimaries { - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - pub fn from_iso(iso: u32) -> Result { - assert_initialized_main_thread!(); - - unsafe { - let value = from_glib(ffi::gst_video_color_primaries_from_iso(iso)); - match value { - crate::VideoColorPrimaries::__Unknown(_) => { - Err(glib::glib_bool_error!("Invalid ISO value")) - } - _ => Ok(value), - } - } - } - - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - pub fn to_iso(&self) -> u32 { - unsafe { ffi::gst_video_color_primaries_to_iso(self.to_glib()) } - } -} - impl From for crate::VideoMultiviewMode { fn from(v: crate::VideoMultiviewFramePacking) -> Self { skip_assert_initialized!();