diff --git a/Gir_GstSdp.toml b/Gir_GstSdp.toml index a021bf8f3..3d8f00a72 100644 --- a/Gir_GstSdp.toml +++ b/Gir_GstSdp.toml @@ -32,6 +32,7 @@ generate = [ ] manual = [ + "GLib.Bytes", ] [[object]] @@ -40,21 +41,23 @@ status = "manual" ref_mode = "ref" [[object]] -name = "GstSdp.SDPMessage" +name = "GstSdp.MIKEYMessage" status = "generate" -use_boxed_functions = true - [[object.function]] - name = "new" - # special return type... + name = "replace_payload" ignore = true [[object.function]] - name = "uninit" - # unsafe + name = "insert_payload" ignore = true + [[object.function]] + name = "add_payload" + ignore = true [[object]] -name = "GstSdp.SDPMedia" +name = "GstSdp.MIKEYPayload" status = "generate" + [[object.function]] + name = "kemac_add_sub" + ignore = true diff --git a/gstreamer-sdp/src/auto/enums.rs b/gstreamer-sdp/src/auto/enums.rs index d8f1f80b4..1211f9321 100644 --- a/gstreamer-sdp/src/auto/enums.rs +++ b/gstreamer-sdp/src/auto/enums.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ 6855214) +// This file was generated by gir (https://github.com/gtk-rs/gir @ 7f5a2b5) // from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT diff --git a/gstreamer-sdp/src/auto/flags.rs b/gstreamer-sdp/src/auto/flags.rs index 1e1712f99..08f4b19cd 100644 --- a/gstreamer-sdp/src/auto/flags.rs +++ b/gstreamer-sdp/src/auto/flags.rs @@ -1,4 +1,4 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ 6855214) +// This file was generated by gir (https://github.com/gtk-rs/gir @ 7f5a2b5) // from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT diff --git a/gstreamer-sdp/src/auto/m_i_k_e_y_message.rs b/gstreamer-sdp/src/auto/m_i_k_e_y_message.rs new file mode 100644 index 000000000..96e85ae16 --- /dev/null +++ b/gstreamer-sdp/src/auto/m_i_k_e_y_message.rs @@ -0,0 +1,166 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 7f5a2b5) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use MIKEYCacheType; +use MIKEYMapType; +use MIKEYPRFFunc; +use MIKEYPayload; +use MIKEYPayloadType; +use MIKEYType; +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct MIKEYMessage(Boxed); + + match fn { + copy => |ptr| gobject_ffi::g_boxed_copy(ffi::gst_mikey_message_get_type(), ptr as *mut _) as *mut ffi::GstMIKEYMessage, + free => |ptr| gobject_ffi::g_boxed_free(ffi::gst_mikey_message_get_type(), ptr as *mut _), + get_type => || ffi::gst_mikey_message_get_type(), + } +} + +impl MIKEYMessage { + pub fn new() -> MIKEYMessage { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_mikey_message_new()) + } + } + + //pub fn new_from_bytes(bytes: &glib::Bytes, info: /*Ignored*/&mut MIKEYDecryptInfo, error: /*Ignored*/Option) -> MIKEYMessage { + // unsafe { TODO: call ffi::gst_mikey_message_new_from_bytes() } + //} + + pub fn new_from_caps(caps: &gst::Caps) -> MIKEYMessage { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_mikey_message_new_from_caps(caps.to_glib_none().0)) + } + } + + //pub fn new_from_data(data: &[u8], info: /*Ignored*/&mut MIKEYDecryptInfo, error: /*Ignored*/Option) -> MIKEYMessage { + // unsafe { TODO: call ffi::gst_mikey_message_new_from_data() } + //} + + pub fn add_cs_srtp(&mut self, policy: u8, ssrc: u32, roc: u32) -> bool { + unsafe { + from_glib(ffi::gst_mikey_message_add_cs_srtp(self.to_glib_none_mut().0, policy, ssrc, roc)) + } + } + + pub fn add_pke(&mut self, C: MIKEYCacheType, data: &[u8]) -> bool { + let data_len = data.len() as u16; + unsafe { + from_glib(ffi::gst_mikey_message_add_pke(self.to_glib_none_mut().0, C.to_glib(), data_len, data.to_glib_none().0)) + } + } + + pub fn add_rand(&mut self, rand: &[u8]) -> bool { + let len = rand.len() as u8; + unsafe { + from_glib(ffi::gst_mikey_message_add_rand(self.to_glib_none_mut().0, len, rand.to_glib_none().0)) + } + } + + pub fn add_rand_len(&mut self, len: u8) -> bool { + unsafe { + from_glib(ffi::gst_mikey_message_add_rand_len(self.to_glib_none_mut().0, len)) + } + } + + //pub fn add_t(&mut self, type_: MIKEYTSType, ts_value: &[u8]) -> bool { + // unsafe { TODO: call ffi::gst_mikey_message_add_t() } + //} + + pub fn add_t_now_ntp_utc(&mut self) -> bool { + unsafe { + from_glib(ffi::gst_mikey_message_add_t_now_ntp_utc(self.to_glib_none_mut().0)) + } + } + + pub fn base64_encode(&mut self) -> Option { + unsafe { + from_glib_full(ffi::gst_mikey_message_base64_encode(self.to_glib_none_mut().0)) + } + } + + pub fn find_payload(&self, type_: MIKEYPayloadType, nth: u32) -> Option { + unsafe { + from_glib_none(ffi::gst_mikey_message_find_payload(self.to_glib_none().0, type_.to_glib(), nth)) + } + } + + //pub fn get_cs_srtp(&self, idx: u32) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_mikey_message_get_cs_srtp() } + //} + + pub fn get_n_cs(&self) -> u32 { + unsafe { + ffi::gst_mikey_message_get_n_cs(self.to_glib_none().0) + } + } + + pub fn get_n_payloads(&self) -> u32 { + unsafe { + ffi::gst_mikey_message_get_n_payloads(self.to_glib_none().0) + } + } + + pub fn get_payload(&self, idx: u32) -> Option { + unsafe { + from_glib_none(ffi::gst_mikey_message_get_payload(self.to_glib_none().0, idx)) + } + } + + //pub fn insert_cs_srtp(&mut self, idx: i32, map: /*Ignored*/&MIKEYMapSRTP) -> bool { + // unsafe { TODO: call ffi::gst_mikey_message_insert_cs_srtp() } + //} + + pub fn remove_cs_srtp(&mut self, idx: i32) -> bool { + unsafe { + from_glib(ffi::gst_mikey_message_remove_cs_srtp(self.to_glib_none_mut().0, idx)) + } + } + + pub fn remove_payload(&mut self, idx: u32) -> bool { + unsafe { + from_glib(ffi::gst_mikey_message_remove_payload(self.to_glib_none_mut().0, idx)) + } + } + + //pub fn replace_cs_srtp(&mut self, idx: i32, map: /*Ignored*/&MIKEYMapSRTP) -> bool { + // unsafe { TODO: call ffi::gst_mikey_message_replace_cs_srtp() } + //} + + pub fn set_info(&mut self, version: u8, type_: MIKEYType, V: bool, prf_func: MIKEYPRFFunc, CSB_id: u32, map_type: MIKEYMapType) -> bool { + unsafe { + from_glib(ffi::gst_mikey_message_set_info(self.to_glib_none_mut().0, version, type_.to_glib(), V.to_glib(), prf_func.to_glib(), CSB_id, map_type.to_glib())) + } + } + + //pub fn to_bytes(&mut self, info: /*Ignored*/&mut MIKEYEncryptInfo, error: /*Ignored*/Option) -> Option { + // unsafe { TODO: call ffi::gst_mikey_message_to_bytes() } + //} + + #[cfg(any(feature = "v1_8_1", feature = "dox"))] + pub fn to_caps(&self, caps: &gst::Caps) -> bool { + unsafe { + from_glib(ffi::gst_mikey_message_to_caps(self.to_glib_none().0, caps.to_glib_none().0)) + } + } +} + +impl Default for MIKEYMessage { + fn default() -> Self { + Self::new() + } +} + +unsafe impl Send for MIKEYMessage {} diff --git a/gstreamer-sdp/src/auto/m_i_k_e_y_payload.rs b/gstreamer-sdp/src/auto/m_i_k_e_y_payload.rs new file mode 100644 index 000000000..cdf8d5f5a --- /dev/null +++ b/gstreamer-sdp/src/auto/m_i_k_e_y_payload.rs @@ -0,0 +1,137 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir @ 7f5a2b5) +// from gir-files (https://github.com/gtk-rs/gir-files @ ???) +// DO NOT EDIT + +use MIKEYCacheType; +use MIKEYEncAlg; +use MIKEYKeyDataType; +use MIKEYMacAlg; +use MIKEYPayloadType; +use MIKEYSecProto; +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct MIKEYPayload(Boxed); + + match fn { + copy => |ptr| gobject_ffi::g_boxed_copy(ffi::gst_mikey_payload_get_type(), ptr as *mut _) as *mut ffi::GstMIKEYPayload, + free => |ptr| gobject_ffi::g_boxed_free(ffi::gst_mikey_payload_get_type(), ptr as *mut _), + get_type => || ffi::gst_mikey_payload_get_type(), + } +} + +impl MIKEYPayload { + pub fn new(type_: MIKEYPayloadType) -> MIKEYPayload { + assert_initialized_main_thread!(); + unsafe { + from_glib_full(ffi::gst_mikey_payload_new(type_.to_glib())) + } + } + + pub fn kemac_get_n_sub(&self) -> u32 { + unsafe { + ffi::gst_mikey_payload_kemac_get_n_sub(self.to_glib_none().0) + } + } + + pub fn kemac_get_sub(&self, idx: u32) -> Option { + unsafe { + from_glib_none(ffi::gst_mikey_payload_kemac_get_sub(self.to_glib_none().0, idx)) + } + } + + pub fn kemac_remove_sub(&mut self, idx: u32) -> bool { + unsafe { + from_glib(ffi::gst_mikey_payload_kemac_remove_sub(self.to_glib_none_mut().0, idx)) + } + } + + pub fn kemac_set(&mut self, enc_alg: MIKEYEncAlg, mac_alg: MIKEYMacAlg) -> bool { + unsafe { + from_glib(ffi::gst_mikey_payload_kemac_set(self.to_glib_none_mut().0, enc_alg.to_glib(), mac_alg.to_glib())) + } + } + + pub fn key_data_set_interval(&mut self, vf_len: u8, vt_data: &[u8]) -> bool { + let vf_data = vf_data.len() as Vec; + let vt_len = vt_data.len() as u8; + unsafe { + from_glib(ffi::gst_mikey_payload_key_data_set_interval(self.to_glib_none_mut().0, vf_len, vf_data.to_glib_none().0, vt_len, vt_data.to_glib_none().0)) + } + } + + pub fn key_data_set_key(&mut self, key_type: MIKEYKeyDataType, key_data: &[u8]) -> bool { + let key_len = key_data.len() as u16; + unsafe { + from_glib(ffi::gst_mikey_payload_key_data_set_key(self.to_glib_none_mut().0, key_type.to_glib(), key_len, key_data.to_glib_none().0)) + } + } + + pub fn key_data_set_salt(&mut self, salt_data: &[u8]) -> bool { + let salt_len = salt_data.len() as u16; + unsafe { + from_glib(ffi::gst_mikey_payload_key_data_set_salt(self.to_glib_none_mut().0, salt_len, salt_data.to_glib_none().0)) + } + } + + pub fn key_data_set_spi(&mut self, spi_data: &[u8]) -> bool { + let spi_len = spi_data.len() as u8; + unsafe { + from_glib(ffi::gst_mikey_payload_key_data_set_spi(self.to_glib_none_mut().0, spi_len, spi_data.to_glib_none().0)) + } + } + + pub fn pke_set(&mut self, C: MIKEYCacheType, data: &[u8]) -> bool { + let data_len = data.len() as u16; + unsafe { + from_glib(ffi::gst_mikey_payload_pke_set(self.to_glib_none_mut().0, C.to_glib(), data_len, data.to_glib_none().0)) + } + } + + pub fn rand_set(&mut self, rand: &[u8]) -> bool { + let len = rand.len() as u8; + unsafe { + from_glib(ffi::gst_mikey_payload_rand_set(self.to_glib_none_mut().0, len, rand.to_glib_none().0)) + } + } + + pub fn sp_add_param(&mut self, type_: u8, val: &[u8]) -> bool { + let len = val.len() as u8; + unsafe { + from_glib(ffi::gst_mikey_payload_sp_add_param(self.to_glib_none_mut().0, type_, len, val.to_glib_none().0)) + } + } + + pub fn sp_get_n_params(&self) -> u32 { + unsafe { + ffi::gst_mikey_payload_sp_get_n_params(self.to_glib_none().0) + } + } + + //pub fn sp_get_param(&self, idx: u32) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::gst_mikey_payload_sp_get_param() } + //} + + pub fn sp_remove_param(&mut self, idx: u32) -> bool { + unsafe { + from_glib(ffi::gst_mikey_payload_sp_remove_param(self.to_glib_none_mut().0, idx)) + } + } + + pub fn sp_set(&mut self, policy: u32, proto: MIKEYSecProto) -> bool { + unsafe { + from_glib(ffi::gst_mikey_payload_sp_set(self.to_glib_none_mut().0, policy, proto.to_glib())) + } + } + + //pub fn t_set(&mut self, type_: MIKEYTSType, ts_value: &[u8]) -> bool { + // unsafe { TODO: call ffi::gst_mikey_payload_t_set() } + //} +} + +unsafe impl Send for MIKEYPayload {} diff --git a/gstreamer-sdp/src/auto/mod.rs b/gstreamer-sdp/src/auto/mod.rs index e4c15ef28..04ea3b687 100644 --- a/gstreamer-sdp/src/auto/mod.rs +++ b/gstreamer-sdp/src/auto/mod.rs @@ -1,12 +1,12 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ 6855214) +// This file was generated by gir (https://github.com/gtk-rs/gir @ 7f5a2b5) // from gir-files (https://github.com/gtk-rs/gir-files @ ???) // DO NOT EDIT -mod s_d_p_media; -pub use self::s_d_p_media::SDPMedia; +mod m_i_k_e_y_message; +pub use self::m_i_k_e_y_message::MIKEYMessage; -mod s_d_p_message; -pub use self::s_d_p_message::SDPMessage; +mod m_i_k_e_y_payload; +pub use self::m_i_k_e_y_payload::MIKEYPayload; mod enums; pub use self::enums::MIKEYCacheType; diff --git a/gstreamer-sdp/src/auto/s_d_p_media.rs b/gstreamer-sdp/src/auto/s_d_p_media.rs deleted file mode 100644 index 55eb2be86..000000000 --- a/gstreamer-sdp/src/auto/s_d_p_media.rs +++ /dev/null @@ -1,285 +0,0 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) -// from gir-files (https://github.com/gtk-rs/gir-files @ ???) -// DO NOT EDIT - -use SDPResult; -use ffi; -use glib::translate::*; -use glib_ffi; -use gst; -use std::mem; -use std::ptr; - -glib_wrapper! { - pub struct SDPMedia(Boxed); - - match fn { - copy => |ptr| ffi::gst_sdp_media_copy(mut_override(ptr)), - free => |ptr| ffi::gst_sdp_media_free(ptr), - } -} - -impl SDPMedia { - pub fn add_attribute<'a, P: Into>>(&mut self, key: &str, value: P) -> SDPResult { - let value = value.into(); - let value = value.to_glib_none(); - unsafe { - from_glib(ffi::gst_sdp_media_add_attribute(self.to_glib_none_mut().0, key.to_glib_none().0, value.0)) - } - } - - pub fn add_bandwidth(&mut self, bwtype: &str, bandwidth: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_add_bandwidth(self.to_glib_none_mut().0, bwtype.to_glib_none().0, bandwidth)) - } - } - - pub fn add_connection(&mut self, nettype: &str, addrtype: &str, address: &str, ttl: u32, addr_number: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_add_connection(self.to_glib_none_mut().0, nettype.to_glib_none().0, addrtype.to_glib_none().0, address.to_glib_none().0, ttl, addr_number)) - } - } - - pub fn add_format(&mut self, format: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_add_format(self.to_glib_none_mut().0, format.to_glib_none().0)) - } - } - - pub fn as_text(&self) -> Option { - unsafe { - from_glib_full(ffi::gst_sdp_media_as_text(self.to_glib_none().0)) - } - } - - pub fn attributes_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_media_attributes_len(self.to_glib_none().0) - } - } - - pub fn attributes_to_caps(&self, caps: &gst::Caps) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_attributes_to_caps(self.to_glib_none().0, caps.to_glib_none().0)) - } - } - - pub fn bandwidths_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_media_bandwidths_len(self.to_glib_none().0) - } - } - - pub fn connections_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_media_connections_len(self.to_glib_none().0) - } - } - - pub fn formats_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_media_formats_len(self.to_glib_none().0) - } - } - - //pub fn get_attribute(&self, idx: u32) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_media_get_attribute() } - //} - - pub fn get_attribute_val(&self, key: &str) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_media_get_attribute_val(self.to_glib_none().0, key.to_glib_none().0)) - } - } - - pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_media_get_attribute_val_n(self.to_glib_none().0, key.to_glib_none().0, nth)) - } - } - - //pub fn get_bandwidth(&self, idx: u32) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_media_get_bandwidth() } - //} - - pub fn get_caps_from_media(&self, pt: i32) -> Option { - unsafe { - from_glib_full(ffi::gst_sdp_media_get_caps_from_media(self.to_glib_none().0, pt)) - } - } - - //pub fn get_connection(&self, idx: u32) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_media_get_connection() } - //} - - pub fn get_format(&self, idx: u32) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_media_get_format(self.to_glib_none().0, idx)) - } - } - - pub fn get_information(&self) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_media_get_information(self.to_glib_none().0)) - } - } - - //pub fn get_key(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_media_get_key() } - //} - - pub fn get_media(&self) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_media_get_media(self.to_glib_none().0)) - } - } - - pub fn get_num_ports(&self) -> u32 { - unsafe { - ffi::gst_sdp_media_get_num_ports(self.to_glib_none().0) - } - } - - pub fn get_port(&self) -> u32 { - unsafe { - ffi::gst_sdp_media_get_port(self.to_glib_none().0) - } - } - - pub fn get_proto(&self) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_media_get_proto(self.to_glib_none().0)) - } - } - - pub fn init(&mut self) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_init(self.to_glib_none_mut().0)) - } - } - - //pub fn insert_attribute(&mut self, idx: i32, attr: /*Ignored*/&mut SDPAttribute) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_media_insert_attribute() } - //} - - //pub fn insert_bandwidth(&mut self, idx: i32, bw: /*Ignored*/&mut SDPBandwidth) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_media_insert_bandwidth() } - //} - - //pub fn insert_connection(&mut self, idx: i32, conn: /*Ignored*/&mut SDPConnection) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_media_insert_connection() } - //} - - pub fn insert_format(&mut self, idx: i32, format: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_insert_format(self.to_glib_none_mut().0, idx, format.to_glib_none().0)) - } - } - - //#[cfg(any(feature = "v1_8_1", feature = "dox"))] - //pub fn parse_keymgmt(&self, mikey: /*Ignored*/MIKEYMessage) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_media_parse_keymgmt() } - //} - - pub fn remove_attribute(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_remove_attribute(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_bandwidth(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_remove_bandwidth(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_connection(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_remove_connection(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_format(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_remove_format(self.to_glib_none_mut().0, idx)) - } - } - - //pub fn replace_attribute(&mut self, idx: u32, attr: /*Ignored*/&mut SDPAttribute) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_media_replace_attribute() } - //} - - //pub fn replace_bandwidth(&mut self, idx: u32, bw: /*Ignored*/&mut SDPBandwidth) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_media_replace_bandwidth() } - //} - - //pub fn replace_connection(&mut self, idx: u32, conn: /*Ignored*/&mut SDPConnection) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_media_replace_connection() } - //} - - pub fn replace_format(&mut self, idx: u32, format: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_replace_format(self.to_glib_none_mut().0, idx, format.to_glib_none().0)) - } - } - - pub fn set_information(&mut self, information: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_set_information(self.to_glib_none_mut().0, information.to_glib_none().0)) - } - } - - pub fn set_key(&mut self, type_: &str, data: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_set_key(self.to_glib_none_mut().0, type_.to_glib_none().0, data.to_glib_none().0)) - } - } - - pub fn set_media(&mut self, med: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_set_media(self.to_glib_none_mut().0, med.to_glib_none().0)) - } - } - - pub fn set_port_info(&mut self, port: u32, num_ports: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_set_port_info(self.to_glib_none_mut().0, port, num_ports)) - } - } - - pub fn set_proto(&mut self, proto: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_set_proto(self.to_glib_none_mut().0, proto.to_glib_none().0)) - } - } - - pub fn uninit(&mut self) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_media_uninit(self.to_glib_none_mut().0)) - } - } - - pub fn new() -> (SDPResult, SDPMedia) { - assert_initialized_main_thread!(); - unsafe { - let mut media = ptr::null_mut(); - let ret = from_glib(ffi::gst_sdp_media_new(&mut media)); - (ret, from_glib_full(media)) - } - } - - pub fn set_media_from_caps(caps: &gst::Caps, media: &mut SDPMedia) -> SDPResult { - assert_initialized_main_thread!(); - unsafe { - from_glib(ffi::gst_sdp_media_set_media_from_caps(caps.to_glib_none().0, media.to_glib_none_mut().0)) - } - } -} - -impl Default for SDPMedia { - fn default() -> Self { - Self::new() - } -} - -unsafe impl Send for SDPMedia {} diff --git a/gstreamer-sdp/src/auto/s_d_p_message.rs b/gstreamer-sdp/src/auto/s_d_p_message.rs deleted file mode 100644 index a047d333e..000000000 --- a/gstreamer-sdp/src/auto/s_d_p_message.rs +++ /dev/null @@ -1,380 +0,0 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) -// from gir-files (https://github.com/gtk-rs/gir-files @ ???) -// DO NOT EDIT - -use SDPMedia; -use SDPResult; -use ffi; -use glib::translate::*; -use glib_ffi; -use gobject_ffi; -use gst; -use std::mem; -use std::ptr; - -glib_wrapper! { - pub struct SDPMessage(Boxed); - - match fn { - copy => |ptr| gobject_ffi::g_boxed_copy(ffi::gst_sdp_message_get_type(), ptr as *mut _) as *mut ffi::GstSDPMessage, - free => |ptr| gobject_ffi::g_boxed_free(ffi::gst_sdp_message_get_type(), ptr as *mut _), - get_type => || ffi::gst_sdp_message_get_type(), - } -} - -impl SDPMessage { - pub fn add_attribute<'a, P: Into>>(&mut self, key: &str, value: P) -> SDPResult { - let value = value.into(); - let value = value.to_glib_none(); - unsafe { - from_glib(ffi::gst_sdp_message_add_attribute(self.to_glib_none_mut().0, key.to_glib_none().0, value.0)) - } - } - - pub fn add_bandwidth(&mut self, bwtype: &str, bandwidth: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_add_bandwidth(self.to_glib_none_mut().0, bwtype.to_glib_none().0, bandwidth)) - } - } - - pub fn add_email(&mut self, email: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_add_email(self.to_glib_none_mut().0, email.to_glib_none().0)) - } - } - - pub fn add_media(&mut self, media: &mut SDPMedia) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_add_media(self.to_glib_none_mut().0, media.to_glib_none_mut().0)) - } - } - - pub fn add_phone(&mut self, phone: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_add_phone(self.to_glib_none_mut().0, phone.to_glib_none().0)) - } - } - - pub fn add_time(&mut self, start: &str, stop: &str, repeat: &[&str]) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_add_time(self.to_glib_none_mut().0, start.to_glib_none().0, stop.to_glib_none().0, repeat.to_glib_none().0)) - } - } - - pub fn add_zone(&mut self, adj_time: &str, typed_time: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_add_zone(self.to_glib_none_mut().0, adj_time.to_glib_none().0, typed_time.to_glib_none().0)) - } - } - - pub fn as_text(&self) -> Option { - unsafe { - from_glib_full(ffi::gst_sdp_message_as_text(self.to_glib_none().0)) - } - } - - pub fn attributes_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_message_attributes_len(self.to_glib_none().0) - } - } - - pub fn attributes_to_caps(&self, caps: &gst::Caps) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_attributes_to_caps(self.to_glib_none().0, caps.to_glib_none().0)) - } - } - - pub fn bandwidths_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_message_bandwidths_len(self.to_glib_none().0) - } - } - - pub fn dump(&self) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_dump(self.to_glib_none().0)) - } - } - - pub fn emails_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_message_emails_len(self.to_glib_none().0) - } - } - - //pub fn get_attribute(&self, idx: u32) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_message_get_attribute() } - //} - - pub fn get_attribute_val(&self, key: &str) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_attribute_val(self.to_glib_none().0, key.to_glib_none().0)) - } - } - - pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_attribute_val_n(self.to_glib_none().0, key.to_glib_none().0, nth)) - } - } - - //pub fn get_bandwidth(&self, idx: u32) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_message_get_bandwidth() } - //} - - //pub fn get_connection(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_message_get_connection() } - //} - - pub fn get_email(&self, idx: u32) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_email(self.to_glib_none().0, idx)) - } - } - - pub fn get_information(&self) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_information(self.to_glib_none().0)) - } - } - - //pub fn get_key(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_message_get_key() } - //} - - pub fn get_media(&self, idx: u32) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_media(self.to_glib_none().0, idx)) - } - } - - //pub fn get_origin(&self) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_message_get_origin() } - //} - - pub fn get_phone(&self, idx: u32) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_phone(self.to_glib_none().0, idx)) - } - } - - pub fn get_session_name(&self) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_session_name(self.to_glib_none().0)) - } - } - - //pub fn get_time(&self, idx: u32) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_message_get_time() } - //} - - pub fn get_uri(&self) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_uri(self.to_glib_none().0)) - } - } - - pub fn get_version(&self) -> Option { - unsafe { - from_glib_none(ffi::gst_sdp_message_get_version(self.to_glib_none().0)) - } - } - - //pub fn get_zone(&self, idx: u32) -> /*Ignored*/Option { - // unsafe { TODO: call ffi::gst_sdp_message_get_zone() } - //} - - pub fn init(&mut self) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_init(self.to_glib_none_mut().0)) - } - } - - //pub fn insert_attribute(&mut self, idx: i32, attr: /*Ignored*/&mut SDPAttribute) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_insert_attribute() } - //} - - //pub fn insert_bandwidth(&mut self, idx: i32, bw: /*Ignored*/&mut SDPBandwidth) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_insert_bandwidth() } - //} - - pub fn insert_email(&mut self, idx: i32, email: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_insert_email(self.to_glib_none_mut().0, idx, email.to_glib_none().0)) - } - } - - pub fn insert_phone(&mut self, idx: i32, phone: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_insert_phone(self.to_glib_none_mut().0, idx, phone.to_glib_none().0)) - } - } - - //pub fn insert_time(&mut self, idx: i32, t: /*Ignored*/&mut SDPTime) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_insert_time() } - //} - - //pub fn insert_zone(&mut self, idx: i32, zone: /*Ignored*/&mut SDPZone) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_insert_zone() } - //} - - pub fn medias_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_message_medias_len(self.to_glib_none().0) - } - } - - //#[cfg(any(feature = "v1_8_1", feature = "dox"))] - //pub fn parse_keymgmt(&self, mikey: /*Ignored*/MIKEYMessage) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_parse_keymgmt() } - //} - - pub fn phones_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_message_phones_len(self.to_glib_none().0) - } - } - - pub fn remove_attribute(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_remove_attribute(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_bandwidth(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_remove_bandwidth(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_email(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_remove_email(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_phone(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_remove_phone(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_time(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_remove_time(self.to_glib_none_mut().0, idx)) - } - } - - pub fn remove_zone(&mut self, idx: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_remove_zone(self.to_glib_none_mut().0, idx)) - } - } - - //pub fn replace_attribute(&mut self, idx: u32, attr: /*Ignored*/&mut SDPAttribute) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_replace_attribute() } - //} - - //pub fn replace_bandwidth(&mut self, idx: u32, bw: /*Ignored*/&mut SDPBandwidth) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_replace_bandwidth() } - //} - - pub fn replace_email(&mut self, idx: u32, email: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_replace_email(self.to_glib_none_mut().0, idx, email.to_glib_none().0)) - } - } - - pub fn replace_phone(&mut self, idx: u32, phone: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_replace_phone(self.to_glib_none_mut().0, idx, phone.to_glib_none().0)) - } - } - - //pub fn replace_time(&mut self, idx: u32, t: /*Ignored*/&mut SDPTime) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_replace_time() } - //} - - //pub fn replace_zone(&mut self, idx: u32, zone: /*Ignored*/&mut SDPZone) -> SDPResult { - // unsafe { TODO: call ffi::gst_sdp_message_replace_zone() } - //} - - pub fn set_connection(&mut self, nettype: &str, addrtype: &str, address: &str, ttl: u32, addr_number: u32) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_set_connection(self.to_glib_none_mut().0, nettype.to_glib_none().0, addrtype.to_glib_none().0, address.to_glib_none().0, ttl, addr_number)) - } - } - - pub fn set_information(&mut self, information: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_set_information(self.to_glib_none_mut().0, information.to_glib_none().0)) - } - } - - pub fn set_key(&mut self, type_: &str, data: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_set_key(self.to_glib_none_mut().0, type_.to_glib_none().0, data.to_glib_none().0)) - } - } - - pub fn set_origin(&mut self, username: &str, sess_id: &str, sess_version: &str, nettype: &str, addrtype: &str, addr: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_set_origin(self.to_glib_none_mut().0, username.to_glib_none().0, sess_id.to_glib_none().0, sess_version.to_glib_none().0, nettype.to_glib_none().0, addrtype.to_glib_none().0, addr.to_glib_none().0)) - } - } - - pub fn set_session_name(&mut self, session_name: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_set_session_name(self.to_glib_none_mut().0, session_name.to_glib_none().0)) - } - } - - pub fn set_uri(&mut self, uri: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_set_uri(self.to_glib_none_mut().0, uri.to_glib_none().0)) - } - } - - pub fn set_version(&mut self, version: &str) -> SDPResult { - unsafe { - from_glib(ffi::gst_sdp_message_set_version(self.to_glib_none_mut().0, version.to_glib_none().0)) - } - } - - pub fn times_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_message_times_len(self.to_glib_none().0) - } - } - - pub fn zones_len(&self) -> u32 { - unsafe { - ffi::gst_sdp_message_zones_len(self.to_glib_none().0) - } - } - - pub fn as_uri(scheme: &str, msg: &SDPMessage) -> Option { - assert_initialized_main_thread!(); - unsafe { - from_glib_full(ffi::gst_sdp_message_as_uri(scheme.to_glib_none().0, msg.to_glib_none().0)) - } - } - - pub fn parse_buffer(data: &[u8], msg: &mut SDPMessage) -> SDPResult { - assert_initialized_main_thread!(); - let size = data.len() as u32; - unsafe { - from_glib(ffi::gst_sdp_message_parse_buffer(data.to_glib_none().0, size, msg.to_glib_none_mut().0)) - } - } - - pub fn parse_uri(uri: &str, msg: &mut SDPMessage) -> SDPResult { - assert_initialized_main_thread!(); - unsafe { - from_glib(ffi::gst_sdp_message_parse_uri(uri.to_glib_none().0, msg.to_glib_none_mut().0)) - } - } -} - -unsafe impl Send for SDPMessage {} diff --git a/gstreamer-sdp/src/auto/s_d_p_time.rs b/gstreamer-sdp/src/auto/s_d_p_time.rs deleted file mode 100644 index 28409242a..000000000 --- a/gstreamer-sdp/src/auto/s_d_p_time.rs +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by gir (https://github.com/gtk-rs/gir @ d1e0127) -// from gir-files (https://github.com/gtk-rs/gir-files @ ???) -// DO NOT EDIT - -use SDPResult; -use ffi; -use glib::translate::*; -use glib_ffi; -use std::mem; -use std::ptr;