sdp: Remove MIKEY API for now

It was completely broken and has to be done differently. Once someone
actually needs it this can be re-added properly.
This commit is contained in:
Sebastian Dröge 2019-02-28 19:44:10 +02:00
parent 1d2f77bb64
commit 7673be5baa
15 changed files with 0 additions and 1380 deletions

View file

@ -18,18 +18,6 @@ external_libraries = [
] ]
generate = [ generate = [
"GstSdp.MIKEYCacheType",
"GstSdp.MIKEYEncAlg",
"GstSdp.MIKEYKVType",
"GstSdp.MIKEYKeyDataType",
"GstSdp.MIKEYMacAlg",
"GstSdp.MIKEYMapType",
"GstSdp.MIKEYPRFFunc",
"GstSdp.MIKEYPayloadType",
"GstSdp.MIKEYSecProto",
"GstSdp.MIKEYSecSRTP",
"GstSdp.MIKEYTSType",
"GstSdp.MIKEYType",
] ]
manual = [ manual = [
@ -40,145 +28,3 @@ manual = [
name = "Gst.Caps" name = "Gst.Caps"
status = "manual" status = "manual"
ref_mode = "ref" ref_mode = "ref"
[[object]]
name = "GstSdp.MIKEYMessage"
status = "generate"
[[object.function]]
name = "add_cs_srtp"
[object.function.return]
bool_return_is_error = "Failed to add the Crypto policy for SRTP"
[[object.function]]
name = "add_pke"
[object.function.return]
bool_return_is_error = "Failed to add the PKE payload"
[[object.function]]
name = "add_rand"
[object.function.return]
bool_return_is_error = "Failed to add the RAND payload"
[[object.function]]
name = "add_rand_len"
[object.function.return]
bool_return_is_error = "Failed to add the RAND payload with random bytes"
[[object.function]]
name = "add_t"
[object.function.return]
bool_return_is_error = "Failed to add the T payload"
[[object.function]]
name = "add_t_now_ntp_utc"
[object.function.return]
bool_return_is_error = "Failed to add the T payload with current time"
[[object.function]]
name = "remove_cs_srtp"
[object.function.return]
bool_return_is_error = "Failed to remove the SRTP policy"
[[object.function]]
name = "remove_payload"
[object.function.return]
bool_return_is_error = "Failed to remove the payload"
[[object.function]]
name = "set_info"
[object.function.return]
bool_return_is_error = "Failed to set the information"
[[object.function]]
name = "to_caps"
[object.function.return]
bool_return_is_error = "Failed to fill caps with SRTP parameters"
[[object.function]]
name = "replace_payload"
ignore = true
[[object.function]]
name = "insert_payload"
ignore = true
[[object.function]]
name = "add_payload"
ignore = true
[[object.function]]
name = "get_payload"
ignore = true
[[object.function]]
name = "base64_encode"
ignore = true
[[object]]
name = "GstSdp.MIKEYPayload"
status = "generate"
[[object.function]]
name = "kemac_add_sub"
ignore = true
[[object.function]]
name = "kemac_remove_sub"
[object.function.return]
bool_return_is_error = "Failed to remove the sub payload"
[[object.function]]
name = "kemac_get_sub"
ignore = true
[[object.function]]
name = "kemac_set"
[object.function.return]
bool_return_is_error = "Failed to set the KEMAC parameters"
[[object.function]]
name = "key_data_set_interval"
ignore = true
[[object.function]]
name = "key_data_set_key"
[object.function.return]
bool_return_is_error = "Failed to set the key"
[[object.function]]
name = "key_data_set_salt"
[object.function.return]
bool_return_is_error = "Failed to set the salt key data"
[[object.function]]
name = "key_data_set_spi"
[object.function.return]
bool_return_is_error = "Failed to set the SPI/MKI validity"
[[object.function]]
name = "pke_set"
[object.function.return]
bool_return_is_error = "Failed to set the PKE values"
[[object.function]]
name = "rand_set"
[object.function.return]
bool_return_is_error = "Failed to set the random values"
[[object.function]]
name = "sp_add_param"
[object.function.return]
bool_return_is_error = "Failed to add the parameter"
[[object.function]]
name = "sp_remove_param"
[object.function.return]
bool_return_is_error = "Failed to remove the parameter"
[[object.function]]
name = "sp_set"
[object.function.return]
bool_return_is_error = "Failed to set the Security Policy parameters"
[[object.function]]
name = "t_set"
ignore = true

View file

@ -1,508 +0,0 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ffi;
use glib::translate::*;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYCacheType {
None,
Always,
ForCsb,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYCacheType {
type GlibType = ffi::GstMIKEYCacheType;
fn to_glib(&self) -> ffi::GstMIKEYCacheType {
match *self {
MIKEYCacheType::None => ffi::GST_MIKEY_CACHE_NONE,
MIKEYCacheType::Always => ffi::GST_MIKEY_CACHE_ALWAYS,
MIKEYCacheType::ForCsb => ffi::GST_MIKEY_CACHE_FOR_CSB,
MIKEYCacheType::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYCacheType> for MIKEYCacheType {
fn from_glib(value: ffi::GstMIKEYCacheType) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYCacheType::None,
1 => MIKEYCacheType::Always,
2 => MIKEYCacheType::ForCsb,
value => MIKEYCacheType::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYEncAlg {
Null,
AesCm128,
AesKw128,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYEncAlg {
type GlibType = ffi::GstMIKEYEncAlg;
fn to_glib(&self) -> ffi::GstMIKEYEncAlg {
match *self {
MIKEYEncAlg::Null => ffi::GST_MIKEY_ENC_NULL,
MIKEYEncAlg::AesCm128 => ffi::GST_MIKEY_ENC_AES_CM_128,
MIKEYEncAlg::AesKw128 => ffi::GST_MIKEY_ENC_AES_KW_128,
MIKEYEncAlg::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYEncAlg> for MIKEYEncAlg {
fn from_glib(value: ffi::GstMIKEYEncAlg) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYEncAlg::Null,
1 => MIKEYEncAlg::AesCm128,
2 => MIKEYEncAlg::AesKw128,
value => MIKEYEncAlg::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYKVType {
Null,
Spi,
Interval,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYKVType {
type GlibType = ffi::GstMIKEYKVType;
fn to_glib(&self) -> ffi::GstMIKEYKVType {
match *self {
MIKEYKVType::Null => ffi::GST_MIKEY_KV_NULL,
MIKEYKVType::Spi => ffi::GST_MIKEY_KV_SPI,
MIKEYKVType::Interval => ffi::GST_MIKEY_KV_INTERVAL,
MIKEYKVType::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYKVType> for MIKEYKVType {
fn from_glib(value: ffi::GstMIKEYKVType) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYKVType::Null,
1 => MIKEYKVType::Spi,
2 => MIKEYKVType::Interval,
value => MIKEYKVType::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYKeyDataType {
Tgk,
Tek,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYKeyDataType {
type GlibType = ffi::GstMIKEYKeyDataType;
fn to_glib(&self) -> ffi::GstMIKEYKeyDataType {
match *self {
MIKEYKeyDataType::Tgk => ffi::GST_MIKEY_KD_TGK,
MIKEYKeyDataType::Tek => ffi::GST_MIKEY_KD_TEK,
MIKEYKeyDataType::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYKeyDataType> for MIKEYKeyDataType {
fn from_glib(value: ffi::GstMIKEYKeyDataType) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYKeyDataType::Tgk,
2 => MIKEYKeyDataType::Tek,
value => MIKEYKeyDataType::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYMacAlg {
Null,
HmacSha1160,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYMacAlg {
type GlibType = ffi::GstMIKEYMacAlg;
fn to_glib(&self) -> ffi::GstMIKEYMacAlg {
match *self {
MIKEYMacAlg::Null => ffi::GST_MIKEY_MAC_NULL,
MIKEYMacAlg::HmacSha1160 => ffi::GST_MIKEY_MAC_HMAC_SHA_1_160,
MIKEYMacAlg::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYMacAlg> for MIKEYMacAlg {
fn from_glib(value: ffi::GstMIKEYMacAlg) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYMacAlg::Null,
1 => MIKEYMacAlg::HmacSha1160,
value => MIKEYMacAlg::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYMapType {
MikeyMapTypeSrtp,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYMapType {
type GlibType = ffi::GstMIKEYMapType;
fn to_glib(&self) -> ffi::GstMIKEYMapType {
match *self {
MIKEYMapType::MikeyMapTypeSrtp => ffi::GST_MIKEY_MAP_TYPE_SRTP,
MIKEYMapType::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYMapType> for MIKEYMapType {
fn from_glib(value: ffi::GstMIKEYMapType) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYMapType::MikeyMapTypeSrtp,
value => MIKEYMapType::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYPRFFunc {
MikeyPrfMikey1,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYPRFFunc {
type GlibType = ffi::GstMIKEYPRFFunc;
fn to_glib(&self) -> ffi::GstMIKEYPRFFunc {
match *self {
MIKEYPRFFunc::MikeyPrfMikey1 => ffi::GST_MIKEY_PRF_MIKEY_1,
MIKEYPRFFunc::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYPRFFunc> for MIKEYPRFFunc {
fn from_glib(value: ffi::GstMIKEYPRFFunc) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYPRFFunc::MikeyPrfMikey1,
value => MIKEYPRFFunc::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYPayloadType {
Last,
Kemac,
Pke,
Dh,
Sign,
T,
Id,
Cert,
Chash,
V,
Sp,
Rand,
Err,
KeyData,
GenExt,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYPayloadType {
type GlibType = ffi::GstMIKEYPayloadType;
fn to_glib(&self) -> ffi::GstMIKEYPayloadType {
match *self {
MIKEYPayloadType::Last => ffi::GST_MIKEY_PT_LAST,
MIKEYPayloadType::Kemac => ffi::GST_MIKEY_PT_KEMAC,
MIKEYPayloadType::Pke => ffi::GST_MIKEY_PT_PKE,
MIKEYPayloadType::Dh => ffi::GST_MIKEY_PT_DH,
MIKEYPayloadType::Sign => ffi::GST_MIKEY_PT_SIGN,
MIKEYPayloadType::T => ffi::GST_MIKEY_PT_T,
MIKEYPayloadType::Id => ffi::GST_MIKEY_PT_ID,
MIKEYPayloadType::Cert => ffi::GST_MIKEY_PT_CERT,
MIKEYPayloadType::Chash => ffi::GST_MIKEY_PT_CHASH,
MIKEYPayloadType::V => ffi::GST_MIKEY_PT_V,
MIKEYPayloadType::Sp => ffi::GST_MIKEY_PT_SP,
MIKEYPayloadType::Rand => ffi::GST_MIKEY_PT_RAND,
MIKEYPayloadType::Err => ffi::GST_MIKEY_PT_ERR,
MIKEYPayloadType::KeyData => ffi::GST_MIKEY_PT_KEY_DATA,
MIKEYPayloadType::GenExt => ffi::GST_MIKEY_PT_GEN_EXT,
MIKEYPayloadType::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYPayloadType> for MIKEYPayloadType {
fn from_glib(value: ffi::GstMIKEYPayloadType) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYPayloadType::Last,
1 => MIKEYPayloadType::Kemac,
2 => MIKEYPayloadType::Pke,
3 => MIKEYPayloadType::Dh,
4 => MIKEYPayloadType::Sign,
5 => MIKEYPayloadType::T,
6 => MIKEYPayloadType::Id,
7 => MIKEYPayloadType::Cert,
8 => MIKEYPayloadType::Chash,
9 => MIKEYPayloadType::V,
10 => MIKEYPayloadType::Sp,
11 => MIKEYPayloadType::Rand,
12 => MIKEYPayloadType::Err,
20 => MIKEYPayloadType::KeyData,
21 => MIKEYPayloadType::GenExt,
value => MIKEYPayloadType::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYSecProto {
MikeySecProtoSrtp,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYSecProto {
type GlibType = ffi::GstMIKEYSecProto;
fn to_glib(&self) -> ffi::GstMIKEYSecProto {
match *self {
MIKEYSecProto::MikeySecProtoSrtp => ffi::GST_MIKEY_SEC_PROTO_SRTP,
MIKEYSecProto::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYSecProto> for MIKEYSecProto {
fn from_glib(value: ffi::GstMIKEYSecProto) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYSecProto::MikeySecProtoSrtp,
value => MIKEYSecProto::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYSecSRTP {
EncAlg,
EncKeyLen,
AuthAlg,
AuthKeyLen,
SaltKeyLen,
Prf,
KeyDerivRate,
SrtpEnc,
SrtcpEnc,
FecOrder,
SrtpAuth,
AuthTagLen,
SrtpPrefixLen,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYSecSRTP {
type GlibType = ffi::GstMIKEYSecSRTP;
fn to_glib(&self) -> ffi::GstMIKEYSecSRTP {
match *self {
MIKEYSecSRTP::EncAlg => ffi::GST_MIKEY_SP_SRTP_ENC_ALG,
MIKEYSecSRTP::EncKeyLen => ffi::GST_MIKEY_SP_SRTP_ENC_KEY_LEN,
MIKEYSecSRTP::AuthAlg => ffi::GST_MIKEY_SP_SRTP_AUTH_ALG,
MIKEYSecSRTP::AuthKeyLen => ffi::GST_MIKEY_SP_SRTP_AUTH_KEY_LEN,
MIKEYSecSRTP::SaltKeyLen => ffi::GST_MIKEY_SP_SRTP_SALT_KEY_LEN,
MIKEYSecSRTP::Prf => ffi::GST_MIKEY_SP_SRTP_PRF,
MIKEYSecSRTP::KeyDerivRate => ffi::GST_MIKEY_SP_SRTP_KEY_DERIV_RATE,
MIKEYSecSRTP::SrtpEnc => ffi::GST_MIKEY_SP_SRTP_SRTP_ENC,
MIKEYSecSRTP::SrtcpEnc => ffi::GST_MIKEY_SP_SRTP_SRTCP_ENC,
MIKEYSecSRTP::FecOrder => ffi::GST_MIKEY_SP_SRTP_FEC_ORDER,
MIKEYSecSRTP::SrtpAuth => ffi::GST_MIKEY_SP_SRTP_SRTP_AUTH,
MIKEYSecSRTP::AuthTagLen => ffi::GST_MIKEY_SP_SRTP_AUTH_TAG_LEN,
MIKEYSecSRTP::SrtpPrefixLen => ffi::GST_MIKEY_SP_SRTP_SRTP_PREFIX_LEN,
MIKEYSecSRTP::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYSecSRTP> for MIKEYSecSRTP {
fn from_glib(value: ffi::GstMIKEYSecSRTP) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYSecSRTP::EncAlg,
1 => MIKEYSecSRTP::EncKeyLen,
2 => MIKEYSecSRTP::AuthAlg,
3 => MIKEYSecSRTP::AuthKeyLen,
4 => MIKEYSecSRTP::SaltKeyLen,
5 => MIKEYSecSRTP::Prf,
6 => MIKEYSecSRTP::KeyDerivRate,
7 => MIKEYSecSRTP::SrtpEnc,
8 => MIKEYSecSRTP::SrtcpEnc,
9 => MIKEYSecSRTP::FecOrder,
10 => MIKEYSecSRTP::SrtpAuth,
11 => MIKEYSecSRTP::AuthTagLen,
12 => MIKEYSecSRTP::SrtpPrefixLen,
value => MIKEYSecSRTP::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYTSType {
NtpUtc,
Ntp,
Counter,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYTSType {
type GlibType = ffi::GstMIKEYTSType;
fn to_glib(&self) -> ffi::GstMIKEYTSType {
match *self {
MIKEYTSType::NtpUtc => ffi::GST_MIKEY_TS_TYPE_NTP_UTC,
MIKEYTSType::Ntp => ffi::GST_MIKEY_TS_TYPE_NTP,
MIKEYTSType::Counter => ffi::GST_MIKEY_TS_TYPE_COUNTER,
MIKEYTSType::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYTSType> for MIKEYTSType {
fn from_glib(value: ffi::GstMIKEYTSType) -> Self {
skip_assert_initialized!();
match value {
0 => MIKEYTSType::NtpUtc,
1 => MIKEYTSType::Ntp,
2 => MIKEYTSType::Counter,
value => MIKEYTSType::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
pub enum MIKEYType {
Invalid,
PskInit,
PskVerify,
PkInit,
PkVerify,
DhInit,
DhResp,
Error,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for MIKEYType {
type GlibType = ffi::GstMIKEYType;
fn to_glib(&self) -> ffi::GstMIKEYType {
match *self {
MIKEYType::Invalid => ffi::GST_MIKEY_TYPE_INVALID,
MIKEYType::PskInit => ffi::GST_MIKEY_TYPE_PSK_INIT,
MIKEYType::PskVerify => ffi::GST_MIKEY_TYPE_PSK_VERIFY,
MIKEYType::PkInit => ffi::GST_MIKEY_TYPE_PK_INIT,
MIKEYType::PkVerify => ffi::GST_MIKEY_TYPE_PK_VERIFY,
MIKEYType::DhInit => ffi::GST_MIKEY_TYPE_DH_INIT,
MIKEYType::DhResp => ffi::GST_MIKEY_TYPE_DH_RESP,
MIKEYType::Error => ffi::GST_MIKEY_TYPE_ERROR,
MIKEYType::__Unknown(value) => value
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstMIKEYType> for MIKEYType {
fn from_glib(value: ffi::GstMIKEYType) -> Self {
skip_assert_initialized!();
match value {
-1 => MIKEYType::Invalid,
0 => MIKEYType::PskInit,
1 => MIKEYType::PskVerify,
2 => MIKEYType::PkInit,
3 => MIKEYType::PkVerify,
4 => MIKEYType::DhInit,
5 => MIKEYType::DhResp,
6 => MIKEYType::Error,
value => MIKEYType::__Unknown(value),
}
}
}

View file

@ -1,7 +0,0 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ffi;
use glib::translate::*;

View file

@ -1,153 +0,0 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// 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;
use glib::translate::*;
use gobject_ffi;
use gst;
glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MIKEYMessage(Boxed<ffi::GstMIKEYMessage>);
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<Error>) -> 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<Error>) -> MIKEYMessage {
// unsafe { TODO: call ffi::gst_mikey_message_new_from_data() }
//}
pub fn add_cs_srtp(&mut self, policy: u8, ssrc: u32, roc: u32) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_add_cs_srtp(self.to_glib_none_mut().0, policy, ssrc, roc), "Failed to add the Crypto policy for SRTP")
}
}
pub fn add_pke(&mut self, C: MIKEYCacheType, data: &[u8]) -> Result<(), glib::error::BoolError> {
let data_len = data.len() as u16;
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_add_pke(self.to_glib_none_mut().0, C.to_glib(), data_len, data.to_glib_none().0), "Failed to add the PKE payload")
}
}
pub fn add_rand(&mut self, rand: &[u8]) -> Result<(), glib::error::BoolError> {
let len = rand.len() as u8;
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_add_rand(self.to_glib_none_mut().0, len, rand.to_glib_none().0), "Failed to add the RAND payload")
}
}
pub fn add_rand_len(&mut self, len: u8) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_add_rand_len(self.to_glib_none_mut().0, len), "Failed to add the RAND payload with random bytes")
}
}
//pub fn add_t(&mut self, type_: MIKEYTSType, ts_value: &[u8]) -> Result<(), glib::error::BoolError> {
// unsafe { TODO: call ffi::gst_mikey_message_add_t() }
//}
pub fn add_t_now_ntp_utc(&mut self) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_add_t_now_ntp_utc(self.to_glib_none_mut().0), "Failed to add the T payload with current time")
}
}
pub fn find_payload(&self, type_: MIKEYPayloadType, nth: u32) -> Option<MIKEYPayload> {
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<MIKEYMapSRTP> {
// 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 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) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_remove_cs_srtp(self.to_glib_none_mut().0, idx), "Failed to remove the SRTP policy")
}
}
pub fn remove_payload(&mut self, idx: u32) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_remove_payload(self.to_glib_none_mut().0, idx), "Failed to remove the payload")
}
}
//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) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(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()), "Failed to set the information")
}
}
//pub fn to_bytes(&mut self, info: /*Ignored*/&mut MIKEYEncryptInfo, error: /*Ignored*/Option<Error>) -> Option<glib::Bytes> {
// 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) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_message_to_caps(self.to_glib_none().0, caps.to_glib_none().0), "Failed to fill caps with SRTP parameters")
}
}
}
impl Default for MIKEYMessage {
fn default() -> Self {
Self::new()
}
}
unsafe impl Send for MIKEYMessage {}

View file

@ -1,118 +0,0 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// 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;
use glib::translate::*;
use gobject_ffi;
glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MIKEYPayload(Boxed<ffi::GstMIKEYPayload>);
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) -> Option<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_remove_sub(&mut self, idx: u32) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_kemac_remove_sub(self.to_glib_none_mut().0, idx), "Failed to remove the sub payload")
}
}
pub fn kemac_set(&mut self, enc_alg: MIKEYEncAlg, mac_alg: MIKEYMacAlg) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_kemac_set(self.to_glib_none_mut().0, enc_alg.to_glib(), mac_alg.to_glib()), "Failed to set the KEMAC parameters")
}
}
pub fn key_data_set_key(&mut self, key_type: MIKEYKeyDataType, key_data: &[u8]) -> Result<(), glib::error::BoolError> {
let key_len = key_data.len() as u16;
unsafe {
glib_result_from_gboolean!(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), "Failed to set the key")
}
}
pub fn key_data_set_salt(&mut self, salt_data: &[u8]) -> Result<(), glib::error::BoolError> {
let salt_len = salt_data.len() as u16;
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_key_data_set_salt(self.to_glib_none_mut().0, salt_len, salt_data.to_glib_none().0), "Failed to set the salt key data")
}
}
pub fn key_data_set_spi(&mut self, spi_data: &[u8]) -> Result<(), glib::error::BoolError> {
let spi_len = spi_data.len() as u8;
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_key_data_set_spi(self.to_glib_none_mut().0, spi_len, spi_data.to_glib_none().0), "Failed to set the SPI/MKI validity")
}
}
pub fn pke_set(&mut self, C: MIKEYCacheType, data: &[u8]) -> Result<(), glib::error::BoolError> {
let data_len = data.len() as u16;
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_pke_set(self.to_glib_none_mut().0, C.to_glib(), data_len, data.to_glib_none().0), "Failed to set the PKE values")
}
}
pub fn rand_set(&mut self, rand: &[u8]) -> Result<(), glib::error::BoolError> {
let len = rand.len() as u8;
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_rand_set(self.to_glib_none_mut().0, len, rand.to_glib_none().0), "Failed to set the random values")
}
}
pub fn sp_add_param(&mut self, type_: u8, val: &[u8]) -> Result<(), glib::error::BoolError> {
let len = val.len() as u8;
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_sp_add_param(self.to_glib_none_mut().0, type_, len, val.to_glib_none().0), "Failed to add the parameter")
}
}
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<MIKEYPayloadSPParam> {
// unsafe { TODO: call ffi::gst_mikey_payload_sp_get_param() }
//}
pub fn sp_remove_param(&mut self, idx: u32) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_sp_remove_param(self.to_glib_none_mut().0, idx), "Failed to remove the parameter")
}
}
pub fn sp_set(&mut self, policy: u32, proto: MIKEYSecProto) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ffi::gst_mikey_payload_sp_set(self.to_glib_none_mut().0, policy, proto.to_glib()), "Failed to set the Security Policy parameters")
}
}
}
unsafe impl Send for MIKEYPayload {}

View file

@ -2,26 +2,6 @@
// from gir-files (https://github.com/gtk-rs/gir-files) // from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT // DO NOT EDIT
mod mikey_message;
pub use self::mikey_message::MIKEYMessage;
mod mikey_payload;
pub use self::mikey_payload::MIKEYPayload;
mod enums;
pub use self::enums::MIKEYCacheType;
pub use self::enums::MIKEYEncAlg;
pub use self::enums::MIKEYKVType;
pub use self::enums::MIKEYKeyDataType;
pub use self::enums::MIKEYMacAlg;
pub use self::enums::MIKEYMapType;
pub use self::enums::MIKEYPRFFunc;
pub use self::enums::MIKEYPayloadType;
pub use self::enums::MIKEYSecProto;
pub use self::enums::MIKEYSecSRTP;
pub use self::enums::MIKEYTSType;
pub use self::enums::MIKEYType;
#[doc(hidden)] #[doc(hidden)]
pub mod traits { pub mod traits {
} }

View file

@ -40,14 +40,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
mod auto; mod auto;
pub use auto::*; pub use auto::*;
mod mikey_decrypt_info;
pub use mikey_decrypt_info::*;
mod mikey_encrypt_info;
pub use mikey_encrypt_info::*;
mod mikey_map_s_r_t_p;
pub use mikey_map_s_r_t_p::*;
mod mikey_payload_s_p_param;
pub use mikey_payload_s_p_param::*;
mod sdp_attribute; mod sdp_attribute;
pub use sdp_attribute::*; pub use sdp_attribute::*;
mod sdp_bandwidth; mod sdp_bandwidth;

View file

@ -1,13 +0,0 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
#[repr(C)]
#[derive(Debug)]
pub struct MIKEYDecryptInfo(ffi::GstMIKEYDecryptInfo);

View file

@ -1,13 +0,0 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
#[repr(C)]
#[derive(Debug)]
pub struct MIKEYEncryptInfo(ffi::GstMIKEYEncryptInfo);

View file

@ -1,31 +0,0 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
#[repr(C)]
#[derive(Debug)]
pub struct MIKEYMapSRTP(ffi::GstMIKEYMapSRTP);
impl MIKEYMapSRTP {
pub fn new(policy: u8, ssrc: u32, roc: u32) -> MIKEYMapSRTP {
MIKEYMapSRTP(ffi::GstMIKEYMapSRTP { policy, ssrc, roc })
}
pub fn policy(&self) -> u8 {
self.0.policy
}
pub fn ssrc(&self) -> u32 {
self.0.ssrc
}
pub fn roc(&self) -> u32 {
self.0.roc
}
}

View file

@ -1,202 +0,0 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::mem;
use std::ptr;
use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use gst;
use auto::{MIKEYMessage, MIKEYTSType};
use m_i_k_e_y_decrypt_info::MIKEYDecryptInfo;
use m_i_k_e_y_encrypt_info::MIKEYEncryptInfo;
use m_i_k_e_y_map_s_r_t_p::MIKEYMapSRTP;
use m_i_k_e_y_payload::MIKEYPayload;
impl MIKEYMessage {
pub fn new_from_bytes<'a, P: Into<Option<&'a MIKEYDecryptInfo>>>(
bytes: &glib::Bytes,
info: P,
) -> Result<MIKEYMessage, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::gst_mikey_message_new_from_bytes(
bytes.to_glib_none(),
info.to_glib_full(),
&mut error,
);
mem::forget(bytes);
mem::forget(info);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
pub fn new_from_data<'a, P: Into<Option<&'a MIKEYDecryptInfo>>>(
data: &[u8],
info: P,
) -> Result<MIKEYMessage, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::gst_mikey_message_new_from_data(
data.to_glib_none().0,
data.len(),
info.to_glib_full(),
&mut err,
);
mem::forget(info);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
pub fn add_t(
&mut self,
type_: MIKEYTSType,
ts_value: &[u8],
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
ffi::gst_mikey_message_add_t(
self.to_glib_none_mut().0,
type_.to_glib(),
ts_value.to_glib_none().0,
),
"Failed to add the T payload"
)
}
}
pub fn get_cs_srtp(&self, idx: u32) -> Option<&MIKEYMapSRTP> {
unsafe {
&*(from_glib_none(ffi::gst_mikey_message_get_cs_srtp(
self.to_glib_none().0,
idx,
)) as *mut MIKEYMapSRTP)
}
}
pub fn insert_cs_srtp(
&mut self,
idx: i32,
map: MIKEYMapSRTP,
) -> Result<(), glib::error::BoolError> {
unsafe {
let res = glib_result_from_gboolean!(
ffi::gst_mikey_message_insert_cs_srtp(
self.to_glib_none_mut().0,
idx,
map.to_glib_full(),
),
"Failed to insert the Crypto Session map for SRTP"
);
mem::forget(map);
res
}
}
pub fn get_payload(&self, idx: u32) -> Option<&MIKEYPayload> {
unsafe {
&*(from_glib_none(ffi::gst_mikey_message_get_payload(
self.to_glib_none().0,
idx,
)) as *mut MIKEYPayload)
}
}
pub fn add_payload(
&mut self,
payload: MIKEYPayload,
) -> Result<(), glib::error::BoolError> {
unsafe {
let res = glib_result_from_gboolean!(
ffi::gst_mikey_message_add_payload(
self.to_glib_none_mut().0,
payload.to_glib_full(),
),
"Failed to add the payload"
);
mem::forget(payload);
res
}
}
pub fn insert_payload(
&mut self,
idx: u32,
payload: MIKEYPayload,
) -> Result<(), glib::error::BoolError> {
unsafe {
let res = glib_result_from_gboolean!(
ffi::gst_mikey_message_insert_payload(
self.to_glib_none_mut().0,
idx,
payload.to_glib_full(),
),
"Failed to insert the payload"
);
mem::forget(payload);
res
}
}
pub fn replace_cs_srtp(
&mut self,
idx: i32,
map: MIKEYMapSRTP,
) -> Result<(), glib::error::BoolError> {
unsafe {
let res = glib_result_from_gboolean!(
ffi::gst_mikey_message_replace_cs_srtp(
self.to_glib_none_mut().0,
idx,
map.to_glib_full(),
),
"Failed to replace the Crypto Session map for SRTP"
);
mem::forget(map);
res
}
}
pub fn replace_payload(
&mut self,
idx: u32,
payload: MIKEYPayload,
) -> Result<(), glib::error::BoolError> {
unsafe {
let res = glib_result_from_gboolean!(
ffi::gst_mikey_message_replace_payload(
self.to_glib_none_mut().0,
idx,
payload.to_glib_full(),
),
"Failed to replace the payload"
);
mem::forget(payload);
res
}
}
pub fn base64_encode(&self) -> Option<String> {
unsafe {
from_glib_full(ffi::gst_mikey_message_base64_encode(
self.to_glib_none_mut().0,
))
}
}
}

View file

@ -1,90 +0,0 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::mem;
use std::ptr;
use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use auto::MIKEYPayload;
use m_i_k_e_y_map_s_r_t_p::MIKEYPayloadSPParam;
impl MIKEYPayload {
pub fn kemac_add_sub(&mut self, newpay: MIKEYPayload) -> Result<(), glib::error::BoolError> {
unsafe {
let res = glib_result_from_gboolean!(
ffi::gst_mikey_payload_kemac_add_sub(
self.to_glib_none_mut().0,
newpay.to_glib_full(),
),
"Failed to add the sub payload"
);
mem::forget(newpay);
res
}
}
pub fn kemac_get_sub(&self, idx: u32) -> Option<&MIKEYPayload> {
unsafe {
&*(from_glib_none(ffi::gst_mikey_payload_kemac_get_sub(
self.to_glib_none().0,
idx,
)) as *mut MIKEYPayload)
}
}
pub fn sp_get_param(&self, idx: u32) -> Option<&MIKEYPayloadSPParam> {
unsafe {
&*(from_glib_none(ffi::gst_mikey_payload_sp_get_param(
self.to_glib_none().0,
idx,
)) as *mut MIKEYPayloadSPParam)
}
}
pub fn t_set(
&mut self,
type_: MIKEYTSType,
ts_value: &[u8],
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(
ffi::gst_mikey_payload_t_set(
self.to_glib_none_mut().0,
type_.to_glib(),
ts_value.to_glib_none().0,
),
"Failed to set the timestamp"
)
}
}
pub fn key_data_set_interval(
&mut self,
vf_data: &[u8],
vt_data: &[u8],
) -> Result<(), glib::error::BoolError> {
let vf_len = vf_data.len() as u8;
let vt_len = vt_data.len() as u8;
unsafe {
glib_result_from_gboolean!(
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,
),
"Failed to set the key validity period"
)
}
}
}

View file

@ -1,33 +0,0 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::slice;
use ffi;
#[repr(C)]
#[derive(Debug)]
pub struct MIKEYPayloadSPParam(ffi::GstMIKEYPayloadSPParam);
impl MIKEYPayloadSPParam {
pub fn type_(&self) -> u8 {
self.0.type_
}
pub fn len(&self) -> u8 {
self.0.len
}
pub fn is_empty(&self) -> bool {
self.0.len == 0
}
pub fn val(&self) -> &[u8] {
unsafe { slice::from_raw_parts(self.0.val as *const u8, self.0.len as usize) }
}
}

View file

@ -23,9 +23,6 @@ use sdp_bandwidth::SDPBandwidth;
use sdp_connection::SDPConnection; use sdp_connection::SDPConnection;
use sdp_key::SDPKey; use sdp_key::SDPKey;
#[cfg(any(feature = "v1_8_1", feature = "dox"))]
use MIKEYMessage;
glib_wrapper! { glib_wrapper! {
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SDPMedia(Boxed<ffi::GstSDPMedia>); pub struct SDPMedia(Boxed<ffi::GstSDPMedia>);
@ -461,18 +458,6 @@ impl SDPMediaRef {
} }
} }
#[cfg(any(feature = "v1_8_1", feature = "dox"))]
pub fn parse_keymgmt(&self) -> Result<MIKEYMessage, ()> {
unsafe {
let mut mikey = ptr::null_mut();
let result = ffi::gst_sdp_media_parse_keymgmt(&self.0, &mut mikey);
match result {
ffi::GST_SDP_OK => Ok(from_glib_full(mikey)),
_ => Err(()),
}
}
}
pub fn remove_attribute(&mut self, idx: u32) -> Result<(), ()> { pub fn remove_attribute(&mut self, idx: u32) -> Result<(), ()> {
if idx >= self.attributes_len() { if idx >= self.attributes_len() {
return Err(()); return Err(());

View file

@ -30,9 +30,6 @@ use sdp_origin::SDPOrigin;
use sdp_time::SDPTime; use sdp_time::SDPTime;
use sdp_zone::SDPZone; use sdp_zone::SDPZone;
#[cfg(any(feature = "v1_8_1", feature = "dox"))]
use MIKEYMessage;
glib_wrapper! { glib_wrapper! {
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SDPMessage(Boxed<ffi::GstSDPMessage>); pub struct SDPMessage(Boxed<ffi::GstSDPMessage>);
@ -618,18 +615,6 @@ impl SDPMessageRef {
unsafe { ffi::gst_sdp_message_medias_len(&self.0) } unsafe { ffi::gst_sdp_message_medias_len(&self.0) }
} }
#[cfg(any(feature = "v1_8_1", feature = "dox"))]
pub fn parse_keymgmt(&self) -> Result<MIKEYMessage, ()> {
unsafe {
let mut mikey = ptr::null_mut();
let result = ffi::gst_sdp_message_parse_keymgmt(&self.0, &mut mikey);
match result {
ffi::GST_SDP_OK => Ok(from_glib_full(mikey)),
_ => Err(()),
}
}
}
pub fn phones_len(&self) -> u32 { pub fn phones_len(&self) -> u32 {
unsafe { ffi::gst_sdp_message_phones_len(&self.0) } unsafe { ffi::gst_sdp_message_phones_len(&self.0) }
} }