use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
use std::ffi::CStr;
use std::fmt;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCBundlePolicy")]
pub enum WebRTCBundlePolicy {
#[doc(alias = "GST_WEBRTC_BUNDLE_POLICY_NONE")]
None,
#[doc(alias = "GST_WEBRTC_BUNDLE_POLICY_BALANCED")]
Balanced,
#[doc(alias = "GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT")]
MaxCompat,
#[doc(alias = "GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE")]
MaxBundle,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl IntoGlib for WebRTCBundlePolicy {
type GlibType = ffi::GstWebRTCBundlePolicy;
fn into_glib(self) -> ffi::GstWebRTCBundlePolicy {
match self {
Self::None => ffi::GST_WEBRTC_BUNDLE_POLICY_NONE,
Self::Balanced => ffi::GST_WEBRTC_BUNDLE_POLICY_BALANCED,
Self::MaxCompat => ffi::GST_WEBRTC_BUNDLE_POLICY_MAX_COMPAT,
Self::MaxBundle => ffi::GST_WEBRTC_BUNDLE_POLICY_MAX_BUNDLE,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCBundlePolicy> for WebRTCBundlePolicy {
unsafe fn from_glib(value: ffi::GstWebRTCBundlePolicy) -> Self {
skip_assert_initialized!();
match value {
0 => Self::None,
1 => Self::Balanced,
2 => Self::MaxCompat,
3 => Self::MaxBundle,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl StaticType for WebRTCBundlePolicy {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_bundle_policy_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl glib::value::ValueType for WebRTCBundlePolicy {
type Type = Self;
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
unsafe impl<'a> FromValue<'a> for WebRTCBundlePolicy {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl ToValue for WebRTCBundlePolicy {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCDTLSSetup")]
pub enum WebRTCDTLSSetup {
#[doc(alias = "GST_WEBRTC_DTLS_SETUP_NONE")]
None,
#[doc(alias = "GST_WEBRTC_DTLS_SETUP_ACTPASS")]
Actpass,
#[doc(alias = "GST_WEBRTC_DTLS_SETUP_ACTIVE")]
Active,
#[doc(alias = "GST_WEBRTC_DTLS_SETUP_PASSIVE")]
Passive,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCDTLSSetup {
type GlibType = ffi::GstWebRTCDTLSSetup;
fn into_glib(self) -> ffi::GstWebRTCDTLSSetup {
match self {
Self::None => ffi::GST_WEBRTC_DTLS_SETUP_NONE,
Self::Actpass => ffi::GST_WEBRTC_DTLS_SETUP_ACTPASS,
Self::Active => ffi::GST_WEBRTC_DTLS_SETUP_ACTIVE,
Self::Passive => ffi::GST_WEBRTC_DTLS_SETUP_PASSIVE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCDTLSSetup> for WebRTCDTLSSetup {
unsafe fn from_glib(value: ffi::GstWebRTCDTLSSetup) -> Self {
skip_assert_initialized!();
match value {
0 => Self::None,
1 => Self::Actpass,
2 => Self::Active,
3 => Self::Passive,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCDTLSSetup {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_dtls_setup_get_type()) }
}
}
impl glib::value::ValueType for WebRTCDTLSSetup {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCDTLSSetup {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCDTLSSetup {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCDTLSTransportState")]
pub enum WebRTCDTLSTransportState {
#[doc(alias = "GST_WEBRTC_DTLS_TRANSPORT_STATE_NEW")]
New,
#[doc(alias = "GST_WEBRTC_DTLS_TRANSPORT_STATE_CLOSED")]
Closed,
#[doc(alias = "GST_WEBRTC_DTLS_TRANSPORT_STATE_FAILED")]
Failed,
#[doc(alias = "GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTING")]
Connecting,
#[doc(alias = "GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTED")]
Connected,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCDTLSTransportState {
type GlibType = ffi::GstWebRTCDTLSTransportState;
fn into_glib(self) -> ffi::GstWebRTCDTLSTransportState {
match self {
Self::New => ffi::GST_WEBRTC_DTLS_TRANSPORT_STATE_NEW,
Self::Closed => ffi::GST_WEBRTC_DTLS_TRANSPORT_STATE_CLOSED,
Self::Failed => ffi::GST_WEBRTC_DTLS_TRANSPORT_STATE_FAILED,
Self::Connecting => ffi::GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTING,
Self::Connected => ffi::GST_WEBRTC_DTLS_TRANSPORT_STATE_CONNECTED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCDTLSTransportState> for WebRTCDTLSTransportState {
unsafe fn from_glib(value: ffi::GstWebRTCDTLSTransportState) -> Self {
skip_assert_initialized!();
match value {
0 => Self::New,
1 => Self::Closed,
2 => Self::Failed,
3 => Self::Connecting,
4 => Self::Connected,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCDTLSTransportState {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_dtls_transport_state_get_type()) }
}
}
impl glib::value::ValueType for WebRTCDTLSTransportState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCDTLSTransportState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCDTLSTransportState {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCDataChannelState")]
pub enum WebRTCDataChannelState {
#[doc(alias = "GST_WEBRTC_DATA_CHANNEL_STATE_NEW")]
New,
#[doc(alias = "GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING")]
Connecting,
#[doc(alias = "GST_WEBRTC_DATA_CHANNEL_STATE_OPEN")]
Open,
#[doc(alias = "GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING")]
Closing,
#[doc(alias = "GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED")]
Closed,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl IntoGlib for WebRTCDataChannelState {
type GlibType = ffi::GstWebRTCDataChannelState;
fn into_glib(self) -> ffi::GstWebRTCDataChannelState {
match self {
Self::New => ffi::GST_WEBRTC_DATA_CHANNEL_STATE_NEW,
Self::Connecting => ffi::GST_WEBRTC_DATA_CHANNEL_STATE_CONNECTING,
Self::Open => ffi::GST_WEBRTC_DATA_CHANNEL_STATE_OPEN,
Self::Closing => ffi::GST_WEBRTC_DATA_CHANNEL_STATE_CLOSING,
Self::Closed => ffi::GST_WEBRTC_DATA_CHANNEL_STATE_CLOSED,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCDataChannelState> for WebRTCDataChannelState {
unsafe fn from_glib(value: ffi::GstWebRTCDataChannelState) -> Self {
skip_assert_initialized!();
match value {
0 => Self::New,
1 => Self::Connecting,
2 => Self::Open,
3 => Self::Closing,
4 => Self::Closed,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl StaticType for WebRTCDataChannelState {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_data_channel_state_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl glib::value::ValueType for WebRTCDataChannelState {
type Type = Self;
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
unsafe impl<'a> FromValue<'a> for WebRTCDataChannelState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl ToValue for WebRTCDataChannelState {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCFECType")]
pub enum WebRTCFECType {
#[doc(alias = "GST_WEBRTC_FEC_TYPE_NONE")]
None,
#[doc(alias = "GST_WEBRTC_FEC_TYPE_ULP_RED")]
UlpRed,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))]
#[doc(hidden)]
impl IntoGlib for WebRTCFECType {
type GlibType = ffi::GstWebRTCFECType;
fn into_glib(self) -> ffi::GstWebRTCFECType {
match self {
Self::None => ffi::GST_WEBRTC_FEC_TYPE_NONE,
Self::UlpRed => ffi::GST_WEBRTC_FEC_TYPE_ULP_RED,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))]
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCFECType> for WebRTCFECType {
unsafe fn from_glib(value: ffi::GstWebRTCFECType) -> Self {
skip_assert_initialized!();
match value {
0 => Self::None,
1 => Self::UlpRed,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))]
impl StaticType for WebRTCFECType {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_fec_type_get_type()) }
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))]
impl glib::value::ValueType for WebRTCFECType {
type Type = Self;
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))]
unsafe impl<'a> FromValue<'a> for WebRTCFECType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))]
impl ToValue for WebRTCFECType {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCICEComponent")]
pub enum WebRTCICEComponent {
#[doc(alias = "GST_WEBRTC_ICE_COMPONENT_RTP")]
Rtp,
#[doc(alias = "GST_WEBRTC_ICE_COMPONENT_RTCP")]
Rtcp,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCICEComponent {
type GlibType = ffi::GstWebRTCICEComponent;
fn into_glib(self) -> ffi::GstWebRTCICEComponent {
match self {
Self::Rtp => ffi::GST_WEBRTC_ICE_COMPONENT_RTP,
Self::Rtcp => ffi::GST_WEBRTC_ICE_COMPONENT_RTCP,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCICEComponent> for WebRTCICEComponent {
unsafe fn from_glib(value: ffi::GstWebRTCICEComponent) -> Self {
skip_assert_initialized!();
match value {
0 => Self::Rtp,
1 => Self::Rtcp,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCICEComponent {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_ice_component_get_type()) }
}
}
impl glib::value::ValueType for WebRTCICEComponent {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCICEComponent {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCICEComponent {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCICEConnectionState")]
pub enum WebRTCICEConnectionState {
#[doc(alias = "GST_WEBRTC_ICE_CONNECTION_STATE_NEW")]
New,
#[doc(alias = "GST_WEBRTC_ICE_CONNECTION_STATE_CHECKING")]
Checking,
#[doc(alias = "GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED")]
Connected,
#[doc(alias = "GST_WEBRTC_ICE_CONNECTION_STATE_COMPLETED")]
Completed,
#[doc(alias = "GST_WEBRTC_ICE_CONNECTION_STATE_FAILED")]
Failed,
#[doc(alias = "GST_WEBRTC_ICE_CONNECTION_STATE_DISCONNECTED")]
Disconnected,
#[doc(alias = "GST_WEBRTC_ICE_CONNECTION_STATE_CLOSED")]
Closed,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCICEConnectionState {
type GlibType = ffi::GstWebRTCICEConnectionState;
fn into_glib(self) -> ffi::GstWebRTCICEConnectionState {
match self {
Self::New => ffi::GST_WEBRTC_ICE_CONNECTION_STATE_NEW,
Self::Checking => ffi::GST_WEBRTC_ICE_CONNECTION_STATE_CHECKING,
Self::Connected => ffi::GST_WEBRTC_ICE_CONNECTION_STATE_CONNECTED,
Self::Completed => ffi::GST_WEBRTC_ICE_CONNECTION_STATE_COMPLETED,
Self::Failed => ffi::GST_WEBRTC_ICE_CONNECTION_STATE_FAILED,
Self::Disconnected => ffi::GST_WEBRTC_ICE_CONNECTION_STATE_DISCONNECTED,
Self::Closed => ffi::GST_WEBRTC_ICE_CONNECTION_STATE_CLOSED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCICEConnectionState> for WebRTCICEConnectionState {
unsafe fn from_glib(value: ffi::GstWebRTCICEConnectionState) -> Self {
skip_assert_initialized!();
match value {
0 => Self::New,
1 => Self::Checking,
2 => Self::Connected,
3 => Self::Completed,
4 => Self::Failed,
5 => Self::Disconnected,
6 => Self::Closed,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCICEConnectionState {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_ice_connection_state_get_type()) }
}
}
impl glib::value::ValueType for WebRTCICEConnectionState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCICEConnectionState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCICEConnectionState {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCICEGatheringState")]
pub enum WebRTCICEGatheringState {
#[doc(alias = "GST_WEBRTC_ICE_GATHERING_STATE_NEW")]
New,
#[doc(alias = "GST_WEBRTC_ICE_GATHERING_STATE_GATHERING")]
Gathering,
#[doc(alias = "GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE")]
Complete,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCICEGatheringState {
type GlibType = ffi::GstWebRTCICEGatheringState;
fn into_glib(self) -> ffi::GstWebRTCICEGatheringState {
match self {
Self::New => ffi::GST_WEBRTC_ICE_GATHERING_STATE_NEW,
Self::Gathering => ffi::GST_WEBRTC_ICE_GATHERING_STATE_GATHERING,
Self::Complete => ffi::GST_WEBRTC_ICE_GATHERING_STATE_COMPLETE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCICEGatheringState> for WebRTCICEGatheringState {
unsafe fn from_glib(value: ffi::GstWebRTCICEGatheringState) -> Self {
skip_assert_initialized!();
match value {
0 => Self::New,
1 => Self::Gathering,
2 => Self::Complete,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCICEGatheringState {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_ice_gathering_state_get_type()) }
}
}
impl glib::value::ValueType for WebRTCICEGatheringState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCICEGatheringState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCICEGatheringState {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCICERole")]
pub enum WebRTCICERole {
#[doc(alias = "GST_WEBRTC_ICE_ROLE_CONTROLLED")]
Controlled,
#[doc(alias = "GST_WEBRTC_ICE_ROLE_CONTROLLING")]
Controlling,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCICERole {
type GlibType = ffi::GstWebRTCICERole;
fn into_glib(self) -> ffi::GstWebRTCICERole {
match self {
Self::Controlled => ffi::GST_WEBRTC_ICE_ROLE_CONTROLLED,
Self::Controlling => ffi::GST_WEBRTC_ICE_ROLE_CONTROLLING,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCICERole> for WebRTCICERole {
unsafe fn from_glib(value: ffi::GstWebRTCICERole) -> Self {
skip_assert_initialized!();
match value {
0 => Self::Controlled,
1 => Self::Controlling,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCICERole {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_ice_role_get_type()) }
}
}
impl glib::value::ValueType for WebRTCICERole {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCICERole {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCICERole {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCICETransportPolicy")]
pub enum WebRTCICETransportPolicy {
#[doc(alias = "GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL")]
All,
#[doc(alias = "GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY")]
Relay,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl IntoGlib for WebRTCICETransportPolicy {
type GlibType = ffi::GstWebRTCICETransportPolicy;
fn into_glib(self) -> ffi::GstWebRTCICETransportPolicy {
match self {
Self::All => ffi::GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL,
Self::Relay => ffi::GST_WEBRTC_ICE_TRANSPORT_POLICY_RELAY,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCICETransportPolicy> for WebRTCICETransportPolicy {
unsafe fn from_glib(value: ffi::GstWebRTCICETransportPolicy) -> Self {
skip_assert_initialized!();
match value {
0 => Self::All,
1 => Self::Relay,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl StaticType for WebRTCICETransportPolicy {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_ice_transport_policy_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl glib::value::ValueType for WebRTCICETransportPolicy {
type Type = Self;
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
unsafe impl<'a> FromValue<'a> for WebRTCICETransportPolicy {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl ToValue for WebRTCICETransportPolicy {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCPeerConnectionState")]
pub enum WebRTCPeerConnectionState {
#[doc(alias = "GST_WEBRTC_PEER_CONNECTION_STATE_NEW")]
New,
#[doc(alias = "GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTING")]
Connecting,
#[doc(alias = "GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTED")]
Connected,
#[doc(alias = "GST_WEBRTC_PEER_CONNECTION_STATE_DISCONNECTED")]
Disconnected,
#[doc(alias = "GST_WEBRTC_PEER_CONNECTION_STATE_FAILED")]
Failed,
#[doc(alias = "GST_WEBRTC_PEER_CONNECTION_STATE_CLOSED")]
Closed,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCPeerConnectionState {
type GlibType = ffi::GstWebRTCPeerConnectionState;
fn into_glib(self) -> ffi::GstWebRTCPeerConnectionState {
match self {
Self::New => ffi::GST_WEBRTC_PEER_CONNECTION_STATE_NEW,
Self::Connecting => ffi::GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTING,
Self::Connected => ffi::GST_WEBRTC_PEER_CONNECTION_STATE_CONNECTED,
Self::Disconnected => ffi::GST_WEBRTC_PEER_CONNECTION_STATE_DISCONNECTED,
Self::Failed => ffi::GST_WEBRTC_PEER_CONNECTION_STATE_FAILED,
Self::Closed => ffi::GST_WEBRTC_PEER_CONNECTION_STATE_CLOSED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCPeerConnectionState> for WebRTCPeerConnectionState {
unsafe fn from_glib(value: ffi::GstWebRTCPeerConnectionState) -> Self {
skip_assert_initialized!();
match value {
0 => Self::New,
1 => Self::Connecting,
2 => Self::Connected,
3 => Self::Disconnected,
4 => Self::Failed,
5 => Self::Closed,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCPeerConnectionState {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_peer_connection_state_get_type()) }
}
}
impl glib::value::ValueType for WebRTCPeerConnectionState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCPeerConnectionState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCPeerConnectionState {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCPriorityType")]
pub enum WebRTCPriorityType {
#[doc(alias = "GST_WEBRTC_PRIORITY_TYPE_VERY_LOW")]
VeryLow,
#[doc(alias = "GST_WEBRTC_PRIORITY_TYPE_LOW")]
Low,
#[doc(alias = "GST_WEBRTC_PRIORITY_TYPE_MEDIUM")]
Medium,
#[doc(alias = "GST_WEBRTC_PRIORITY_TYPE_HIGH")]
High,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl IntoGlib for WebRTCPriorityType {
type GlibType = ffi::GstWebRTCPriorityType;
fn into_glib(self) -> ffi::GstWebRTCPriorityType {
match self {
Self::VeryLow => ffi::GST_WEBRTC_PRIORITY_TYPE_VERY_LOW,
Self::Low => ffi::GST_WEBRTC_PRIORITY_TYPE_LOW,
Self::Medium => ffi::GST_WEBRTC_PRIORITY_TYPE_MEDIUM,
Self::High => ffi::GST_WEBRTC_PRIORITY_TYPE_HIGH,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCPriorityType> for WebRTCPriorityType {
unsafe fn from_glib(value: ffi::GstWebRTCPriorityType) -> Self {
skip_assert_initialized!();
match value {
1 => Self::VeryLow,
2 => Self::Low,
3 => Self::Medium,
4 => Self::High,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl StaticType for WebRTCPriorityType {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_priority_type_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl glib::value::ValueType for WebRTCPriorityType {
type Type = Self;
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
unsafe impl<'a> FromValue<'a> for WebRTCPriorityType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl ToValue for WebRTCPriorityType {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCRTPTransceiverDirection")]
pub enum WebRTCRTPTransceiverDirection {
#[doc(alias = "GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_NONE")]
None,
#[doc(alias = "GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE")]
Inactive,
#[doc(alias = "GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY")]
Sendonly,
#[doc(alias = "GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY")]
Recvonly,
#[doc(alias = "GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV")]
Sendrecv,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCRTPTransceiverDirection {
type GlibType = ffi::GstWebRTCRTPTransceiverDirection;
fn into_glib(self) -> ffi::GstWebRTCRTPTransceiverDirection {
match self {
Self::None => ffi::GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_NONE,
Self::Inactive => ffi::GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE,
Self::Sendonly => ffi::GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY,
Self::Recvonly => ffi::GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY,
Self::Sendrecv => ffi::GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCRTPTransceiverDirection> for WebRTCRTPTransceiverDirection {
unsafe fn from_glib(value: ffi::GstWebRTCRTPTransceiverDirection) -> Self {
skip_assert_initialized!();
match value {
0 => Self::None,
1 => Self::Inactive,
2 => Self::Sendonly,
3 => Self::Recvonly,
4 => Self::Sendrecv,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCRTPTransceiverDirection {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_rtp_transceiver_direction_get_type()) }
}
}
impl glib::value::ValueType for WebRTCRTPTransceiverDirection {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCRTPTransceiverDirection {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCRTPTransceiverDirection {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCSCTPTransportState")]
pub enum WebRTCSCTPTransportState {
#[doc(alias = "GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW")]
New,
#[doc(alias = "GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING")]
Connecting,
#[doc(alias = "GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED")]
Connected,
#[doc(alias = "GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED")]
Closed,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl IntoGlib for WebRTCSCTPTransportState {
type GlibType = ffi::GstWebRTCSCTPTransportState;
fn into_glib(self) -> ffi::GstWebRTCSCTPTransportState {
match self {
Self::New => ffi::GST_WEBRTC_SCTP_TRANSPORT_STATE_NEW,
Self::Connecting => ffi::GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTING,
Self::Connected => ffi::GST_WEBRTC_SCTP_TRANSPORT_STATE_CONNECTED,
Self::Closed => ffi::GST_WEBRTC_SCTP_TRANSPORT_STATE_CLOSED,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCSCTPTransportState> for WebRTCSCTPTransportState {
unsafe fn from_glib(value: ffi::GstWebRTCSCTPTransportState) -> Self {
skip_assert_initialized!();
match value {
0 => Self::New,
1 => Self::Connecting,
2 => Self::Connected,
3 => Self::Closed,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl StaticType for WebRTCSCTPTransportState {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_sctp_transport_state_get_type()) }
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl glib::value::ValueType for WebRTCSCTPTransportState {
type Type = Self;
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
unsafe impl<'a> FromValue<'a> for WebRTCSCTPTransportState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
impl ToValue for WebRTCSCTPTransportState {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCSDPType")]
pub enum WebRTCSDPType {
#[doc(alias = "GST_WEBRTC_SDP_TYPE_OFFER")]
Offer,
#[doc(alias = "GST_WEBRTC_SDP_TYPE_PRANSWER")]
Pranswer,
#[doc(alias = "GST_WEBRTC_SDP_TYPE_ANSWER")]
Answer,
#[doc(alias = "GST_WEBRTC_SDP_TYPE_ROLLBACK")]
Rollback,
#[doc(hidden)]
__Unknown(i32),
}
impl WebRTCSDPType {
pub fn to_str<'a>(self) -> &'a str {
unsafe {
CStr::from_ptr(
ffi::gst_webrtc_sdp_type_to_string(self.into_glib())
.as_ref()
.expect("gst_webrtc_sdp_type_to_string returned NULL"),
)
.to_str()
.expect("gst_webrtc_sdp_type_to_string returned an invalid string")
}
}
}
impl fmt::Display for WebRTCSDPType {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.to_str())
}
}
#[doc(hidden)]
impl IntoGlib for WebRTCSDPType {
type GlibType = ffi::GstWebRTCSDPType;
fn into_glib(self) -> ffi::GstWebRTCSDPType {
match self {
Self::Offer => ffi::GST_WEBRTC_SDP_TYPE_OFFER,
Self::Pranswer => ffi::GST_WEBRTC_SDP_TYPE_PRANSWER,
Self::Answer => ffi::GST_WEBRTC_SDP_TYPE_ANSWER,
Self::Rollback => ffi::GST_WEBRTC_SDP_TYPE_ROLLBACK,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCSDPType> for WebRTCSDPType {
unsafe fn from_glib(value: ffi::GstWebRTCSDPType) -> Self {
skip_assert_initialized!();
match value {
1 => Self::Offer,
2 => Self::Pranswer,
3 => Self::Answer,
4 => Self::Rollback,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCSDPType {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_sdp_type_get_type()) }
}
}
impl glib::value::ValueType for WebRTCSDPType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCSDPType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCSDPType {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCSignalingState")]
pub enum WebRTCSignalingState {
#[doc(alias = "GST_WEBRTC_SIGNALING_STATE_STABLE")]
Stable,
#[doc(alias = "GST_WEBRTC_SIGNALING_STATE_CLOSED")]
Closed,
#[doc(alias = "GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER")]
HaveLocalOffer,
#[doc(alias = "GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER")]
HaveRemoteOffer,
#[doc(alias = "GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER")]
HaveLocalPranswer,
#[doc(alias = "GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER")]
HaveRemotePranswer,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCSignalingState {
type GlibType = ffi::GstWebRTCSignalingState;
fn into_glib(self) -> ffi::GstWebRTCSignalingState {
match self {
Self::Stable => ffi::GST_WEBRTC_SIGNALING_STATE_STABLE,
Self::Closed => ffi::GST_WEBRTC_SIGNALING_STATE_CLOSED,
Self::HaveLocalOffer => ffi::GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_OFFER,
Self::HaveRemoteOffer => ffi::GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_OFFER,
Self::HaveLocalPranswer => ffi::GST_WEBRTC_SIGNALING_STATE_HAVE_LOCAL_PRANSWER,
Self::HaveRemotePranswer => ffi::GST_WEBRTC_SIGNALING_STATE_HAVE_REMOTE_PRANSWER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCSignalingState> for WebRTCSignalingState {
unsafe fn from_glib(value: ffi::GstWebRTCSignalingState) -> Self {
skip_assert_initialized!();
match value {
0 => Self::Stable,
1 => Self::Closed,
2 => Self::HaveLocalOffer,
3 => Self::HaveRemoteOffer,
4 => Self::HaveLocalPranswer,
5 => Self::HaveRemotePranswer,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCSignalingState {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_signaling_state_get_type()) }
}
}
impl glib::value::ValueType for WebRTCSignalingState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCSignalingState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCSignalingState {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GstWebRTCStatsType")]
pub enum WebRTCStatsType {
#[doc(alias = "GST_WEBRTC_STATS_CODEC")]
Codec,
#[doc(alias = "GST_WEBRTC_STATS_INBOUND_RTP")]
InboundRtp,
#[doc(alias = "GST_WEBRTC_STATS_OUTBOUND_RTP")]
OutboundRtp,
#[doc(alias = "GST_WEBRTC_STATS_REMOTE_INBOUND_RTP")]
RemoteInboundRtp,
#[doc(alias = "GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP")]
RemoteOutboundRtp,
#[doc(alias = "GST_WEBRTC_STATS_CSRC")]
Csrc,
#[doc(alias = "GST_WEBRTC_STATS_PEER_CONNECTION")]
PeerConnection,
#[doc(alias = "GST_WEBRTC_STATS_DATA_CHANNEL")]
DataChannel,
#[doc(alias = "GST_WEBRTC_STATS_STREAM")]
Stream,
#[doc(alias = "GST_WEBRTC_STATS_TRANSPORT")]
Transport,
#[doc(alias = "GST_WEBRTC_STATS_CANDIDATE_PAIR")]
CandidatePair,
#[doc(alias = "GST_WEBRTC_STATS_LOCAL_CANDIDATE")]
LocalCandidate,
#[doc(alias = "GST_WEBRTC_STATS_REMOTE_CANDIDATE")]
RemoteCandidate,
#[doc(alias = "GST_WEBRTC_STATS_CERTIFICATE")]
Certificate,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl IntoGlib for WebRTCStatsType {
type GlibType = ffi::GstWebRTCStatsType;
fn into_glib(self) -> ffi::GstWebRTCStatsType {
match self {
Self::Codec => ffi::GST_WEBRTC_STATS_CODEC,
Self::InboundRtp => ffi::GST_WEBRTC_STATS_INBOUND_RTP,
Self::OutboundRtp => ffi::GST_WEBRTC_STATS_OUTBOUND_RTP,
Self::RemoteInboundRtp => ffi::GST_WEBRTC_STATS_REMOTE_INBOUND_RTP,
Self::RemoteOutboundRtp => ffi::GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP,
Self::Csrc => ffi::GST_WEBRTC_STATS_CSRC,
Self::PeerConnection => ffi::GST_WEBRTC_STATS_PEER_CONNECTION,
Self::DataChannel => ffi::GST_WEBRTC_STATS_DATA_CHANNEL,
Self::Stream => ffi::GST_WEBRTC_STATS_STREAM,
Self::Transport => ffi::GST_WEBRTC_STATS_TRANSPORT,
Self::CandidatePair => ffi::GST_WEBRTC_STATS_CANDIDATE_PAIR,
Self::LocalCandidate => ffi::GST_WEBRTC_STATS_LOCAL_CANDIDATE,
Self::RemoteCandidate => ffi::GST_WEBRTC_STATS_REMOTE_CANDIDATE,
Self::Certificate => ffi::GST_WEBRTC_STATS_CERTIFICATE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstWebRTCStatsType> for WebRTCStatsType {
unsafe fn from_glib(value: ffi::GstWebRTCStatsType) -> Self {
skip_assert_initialized!();
match value {
1 => Self::Codec,
2 => Self::InboundRtp,
3 => Self::OutboundRtp,
4 => Self::RemoteInboundRtp,
5 => Self::RemoteOutboundRtp,
6 => Self::Csrc,
7 => Self::PeerConnection,
8 => Self::DataChannel,
9 => Self::Stream,
10 => Self::Transport,
11 => Self::CandidatePair,
12 => Self::LocalCandidate,
13 => Self::RemoteCandidate,
14 => Self::Certificate,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WebRTCStatsType {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_stats_type_get_type()) }
}
}
impl glib::value::ValueType for WebRTCStatsType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WebRTCStatsType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCStatsType {
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}