From d7fe610767bf39d6160c04ce299dea639724b7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 8 Oct 2021 19:57:14 +0300 Subject: [PATCH] rtp: Fix mutability of caps in RtpHeaderExtension API --- gstreamer-rtp/Gir.toml | 15 +++++++ .../src/auto/rtp_header_extension.rs | 39 ------------------- gstreamer-rtp/src/rtp_header_extension.rs | 39 +++++++++++++++++++ 3 files changed, 54 insertions(+), 39 deletions(-) diff --git a/gstreamer-rtp/Gir.toml b/gstreamer-rtp/Gir.toml index 30c5dc9df..4e45ac89e 100644 --- a/gstreamer-rtp/Gir.toml +++ b/gstreamer-rtp/Gir.toml @@ -72,6 +72,21 @@ manual_traits = ["RTPHeaderExtensionExtManual"] # Mutability of BufferRef manual = true + [[object.function]] + name = "set_caps_from_attributes" + # Mutability of CapsRef + manual = true + + [[object.function]] + name = "set_caps_from_attributes_helper" + # Mutability of CapsRef + manual = true + + [[object.function]] + name = "update_non_rtp_src_caps" + # Mutability of CapsRef + manual = true + [[object.function]] name = "get_sdp_caps_field_name" [object.function.return] diff --git a/gstreamer-rtp/src/auto/rtp_header_extension.rs b/gstreamer-rtp/src/auto/rtp_header_extension.rs index d05d5d104..4ba1d0433 100644 --- a/gstreamer-rtp/src/auto/rtp_header_extension.rs +++ b/gstreamer-rtp/src/auto/rtp_header_extension.rs @@ -62,12 +62,6 @@ pub trait RTPHeaderExtensionExt: 'static { #[doc(alias = "gst_rtp_header_extension_set_attributes_from_caps")] fn set_attributes_from_caps(&self, caps: &gst::Caps) -> bool; - #[doc(alias = "gst_rtp_header_extension_set_caps_from_attributes")] - fn set_caps_from_attributes(&self, caps: &gst::Caps) -> bool; - - #[doc(alias = "gst_rtp_header_extension_set_caps_from_attributes_helper")] - fn set_caps_from_attributes_helper(&self, caps: &gst::Caps, attributes: &str) -> bool; - #[doc(alias = "gst_rtp_header_extension_set_direction")] fn set_direction(&self, direction: RTPHeaderExtensionDirection); @@ -80,9 +74,6 @@ pub trait RTPHeaderExtensionExt: 'static { #[doc(alias = "gst_rtp_header_extension_set_wants_update_non_rtp_src_caps")] fn set_wants_update_non_rtp_src_caps(&self, state: bool); - #[doc(alias = "gst_rtp_header_extension_update_non_rtp_src_caps")] - fn update_non_rtp_src_caps(&self, caps: &gst::Caps) -> bool; - #[doc(alias = "gst_rtp_header_extension_wants_update_non_rtp_src_caps")] fn wants_update_non_rtp_src_caps(&self) -> bool; } @@ -142,27 +133,6 @@ impl> RTPHeaderExtensionExt for O { } } - fn set_caps_from_attributes(&self, caps: &gst::Caps) -> bool { - unsafe { - from_glib(ffi::gst_rtp_header_extension_set_caps_from_attributes( - self.as_ref().to_glib_none().0, - caps.to_glib_none().0, - )) - } - } - - fn set_caps_from_attributes_helper(&self, caps: &gst::Caps, attributes: &str) -> bool { - unsafe { - from_glib( - ffi::gst_rtp_header_extension_set_caps_from_attributes_helper( - self.as_ref().to_glib_none().0, - caps.to_glib_none().0, - attributes.to_glib_none().0, - ), - ) - } - } - fn set_direction(&self, direction: RTPHeaderExtensionDirection) { unsafe { ffi::gst_rtp_header_extension_set_direction( @@ -196,15 +166,6 @@ impl> RTPHeaderExtensionExt for O { } } - fn update_non_rtp_src_caps(&self, caps: &gst::Caps) -> bool { - unsafe { - from_glib(ffi::gst_rtp_header_extension_update_non_rtp_src_caps( - self.as_ref().to_glib_none().0, - caps.to_glib_none().0, - )) - } - } - fn wants_update_non_rtp_src_caps(&self) -> bool { unsafe { from_glib(ffi::gst_rtp_header_extension_wants_update_non_rtp_src_caps( diff --git a/gstreamer-rtp/src/rtp_header_extension.rs b/gstreamer-rtp/src/rtp_header_extension.rs index 4d0d135f6..492c6e771 100644 --- a/gstreamer-rtp/src/rtp_header_extension.rs +++ b/gstreamer-rtp/src/rtp_header_extension.rs @@ -20,6 +20,15 @@ pub trait RTPHeaderExtensionExtManual: 'static { output: &mut gst::BufferRef, data: &mut [u8], ) -> Result; + + #[doc(alias = "gst_rtp_header_extension_set_caps_from_attributes")] + fn set_caps_from_attributes(&self, caps: &mut gst::CapsRef) -> bool; + + #[doc(alias = "gst_rtp_header_extension_set_caps_from_attributes_helper")] + fn set_caps_from_attributes_helper(&self, caps: &mut gst::CapsRef, attributes: &str) -> bool; + + #[doc(alias = "gst_rtp_header_extension_update_non_rtp_src_caps")] + fn update_non_rtp_src_caps(&self, caps: &mut gst::CapsRef) -> bool; } impl> RTPHeaderExtensionExtManual for O { @@ -66,4 +75,34 @@ impl> RTPHeaderExtensionExtManual for O { } } } + + fn set_caps_from_attributes(&self, caps: &mut gst::CapsRef) -> bool { + unsafe { + from_glib(ffi::gst_rtp_header_extension_set_caps_from_attributes( + self.as_ref().to_glib_none().0, + caps.as_mut_ptr(), + )) + } + } + + fn set_caps_from_attributes_helper(&self, caps: &mut gst::CapsRef, attributes: &str) -> bool { + unsafe { + from_glib( + ffi::gst_rtp_header_extension_set_caps_from_attributes_helper( + self.as_ref().to_glib_none().0, + caps.as_mut_ptr(), + attributes.to_glib_none().0, + ), + ) + } + } + + fn update_non_rtp_src_caps(&self, caps: &mut gst::CapsRef) -> bool { + unsafe { + from_glib(ffi::gst_rtp_header_extension_update_non_rtp_src_caps( + self.as_ref().to_glib_none().0, + caps.as_mut_ptr(), + )) + } + } }