webrtc: Generate various new enum types that were added in 1.14.1/1.16

This commit is contained in:
Sebastian Dröge 2019-06-25 19:20:37 +03:00
parent e0d345fbb4
commit 6871e501db
3 changed files with 441 additions and 0 deletions

View file

@ -29,6 +29,12 @@ generate = [
"GstWebRTC.WebRTCRTPTransceiverDirection", "GstWebRTC.WebRTCRTPTransceiverDirection",
"GstWebRTC.WebRTCSignalingState", "GstWebRTC.WebRTCSignalingState",
"GstWebRTC.WebRTCStatsType", "GstWebRTC.WebRTCStatsType",
"GstWebRTC.WebRTCBundlePolicy",
"GstWebRTC.WebRTCDataChannelState",
"GstWebRTC.WebRTCICETransportPolicy",
"GstWebRTC.WebRTCPriorityType",
"GstWebRTC.WebRTCSCTPTransportState",
"GstWebRTC.WebRTCFECType",
] ]
manual = [ manual = [

View file

@ -12,6 +12,76 @@ use glib::Type;
use gobject_sys; use gobject_sys;
use gst_web_rtc_sys; use gst_web_rtc_sys;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCBundlePolicy {
None,
Balanced,
MaxCompat,
MaxBundle,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for WebRTCBundlePolicy {
type GlibType = gst_web_rtc_sys::GstWebRTCBundlePolicy;
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCBundlePolicy {
match *self {
WebRTCBundlePolicy::None => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_NONE,
WebRTCBundlePolicy::Balanced => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_BALANCED,
WebRTCBundlePolicy::MaxCompat => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT,
WebRTCBundlePolicy::MaxBundle => gst_web_rtc_sys::GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE,
WebRTCBundlePolicy::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_web_rtc_sys::GstWebRTCBundlePolicy> for WebRTCBundlePolicy {
fn from_glib(value: gst_web_rtc_sys::GstWebRTCBundlePolicy) -> Self {
skip_assert_initialized!();
match value {
0 => WebRTCBundlePolicy::None,
1 => WebRTCBundlePolicy::Balanced,
2 => WebRTCBundlePolicy::MaxCompat,
3 => WebRTCBundlePolicy::MaxBundle,
value => WebRTCBundlePolicy::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl StaticType for WebRTCBundlePolicy {
fn static_type() -> Type {
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_bundle_policy_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValueOptional<'a> for WebRTCBundlePolicy {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValue<'a> for WebRTCBundlePolicy {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl SetValue for WebRTCBundlePolicy {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCDTLSSetup { pub enum WebRTCDTLSSetup {
None, None,
@ -149,6 +219,147 @@ impl SetValue for WebRTCDTLSTransportState {
} }
} }
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCDataChannelState {
New,
Connecting,
Open,
Closing,
Closed,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for WebRTCDataChannelState {
type GlibType = gst_web_rtc_sys::GstWebRTCDataChannelState;
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCDataChannelState {
match *self {
WebRTCDataChannelState::New => gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_NEW,
WebRTCDataChannelState::Connecting => {
gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING
}
WebRTCDataChannelState::Open => gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_OPEN,
WebRTCDataChannelState::Closing => {
gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING
}
WebRTCDataChannelState::Closed => gst_web_rtc_sys::GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED,
WebRTCDataChannelState::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_web_rtc_sys::GstWebRTCDataChannelState> for WebRTCDataChannelState {
fn from_glib(value: gst_web_rtc_sys::GstWebRTCDataChannelState) -> Self {
skip_assert_initialized!();
match value {
0 => WebRTCDataChannelState::New,
1 => WebRTCDataChannelState::Connecting,
2 => WebRTCDataChannelState::Open,
3 => WebRTCDataChannelState::Closing,
4 => WebRTCDataChannelState::Closed,
value => WebRTCDataChannelState::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl StaticType for WebRTCDataChannelState {
fn static_type() -> Type {
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_data_channel_state_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValueOptional<'a> for WebRTCDataChannelState {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValue<'a> for WebRTCDataChannelState {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl SetValue for WebRTCDataChannelState {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCFECType {
None,
UlpRed,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for WebRTCFECType {
type GlibType = gst_web_rtc_sys::GstWebRTCFECType;
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCFECType {
match *self {
WebRTCFECType::None => gst_web_rtc_sys::GST_WEBRTC_FEC_TYPE_NONE,
WebRTCFECType::UlpRed => gst_web_rtc_sys::GST_WEBRTC_FEC_TYPE_ULP_RED,
WebRTCFECType::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_web_rtc_sys::GstWebRTCFECType> for WebRTCFECType {
fn from_glib(value: gst_web_rtc_sys::GstWebRTCFECType) -> Self {
skip_assert_initialized!();
match value {
0 => WebRTCFECType::None,
1 => WebRTCFECType::UlpRed,
value => WebRTCFECType::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
impl StaticType for WebRTCFECType {
fn static_type() -> Type {
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_fec_type_get_type()) }
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
impl<'a> FromValueOptional<'a> for WebRTCFECType {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
impl<'a> FromValue<'a> for WebRTCFECType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
impl SetValue for WebRTCFECType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCICEComponent { pub enum WebRTCICEComponent {
Rtp, Rtp,
@ -411,6 +622,72 @@ impl SetValue for WebRTCICERole {
} }
} }
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCICETransportPolicy {
All,
Relay,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for WebRTCICETransportPolicy {
type GlibType = gst_web_rtc_sys::GstWebRTCICETransportPolicy;
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCICETransportPolicy {
match *self {
WebRTCICETransportPolicy::All => gst_web_rtc_sys::GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL,
WebRTCICETransportPolicy::Relay => {
gst_web_rtc_sys::GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY
}
WebRTCICETransportPolicy::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_web_rtc_sys::GstWebRTCICETransportPolicy> for WebRTCICETransportPolicy {
fn from_glib(value: gst_web_rtc_sys::GstWebRTCICETransportPolicy) -> Self {
skip_assert_initialized!();
match value {
0 => WebRTCICETransportPolicy::All,
1 => WebRTCICETransportPolicy::Relay,
value => WebRTCICETransportPolicy::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl StaticType for WebRTCICETransportPolicy {
fn static_type() -> Type {
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_ice_transport_policy_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValueOptional<'a> for WebRTCICETransportPolicy {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValue<'a> for WebRTCICETransportPolicy {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl SetValue for WebRTCICETransportPolicy {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCPeerConnectionState { pub enum WebRTCPeerConnectionState {
New, New,
@ -490,6 +767,76 @@ impl SetValue for WebRTCPeerConnectionState {
} }
} }
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCPriorityType {
VeryLow,
Low,
Medium,
High,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for WebRTCPriorityType {
type GlibType = gst_web_rtc_sys::GstWebRTCPriorityType;
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCPriorityType {
match *self {
WebRTCPriorityType::VeryLow => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_VERY_LOW,
WebRTCPriorityType::Low => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_LOW,
WebRTCPriorityType::Medium => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_MEDIUM,
WebRTCPriorityType::High => gst_web_rtc_sys::GST_WEBRTC_PRIORITY_TYPE_HIGH,
WebRTCPriorityType::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_web_rtc_sys::GstWebRTCPriorityType> for WebRTCPriorityType {
fn from_glib(value: gst_web_rtc_sys::GstWebRTCPriorityType) -> Self {
skip_assert_initialized!();
match value {
1 => WebRTCPriorityType::VeryLow,
2 => WebRTCPriorityType::Low,
3 => WebRTCPriorityType::Medium,
4 => WebRTCPriorityType::High,
value => WebRTCPriorityType::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl StaticType for WebRTCPriorityType {
fn static_type() -> Type {
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_priority_type_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValueOptional<'a> for WebRTCPriorityType {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValue<'a> for WebRTCPriorityType {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl SetValue for WebRTCPriorityType {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCRTPTransceiverDirection { pub enum WebRTCRTPTransceiverDirection {
None, None,
@ -566,6 +913,82 @@ impl SetValue for WebRTCRTPTransceiverDirection {
} }
} }
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCSCTPTransportState {
New,
Connecting,
Connected,
Closed,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl ToGlib for WebRTCSCTPTransportState {
type GlibType = gst_web_rtc_sys::GstWebRTCSCTPTransportState;
fn to_glib(&self) -> gst_web_rtc_sys::GstWebRTCSCTPTransportState {
match *self {
WebRTCSCTPTransportState::New => gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW,
WebRTCSCTPTransportState::Connecting => {
gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING
}
WebRTCSCTPTransportState::Connected => {
gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED
}
WebRTCSCTPTransportState::Closed => {
gst_web_rtc_sys::GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED
}
WebRTCSCTPTransportState::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[doc(hidden)]
impl FromGlib<gst_web_rtc_sys::GstWebRTCSCTPTransportState> for WebRTCSCTPTransportState {
fn from_glib(value: gst_web_rtc_sys::GstWebRTCSCTPTransportState) -> Self {
skip_assert_initialized!();
match value {
0 => WebRTCSCTPTransportState::New,
1 => WebRTCSCTPTransportState::Connecting,
2 => WebRTCSCTPTransportState::Connected,
3 => WebRTCSCTPTransportState::Closed,
value => WebRTCSCTPTransportState::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl StaticType for WebRTCSCTPTransportState {
fn static_type() -> Type {
unsafe { from_glib(gst_web_rtc_sys::gst_webrtc_sctp_transport_state_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValueOptional<'a> for WebRTCSCTPTransportState {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl<'a> FromValue<'a> for WebRTCSCTPTransportState {
unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
impl SetValue for WebRTCSCTPTransportState {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum WebRTCSDPType { pub enum WebRTCSDPType {
Offer, Offer,

View file

@ -21,14 +21,26 @@ mod web_rtc_session_description;
pub use self::web_rtc_session_description::WebRTCSessionDescription; pub use self::web_rtc_session_description::WebRTCSessionDescription;
mod enums; mod enums;
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::enums::WebRTCBundlePolicy;
pub use self::enums::WebRTCDTLSSetup; pub use self::enums::WebRTCDTLSSetup;
pub use self::enums::WebRTCDTLSTransportState; pub use self::enums::WebRTCDTLSTransportState;
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::enums::WebRTCDataChannelState;
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
pub use self::enums::WebRTCFECType;
pub use self::enums::WebRTCICEComponent; pub use self::enums::WebRTCICEComponent;
pub use self::enums::WebRTCICEConnectionState; pub use self::enums::WebRTCICEConnectionState;
pub use self::enums::WebRTCICEGatheringState; pub use self::enums::WebRTCICEGatheringState;
pub use self::enums::WebRTCICERole; pub use self::enums::WebRTCICERole;
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::enums::WebRTCICETransportPolicy;
pub use self::enums::WebRTCPeerConnectionState; pub use self::enums::WebRTCPeerConnectionState;
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::enums::WebRTCPriorityType;
pub use self::enums::WebRTCRTPTransceiverDirection; pub use self::enums::WebRTCRTPTransceiverDirection;
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::enums::WebRTCSCTPTransportState;
pub use self::enums::WebRTCSDPType; pub use self::enums::WebRTCSDPType;
pub use self::enums::WebRTCSignalingState; pub use self::enums::WebRTCSignalingState;
pub use self::enums::WebRTCStatsType; pub use self::enums::WebRTCStatsType;