Get rid of GstSDPResult enum

This commit is contained in:
Sebastian Dröge 2018-04-05 21:05:49 +03:00
parent 19b6987012
commit fb73d1bc15
10 changed files with 162 additions and 362 deletions

View file

@ -28,7 +28,6 @@ generate = [
"GstSdp.MIKEYSecSRTP", "GstSdp.MIKEYSecSRTP",
"GstSdp.MIKEYTSType", "GstSdp.MIKEYTSType",
"GstSdp.MIKEYType", "GstSdp.MIKEYType",
"GstSdp.SDPResult",
] ]
manual = [ manual = [

View file

@ -494,36 +494,3 @@ impl FromGlib<ffi::GstMIKEYType> for MIKEYType {
} }
} }
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum SDPResult {
Ok,
Einval,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for SDPResult {
type GlibType = ffi::GstSDPResult;
fn to_glib(&self) -> ffi::GstSDPResult {
match *self {
SDPResult::Ok => ffi::GST_SDP_OK,
SDPResult::Einval => ffi::GST_SDP_EINVAL,
SDPResult::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstSDPResult> for SDPResult {
fn from_glib(value: ffi::GstSDPResult) -> Self {
skip_assert_initialized!();
match value {
0 => SDPResult::Ok,
-1 => SDPResult::Einval,
value => SDPResult::__Unknown(value),
}
}
}

View file

@ -21,7 +21,6 @@ pub use self::enums::MIKEYSecProto;
pub use self::enums::MIKEYSecSRTP; pub use self::enums::MIKEYSecSRTP;
pub use self::enums::MIKEYTSType; pub use self::enums::MIKEYTSType;
pub use self::enums::MIKEYType; pub use self::enums::MIKEYType;
pub use self::enums::SDPResult;
#[doc(hidden)] #[doc(hidden)]
pub mod traits { pub mod traits {

View file

@ -12,8 +12,6 @@ use std::mem;
use ffi; use ffi;
use glib::translate::*; use glib::translate::*;
use auto::SDPResult;
#[repr(C)] #[repr(C)]
pub struct SDPAttribute(pub(crate) ffi::GstSDPAttribute); pub struct SDPAttribute(pub(crate) ffi::GstSDPAttribute);
@ -22,13 +20,10 @@ impl SDPAttribute {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
let mut attr = mem::zeroed(); let mut attr = mem::zeroed();
let result = from_glib(ffi::gst_sdp_attribute_set( let result =
&mut attr, ffi::gst_sdp_attribute_set(&mut attr, key.to_glib_none().0, value.to_glib_none().0);
key.to_glib_none().0,
value.to_glib_none().0,
));
match result { match result {
SDPResult::Ok => Ok(SDPAttribute(attr)), ffi::GST_SDP_OK => Ok(SDPAttribute(attr)),
_ => Err(()), _ => Err(()),
} }
} }

View file

@ -12,8 +12,6 @@ use std::mem;
use ffi; use ffi;
use glib::translate::*; use glib::translate::*;
use auto::SDPResult;
#[repr(C)] #[repr(C)]
pub struct SDPBandwidth(pub(crate) ffi::GstSDPBandwidth); pub struct SDPBandwidth(pub(crate) ffi::GstSDPBandwidth);
@ -22,13 +20,9 @@ impl SDPBandwidth {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
let mut bw = mem::zeroed(); let mut bw = mem::zeroed();
let result = from_glib(ffi::gst_sdp_bandwidth_set( let result = ffi::gst_sdp_bandwidth_set(&mut bw, bwtype.to_glib_none().0, bandwidth);
&mut bw,
bwtype.to_glib_none().0,
bandwidth,
));
match result { match result {
SDPResult::Ok => Ok(SDPBandwidth(bw)), ffi::GST_SDP_OK => Ok(SDPBandwidth(bw)),
_ => Err(()), _ => Err(()),
} }
} }

View file

@ -12,8 +12,6 @@ use std::mem;
use ffi; use ffi;
use glib::translate::*; use glib::translate::*;
use auto::SDPResult;
#[repr(C)] #[repr(C)]
pub struct SDPConnection(pub(crate) ffi::GstSDPConnection); pub struct SDPConnection(pub(crate) ffi::GstSDPConnection);
@ -28,16 +26,16 @@ impl SDPConnection {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
let mut conn = mem::zeroed(); let mut conn = mem::zeroed();
let result = from_glib(ffi::gst_sdp_connection_set( let result = ffi::gst_sdp_connection_set(
&mut conn, &mut conn,
nettype.to_glib_none().0, nettype.to_glib_none().0,
addrtype.to_glib_none().0, addrtype.to_glib_none().0,
address.to_glib_none().0, address.to_glib_none().0,
ttl, ttl,
addr_number, addr_number,
)); );
match result { match result {
SDPResult::Ok => Ok(SDPConnection(conn)), ffi::GST_SDP_OK => Ok(SDPConnection(conn)),
_ => Err(()), _ => Err(()),
} }
} }

View file

@ -15,7 +15,6 @@ use glib::translate::*;
use glib_ffi; use glib_ffi;
use gst; use gst;
use SDPResult;
use s_d_p_attribute::SDPAttribute; use s_d_p_attribute::SDPAttribute;
use s_d_p_bandwidth::SDPBandwidth; use s_d_p_bandwidth::SDPBandwidth;
use s_d_p_connection::SDPConnection; use s_d_p_connection::SDPConnection;
@ -41,9 +40,9 @@ impl SDPMedia {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
let mut media = ptr::null_mut(); let mut media = ptr::null_mut();
let result = from_glib(ffi::gst_sdp_media_new(&mut media)); let result = ffi::gst_sdp_media_new(&mut media);
match result { match result {
SDPResult::Ok => Ok(from_glib_full(media)), ffi::GST_SDP_OK => Ok(from_glib_full(media)),
_ => Err(()), _ => Err(()),
} }
} }
@ -57,28 +56,28 @@ impl SDPMedia {
let value = value.into(); let value = value.into();
let value = value.to_glib_none(); let value = value.to_glib_none();
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_add_attribute( ffi::gst_sdp_media_add_attribute(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
key.to_glib_none().0, key.to_glib_none().0,
value.0, value.0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn add_bandwidth(&mut self, bwtype: &str, bandwidth: u32) -> Result<(), ()> { pub fn add_bandwidth(&mut self, bwtype: &str, bandwidth: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_add_bandwidth( ffi::gst_sdp_media_add_bandwidth(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
bwtype.to_glib_none().0, bwtype.to_glib_none().0,
bandwidth, bandwidth,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -92,30 +91,27 @@ impl SDPMedia {
addr_number: u32, addr_number: u32,
) -> Result<(), ()> { ) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_add_connection( ffi::gst_sdp_media_add_connection(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
nettype.to_glib_none().0, nettype.to_glib_none().0,
addrtype.to_glib_none().0, addrtype.to_glib_none().0,
address.to_glib_none().0, address.to_glib_none().0,
ttl, ttl,
addr_number, addr_number,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn add_format(&mut self, format: &str) -> Result<(), ()> { pub fn add_format(&mut self, format: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_add_format( ffi::gst_sdp_media_add_format(self.to_glib_none_mut().0, format.to_glib_none().0)
self.to_glib_none_mut().0,
format.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -130,13 +126,10 @@ impl SDPMedia {
pub fn attributes_to_caps(&self, caps: &gst::Caps) -> Result<(), ()> { pub fn attributes_to_caps(&self, caps: &gst::Caps) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_attributes_to_caps( ffi::gst_sdp_media_attributes_to_caps(self.to_glib_none().0, caps.to_glib_none().0)
self.to_glib_none().0,
caps.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -311,59 +304,47 @@ impl SDPMedia {
pub fn insert_attribute(&mut self, idx: i32, mut attr: SDPAttribute) -> Result<(), ()> { pub fn insert_attribute(&mut self, idx: i32, mut attr: SDPAttribute) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_insert_attribute( ffi::gst_sdp_media_insert_attribute(self.to_glib_none_mut().0, idx, &mut attr.0)
self.to_glib_none_mut().0,
idx,
&mut attr.0,
))
}; };
mem::forget(attr); mem::forget(attr);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_bandwidth(&mut self, idx: i32, mut bw: SDPBandwidth) -> Result<(), ()> { pub fn insert_bandwidth(&mut self, idx: i32, mut bw: SDPBandwidth) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_insert_bandwidth( ffi::gst_sdp_media_insert_bandwidth(self.to_glib_none_mut().0, idx, &mut bw.0)
self.to_glib_none_mut().0,
idx,
&mut bw.0,
))
}; };
mem::forget(bw); mem::forget(bw);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_connection(&mut self, idx: i32, mut conn: SDPConnection) -> Result<(), ()> { pub fn insert_connection(&mut self, idx: i32, mut conn: SDPConnection) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_insert_connection( ffi::gst_sdp_media_insert_connection(self.to_glib_none_mut().0, idx, &mut conn.0)
self.to_glib_none_mut().0,
idx,
&mut conn.0,
))
}; };
mem::forget(conn); mem::forget(conn);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_format(&mut self, idx: i32, format: &str) -> Result<(), ()> { pub fn insert_format(&mut self, idx: i32, format: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_insert_format( ffi::gst_sdp_media_insert_format(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
idx, idx,
format.to_glib_none().0, format.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -372,191 +353,146 @@ impl SDPMedia {
pub fn parse_keymgmt(&self) -> Result<MIKEYMessage, ()> { pub fn parse_keymgmt(&self) -> Result<MIKEYMessage, ()> {
unsafe { unsafe {
let mut mikey = ptr::null_mut(); let mut mikey = ptr::null_mut();
let result = from_glib(ffi::gst_sdp_media_parse_keymgmt( let result = ffi::gst_sdp_media_parse_keymgmt(self.to_glib_none().0, &mut mikey);
self.to_glib_none().0,
&mut mikey,
));
match result { match result {
SDPResult::Ok => Ok(from_glib_full(mikey)), ffi::GST_SDP_OK => Ok(from_glib_full(mikey)),
_ => Err(()), _ => Err(()),
} }
} }
} }
pub fn remove_attribute(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_attribute(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe { ffi::gst_sdp_media_remove_attribute(self.to_glib_none_mut().0, idx) };
from_glib(ffi::gst_sdp_media_remove_attribute(
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_bandwidth(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_bandwidth(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe { ffi::gst_sdp_media_remove_bandwidth(self.to_glib_none_mut().0, idx) };
from_glib(ffi::gst_sdp_media_remove_bandwidth(
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_connection(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_connection(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result =
from_glib(ffi::gst_sdp_media_remove_connection( unsafe { ffi::gst_sdp_media_remove_connection(self.to_glib_none_mut().0, idx) };
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_format(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_format(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe { ffi::gst_sdp_media_remove_format(self.to_glib_none_mut().0, idx) };
from_glib(ffi::gst_sdp_media_remove_format(
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_attribute(&mut self, idx: u32, mut attr: SDPAttribute) -> Result<(), ()> { pub fn replace_attribute(&mut self, idx: u32, mut attr: SDPAttribute) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_replace_attribute( ffi::gst_sdp_media_replace_attribute(self.to_glib_none_mut().0, idx, &mut attr.0)
self.to_glib_none_mut().0,
idx,
&mut attr.0,
))
}; };
mem::forget(attr); mem::forget(attr);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_bandwidth(&mut self, idx: u32, mut bw: SDPBandwidth) -> Result<(), ()> { pub fn replace_bandwidth(&mut self, idx: u32, mut bw: SDPBandwidth) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_replace_bandwidth( ffi::gst_sdp_media_replace_bandwidth(self.to_glib_none_mut().0, idx, &mut bw.0)
self.to_glib_none_mut().0,
idx,
&mut bw.0,
))
}; };
mem::forget(bw); mem::forget(bw);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_connection(&mut self, idx: u32, mut conn: SDPConnection) -> Result<(), ()> { pub fn replace_connection(&mut self, idx: u32, mut conn: SDPConnection) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_replace_connection( ffi::gst_sdp_media_replace_connection(self.to_glib_none_mut().0, idx, &mut conn.0)
self.to_glib_none_mut().0,
idx,
&mut conn.0,
))
}; };
mem::forget(conn); mem::forget(conn);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_format(&mut self, idx: u32, format: &str) -> Result<(), ()> { pub fn replace_format(&mut self, idx: u32, format: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_replace_format( ffi::gst_sdp_media_replace_format(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
idx, idx,
format.to_glib_none().0, format.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_information(&mut self, information: &str) -> Result<(), ()> { pub fn set_information(&mut self, information: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_set_information( ffi::gst_sdp_media_set_information(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
information.to_glib_none().0, information.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_key(&mut self, type_: &str, data: &str) -> Result<(), ()> { pub fn set_key(&mut self, type_: &str, data: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_set_key( ffi::gst_sdp_media_set_key(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
type_.to_glib_none().0, type_.to_glib_none().0,
data.to_glib_none().0, data.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_media(&mut self, med: &str) -> Result<(), ()> { pub fn set_media(&mut self, med: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_set_media( ffi::gst_sdp_media_set_media(self.to_glib_none_mut().0, med.to_glib_none().0)
self.to_glib_none_mut().0,
med.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_port_info(&mut self, port: u32, num_ports: u32) -> Result<(), ()> { pub fn set_port_info(&mut self, port: u32, num_ports: u32) -> Result<(), ()> {
let result = unsafe { let result =
from_glib(ffi::gst_sdp_media_set_port_info( unsafe { ffi::gst_sdp_media_set_port_info(self.to_glib_none_mut().0, port, num_ports) };
self.to_glib_none_mut().0,
port,
num_ports,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_proto(&mut self, proto: &str) -> Result<(), ()> { pub fn set_proto(&mut self, proto: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_set_proto( ffi::gst_sdp_media_set_proto(self.to_glib_none_mut().0, proto.to_glib_none().0)
self.to_glib_none_mut().0,
proto.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -564,14 +500,14 @@ impl SDPMedia {
pub fn set_media_from_caps(caps: &gst::Caps, media: &mut SDPMedia) -> Result<(), ()> { pub fn set_media_from_caps(caps: &gst::Caps, media: &mut SDPMedia) -> Result<(), ()> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_media_set_media_from_caps( ffi::gst_sdp_media_set_media_from_caps(
caps.to_glib_none().0, caps.to_glib_none().0,
media.to_glib_none_mut().0, media.to_glib_none_mut().0,
)) )
}; };
mem::forget(media); mem::forget(media);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }

View file

@ -17,7 +17,6 @@ use gobject_ffi;
use gst; use gst;
use gst::MiniObject; use gst::MiniObject;
use SDPResult;
use s_d_p_attribute::SDPAttribute; use s_d_p_attribute::SDPAttribute;
use s_d_p_bandwidth::SDPBandwidth; use s_d_p_bandwidth::SDPBandwidth;
use s_d_p_connection::SDPConnection; use s_d_p_connection::SDPConnection;
@ -53,83 +52,77 @@ impl SDPMessage {
value: P, value: P,
) -> Result<(), ()> { ) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_add_attribute( ffi::gst_sdp_message_add_attribute(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
key.to_glib_none().0, key.to_glib_none().0,
value.into().to_glib_none().0, value.into().to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn add_email(&mut self, email: &str) -> Result<(), ()> { pub fn add_email(&mut self, email: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_add_email( ffi::gst_sdp_message_add_email(self.to_glib_none_mut().0, email.to_glib_none().0)
self.to_glib_none_mut().0,
email.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn add_media(&mut self, media: SDPMedia) -> Result<(), ()> { pub fn add_media(&mut self, media: SDPMedia) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_add_media( ffi::gst_sdp_message_add_media(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
media.to_glib_full() as *mut ffi::GstSDPMedia, media.to_glib_full() as *mut ffi::GstSDPMedia,
)) )
}; };
mem::forget(media); mem::forget(media);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn add_phone(&mut self, phone: &str) -> Result<(), ()> { pub fn add_phone(&mut self, phone: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_add_phone( ffi::gst_sdp_message_add_phone(self.to_glib_none_mut().0, phone.to_glib_none().0)
self.to_glib_none_mut().0,
phone.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn add_time(&mut self, start: &str, stop: &str, repeat: &[&str]) -> Result<(), ()> { pub fn add_time(&mut self, start: &str, stop: &str, repeat: &[&str]) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_add_time( ffi::gst_sdp_message_add_time(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
start.to_glib_none().0, start.to_glib_none().0,
stop.to_glib_none().0, stop.to_glib_none().0,
repeat.to_glib_none().0, repeat.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn add_zone(&mut self, adj_time: &str, typed_time: &str) -> Result<(), ()> { pub fn add_zone(&mut self, adj_time: &str, typed_time: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_add_zone( ffi::gst_sdp_message_add_zone(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
adj_time.to_glib_none().0, adj_time.to_glib_none().0,
typed_time.to_glib_none().0, typed_time.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -144,13 +137,10 @@ impl SDPMessage {
pub fn attributes_to_caps(&self, caps: &mut gst::CapsRef) -> Result<(), ()> { pub fn attributes_to_caps(&self, caps: &mut gst::CapsRef) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_attributes_to_caps( ffi::gst_sdp_message_attributes_to_caps(self.to_glib_none().0, caps.as_mut_ptr())
self.to_glib_none().0,
caps.as_mut_ptr(),
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -160,9 +150,9 @@ impl SDPMessage {
} }
pub fn dump(&self) -> Result<(), ()> { pub fn dump(&self) -> Result<(), ()> {
let result = unsafe { from_glib(ffi::gst_sdp_message_dump(self.to_glib_none().0)) }; let result = unsafe { ffi::gst_sdp_message_dump(self.to_glib_none().0) };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -386,88 +376,72 @@ impl SDPMessage {
pub fn insert_attribute(&mut self, idx: i32, mut attr: SDPAttribute) -> Result<(), ()> { pub fn insert_attribute(&mut self, idx: i32, mut attr: SDPAttribute) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_insert_attribute( ffi::gst_sdp_message_insert_attribute(self.to_glib_none_mut().0, idx, &mut attr.0)
self.to_glib_none_mut().0,
idx,
&mut attr.0,
))
}; };
mem::forget(attr); mem::forget(attr);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_bandwidth(&mut self, idx: i32, mut bw: SDPBandwidth) -> Result<(), ()> { pub fn insert_bandwidth(&mut self, idx: i32, mut bw: SDPBandwidth) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_insert_bandwidth( ffi::gst_sdp_message_insert_bandwidth(self.to_glib_none_mut().0, idx, &mut bw.0)
self.to_glib_none_mut().0,
idx,
&mut bw.0,
))
}; };
mem::forget(bw); mem::forget(bw);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_email(&mut self, idx: i32, email: &str) -> Result<(), ()> { pub fn insert_email(&mut self, idx: i32, email: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_insert_email( ffi::gst_sdp_message_insert_email(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
idx, idx,
email.to_glib_none().0, email.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_phone(&mut self, idx: i32, phone: &str) -> Result<(), ()> { pub fn insert_phone(&mut self, idx: i32, phone: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_insert_phone( ffi::gst_sdp_message_insert_phone(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
idx, idx,
phone.to_glib_none().0, phone.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_time(&mut self, idx: i32, mut time: SDPTime) -> Result<(), ()> { pub fn insert_time(&mut self, idx: i32, mut time: SDPTime) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_insert_time( ffi::gst_sdp_message_insert_time(self.to_glib_none_mut().0, idx, &mut time.0)
self.to_glib_none_mut().0,
idx,
&mut time.0,
))
}; };
mem::forget(time); mem::forget(time);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn insert_zone(&mut self, idx: i32, mut zone: SDPZone) -> Result<(), ()> { pub fn insert_zone(&mut self, idx: i32, mut zone: SDPZone) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_insert_zone( ffi::gst_sdp_message_insert_zone(self.to_glib_none_mut().0, idx, &mut zone.0)
self.to_glib_none_mut().0,
idx,
&mut zone.0,
))
}; };
mem::forget(zone); mem::forget(zone);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -478,15 +452,11 @@ impl SDPMessage {
#[cfg(any(feature = "v1_8_1", feature = "dox"))] #[cfg(any(feature = "v1_8_1", feature = "dox"))]
pub fn parse_keymgmt(&self, mikey: MIKEYMessage) -> Result<(), ()> { pub fn parse_keymgmt(&self, mikey: MIKEYMessage) -> Result<(), ()> {
let result = unsafe { let result =
from_glib(ffi::gst_sdp_message_parse_keymgmt( unsafe { ffi::gst_sdp_message_parse_keymgmt(self.to_glib_none().0, &mut mikey) };
self.to_glib_none().0,
&mut mikey,
))
};
mem::forget(mikey); mem::forget(mikey);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -496,167 +466,123 @@ impl SDPMessage {
} }
pub fn remove_attribute(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_attribute(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result =
from_glib(ffi::gst_sdp_message_remove_attribute( unsafe { ffi::gst_sdp_message_remove_attribute(self.to_glib_none_mut().0, idx) };
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_bandwidth(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_bandwidth(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result =
from_glib(ffi::gst_sdp_message_remove_bandwidth( unsafe { ffi::gst_sdp_message_remove_bandwidth(self.to_glib_none_mut().0, idx) };
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_email(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_email(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe { ffi::gst_sdp_message_remove_email(self.to_glib_none_mut().0, idx) };
from_glib(ffi::gst_sdp_message_remove_email(
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_phone(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_phone(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe { ffi::gst_sdp_message_remove_phone(self.to_glib_none_mut().0, idx) };
from_glib(ffi::gst_sdp_message_remove_phone(
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_time(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_time(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe { ffi::gst_sdp_message_remove_time(self.to_glib_none_mut().0, idx) };
from_glib(ffi::gst_sdp_message_remove_time(
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn remove_zone(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_zone(&mut self, idx: u32) -> Result<(), ()> {
let result = unsafe { let result = unsafe { ffi::gst_sdp_message_remove_zone(self.to_glib_none_mut().0, idx) };
from_glib(ffi::gst_sdp_message_remove_zone(
self.to_glib_none_mut().0,
idx,
))
};
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_attribute(&mut self, idx: u32, mut attr: SDPAttribute) -> Result<(), ()> { pub fn replace_attribute(&mut self, idx: u32, mut attr: SDPAttribute) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_replace_attribute( ffi::gst_sdp_message_replace_attribute(self.to_glib_none_mut().0, idx, &mut attr.0)
self.to_glib_none_mut().0,
idx,
&mut attr.0,
))
}; };
mem::forget(attr); mem::forget(attr);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_bandwidth(&mut self, idx: u32, mut bw: SDPBandwidth) -> Result<(), ()> { pub fn replace_bandwidth(&mut self, idx: u32, mut bw: SDPBandwidth) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_replace_bandwidth( ffi::gst_sdp_message_replace_bandwidth(self.to_glib_none_mut().0, idx, &mut bw.0)
self.to_glib_none_mut().0,
idx,
&mut bw.0,
))
}; };
mem::forget(bw); mem::forget(bw);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_email(&mut self, idx: u32, email: &str) -> Result<(), ()> { pub fn replace_email(&mut self, idx: u32, email: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_replace_email( ffi::gst_sdp_message_replace_email(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
idx, idx,
email.to_glib_none().0, email.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_phone(&mut self, idx: u32, phone: &str) -> Result<(), ()> { pub fn replace_phone(&mut self, idx: u32, phone: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_replace_phone( ffi::gst_sdp_message_replace_phone(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
idx, idx,
phone.to_glib_none().0, phone.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_time(&mut self, idx: u32, mut time: SDPTime) -> Result<(), ()> { pub fn replace_time(&mut self, idx: u32, mut time: SDPTime) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_replace_time( ffi::gst_sdp_message_replace_time(self.to_glib_none_mut().0, idx, &mut time.0)
self.to_glib_none_mut().0,
idx,
&mut time.0,
))
}; };
mem::forget(time); mem::forget(time);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn replace_zone(&mut self, idx: u32, mut zone: SDPZone) -> Result<(), ()> { pub fn replace_zone(&mut self, idx: u32, mut zone: SDPZone) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_replace_zone( ffi::gst_sdp_message_replace_zone(self.to_glib_none_mut().0, idx, &mut zone.0)
self.to_glib_none_mut().0,
idx,
&mut zone.0,
))
}; };
mem::forget(zone); mem::forget(zone);
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -670,44 +596,44 @@ impl SDPMessage {
addr_number: u32, addr_number: u32,
) -> Result<(), ()> { ) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_set_connection( ffi::gst_sdp_message_set_connection(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
nettype.to_glib_none().0, nettype.to_glib_none().0,
addrtype.to_glib_none().0, addrtype.to_glib_none().0,
address.to_glib_none().0, address.to_glib_none().0,
ttl, ttl,
addr_number, addr_number,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_information(&mut self, information: &str) -> Result<(), ()> { pub fn set_information(&mut self, information: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_set_information( ffi::gst_sdp_message_set_information(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
information.to_glib_none().0, information.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_key(&mut self, type_: &str, data: &str) -> Result<(), ()> { pub fn set_key(&mut self, type_: &str, data: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_set_key( ffi::gst_sdp_message_set_key(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
type_.to_glib_none().0, type_.to_glib_none().0,
data.to_glib_none().0, data.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -722,7 +648,7 @@ impl SDPMessage {
addr: &str, addr: &str,
) -> Result<(), ()> { ) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_set_origin( ffi::gst_sdp_message_set_origin(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
username.to_glib_none().0, username.to_glib_none().0,
sess_id.to_glib_none().0, sess_id.to_glib_none().0,
@ -730,49 +656,43 @@ impl SDPMessage {
nettype.to_glib_none().0, nettype.to_glib_none().0,
addrtype.to_glib_none().0, addrtype.to_glib_none().0,
addr.to_glib_none().0, addr.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_session_name(&mut self, session_name: &str) -> Result<(), ()> { pub fn set_session_name(&mut self, session_name: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_set_session_name( ffi::gst_sdp_message_set_session_name(
self.to_glib_none_mut().0, self.to_glib_none_mut().0,
session_name.to_glib_none().0, session_name.to_glib_none().0,
)) )
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_uri(&mut self, uri: &str) -> Result<(), ()> { pub fn set_uri(&mut self, uri: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_set_uri( ffi::gst_sdp_message_set_uri(self.to_glib_none_mut().0, uri.to_glib_none().0)
self.to_glib_none_mut().0,
uri.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
pub fn set_version(&mut self, version: &str) -> Result<(), ()> { pub fn set_version(&mut self, version: &str) -> Result<(), ()> {
let result = unsafe { let result = unsafe {
from_glib(ffi::gst_sdp_message_set_version( ffi::gst_sdp_message_set_version(self.to_glib_none_mut().0, version.to_glib_none().0)
self.to_glib_none_mut().0,
version.to_glib_none().0,
))
}; };
match result { match result {
SDPResult::Ok => Ok(()), ffi::GST_SDP_OK => Ok(()),
_ => Err(()), _ => Err(()),
} }
} }
@ -801,13 +721,9 @@ impl SDPMessage {
let size = data.len() as u32; let size = data.len() as u32;
let msg = glib_ffi::g_malloc0(mem::size_of::<ffi::GstSDPMessage>()) let msg = glib_ffi::g_malloc0(mem::size_of::<ffi::GstSDPMessage>())
as *mut ffi::GstSDPMessage; as *mut ffi::GstSDPMessage;
let result = from_glib(ffi::gst_sdp_message_parse_buffer( let result = ffi::gst_sdp_message_parse_buffer(data.to_glib_none().0, size, msg);
data.to_glib_none().0,
size,
msg,
));
match result { match result {
SDPResult::Ok => Ok(from_glib_full(msg)), ffi::GST_SDP_OK => Ok(from_glib_full(msg)),
_ => { _ => {
glib_ffi::g_free(msg as *mut _); glib_ffi::g_free(msg as *mut _);
Err(()) Err(())
@ -821,9 +737,9 @@ impl SDPMessage {
unsafe { unsafe {
let msg = glib_ffi::g_malloc0(mem::size_of::<ffi::GstSDPMessage>()) let msg = glib_ffi::g_malloc0(mem::size_of::<ffi::GstSDPMessage>())
as *mut ffi::GstSDPMessage; as *mut ffi::GstSDPMessage;
let result = from_glib(ffi::gst_sdp_message_parse_uri(uri.to_glib_none().0, msg)); let result = ffi::gst_sdp_message_parse_uri(uri.to_glib_none().0, msg);
match result { match result {
SDPResult::Ok => Ok(from_glib_full(msg)), ffi::GST_SDP_OK => Ok(from_glib_full(msg)),
_ => { _ => {
glib_ffi::g_free(msg as *mut _); glib_ffi::g_free(msg as *mut _);
Err(()) Err(())

View file

@ -13,8 +13,6 @@ use std::os::raw::c_char;
use ffi; use ffi;
use glib::translate::*; use glib::translate::*;
use auto::SDPResult;
#[repr(C)] #[repr(C)]
pub struct SDPTime(pub(crate) ffi::GstSDPTime); pub struct SDPTime(pub(crate) ffi::GstSDPTime);
@ -23,14 +21,14 @@ impl SDPTime {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
let mut time = mem::zeroed(); let mut time = mem::zeroed();
let result = from_glib(ffi::gst_sdp_time_set( let result = ffi::gst_sdp_time_set(
&mut time, &mut time,
start.to_glib_none().0, start.to_glib_none().0,
stop.to_glib_none().0, stop.to_glib_none().0,
repeat.to_glib_none().0, repeat.to_glib_none().0,
)); );
match result { match result {
SDPResult::Ok => Ok(SDPTime(time)), ffi::GST_SDP_OK => Ok(SDPTime(time)),
_ => Err(()), _ => Err(()),
} }
} }

View file

@ -12,8 +12,6 @@ use std::mem;
use ffi; use ffi;
use glib::translate::*; use glib::translate::*;
use auto::SDPResult;
#[repr(C)] #[repr(C)]
pub struct SDPZone(pub(crate) ffi::GstSDPZone); pub struct SDPZone(pub(crate) ffi::GstSDPZone);
@ -22,13 +20,13 @@ impl SDPZone {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
let mut zone = mem::zeroed(); let mut zone = mem::zeroed();
let result = from_glib(ffi::gst_sdp_zone_set( let result = ffi::gst_sdp_zone_set(
&mut zone, &mut zone,
time.to_glib_none().0, time.to_glib_none().0,
typed_time.to_glib_none().0, typed_time.to_glib_none().0,
)); );
match result { match result {
SDPResult::Ok => Ok(SDPZone(zone)), ffi::GST_SDP_OK => Ok(SDPZone(zone)),
_ => Err(()), _ => Err(()),
} }
} }