From 2fe925927b0e4e3addac5675b4490dd36ea8da26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 5 Apr 2018 23:00:25 +0300 Subject: [PATCH] Add missing imports to sdp library and fix build --- gstreamer-sdp/src/s_d_p_media.rs | 3 +++ gstreamer-sdp/src/s_d_p_message.rs | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gstreamer-sdp/src/s_d_p_media.rs b/gstreamer-sdp/src/s_d_p_media.rs index 0524bbb8d..9c5d645e5 100644 --- a/gstreamer-sdp/src/s_d_p_media.rs +++ b/gstreamer-sdp/src/s_d_p_media.rs @@ -20,6 +20,9 @@ use s_d_p_bandwidth::SDPBandwidth; use s_d_p_connection::SDPConnection; use s_d_p_key::SDPKey; +#[cfg(any(feature = "v1_8_1", feature = "dox"))] +use MIKEYMessage; + glib_wrapper! { pub struct SDPMedia(Boxed); diff --git a/gstreamer-sdp/src/s_d_p_message.rs b/gstreamer-sdp/src/s_d_p_message.rs index 713503166..f0c454b74 100644 --- a/gstreamer-sdp/src/s_d_p_message.rs +++ b/gstreamer-sdp/src/s_d_p_message.rs @@ -26,6 +26,9 @@ use s_d_p_origin::SDPOrigin; use s_d_p_time::SDPTime; use s_d_p_zone::SDPZone; +#[cfg(any(feature = "v1_8_1", feature = "dox"))] +use MIKEYMessage; + glib_wrapper! { pub struct SDPMessage(Boxed); @@ -451,13 +454,14 @@ impl SDPMessage { } #[cfg(any(feature = "v1_8_1", feature = "dox"))] - pub fn parse_keymgmt(&self, mikey: MIKEYMessage) -> Result<(), ()> { - let result = - unsafe { ffi::gst_sdp_message_parse_keymgmt(self.to_glib_none().0, &mut mikey) }; - mem::forget(mikey); - match result { - ffi::GST_SDP_OK => Ok(()), - _ => Err(()), + pub fn parse_keymgmt(&self) -> Result { + unsafe { + let mut mikey = ptr::null_mut(); + let result = ffi::gst_sdp_message_parse_keymgmt(self.to_glib_none().0, &mut mikey); + match result { + ffi::GST_SDP_OK => Ok(from_glib_full(mikey)), + _ => Err(()), + } } }