gstreamer-rtsp-server: Regenerate

This commit is contained in:
Sebastian Dröge 2020-11-22 12:40:56 +02:00
parent 0327e98b5f
commit 1e9d3e717c
18 changed files with 977 additions and 1280 deletions

View file

@ -9,8 +9,6 @@ use glib::value::SetValue;
use glib::value::Value; use glib::value::Value;
use glib::StaticType; use glib::StaticType;
use glib::Type; use glib::Type;
use gobject_sys;
use gst_rtsp_server_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive] #[non_exhaustive]
@ -26,25 +24,23 @@ pub enum RTSPAddressPoolResult {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPAddressPoolResult { impl ToGlib for RTSPAddressPoolResult {
type GlibType = gst_rtsp_server_sys::GstRTSPAddressPoolResult; type GlibType = ffi::GstRTSPAddressPoolResult;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPAddressPoolResult { fn to_glib(&self) -> ffi::GstRTSPAddressPoolResult {
match *self { match *self {
RTSPAddressPoolResult::Ok => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_OK, RTSPAddressPoolResult::Ok => ffi::GST_RTSP_ADDRESS_POOL_OK,
RTSPAddressPoolResult::Einval => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_EINVAL, RTSPAddressPoolResult::Einval => ffi::GST_RTSP_ADDRESS_POOL_EINVAL,
RTSPAddressPoolResult::Ereserved => { RTSPAddressPoolResult::Ereserved => ffi::GST_RTSP_ADDRESS_POOL_ERESERVED,
gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ERESERVED RTSPAddressPoolResult::Erange => ffi::GST_RTSP_ADDRESS_POOL_ERANGE,
} RTSPAddressPoolResult::Elast => ffi::GST_RTSP_ADDRESS_POOL_ELAST,
RTSPAddressPoolResult::Erange => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ERANGE,
RTSPAddressPoolResult::Elast => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ELAST,
RTSPAddressPoolResult::__Unknown(value) => value, RTSPAddressPoolResult::__Unknown(value) => value,
} }
} }
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPAddressPoolResult> for RTSPAddressPoolResult { impl FromGlib<ffi::GstRTSPAddressPoolResult> for RTSPAddressPoolResult {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPAddressPoolResult) -> Self { fn from_glib(value: ffi::GstRTSPAddressPoolResult) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value { match value {
0 => RTSPAddressPoolResult::Ok, 0 => RTSPAddressPoolResult::Ok,
@ -69,21 +65,21 @@ pub enum RTSPFilterResult {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPFilterResult { impl ToGlib for RTSPFilterResult {
type GlibType = gst_rtsp_server_sys::GstRTSPFilterResult; type GlibType = ffi::GstRTSPFilterResult;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPFilterResult { fn to_glib(&self) -> ffi::GstRTSPFilterResult {
match *self { match *self {
RTSPFilterResult::Remove => gst_rtsp_server_sys::GST_RTSP_FILTER_REMOVE, RTSPFilterResult::Remove => ffi::GST_RTSP_FILTER_REMOVE,
RTSPFilterResult::Keep => gst_rtsp_server_sys::GST_RTSP_FILTER_KEEP, RTSPFilterResult::Keep => ffi::GST_RTSP_FILTER_KEEP,
RTSPFilterResult::Ref => gst_rtsp_server_sys::GST_RTSP_FILTER_REF, RTSPFilterResult::Ref => ffi::GST_RTSP_FILTER_REF,
RTSPFilterResult::__Unknown(value) => value, RTSPFilterResult::__Unknown(value) => value,
} }
} }
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPFilterResult> for RTSPFilterResult { impl FromGlib<ffi::GstRTSPFilterResult> for RTSPFilterResult {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPFilterResult) -> Self { fn from_glib(value: ffi::GstRTSPFilterResult) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value { match value {
0 => RTSPFilterResult::Remove, 0 => RTSPFilterResult::Remove,
@ -109,24 +105,24 @@ pub enum RTSPMediaStatus {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPMediaStatus { impl ToGlib for RTSPMediaStatus {
type GlibType = gst_rtsp_server_sys::GstRTSPMediaStatus; type GlibType = ffi::GstRTSPMediaStatus;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPMediaStatus { fn to_glib(&self) -> ffi::GstRTSPMediaStatus {
match *self { match *self {
RTSPMediaStatus::Unprepared => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_UNPREPARED, RTSPMediaStatus::Unprepared => ffi::GST_RTSP_MEDIA_STATUS_UNPREPARED,
RTSPMediaStatus::Unpreparing => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_UNPREPARING, RTSPMediaStatus::Unpreparing => ffi::GST_RTSP_MEDIA_STATUS_UNPREPARING,
RTSPMediaStatus::Preparing => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_PREPARING, RTSPMediaStatus::Preparing => ffi::GST_RTSP_MEDIA_STATUS_PREPARING,
RTSPMediaStatus::Prepared => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_PREPARED, RTSPMediaStatus::Prepared => ffi::GST_RTSP_MEDIA_STATUS_PREPARED,
RTSPMediaStatus::Suspended => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_SUSPENDED, RTSPMediaStatus::Suspended => ffi::GST_RTSP_MEDIA_STATUS_SUSPENDED,
RTSPMediaStatus::Error => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_ERROR, RTSPMediaStatus::Error => ffi::GST_RTSP_MEDIA_STATUS_ERROR,
RTSPMediaStatus::__Unknown(value) => value, RTSPMediaStatus::__Unknown(value) => value,
} }
} }
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPMediaStatus> for RTSPMediaStatus { impl FromGlib<ffi::GstRTSPMediaStatus> for RTSPMediaStatus {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPMediaStatus) -> Self { fn from_glib(value: ffi::GstRTSPMediaStatus) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value { match value {
0 => RTSPMediaStatus::Unprepared, 0 => RTSPMediaStatus::Unprepared,
@ -152,14 +148,14 @@ pub enum RTSPPublishClockMode {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPPublishClockMode { impl ToGlib for RTSPPublishClockMode {
type GlibType = gst_rtsp_server_sys::GstRTSPPublishClockMode; type GlibType = ffi::GstRTSPPublishClockMode;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPPublishClockMode { fn to_glib(&self) -> ffi::GstRTSPPublishClockMode {
match *self { match *self {
RTSPPublishClockMode::None => gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_NONE, RTSPPublishClockMode::None => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_NONE,
RTSPPublishClockMode::Clock => gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK, RTSPPublishClockMode::Clock => ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK,
RTSPPublishClockMode::ClockAndOffset => { RTSPPublishClockMode::ClockAndOffset => {
gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET ffi::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET
} }
RTSPPublishClockMode::__Unknown(value) => value, RTSPPublishClockMode::__Unknown(value) => value,
} }
@ -167,8 +163,8 @@ impl ToGlib for RTSPPublishClockMode {
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPPublishClockMode> for RTSPPublishClockMode { impl FromGlib<ffi::GstRTSPPublishClockMode> for RTSPPublishClockMode {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPPublishClockMode) -> Self { fn from_glib(value: ffi::GstRTSPPublishClockMode) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value { match value {
0 => RTSPPublishClockMode::None, 0 => RTSPPublishClockMode::None,
@ -181,7 +177,7 @@ impl FromGlib<gst_rtsp_server_sys::GstRTSPPublishClockMode> for RTSPPublishClock
impl StaticType for RTSPPublishClockMode { impl StaticType for RTSPPublishClockMode {
fn static_type() -> Type { fn static_type() -> Type {
unsafe { from_glib(gst_rtsp_server_sys::gst_rtsp_publish_clock_mode_get_type()) } unsafe { from_glib(ffi::gst_rtsp_publish_clock_mode_get_type()) }
} }
} }
@ -193,13 +189,13 @@ impl<'a> FromValueOptional<'a> for RTSPPublishClockMode {
impl<'a> FromValue<'a> for RTSPPublishClockMode { impl<'a> FromValue<'a> for RTSPPublishClockMode {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for RTSPPublishClockMode { impl SetValue for RTSPPublishClockMode {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }
@ -215,21 +211,21 @@ pub enum RTSPSuspendMode {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPSuspendMode { impl ToGlib for RTSPSuspendMode {
type GlibType = gst_rtsp_server_sys::GstRTSPSuspendMode; type GlibType = ffi::GstRTSPSuspendMode;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPSuspendMode { fn to_glib(&self) -> ffi::GstRTSPSuspendMode {
match *self { match *self {
RTSPSuspendMode::None => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_NONE, RTSPSuspendMode::None => ffi::GST_RTSP_SUSPEND_MODE_NONE,
RTSPSuspendMode::Pause => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_PAUSE, RTSPSuspendMode::Pause => ffi::GST_RTSP_SUSPEND_MODE_PAUSE,
RTSPSuspendMode::Reset => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_RESET, RTSPSuspendMode::Reset => ffi::GST_RTSP_SUSPEND_MODE_RESET,
RTSPSuspendMode::__Unknown(value) => value, RTSPSuspendMode::__Unknown(value) => value,
} }
} }
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPSuspendMode> for RTSPSuspendMode { impl FromGlib<ffi::GstRTSPSuspendMode> for RTSPSuspendMode {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPSuspendMode) -> Self { fn from_glib(value: ffi::GstRTSPSuspendMode) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value { match value {
0 => RTSPSuspendMode::None, 0 => RTSPSuspendMode::None,
@ -242,7 +238,7 @@ impl FromGlib<gst_rtsp_server_sys::GstRTSPSuspendMode> for RTSPSuspendMode {
impl StaticType for RTSPSuspendMode { impl StaticType for RTSPSuspendMode {
fn static_type() -> Type { fn static_type() -> Type {
unsafe { from_glib(gst_rtsp_server_sys::gst_rtsp_suspend_mode_get_type()) } unsafe { from_glib(ffi::gst_rtsp_suspend_mode_get_type()) }
} }
} }
@ -254,13 +250,13 @@ impl<'a> FromValueOptional<'a> for RTSPSuspendMode {
impl<'a> FromValue<'a> for RTSPSuspendMode { impl<'a> FromValue<'a> for RTSPSuspendMode {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
} }
} }
impl SetValue for RTSPSuspendMode { impl SetValue for RTSPSuspendMode {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
} }
} }
@ -275,20 +271,20 @@ pub enum RTSPThreadType {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPThreadType { impl ToGlib for RTSPThreadType {
type GlibType = gst_rtsp_server_sys::GstRTSPThreadType; type GlibType = ffi::GstRTSPThreadType;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPThreadType { fn to_glib(&self) -> ffi::GstRTSPThreadType {
match *self { match *self {
RTSPThreadType::Client => gst_rtsp_server_sys::GST_RTSP_THREAD_TYPE_CLIENT, RTSPThreadType::Client => ffi::GST_RTSP_THREAD_TYPE_CLIENT,
RTSPThreadType::Media => gst_rtsp_server_sys::GST_RTSP_THREAD_TYPE_MEDIA, RTSPThreadType::Media => ffi::GST_RTSP_THREAD_TYPE_MEDIA,
RTSPThreadType::__Unknown(value) => value, RTSPThreadType::__Unknown(value) => value,
} }
} }
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPThreadType> for RTSPThreadType { impl FromGlib<ffi::GstRTSPThreadType> for RTSPThreadType {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPThreadType) -> Self { fn from_glib(value: ffi::GstRTSPThreadType) -> Self {
skip_assert_initialized!(); skip_assert_initialized!();
match value { match value {
0 => RTSPThreadType::Client, 0 => RTSPThreadType::Client,

View file

@ -2,6 +2,7 @@
// 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
use bitflags::bitflags;
use glib::translate::*; use glib::translate::*;
use glib::value::FromValue; use glib::value::FromValue;
use glib::value::FromValueOptional; use glib::value::FromValueOptional;
@ -9,8 +10,6 @@ use glib::value::SetValue;
use glib::value::Value; use glib::value::Value;
use glib::StaticType; use glib::StaticType;
use glib::Type; use glib::Type;
use gobject_sys;
use gst_rtsp_server_sys;
bitflags! { bitflags! {
pub struct RTSPAddressFlags: u32 { pub struct RTSPAddressFlags: u32 {
@ -24,16 +23,16 @@ bitflags! {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPAddressFlags { impl ToGlib for RTSPAddressFlags {
type GlibType = gst_rtsp_server_sys::GstRTSPAddressFlags; type GlibType = ffi::GstRTSPAddressFlags;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPAddressFlags { fn to_glib(&self) -> ffi::GstRTSPAddressFlags {
self.bits() self.bits()
} }
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPAddressFlags> for RTSPAddressFlags { impl FromGlib<ffi::GstRTSPAddressFlags> for RTSPAddressFlags {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPAddressFlags) -> RTSPAddressFlags { fn from_glib(value: ffi::GstRTSPAddressFlags) -> RTSPAddressFlags {
skip_assert_initialized!(); skip_assert_initialized!();
RTSPAddressFlags::from_bits_truncate(value) RTSPAddressFlags::from_bits_truncate(value)
} }
@ -48,16 +47,16 @@ bitflags! {
#[doc(hidden)] #[doc(hidden)]
impl ToGlib for RTSPTransportMode { impl ToGlib for RTSPTransportMode {
type GlibType = gst_rtsp_server_sys::GstRTSPTransportMode; type GlibType = ffi::GstRTSPTransportMode;
fn to_glib(&self) -> gst_rtsp_server_sys::GstRTSPTransportMode { fn to_glib(&self) -> ffi::GstRTSPTransportMode {
self.bits() self.bits()
} }
} }
#[doc(hidden)] #[doc(hidden)]
impl FromGlib<gst_rtsp_server_sys::GstRTSPTransportMode> for RTSPTransportMode { impl FromGlib<ffi::GstRTSPTransportMode> for RTSPTransportMode {
fn from_glib(value: gst_rtsp_server_sys::GstRTSPTransportMode) -> RTSPTransportMode { fn from_glib(value: ffi::GstRTSPTransportMode) -> RTSPTransportMode {
skip_assert_initialized!(); skip_assert_initialized!();
RTSPTransportMode::from_bits_truncate(value) RTSPTransportMode::from_bits_truncate(value)
} }
@ -65,7 +64,7 @@ impl FromGlib<gst_rtsp_server_sys::GstRTSPTransportMode> for RTSPTransportMode {
impl StaticType for RTSPTransportMode { impl StaticType for RTSPTransportMode {
fn static_type() -> Type { fn static_type() -> Type {
unsafe { from_glib(gst_rtsp_server_sys::gst_rtsp_transport_mode_get_type()) } unsafe { from_glib(ffi::gst_rtsp_transport_mode_get_type()) }
} }
} }
@ -77,12 +76,12 @@ impl<'a> FromValueOptional<'a> for RTSPTransportMode {
impl<'a> FromValue<'a> for RTSPTransportMode { impl<'a> FromValue<'a> for RTSPTransportMode {
unsafe fn from_value(value: &Value) -> Self { unsafe fn from_value(value: &Value) -> Self {
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0)) from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
} }
} }
impl SetValue for RTSPTransportMode { impl SetValue for RTSPTransportMode {
unsafe fn set_value(value: &mut Value, this: &Self) { unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
} }
} }

View file

@ -3,16 +3,15 @@
// DO NOT EDIT // DO NOT EDIT
use glib::translate::*; use glib::translate::*;
use gst_rtsp_server_sys;
glib_wrapper! { glib::glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct RTSPAddress(Boxed<gst_rtsp_server_sys::GstRTSPAddress>); pub struct RTSPAddress(Boxed<ffi::GstRTSPAddress>);
match fn { match fn {
copy => |ptr| gst_rtsp_server_sys::gst_rtsp_address_copy(mut_override(ptr)), copy => |ptr| ffi::gst_rtsp_address_copy(mut_override(ptr)),
free => |ptr| gst_rtsp_server_sys::gst_rtsp_address_free(ptr), free => |ptr| ffi::gst_rtsp_address_free(ptr),
get_type => || gst_rtsp_server_sys::gst_rtsp_address_get_type(), get_type => || ffi::gst_rtsp_address_get_type(),
} }
} }

View file

@ -2,25 +2,23 @@
// 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
use glib; use crate::RTSPAddress;
use crate::RTSPAddressFlags;
use glib::object::IsA; use glib::object::IsA;
use glib::translate::*; use glib::translate::*;
use gst_rtsp_server_sys;
use RTSPAddress;
use RTSPAddressFlags;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPAddressPool(Object<gst_rtsp_server_sys::GstRTSPAddressPool, gst_rtsp_server_sys::GstRTSPAddressPoolClass>); pub struct RTSPAddressPool(Object<ffi::GstRTSPAddressPool, ffi::GstRTSPAddressPoolClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_address_pool_get_type(), get_type => || ffi::gst_rtsp_address_pool_get_type(),
} }
} }
impl RTSPAddressPool { impl RTSPAddressPool {
pub fn new() -> RTSPAddressPool { pub fn new() -> RTSPAddressPool {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_address_pool_new()) } unsafe { from_glib_full(ffi::gst_rtsp_address_pool_new()) }
} }
} }
@ -65,12 +63,12 @@ impl<O: IsA<RTSPAddressPool>> RTSPAddressPoolExt for O {
n_ports: i32, n_ports: i32,
) -> Result<RTSPAddress, glib::BoolError> { ) -> Result<RTSPAddress, glib::BoolError> {
unsafe { unsafe {
Option::<_>::from_glib_full(gst_rtsp_server_sys::gst_rtsp_address_pool_acquire_address( Option::<_>::from_glib_full(ffi::gst_rtsp_address_pool_acquire_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
flags.to_glib(), flags.to_glib(),
n_ports, n_ports,
)) ))
.ok_or_else(|| glib_bool_error!("Failed to acquire address")) .ok_or_else(|| glib::glib_bool_error!("Failed to acquire address"))
} }
} }
@ -83,8 +81,8 @@ impl<O: IsA<RTSPAddressPool>> RTSPAddressPoolExt for O {
ttl: u8, ttl: u8,
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_address_pool_add_range( ffi::gst_rtsp_address_pool_add_range(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
min_address.to_glib_none().0, min_address.to_glib_none().0,
max_address.to_glib_none().0, max_address.to_glib_none().0,
@ -99,23 +97,21 @@ impl<O: IsA<RTSPAddressPool>> RTSPAddressPoolExt for O {
fn clear(&self) { fn clear(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_address_pool_clear(self.as_ref().to_glib_none().0); ffi::gst_rtsp_address_pool_clear(self.as_ref().to_glib_none().0);
} }
} }
fn dump(&self) { fn dump(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_address_pool_dump(self.as_ref().to_glib_none().0); ffi::gst_rtsp_address_pool_dump(self.as_ref().to_glib_none().0);
} }
} }
fn has_unicast_addresses(&self) -> bool { fn has_unicast_addresses(&self) -> bool {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_address_pool_has_unicast_addresses(
gst_rtsp_server_sys::gst_rtsp_address_pool_has_unicast_addresses( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
} }

View file

@ -2,55 +2,43 @@
// 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
use gio; use crate::RTSPToken;
use gio_sys;
use glib;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use glib_sys;
#[cfg(any(feature = "v1_12", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
use gst_rtsp;
use gst_rtsp_server_sys;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use std;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem::transmute; use std::mem::transmute;
use RTSPToken;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPAuth(Object<gst_rtsp_server_sys::GstRTSPAuth, gst_rtsp_server_sys::GstRTSPAuthClass>); pub struct RTSPAuth(Object<ffi::GstRTSPAuth, ffi::GstRTSPAuthClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_auth_get_type(), get_type => || ffi::gst_rtsp_auth_get_type(),
} }
} }
impl RTSPAuth { impl RTSPAuth {
pub fn new() -> RTSPAuth { pub fn new() -> RTSPAuth {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_auth_new()) } unsafe { from_glib_full(ffi::gst_rtsp_auth_new()) }
} }
pub fn check(check: &str) -> Result<(), glib::error::BoolError> { pub fn check(check: &str) -> Result<(), glib::error::BoolError> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_auth_check(check.to_glib_none().0), ffi::gst_rtsp_auth_check(check.to_glib_none().0),
"Check failed" "Check failed"
) )
} }
} }
pub fn make_basic(user: &str, pass: &str) -> GString { pub fn make_basic(user: &str, pass: &str) -> glib::GString {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_auth_make_basic( from_glib_full(ffi::gst_rtsp_auth_make_basic(
user.to_glib_none().0, user.to_glib_none().0,
pass.to_glib_none().0, pass.to_glib_none().0,
)) ))
@ -80,7 +68,7 @@ pub trait RTSPAuthExt: 'static {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_realm(&self) -> Option<GString>; fn get_realm(&self) -> Option<glib::GString>;
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
@ -130,7 +118,7 @@ pub trait RTSPAuthExt: 'static {
impl<O: IsA<RTSPAuth>> RTSPAuthExt for O { impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn add_basic(&self, basic: &str, token: &RTSPToken) { fn add_basic(&self, basic: &str, token: &RTSPToken) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_add_basic( ffi::gst_rtsp_auth_add_basic(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
basic.to_glib_none().0, basic.to_glib_none().0,
token.to_glib_none().0, token.to_glib_none().0,
@ -142,7 +130,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
fn add_digest(&self, user: &str, pass: &str, token: &RTSPToken) { fn add_digest(&self, user: &str, pass: &str, token: &RTSPToken) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_add_digest( ffi::gst_rtsp_auth_add_digest(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
user.to_glib_none().0, user.to_glib_none().0,
pass.to_glib_none().0, pass.to_glib_none().0,
@ -153,7 +141,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn get_default_token(&self) -> Option<RTSPToken> { fn get_default_token(&self) -> Option<RTSPToken> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_auth_get_default_token( from_glib_full(ffi::gst_rtsp_auth_get_default_token(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -161,19 +149,15 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_realm(&self) -> Option<GString> { fn get_realm(&self) -> Option<glib::GString> {
unsafe { unsafe { from_glib_full(ffi::gst_rtsp_auth_get_realm(self.as_ref().to_glib_none().0)) }
from_glib_full(gst_rtsp_server_sys::gst_rtsp_auth_get_realm(
self.as_ref().to_glib_none().0,
))
}
} }
#[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg(any(feature = "v1_12", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
fn get_supported_methods(&self) -> gst_rtsp::RTSPAuthMethod { fn get_supported_methods(&self) -> gst_rtsp::RTSPAuthMethod {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_auth_get_supported_methods( from_glib(ffi::gst_rtsp_auth_get_supported_methods(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -181,17 +165,15 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn get_tls_authentication_mode(&self) -> gio::TlsAuthenticationMode { fn get_tls_authentication_mode(&self) -> gio::TlsAuthenticationMode {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_auth_get_tls_authentication_mode(
gst_rtsp_server_sys::gst_rtsp_auth_get_tls_authentication_mode( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn get_tls_certificate(&self) -> Option<gio::TlsCertificate> { fn get_tls_certificate(&self) -> Option<gio::TlsCertificate> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_auth_get_tls_certificate( from_glib_full(ffi::gst_rtsp_auth_get_tls_certificate(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -199,7 +181,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn get_tls_database(&self) -> Option<gio::TlsDatabase> { fn get_tls_database(&self) -> Option<gio::TlsDatabase> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_auth_get_tls_database( from_glib_full(ffi::gst_rtsp_auth_get_tls_database(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -209,7 +191,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn parse_htdigest<P: AsRef<std::path::Path>>(&self, path: P, token: &RTSPToken) -> bool { fn parse_htdigest<P: AsRef<std::path::Path>>(&self, path: P, token: &RTSPToken) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_auth_parse_htdigest( from_glib(ffi::gst_rtsp_auth_parse_htdigest(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
path.as_ref().to_glib_none().0, path.as_ref().to_glib_none().0,
token.to_glib_none().0, token.to_glib_none().0,
@ -219,10 +201,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn remove_basic(&self, basic: &str) { fn remove_basic(&self, basic: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_remove_basic( ffi::gst_rtsp_auth_remove_basic(self.as_ref().to_glib_none().0, basic.to_glib_none().0);
self.as_ref().to_glib_none().0,
basic.to_glib_none().0,
);
} }
} }
@ -230,10 +209,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
fn remove_digest(&self, user: &str) { fn remove_digest(&self, user: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_remove_digest( ffi::gst_rtsp_auth_remove_digest(self.as_ref().to_glib_none().0, user.to_glib_none().0);
self.as_ref().to_glib_none().0,
user.to_glib_none().0,
);
} }
} }
@ -241,10 +217,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_realm(&self, realm: &str) { fn set_realm(&self, realm: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_set_realm( ffi::gst_rtsp_auth_set_realm(self.as_ref().to_glib_none().0, realm.to_glib_none().0);
self.as_ref().to_glib_none().0,
realm.to_glib_none().0,
);
} }
} }
@ -252,7 +225,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod) { fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_set_supported_methods( ffi::gst_rtsp_auth_set_supported_methods(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
methods.to_glib(), methods.to_glib(),
); );
@ -261,7 +234,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn set_tls_authentication_mode(&self, mode: gio::TlsAuthenticationMode) { fn set_tls_authentication_mode(&self, mode: gio::TlsAuthenticationMode) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_set_tls_authentication_mode( ffi::gst_rtsp_auth_set_tls_authentication_mode(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
mode.to_glib(), mode.to_glib(),
); );
@ -270,7 +243,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn set_tls_certificate<P: IsA<gio::TlsCertificate>>(&self, cert: Option<&P>) { fn set_tls_certificate<P: IsA<gio::TlsCertificate>>(&self, cert: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_set_tls_certificate( ffi::gst_rtsp_auth_set_tls_certificate(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
cert.map(|p| p.as_ref()).to_glib_none().0, cert.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -279,7 +252,7 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
fn set_tls_database<P: IsA<gio::TlsDatabase>>(&self, database: Option<&P>) { fn set_tls_database<P: IsA<gio::TlsDatabase>>(&self, database: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_auth_set_tls_database( ffi::gst_rtsp_auth_set_tls_database(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
database.map(|p| p.as_ref()).to_glib_none().0, database.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -302,12 +275,12 @@ impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
+ Sync + Sync
+ 'static, + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPAuth, this: *mut ffi::GstRTSPAuth,
connection: *mut gio_sys::GTlsConnection, connection: *mut gio::ffi::GTlsConnection,
peer_cert: *mut gio_sys::GTlsCertificate, peer_cert: *mut gio::ffi::GTlsCertificate,
errors: gio_sys::GTlsCertificateFlags, errors: gio::ffi::GTlsCertificateFlags,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> glib_sys::gboolean ) -> glib::ffi::gboolean
where where
P: IsA<RTSPAuth>, P: IsA<RTSPAuth>,
{ {

View file

@ -2,6 +2,16 @@
// 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
use crate::RTSPAuth;
use crate::RTSPContext;
use crate::RTSPFilterResult;
use crate::RTSPMountPoints;
use crate::RTSPSession;
use crate::RTSPSessionPool;
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
use crate::RTSPStreamTransport;
use crate::RTSPThreadPool;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
@ -9,40 +19,21 @@ use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib::StaticType; use glib::StaticType;
use glib::Value; use glib::Value;
use glib_sys;
use gobject_sys;
#[cfg(any(feature = "v1_12", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
use gst_rtsp;
use gst_rtsp_server_sys;
#[cfg(any(feature = "v1_12", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
use gst_rtsp_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem::transmute; use std::mem::transmute;
use RTSPAuth;
use RTSPContext;
use RTSPFilterResult;
use RTSPMountPoints;
use RTSPSession;
use RTSPSessionPool;
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
use RTSPStreamTransport;
use RTSPThreadPool;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPClient(Object<gst_rtsp_server_sys::GstRTSPClient, gst_rtsp_server_sys::GstRTSPClientClass>); pub struct RTSPClient(Object<ffi::GstRTSPClient, ffi::GstRTSPClientClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_client_get_type(), get_type => || ffi::gst_rtsp_client_get_type(),
} }
} }
impl RTSPClient { impl RTSPClient {
pub fn new() -> RTSPClient { pub fn new() -> RTSPClient {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_client_new()) } unsafe { from_glib_full(ffi::gst_rtsp_client_new()) }
} }
} }
@ -295,35 +286,31 @@ pub trait RTSPClientExt: 'static {
impl<O: IsA<RTSPClient>> RTSPClientExt for O { impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn close(&self) { fn close(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_client_close(self.as_ref().to_glib_none().0); ffi::gst_rtsp_client_close(self.as_ref().to_glib_none().0);
} }
} }
fn get_auth(&self) -> Option<RTSPAuth> { fn get_auth(&self) -> Option<RTSPAuth> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_client_get_auth( from_glib_full(ffi::gst_rtsp_client_get_auth(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
//fn get_connection(&self) -> /*Ignored*/Option<gst_rtsp::RTSPConnection> { //fn get_connection(&self) -> /*Ignored*/Option<gst_rtsp::RTSPConnection> {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_client_get_connection() } // unsafe { TODO: call ffi:gst_rtsp_client_get_connection() }
//} //}
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn get_content_length_limit(&self) -> u32 { fn get_content_length_limit(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_client_get_content_length_limit(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_client_get_content_length_limit(
self.as_ref().to_glib_none().0,
)
}
} }
fn get_mount_points(&self) -> Option<RTSPMountPoints> { fn get_mount_points(&self) -> Option<RTSPMountPoints> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_client_get_mount_points( from_glib_full(ffi::gst_rtsp_client_get_mount_points(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -331,7 +318,7 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn get_session_pool(&self) -> Option<RTSPSessionPool> { fn get_session_pool(&self) -> Option<RTSPSessionPool> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_client_get_session_pool( from_glib_full(ffi::gst_rtsp_client_get_session_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -341,7 +328,7 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn get_stream_transport(&self, channel: u8) -> Option<RTSPStreamTransport> { fn get_stream_transport(&self, channel: u8) -> Option<RTSPStreamTransport> {
unsafe { unsafe {
from_glib_none(gst_rtsp_server_sys::gst_rtsp_client_get_stream_transport( from_glib_none(ffi::gst_rtsp_client_get_stream_transport(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
channel, channel,
)) ))
@ -350,18 +337,18 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn get_thread_pool(&self) -> Option<RTSPThreadPool> { fn get_thread_pool(&self) -> Option<RTSPThreadPool> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_client_get_thread_pool( from_glib_full(ffi::gst_rtsp_client_get_thread_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
//fn handle_message(&self, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult { //fn handle_message(&self, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_client_handle_message() } // unsafe { TODO: call ffi:gst_rtsp_client_handle_message() }
//} //}
//fn send_message<P: IsA<RTSPSession>>(&self, session: Option<&P>, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult { //fn send_message<P: IsA<RTSPSession>>(&self, session: Option<&P>, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_client_send_message() } // unsafe { TODO: call ffi:gst_rtsp_client_send_message() }
//} //}
fn session_filter( fn session_filter(
@ -371,10 +358,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
let func_data: Option<&mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult)> = let func_data: Option<&mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult)> =
func; func;
unsafe extern "C" fn func_func( unsafe extern "C" fn func_func(
client: *mut gst_rtsp_server_sys::GstRTSPClient, client: *mut ffi::GstRTSPClient,
sess: *mut gst_rtsp_server_sys::GstRTSPSession, sess: *mut ffi::GstRTSPSession,
user_data: glib_sys::gpointer, user_data: glib::ffi::gpointer,
) -> gst_rtsp_server_sys::GstRTSPFilterResult { ) -> ffi::GstRTSPFilterResult {
let client = from_glib_borrow(client); let client = from_glib_borrow(client);
let sess = from_glib_borrow(sess); let sess = from_glib_borrow(sess);
let callback: *mut Option< let callback: *mut Option<
@ -397,19 +384,17 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
&mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult),
> = &func_data; > = &func_data;
unsafe { unsafe {
FromGlibPtrContainer::from_glib_full( FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_client_session_filter(
gst_rtsp_server_sys::gst_rtsp_client_session_filter( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, func,
func, super_callback0 as *const _ as usize as *mut _,
super_callback0 as *const _ as usize as *mut _, ))
),
)
} }
} }
fn set_auth<P: IsA<RTSPAuth>>(&self, auth: Option<&P>) { fn set_auth<P: IsA<RTSPAuth>>(&self, auth: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_client_set_auth( ffi::gst_rtsp_client_set_auth(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
auth.map(|p| p.as_ref()).to_glib_none().0, auth.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -417,23 +402,20 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
} }
//fn set_connection(&self, conn: /*Ignored*/&mut gst_rtsp::RTSPConnection) -> bool { //fn set_connection(&self, conn: /*Ignored*/&mut gst_rtsp::RTSPConnection) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_client_set_connection() } // unsafe { TODO: call ffi:gst_rtsp_client_set_connection() }
//} //}
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn set_content_length_limit(&self, limit: u32) { fn set_content_length_limit(&self, limit: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_client_set_content_length_limit( ffi::gst_rtsp_client_set_content_length_limit(self.as_ref().to_glib_none().0, limit);
self.as_ref().to_glib_none().0,
limit,
);
} }
} }
fn set_mount_points<P: IsA<RTSPMountPoints>>(&self, mounts: Option<&P>) { fn set_mount_points<P: IsA<RTSPMountPoints>>(&self, mounts: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_client_set_mount_points( ffi::gst_rtsp_client_set_mount_points(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
mounts.map(|p| p.as_ref()).to_glib_none().0, mounts.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -441,18 +423,18 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
} }
//fn set_send_func(&self, func: /*Unimplemented*/Fn(&RTSPClient, /*Ignored*/gst_rtsp::RTSPMessage, bool) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) { //fn set_send_func(&self, func: /*Unimplemented*/Fn(&RTSPClient, /*Ignored*/gst_rtsp::RTSPMessage, bool) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_client_set_send_func() } // unsafe { TODO: call ffi:gst_rtsp_client_set_send_func() }
//} //}
//#[cfg(any(feature = "v1_16", feature = "dox"))] //#[cfg(any(feature = "v1_16", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
//fn set_send_messages_func(&self, func: /*Unimplemented*/Fn(&RTSPClient, /*Ignored*/gst_rtsp::RTSPMessage, u32, bool) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) { //fn set_send_messages_func(&self, func: /*Unimplemented*/Fn(&RTSPClient, /*Ignored*/gst_rtsp::RTSPMessage, u32, bool) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_client_set_send_messages_func() } // unsafe { TODO: call ffi:gst_rtsp_client_set_send_messages_func() }
//} //}
fn set_session_pool<P: IsA<RTSPSessionPool>>(&self, pool: Option<&P>) { fn set_session_pool<P: IsA<RTSPSessionPool>>(&self, pool: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_client_set_session_pool( ffi::gst_rtsp_client_set_session_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
pool.map(|p| p.as_ref()).to_glib_none().0, pool.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -461,7 +443,7 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn set_thread_pool<P: IsA<RTSPThreadPool>>(&self, pool: Option<&P>) { fn set_thread_pool<P: IsA<RTSPThreadPool>>(&self, pool: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_client_set_thread_pool( ffi::gst_rtsp_client_set_thread_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
pool.map(|p| p.as_ref()).to_glib_none().0, pool.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -471,8 +453,8 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn get_property_drop_backlog(&self) -> bool { fn get_property_drop_backlog(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"drop-backlog\0".as_ptr() as *const _, b"drop-backlog\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -485,8 +467,8 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn set_property_drop_backlog(&self, drop_backlog: bool) { fn set_property_drop_backlog(&self, drop_backlog: bool) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"drop-backlog\0".as_ptr() as *const _, b"drop-backlog\0".as_ptr() as *const _,
Value::from(&drop_backlog).to_glib_none().0, Value::from(&drop_backlog).to_glib_none().0,
); );
@ -496,8 +478,8 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn get_property_post_session_timeout(&self) -> i32 { fn get_property_post_session_timeout(&self) -> i32 {
unsafe { unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type()); let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"post-session-timeout\0".as_ptr() as *const _, b"post-session-timeout\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -510,8 +492,8 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn set_property_post_session_timeout(&self, post_session_timeout: i32) { fn set_property_post_session_timeout(&self, post_session_timeout: i32) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"post-session-timeout\0".as_ptr() as *const _, b"post-session-timeout\0".as_ptr() as *const _,
Value::from(&post_session_timeout).to_glib_none().0, Value::from(&post_session_timeout).to_glib_none().0,
); );
@ -526,9 +508,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -557,8 +539,8 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId { fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn closed_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn closed_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -586,9 +568,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -619,9 +601,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -652,9 +634,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -685,9 +667,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPSession) + Send + Sync + 'static, F: Fn(&P, &RTSPSession) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
object: *mut gst_rtsp_server_sys::GstRTSPSession, object: *mut ffi::GstRTSPSession,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -718,9 +700,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -751,9 +733,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -784,9 +766,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -821,10 +803,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -860,10 +842,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -899,10 +881,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -938,10 +920,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -977,10 +959,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1016,10 +998,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1055,10 +1037,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1094,10 +1076,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1133,10 +1115,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1172,10 +1154,10 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static, F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp::ffi::GstRTSPStatusCode
where where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1207,9 +1189,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1244,9 +1226,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1277,9 +1259,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1310,9 +1292,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P, &RTSPContext) + Send + Sync + 'static, F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut ffi::GstRTSPContext,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1340,9 +1322,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_drop_backlog_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_drop_backlog_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1367,9 +1349,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_mount_points_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_mount_points_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1397,9 +1379,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
P, P,
F: Fn(&P) + Send + Sync + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {
@ -1424,9 +1406,9 @@ impl<O: IsA<RTSPClient>> RTSPClientExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_session_pool_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_session_pool_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPClient, this: *mut ffi::GstRTSPClient,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPClient>, P: IsA<RTSPClient>,
{ {

File diff suppressed because it is too large Load diff

View file

@ -2,40 +2,33 @@
// 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
use glib; use crate::RTSPAddressPool;
use crate::RTSPMedia;
use crate::RTSPPublishClockMode;
use crate::RTSPSuspendMode;
use crate::RTSPTransportMode;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use glib::StaticType; use glib::StaticType;
use glib::Value; use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_rtsp;
use gst_rtsp_server_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem::transmute; use std::mem::transmute;
use RTSPAddressPool;
use RTSPMedia;
use RTSPPublishClockMode;
use RTSPSuspendMode;
use RTSPTransportMode;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPMediaFactory(Object<gst_rtsp_server_sys::GstRTSPMediaFactory, gst_rtsp_server_sys::GstRTSPMediaFactoryClass>); pub struct RTSPMediaFactory(Object<ffi::GstRTSPMediaFactory, ffi::GstRTSPMediaFactoryClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_media_factory_get_type(), get_type => || ffi::gst_rtsp_media_factory_get_type(),
} }
} }
impl RTSPMediaFactory { impl RTSPMediaFactory {
pub fn new() -> RTSPMediaFactory { pub fn new() -> RTSPMediaFactory {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_new()) } unsafe { from_glib_full(ffi::gst_rtsp_media_factory_new()) }
} }
} }
@ -73,7 +66,7 @@ pub trait RTSPMediaFactoryExt: 'static {
fn get_latency(&self) -> u32; fn get_latency(&self) -> u32;
fn get_launch(&self) -> Option<GString>; fn get_launch(&self) -> Option<glib::GString>;
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
@ -81,7 +74,7 @@ pub trait RTSPMediaFactoryExt: 'static {
fn get_media_gtype(&self) -> glib::types::Type; fn get_media_gtype(&self) -> glib::types::Type;
fn get_multicast_iface(&self) -> Option<GString>; fn get_multicast_iface(&self) -> Option<glib::GString>;
//fn get_permissions(&self) -> /*Ignored*/Option<RTSPPermissions>; //fn get_permissions(&self) -> /*Ignored*/Option<RTSPPermissions>;
@ -258,50 +251,44 @@ pub trait RTSPMediaFactoryExt: 'static {
impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O { impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
//fn add_role(&self, role: &str, fieldname: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { //fn add_role(&self, role: &str, fieldname: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_media_factory_add_role() } // unsafe { TODO: call ffi:gst_rtsp_media_factory_add_role() }
//} //}
fn construct(&self, url: &gst_rtsp::RTSPUrl) -> Result<RTSPMedia, glib::BoolError> { fn construct(&self, url: &gst_rtsp::RTSPUrl) -> Result<RTSPMedia, glib::BoolError> {
unsafe { unsafe {
Option::<_>::from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_construct( Option::<_>::from_glib_full(ffi::gst_rtsp_media_factory_construct(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
url.to_glib_none().0, url.to_glib_none().0,
)) ))
.ok_or_else(|| glib_bool_error!("Failed to construct media")) .ok_or_else(|| glib::glib_bool_error!("Failed to construct media"))
} }
} }
fn create_element(&self, url: &gst_rtsp::RTSPUrl) -> Result<gst::Element, glib::BoolError> { fn create_element(&self, url: &gst_rtsp::RTSPUrl) -> Result<gst::Element, glib::BoolError> {
unsafe { unsafe {
Option::<_>::from_glib_none(gst_rtsp_server_sys::gst_rtsp_media_factory_create_element( Option::<_>::from_glib_none(ffi::gst_rtsp_media_factory_create_element(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
url.to_glib_none().0, url.to_glib_none().0,
)) ))
.ok_or_else(|| glib_bool_error!("Failed to create media element")) .ok_or_else(|| glib::glib_bool_error!("Failed to create media element"))
} }
} }
fn get_address_pool(&self) -> Option<RTSPAddressPool> { fn get_address_pool(&self) -> Option<RTSPAddressPool> {
unsafe { unsafe {
from_glib_full( from_glib_full(ffi::gst_rtsp_media_factory_get_address_pool(
gst_rtsp_server_sys::gst_rtsp_media_factory_get_address_pool( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn get_buffer_size(&self) -> u32 { fn get_buffer_size(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_media_factory_get_buffer_size(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_media_factory_get_buffer_size(
self.as_ref().to_glib_none().0,
)
}
} }
fn get_clock(&self) -> Option<gst::Clock> { fn get_clock(&self) -> Option<gst::Clock> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_get_clock( from_glib_full(ffi::gst_rtsp_media_factory_get_clock(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -311,31 +298,25 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_do_retransmission(&self) -> bool { fn get_do_retransmission(&self) -> bool {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_get_do_retransmission(
gst_rtsp_server_sys::gst_rtsp_media_factory_get_do_retransmission( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn get_dscp_qos(&self) -> i32 { fn get_dscp_qos(&self) -> i32 {
unsafe { unsafe { ffi::gst_rtsp_media_factory_get_dscp_qos(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_media_factory_get_dscp_qos(self.as_ref().to_glib_none().0)
}
} }
fn get_latency(&self) -> u32 { fn get_latency(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_media_factory_get_latency(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_media_factory_get_latency(self.as_ref().to_glib_none().0)
}
} }
fn get_launch(&self) -> Option<GString> { fn get_launch(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_get_launch( from_glib_full(ffi::gst_rtsp_media_factory_get_launch(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -344,38 +325,32 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_max_mcast_ttl(&self) -> u32 { fn get_max_mcast_ttl(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_media_factory_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_media_factory_get_max_mcast_ttl(
self.as_ref().to_glib_none().0,
)
}
} }
fn get_media_gtype(&self) -> glib::types::Type { fn get_media_gtype(&self) -> glib::types::Type {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_media_factory_get_media_gtype( from_glib(ffi::gst_rtsp_media_factory_get_media_gtype(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_multicast_iface(&self) -> Option<GString> { fn get_multicast_iface(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full( from_glib_full(ffi::gst_rtsp_media_factory_get_multicast_iface(
gst_rtsp_server_sys::gst_rtsp_media_factory_get_multicast_iface( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
//fn get_permissions(&self) -> /*Ignored*/Option<RTSPPermissions> { //fn get_permissions(&self) -> /*Ignored*/Option<RTSPPermissions> {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_media_factory_get_permissions() } // unsafe { TODO: call ffi:gst_rtsp_media_factory_get_permissions() }
//} //}
fn get_profiles(&self) -> gst_rtsp::RTSPProfile { fn get_profiles(&self) -> gst_rtsp::RTSPProfile {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_media_factory_get_profiles( from_glib(ffi::gst_rtsp_media_factory_get_profiles(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -383,7 +358,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans { fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_media_factory_get_protocols( from_glib(ffi::gst_rtsp_media_factory_get_protocols(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -391,41 +366,33 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_publish_clock_mode(&self) -> RTSPPublishClockMode { fn get_publish_clock_mode(&self) -> RTSPPublishClockMode {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_get_publish_clock_mode(
gst_rtsp_server_sys::gst_rtsp_media_factory_get_publish_clock_mode( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn get_retransmission_time(&self) -> gst::ClockTime { fn get_retransmission_time(&self) -> gst::ClockTime {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_get_retransmission_time(
gst_rtsp_server_sys::gst_rtsp_media_factory_get_retransmission_time( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn get_suspend_mode(&self) -> RTSPSuspendMode { fn get_suspend_mode(&self) -> RTSPSuspendMode {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_get_suspend_mode(
gst_rtsp_server_sys::gst_rtsp_media_factory_get_suspend_mode( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn get_transport_mode(&self) -> RTSPTransportMode { fn get_transport_mode(&self) -> RTSPTransportMode {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_get_transport_mode(
gst_rtsp_server_sys::gst_rtsp_media_factory_get_transport_mode( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
@ -433,17 +400,15 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn is_bind_mcast_address(&self) -> bool { fn is_bind_mcast_address(&self) -> bool {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_is_bind_mcast_address(
gst_rtsp_server_sys::gst_rtsp_media_factory_is_bind_mcast_address( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn is_eos_shutdown(&self) -> bool { fn is_eos_shutdown(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_media_factory_is_eos_shutdown( from_glib(ffi::gst_rtsp_media_factory_is_eos_shutdown(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -451,7 +416,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn is_shared(&self) -> bool { fn is_shared(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_media_factory_is_shared( from_glib(ffi::gst_rtsp_media_factory_is_shared(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -459,17 +424,15 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn is_stop_on_disonnect(&self) -> bool { fn is_stop_on_disonnect(&self) -> bool {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_is_stop_on_disonnect(
gst_rtsp_server_sys::gst_rtsp_media_factory_is_stop_on_disonnect( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn set_address_pool<P: IsA<RTSPAddressPool>>(&self, pool: Option<&P>) { fn set_address_pool<P: IsA<RTSPAddressPool>>(&self, pool: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_address_pool( ffi::gst_rtsp_media_factory_set_address_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
pool.map(|p| p.as_ref()).to_glib_none().0, pool.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -480,7 +443,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_bind_mcast_address(&self, bind_mcast_addr: bool) { fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_bind_mcast_address( ffi::gst_rtsp_media_factory_set_bind_mcast_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
bind_mcast_addr.to_glib(), bind_mcast_addr.to_glib(),
); );
@ -489,16 +452,13 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_buffer_size(&self, size: u32) { fn set_buffer_size(&self, size: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_buffer_size( ffi::gst_rtsp_media_factory_set_buffer_size(self.as_ref().to_glib_none().0, size);
self.as_ref().to_glib_none().0,
size,
);
} }
} }
fn set_clock<P: IsA<gst::Clock>>(&self, clock: Option<&P>) { fn set_clock<P: IsA<gst::Clock>>(&self, clock: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_clock( ffi::gst_rtsp_media_factory_set_clock(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
clock.map(|p| p.as_ref()).to_glib_none().0, clock.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -509,7 +469,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_do_retransmission(&self, do_retransmission: bool) { fn set_do_retransmission(&self, do_retransmission: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_do_retransmission( ffi::gst_rtsp_media_factory_set_do_retransmission(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
do_retransmission.to_glib(), do_retransmission.to_glib(),
); );
@ -520,16 +480,13 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn set_dscp_qos(&self, dscp_qos: i32) { fn set_dscp_qos(&self, dscp_qos: i32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_dscp_qos( ffi::gst_rtsp_media_factory_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
self.as_ref().to_glib_none().0,
dscp_qos,
);
} }
} }
fn set_eos_shutdown(&self, eos_shutdown: bool) { fn set_eos_shutdown(&self, eos_shutdown: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_eos_shutdown( ffi::gst_rtsp_media_factory_set_eos_shutdown(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
eos_shutdown.to_glib(), eos_shutdown.to_glib(),
); );
@ -538,16 +495,13 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_latency(&self, latency: u32) { fn set_latency(&self, latency: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_latency( ffi::gst_rtsp_media_factory_set_latency(self.as_ref().to_glib_none().0, latency);
self.as_ref().to_glib_none().0,
latency,
);
} }
} }
fn set_launch(&self, launch: &str) { fn set_launch(&self, launch: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_launch( ffi::gst_rtsp_media_factory_set_launch(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
launch.to_glib_none().0, launch.to_glib_none().0,
); );
@ -558,18 +512,16 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_max_mcast_ttl(&self, ttl: u32) -> bool { fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_media_factory_set_max_mcast_ttl(
gst_rtsp_server_sys::gst_rtsp_media_factory_set_max_mcast_ttl( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ttl,
ttl, ))
),
)
} }
} }
fn set_media_gtype(&self, media_gtype: glib::types::Type) { fn set_media_gtype(&self, media_gtype: glib::types::Type) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_media_gtype( ffi::gst_rtsp_media_factory_set_media_gtype(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
media_gtype.to_glib(), media_gtype.to_glib(),
); );
@ -578,7 +530,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_multicast_iface(&self, multicast_iface: Option<&str>) { fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_multicast_iface( ffi::gst_rtsp_media_factory_set_multicast_iface(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
multicast_iface.to_glib_none().0, multicast_iface.to_glib_none().0,
); );
@ -586,12 +538,12 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
} }
//fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>) { //fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_media_factory_set_permissions() } // unsafe { TODO: call ffi:gst_rtsp_media_factory_set_permissions() }
//} //}
fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) { fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_profiles( ffi::gst_rtsp_media_factory_set_profiles(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
profiles.to_glib(), profiles.to_glib(),
); );
@ -600,7 +552,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) { fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_protocols( ffi::gst_rtsp_media_factory_set_protocols(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
protocols.to_glib(), protocols.to_glib(),
); );
@ -609,7 +561,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) { fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_publish_clock_mode( ffi::gst_rtsp_media_factory_set_publish_clock_mode(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
mode.to_glib(), mode.to_glib(),
); );
@ -618,7 +570,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_retransmission_time(&self, time: gst::ClockTime) { fn set_retransmission_time(&self, time: gst::ClockTime) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_retransmission_time( ffi::gst_rtsp_media_factory_set_retransmission_time(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
time.to_glib(), time.to_glib(),
); );
@ -627,7 +579,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_shared(&self, shared: bool) { fn set_shared(&self, shared: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_shared( ffi::gst_rtsp_media_factory_set_shared(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
shared.to_glib(), shared.to_glib(),
); );
@ -636,7 +588,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) { fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_stop_on_disconnect( ffi::gst_rtsp_media_factory_set_stop_on_disconnect(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
stop_on_disconnect.to_glib(), stop_on_disconnect.to_glib(),
); );
@ -645,7 +597,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_suspend_mode(&self, mode: RTSPSuspendMode) { fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_suspend_mode( ffi::gst_rtsp_media_factory_set_suspend_mode(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
mode.to_glib(), mode.to_glib(),
); );
@ -654,7 +606,7 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_transport_mode(&self, mode: RTSPTransportMode) { fn set_transport_mode(&self, mode: RTSPTransportMode) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_set_transport_mode( ffi::gst_rtsp_media_factory_set_transport_mode(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
mode.to_glib(), mode.to_glib(),
); );
@ -664,8 +616,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_property_bind_mcast_address(&self) -> bool { fn get_property_bind_mcast_address(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"bind-mcast-address\0".as_ptr() as *const _, b"bind-mcast-address\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -678,8 +630,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_property_bind_mcast_address(&self, bind_mcast_address: bool) { fn set_property_bind_mcast_address(&self, bind_mcast_address: bool) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"bind-mcast-address\0".as_ptr() as *const _, b"bind-mcast-address\0".as_ptr() as *const _,
Value::from(&bind_mcast_address).to_glib_none().0, Value::from(&bind_mcast_address).to_glib_none().0,
); );
@ -689,8 +641,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_property_dscp_qos(&self) -> i32 { fn get_property_dscp_qos(&self) -> i32 {
unsafe { unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type()); let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"dscp-qos\0".as_ptr() as *const _, b"dscp-qos\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -703,8 +655,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_property_dscp_qos(&self, dscp_qos: i32) { fn set_property_dscp_qos(&self, dscp_qos: i32) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"dscp-qos\0".as_ptr() as *const _, b"dscp-qos\0".as_ptr() as *const _,
Value::from(&dscp_qos).to_glib_none().0, Value::from(&dscp_qos).to_glib_none().0,
); );
@ -714,8 +666,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_property_eos_shutdown(&self) -> bool { fn get_property_eos_shutdown(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"eos-shutdown\0".as_ptr() as *const _, b"eos-shutdown\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -729,8 +681,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_property_max_mcast_ttl(&self) -> u32 { fn get_property_max_mcast_ttl(&self) -> u32 {
unsafe { unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type()); let mut value = Value::from_type(<u32 as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"max-mcast-ttl\0".as_ptr() as *const _, b"max-mcast-ttl\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -743,8 +695,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn set_property_max_mcast_ttl(&self, max_mcast_ttl: u32) { fn set_property_max_mcast_ttl(&self, max_mcast_ttl: u32) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"max-mcast-ttl\0".as_ptr() as *const _, b"max-mcast-ttl\0".as_ptr() as *const _,
Value::from(&max_mcast_ttl).to_glib_none().0, Value::from(&max_mcast_ttl).to_glib_none().0,
); );
@ -754,8 +706,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_property_shared(&self) -> bool { fn get_property_shared(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"shared\0".as_ptr() as *const _, b"shared\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -769,8 +721,8 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
fn get_property_stop_on_disconnect(&self) -> bool { fn get_property_stop_on_disconnect(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"stop-on-disconnect\0".as_ptr() as *const _, b"stop-on-disconnect\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -789,9 +741,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
P, P,
F: Fn(&P, &RTSPMedia) + Send + Sync + 'static, F: Fn(&P, &RTSPMedia) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
object: *mut gst_rtsp_server_sys::GstRTSPMedia, object: *mut ffi::GstRTSPMedia,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -822,9 +774,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
P, P,
F: Fn(&P, &RTSPMedia) + Send + Sync + 'static, F: Fn(&P, &RTSPMedia) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
object: *mut gst_rtsp_server_sys::GstRTSPMedia, object: *mut ffi::GstRTSPMedia,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -855,9 +807,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
P, P,
F: Fn(&P) + Send + Sync + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -882,9 +834,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_buffer_size_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_buffer_size_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -909,9 +861,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_clock_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_clock_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -936,9 +888,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_dscp_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_dscp_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -963,9 +915,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_eos_shutdown_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_eos_shutdown_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -990,9 +942,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1017,9 +969,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_launch_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_launch_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1044,9 +996,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_max_mcast_ttl_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_max_mcast_ttl_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1071,9 +1023,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_profiles_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_profiles_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1098,9 +1050,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_protocols_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_protocols_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1125,9 +1077,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_shared_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_shared_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1155,9 +1107,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
P, P,
F: Fn(&P) + Send + Sync + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1182,9 +1134,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_suspend_mode_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_suspend_mode_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {
@ -1212,9 +1164,9 @@ impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {
P, P,
F: Fn(&P) + Send + Sync + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, this: *mut ffi::GstRTSPMediaFactory,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactory>, P: IsA<RTSPMediaFactory>,
{ {

View file

@ -2,33 +2,29 @@
// 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
use crate::RTSPMediaFactory;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use glib::StaticType; use glib::StaticType;
use glib::Value; use glib::Value;
use glib_sys;
use gobject_sys;
use gst_rtsp_server_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem::transmute; use std::mem::transmute;
use RTSPMediaFactory;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPMediaFactoryURI(Object<gst_rtsp_server_sys::GstRTSPMediaFactoryURI, gst_rtsp_server_sys::GstRTSPMediaFactoryURIClass>) @extends RTSPMediaFactory; pub struct RTSPMediaFactoryURI(Object<ffi::GstRTSPMediaFactoryURI, ffi::GstRTSPMediaFactoryURIClass>) @extends RTSPMediaFactory;
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_media_factory_uri_get_type(), get_type => || ffi::gst_rtsp_media_factory_uri_get_type(),
} }
} }
impl RTSPMediaFactoryURI { impl RTSPMediaFactoryURI {
pub fn new() -> RTSPMediaFactoryURI { pub fn new() -> RTSPMediaFactoryURI {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_uri_new()) } unsafe { from_glib_full(ffi::gst_rtsp_media_factory_uri_new()) }
} }
} }
@ -44,7 +40,7 @@ unsafe impl Sync for RTSPMediaFactoryURI {}
pub const NONE_RTSP_MEDIA_FACTORY_URI: Option<&RTSPMediaFactoryURI> = None; pub const NONE_RTSP_MEDIA_FACTORY_URI: Option<&RTSPMediaFactoryURI> = None;
pub trait RTSPMediaFactoryURIExt: 'static { pub trait RTSPMediaFactoryURIExt: 'static {
fn get_uri(&self) -> Option<GString>; fn get_uri(&self) -> Option<glib::GString>;
fn set_uri(&self, uri: &str); fn set_uri(&self, uri: &str);
@ -64,9 +60,9 @@ pub trait RTSPMediaFactoryURIExt: 'static {
} }
impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O { impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
fn get_uri(&self) -> Option<GString> { fn get_uri(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_uri_get_uri( from_glib_full(ffi::gst_rtsp_media_factory_uri_get_uri(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -74,7 +70,7 @@ impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
fn set_uri(&self, uri: &str) { fn set_uri(&self, uri: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_media_factory_uri_set_uri( ffi::gst_rtsp_media_factory_uri_set_uri(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
uri.to_glib_none().0, uri.to_glib_none().0,
); );
@ -84,8 +80,8 @@ impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
fn get_property_use_gstpay(&self) -> bool { fn get_property_use_gstpay(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"use-gstpay\0".as_ptr() as *const _, b"use-gstpay\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -98,8 +94,8 @@ impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
fn set_property_use_gstpay(&self, use_gstpay: bool) { fn set_property_use_gstpay(&self, use_gstpay: bool) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"use-gstpay\0".as_ptr() as *const _, b"use-gstpay\0".as_ptr() as *const _,
Value::from(&use_gstpay).to_glib_none().0, Value::from(&use_gstpay).to_glib_none().0,
); );
@ -111,9 +107,9 @@ impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_uri_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_uri_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactoryURI, this: *mut ffi::GstRTSPMediaFactoryURI,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactoryURI>, P: IsA<RTSPMediaFactoryURI>,
{ {
@ -138,9 +134,9 @@ impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_use_gstpay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_use_gstpay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactoryURI, this: *mut ffi::GstRTSPMediaFactoryURI,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPMediaFactoryURI>, P: IsA<RTSPMediaFactoryURI>,
{ {

View file

@ -2,27 +2,23 @@
// 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
use glib; use crate::RTSPMediaFactory;
use glib::object::IsA; use glib::object::IsA;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use gst_rtsp;
use gst_rtsp_server_sys;
use std::mem; use std::mem;
use RTSPMediaFactory;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPMountPoints(Object<gst_rtsp_server_sys::GstRTSPMountPoints, gst_rtsp_server_sys::GstRTSPMountPointsClass>); pub struct RTSPMountPoints(Object<ffi::GstRTSPMountPoints, ffi::GstRTSPMountPointsClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_mount_points_get_type(), get_type => || ffi::gst_rtsp_mount_points_get_type(),
} }
} }
impl RTSPMountPoints { impl RTSPMountPoints {
pub fn new() -> RTSPMountPoints { pub fn new() -> RTSPMountPoints {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_mount_points_new()) } unsafe { from_glib_full(ffi::gst_rtsp_mount_points_new()) }
} }
} }
@ -40,7 +36,7 @@ pub const NONE_RTSP_MOUNT_POINTS: Option<&RTSPMountPoints> = None;
pub trait RTSPMountPointsExt: 'static { pub trait RTSPMountPointsExt: 'static {
fn add_factory<P: IsA<RTSPMediaFactory>>(&self, path: &str, factory: &P); fn add_factory<P: IsA<RTSPMediaFactory>>(&self, path: &str, factory: &P);
fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Result<GString, glib::BoolError>; fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Result<glib::GString, glib::BoolError>;
fn match_(&self, path: &str) -> (RTSPMediaFactory, i32); fn match_(&self, path: &str) -> (RTSPMediaFactory, i32);
@ -50,7 +46,7 @@ pub trait RTSPMountPointsExt: 'static {
impl<O: IsA<RTSPMountPoints>> RTSPMountPointsExt for O { impl<O: IsA<RTSPMountPoints>> RTSPMountPointsExt for O {
fn add_factory<P: IsA<RTSPMediaFactory>>(&self, path: &str, factory: &P) { fn add_factory<P: IsA<RTSPMediaFactory>>(&self, path: &str, factory: &P) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_mount_points_add_factory( ffi::gst_rtsp_mount_points_add_factory(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
path.to_glib_none().0, path.to_glib_none().0,
factory.as_ref().to_glib_full(), factory.as_ref().to_glib_full(),
@ -58,20 +54,20 @@ impl<O: IsA<RTSPMountPoints>> RTSPMountPointsExt for O {
} }
} }
fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Result<GString, glib::BoolError> { fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Result<glib::GString, glib::BoolError> {
unsafe { unsafe {
Option::<_>::from_glib_full(gst_rtsp_server_sys::gst_rtsp_mount_points_make_path( Option::<_>::from_glib_full(ffi::gst_rtsp_mount_points_make_path(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
url.to_glib_none().0, url.to_glib_none().0,
)) ))
.ok_or_else(|| glib_bool_error!("Failed to make path")) .ok_or_else(|| glib::glib_bool_error!("Failed to make path"))
} }
} }
fn match_(&self, path: &str) -> (RTSPMediaFactory, i32) { fn match_(&self, path: &str) -> (RTSPMediaFactory, i32) {
unsafe { unsafe {
let mut matched = mem::MaybeUninit::uninit(); let mut matched = mem::MaybeUninit::uninit();
let ret = from_glib_full(gst_rtsp_server_sys::gst_rtsp_mount_points_match( let ret = from_glib_full(ffi::gst_rtsp_mount_points_match(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
path.to_glib_none().0, path.to_glib_none().0,
matched.as_mut_ptr(), matched.as_mut_ptr(),
@ -83,7 +79,7 @@ impl<O: IsA<RTSPMountPoints>> RTSPMountPointsExt for O {
fn remove_factory(&self, path: &str) { fn remove_factory(&self, path: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_mount_points_remove_factory( ffi::gst_rtsp_mount_points_remove_factory(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
path.to_glib_none().0, path.to_glib_none().0,
); );

View file

@ -2,41 +2,35 @@
// 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
use gio; use crate::RTSPAuth;
use glib; use crate::RTSPClient;
use crate::RTSPFilterResult;
use crate::RTSPMountPoints;
use crate::RTSPSessionPool;
use crate::RTSPThreadPool;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use glib::StaticType; use glib::StaticType;
use glib::Value; use glib::Value;
use glib_sys;
use gobject_sys;
use gst_rtsp_server_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem::transmute; use std::mem::transmute;
use std::ptr; use std::ptr;
use RTSPAuth;
use RTSPClient;
use RTSPFilterResult;
use RTSPMountPoints;
use RTSPSessionPool;
use RTSPThreadPool;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPServer(Object<gst_rtsp_server_sys::GstRTSPServer, gst_rtsp_server_sys::GstRTSPServerClass>); pub struct RTSPServer(Object<ffi::GstRTSPServer, ffi::GstRTSPServerClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_server_get_type(), get_type => || ffi::gst_rtsp_server_get_type(),
} }
} }
impl RTSPServer { impl RTSPServer {
pub fn new() -> RTSPServer { pub fn new() -> RTSPServer {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_server_new()) } unsafe { from_glib_full(ffi::gst_rtsp_server_new()) }
} }
pub fn io_func<P: IsA<gio::Socket>, Q: IsA<RTSPServer>>( pub fn io_func<P: IsA<gio::Socket>, Q: IsA<RTSPServer>>(
@ -46,8 +40,8 @@ impl RTSPServer {
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_server_io_func( ffi::gst_rtsp_server_io_func(
socket.as_ref().to_glib_none().0, socket.as_ref().to_glib_none().0,
condition.to_glib(), condition.to_glib(),
server.as_ref().to_glib_none().0 server.as_ref().to_glib_none().0
@ -85,7 +79,7 @@ pub trait RTSPServerExt: 'static {
cancellable: Option<&P>, cancellable: Option<&P>,
) -> Result<glib::Source, glib::Error>; ) -> Result<glib::Source, glib::Error>;
fn get_address(&self) -> Option<GString>; fn get_address(&self) -> Option<glib::GString>;
fn get_auth(&self) -> Option<RTSPAuth>; fn get_auth(&self) -> Option<RTSPAuth>;
@ -99,7 +93,7 @@ pub trait RTSPServerExt: 'static {
fn get_mount_points(&self) -> Option<RTSPMountPoints>; fn get_mount_points(&self) -> Option<RTSPMountPoints>;
fn get_service(&self) -> Option<GString>; fn get_service(&self) -> Option<glib::GString>;
fn get_session_pool(&self) -> Option<RTSPSessionPool>; fn get_session_pool(&self) -> Option<RTSPSessionPool>;
@ -184,10 +178,10 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
let func_data: Option<&mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult)> = let func_data: Option<&mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult)> =
func; func;
unsafe extern "C" fn func_func( unsafe extern "C" fn func_func(
server: *mut gst_rtsp_server_sys::GstRTSPServer, server: *mut ffi::GstRTSPServer,
client: *mut gst_rtsp_server_sys::GstRTSPClient, client: *mut ffi::GstRTSPClient,
user_data: glib_sys::gpointer, user_data: glib::ffi::gpointer,
) -> gst_rtsp_server_sys::GstRTSPFilterResult { ) -> ffi::GstRTSPFilterResult {
let server = from_glib_borrow(server); let server = from_glib_borrow(server);
let client = from_glib_borrow(client); let client = from_glib_borrow(client);
let callback: *mut Option< let callback: *mut Option<
@ -210,13 +204,11 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
&mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult),
> = &func_data; > = &func_data;
unsafe { unsafe {
FromGlibPtrContainer::from_glib_full( FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_server_client_filter(
gst_rtsp_server_sys::gst_rtsp_server_client_filter( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, func,
func, super_callback0 as *const _ as usize as *mut _,
super_callback0 as *const _ as usize as *mut _, ))
),
)
} }
} }
@ -226,7 +218,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
) -> Result<gio::Socket, glib::Error> { ) -> Result<gio::Socket, glib::Error> {
unsafe { unsafe {
let mut error = ptr::null_mut(); let mut error = ptr::null_mut();
let ret = gst_rtsp_server_sys::gst_rtsp_server_create_socket( let ret = ffi::gst_rtsp_server_create_socket(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
cancellable.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0,
&mut error, &mut error,
@ -245,7 +237,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
) -> Result<glib::Source, glib::Error> { ) -> Result<glib::Source, glib::Error> {
unsafe { unsafe {
let mut error = ptr::null_mut(); let mut error = ptr::null_mut();
let ret = gst_rtsp_server_sys::gst_rtsp_server_create_source( let ret = ffi::gst_rtsp_server_create_source(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
cancellable.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0,
&mut error, &mut error,
@ -258,9 +250,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
} }
} }
fn get_address(&self) -> Option<GString> { fn get_address(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_server_get_address( from_glib_full(ffi::gst_rtsp_server_get_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -268,43 +260,37 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn get_auth(&self) -> Option<RTSPAuth> { fn get_auth(&self) -> Option<RTSPAuth> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_server_get_auth( from_glib_full(ffi::gst_rtsp_server_get_auth(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_backlog(&self) -> i32 { fn get_backlog(&self) -> i32 {
unsafe { gst_rtsp_server_sys::gst_rtsp_server_get_backlog(self.as_ref().to_glib_none().0) } unsafe { ffi::gst_rtsp_server_get_backlog(self.as_ref().to_glib_none().0) }
} }
fn get_bound_port(&self) -> i32 { fn get_bound_port(&self) -> i32 {
unsafe { unsafe { ffi::gst_rtsp_server_get_bound_port(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_server_get_bound_port(self.as_ref().to_glib_none().0)
}
} }
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn get_content_length_limit(&self) -> u32 { fn get_content_length_limit(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_server_get_content_length_limit(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_server_get_content_length_limit(
self.as_ref().to_glib_none().0,
)
}
} }
fn get_mount_points(&self) -> Option<RTSPMountPoints> { fn get_mount_points(&self) -> Option<RTSPMountPoints> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_server_get_mount_points( from_glib_full(ffi::gst_rtsp_server_get_mount_points(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_service(&self) -> Option<GString> { fn get_service(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_server_get_service( from_glib_full(ffi::gst_rtsp_server_get_service(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -312,7 +298,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn get_session_pool(&self) -> Option<RTSPSessionPool> { fn get_session_pool(&self) -> Option<RTSPSessionPool> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_server_get_session_pool( from_glib_full(ffi::gst_rtsp_server_get_session_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -320,7 +306,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn get_thread_pool(&self) -> Option<RTSPThreadPool> { fn get_thread_pool(&self) -> Option<RTSPThreadPool> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_server_get_thread_pool( from_glib_full(ffi::gst_rtsp_server_get_thread_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -328,7 +314,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn set_address(&self, address: &str) { fn set_address(&self, address: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_address( ffi::gst_rtsp_server_set_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
address.to_glib_none().0, address.to_glib_none().0,
); );
@ -337,7 +323,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn set_auth<P: IsA<RTSPAuth>>(&self, auth: Option<&P>) { fn set_auth<P: IsA<RTSPAuth>>(&self, auth: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_auth( ffi::gst_rtsp_server_set_auth(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
auth.map(|p| p.as_ref()).to_glib_none().0, auth.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -346,10 +332,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn set_backlog(&self, backlog: i32) { fn set_backlog(&self, backlog: i32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_backlog( ffi::gst_rtsp_server_set_backlog(self.as_ref().to_glib_none().0, backlog);
self.as_ref().to_glib_none().0,
backlog,
);
} }
} }
@ -357,16 +340,13 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn set_content_length_limit(&self, limit: u32) { fn set_content_length_limit(&self, limit: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_content_length_limit( ffi::gst_rtsp_server_set_content_length_limit(self.as_ref().to_glib_none().0, limit);
self.as_ref().to_glib_none().0,
limit,
);
} }
} }
fn set_mount_points<P: IsA<RTSPMountPoints>>(&self, mounts: Option<&P>) { fn set_mount_points<P: IsA<RTSPMountPoints>>(&self, mounts: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_mount_points( ffi::gst_rtsp_server_set_mount_points(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
mounts.map(|p| p.as_ref()).to_glib_none().0, mounts.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -375,7 +355,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn set_service(&self, service: &str) { fn set_service(&self, service: &str) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_service( ffi::gst_rtsp_server_set_service(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
service.to_glib_none().0, service.to_glib_none().0,
); );
@ -384,7 +364,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn set_session_pool<P: IsA<RTSPSessionPool>>(&self, pool: Option<&P>) { fn set_session_pool<P: IsA<RTSPSessionPool>>(&self, pool: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_session_pool( ffi::gst_rtsp_server_set_session_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
pool.map(|p| p.as_ref()).to_glib_none().0, pool.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -393,7 +373,7 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn set_thread_pool<P: IsA<RTSPThreadPool>>(&self, pool: Option<&P>) { fn set_thread_pool<P: IsA<RTSPThreadPool>>(&self, pool: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_server_set_thread_pool( ffi::gst_rtsp_server_set_thread_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
pool.map(|p| p.as_ref()).to_glib_none().0, pool.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -408,8 +388,8 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
initial_buffer: Option<&str>, initial_buffer: Option<&str>,
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_server_transfer_connection( ffi::gst_rtsp_server_transfer_connection(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
socket.as_ref().to_glib_full(), socket.as_ref().to_glib_full(),
ip.to_glib_none().0, ip.to_glib_none().0,
@ -424,8 +404,8 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn get_property_content_length_limit(&self) -> u32 { fn get_property_content_length_limit(&self) -> u32 {
unsafe { unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type()); let mut value = Value::from_type(<u32 as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"content-length-limit\0".as_ptr() as *const _, b"content-length-limit\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -438,8 +418,8 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
fn set_property_content_length_limit(&self, content_length_limit: u32) { fn set_property_content_length_limit(&self, content_length_limit: u32) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"content-length-limit\0".as_ptr() as *const _, b"content-length-limit\0".as_ptr() as *const _,
Value::from(&content_length_limit).to_glib_none().0, Value::from(&content_length_limit).to_glib_none().0,
); );
@ -454,9 +434,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
P, P,
F: Fn(&P, &RTSPClient) + Send + Sync + 'static, F: Fn(&P, &RTSPClient) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
object: *mut gst_rtsp_server_sys::GstRTSPClient, object: *mut ffi::GstRTSPClient,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {
@ -484,9 +464,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_address_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_address_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {
@ -511,9 +491,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_backlog_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_backlog_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {
@ -538,9 +518,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_bound_port_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_bound_port_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {
@ -568,9 +548,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
P, P,
F: Fn(&P) + Send + Sync + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {
@ -595,9 +575,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_mount_points_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_mount_points_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {
@ -622,9 +602,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_service_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_service_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {
@ -649,9 +629,9 @@ impl<O: IsA<RTSPServer>> RTSPServerExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_session_pool_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_session_pool_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPServer, this: *mut ffi::GstRTSPServer,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPServer>, P: IsA<RTSPServer>,
{ {

View file

@ -2,41 +2,32 @@
// 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
use glib; use crate::RTSPFilterResult;
use crate::RTSPMedia;
use crate::RTSPSessionMedia;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use glib::StaticType; use glib::StaticType;
use glib::Value; use glib::Value;
use glib_sys;
use gobject_sys;
use gst_rtsp_server_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem; use std::mem;
use std::mem::transmute; use std::mem::transmute;
use RTSPFilterResult;
use RTSPMedia;
use RTSPSessionMedia;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPSession(Object<gst_rtsp_server_sys::GstRTSPSession, gst_rtsp_server_sys::GstRTSPSessionClass>); pub struct RTSPSession(Object<ffi::GstRTSPSession, ffi::GstRTSPSessionClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_session_get_type(), get_type => || ffi::gst_rtsp_session_get_type(),
} }
} }
impl RTSPSession { impl RTSPSession {
pub fn new(sessionid: &str) -> RTSPSession { pub fn new(sessionid: &str) -> RTSPSession {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe { from_glib_full(ffi::gst_rtsp_session_new(sessionid.to_glib_none().0)) }
from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_new(
sessionid.to_glib_none().0,
))
}
} }
} }
@ -53,11 +44,11 @@ pub trait RTSPSessionExt: 'static {
func: Option<&mut dyn (FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult)>, func: Option<&mut dyn (FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult)>,
) -> Vec<RTSPSessionMedia>; ) -> Vec<RTSPSessionMedia>;
fn get_header(&self) -> Option<GString>; fn get_header(&self) -> Option<glib::GString>;
fn get_media(&self, path: &str) -> (Option<RTSPSessionMedia>, i32); fn get_media(&self, path: &str) -> (Option<RTSPSessionMedia>, i32);
fn get_sessionid(&self) -> Option<GString>; fn get_sessionid(&self) -> Option<glib::GString>;
fn get_timeout(&self) -> u32; fn get_timeout(&self) -> u32;
@ -110,7 +101,7 @@ pub trait RTSPSessionExt: 'static {
impl<O: IsA<RTSPSession>> RTSPSessionExt for O { impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
fn allow_expire(&self) { fn allow_expire(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_session_allow_expire(self.as_ref().to_glib_none().0); ffi::gst_rtsp_session_allow_expire(self.as_ref().to_glib_none().0);
} }
} }
@ -122,10 +113,10 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
&mut dyn (FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult),
> = func; > = func;
unsafe extern "C" fn func_func( unsafe extern "C" fn func_func(
sess: *mut gst_rtsp_server_sys::GstRTSPSession, sess: *mut ffi::GstRTSPSession,
media: *mut gst_rtsp_server_sys::GstRTSPSessionMedia, media: *mut ffi::GstRTSPSessionMedia,
user_data: glib_sys::gpointer, user_data: glib::ffi::gpointer,
) -> gst_rtsp_server_sys::GstRTSPFilterResult { ) -> ffi::GstRTSPFilterResult {
let sess = from_glib_borrow(sess); let sess = from_glib_borrow(sess);
let media = from_glib_borrow(media); let media = from_glib_borrow(media);
let callback: *mut Option< let callback: *mut Option<
@ -150,7 +141,7 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
&mut dyn (FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult),
> = &func_data; > = &func_data;
unsafe { unsafe {
FromGlibPtrContainer::from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_filter( FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_session_filter(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
func, func,
super_callback0 as *const _ as usize as *mut _, super_callback0 as *const _ as usize as *mut _,
@ -158,9 +149,9 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
} }
} }
fn get_header(&self) -> Option<GString> { fn get_header(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_get_header( from_glib_full(ffi::gst_rtsp_session_get_header(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -169,7 +160,7 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
fn get_media(&self, path: &str) -> (Option<RTSPSessionMedia>, i32) { fn get_media(&self, path: &str) -> (Option<RTSPSessionMedia>, i32) {
unsafe { unsafe {
let mut matched = mem::MaybeUninit::uninit(); let mut matched = mem::MaybeUninit::uninit();
let ret = from_glib_none(gst_rtsp_server_sys::gst_rtsp_session_get_media( let ret = from_glib_none(ffi::gst_rtsp_session_get_media(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
path.to_glib_none().0, path.to_glib_none().0,
matched.as_mut_ptr(), matched.as_mut_ptr(),
@ -179,25 +170,25 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
} }
} }
fn get_sessionid(&self) -> Option<GString> { fn get_sessionid(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_none(gst_rtsp_server_sys::gst_rtsp_session_get_sessionid( from_glib_none(ffi::gst_rtsp_session_get_sessionid(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_timeout(&self) -> u32 { fn get_timeout(&self) -> u32 {
unsafe { gst_rtsp_server_sys::gst_rtsp_session_get_timeout(self.as_ref().to_glib_none().0) } unsafe { ffi::gst_rtsp_session_get_timeout(self.as_ref().to_glib_none().0) }
} }
//fn is_expired(&self, now: /*Ignored*/&mut glib::TimeVal) -> bool { //fn is_expired(&self, now: /*Ignored*/&mut glib::TimeVal) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_is_expired() } // unsafe { TODO: call ffi:gst_rtsp_session_is_expired() }
//} //}
fn is_expired_usec(&self, now: i64) -> bool { fn is_expired_usec(&self, now: i64) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_session_is_expired_usec( from_glib(ffi::gst_rtsp_session_is_expired_usec(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
now, now,
)) ))
@ -210,37 +201,32 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
media: &P, media: &P,
) -> Result<RTSPSessionMedia, glib::BoolError> { ) -> Result<RTSPSessionMedia, glib::BoolError> {
unsafe { unsafe {
Option::<_>::from_glib_none(gst_rtsp_server_sys::gst_rtsp_session_manage_media( Option::<_>::from_glib_none(ffi::gst_rtsp_session_manage_media(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
path.to_glib_none().0, path.to_glib_none().0,
media.as_ref().to_glib_full(), media.as_ref().to_glib_full(),
)) ))
.ok_or_else(|| glib_bool_error!("Failed to manage media")) .ok_or_else(|| glib::glib_bool_error!("Failed to manage media"))
} }
} }
//fn next_timeout(&self, now: /*Ignored*/&mut glib::TimeVal) -> i32 { //fn next_timeout(&self, now: /*Ignored*/&mut glib::TimeVal) -> i32 {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_next_timeout() } // unsafe { TODO: call ffi:gst_rtsp_session_next_timeout() }
//} //}
fn next_timeout_usec(&self, now: i64) -> i32 { fn next_timeout_usec(&self, now: i64) -> i32 {
unsafe { unsafe { ffi::gst_rtsp_session_next_timeout_usec(self.as_ref().to_glib_none().0, now) }
gst_rtsp_server_sys::gst_rtsp_session_next_timeout_usec(
self.as_ref().to_glib_none().0,
now,
)
}
} }
fn prevent_expire(&self) { fn prevent_expire(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_session_prevent_expire(self.as_ref().to_glib_none().0); ffi::gst_rtsp_session_prevent_expire(self.as_ref().to_glib_none().0);
} }
} }
fn release_media<P: IsA<RTSPSessionMedia>>(&self, media: &P) -> bool { fn release_media<P: IsA<RTSPSessionMedia>>(&self, media: &P) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_session_release_media( from_glib(ffi::gst_rtsp_session_release_media(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
media.as_ref().to_glib_none().0, media.as_ref().to_glib_none().0,
)) ))
@ -249,24 +235,21 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
fn set_timeout(&self, timeout: u32) { fn set_timeout(&self, timeout: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_session_set_timeout( ffi::gst_rtsp_session_set_timeout(self.as_ref().to_glib_none().0, timeout);
self.as_ref().to_glib_none().0,
timeout,
);
} }
} }
fn touch(&self) { fn touch(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_session_touch(self.as_ref().to_glib_none().0); ffi::gst_rtsp_session_touch(self.as_ref().to_glib_none().0);
} }
} }
fn get_property_extra_timeout(&self) -> u32 { fn get_property_extra_timeout(&self) -> u32 {
unsafe { unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type()); let mut value = Value::from_type(<u32 as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"extra-timeout\0".as_ptr() as *const _, b"extra-timeout\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -279,8 +262,8 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
fn set_property_extra_timeout(&self, extra_timeout: u32) { fn set_property_extra_timeout(&self, extra_timeout: u32) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"extra-timeout\0".as_ptr() as *const _, b"extra-timeout\0".as_ptr() as *const _,
Value::from(&extra_timeout).to_glib_none().0, Value::from(&extra_timeout).to_glib_none().0,
); );
@ -290,8 +273,8 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
fn get_property_timeout_always_visible(&self) -> bool { fn get_property_timeout_always_visible(&self) -> bool {
unsafe { unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type()); let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property( glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"timeout-always-visible\0".as_ptr() as *const _, b"timeout-always-visible\0".as_ptr() as *const _,
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
); );
@ -304,8 +287,8 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
fn set_property_timeout_always_visible(&self, timeout_always_visible: bool) { fn set_property_timeout_always_visible(&self, timeout_always_visible: bool) {
unsafe { unsafe {
gobject_sys::g_object_set_property( glib::gobject_ffi::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject, self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
b"timeout-always-visible\0".as_ptr() as *const _, b"timeout-always-visible\0".as_ptr() as *const _,
Value::from(&timeout_always_visible).to_glib_none().0, Value::from(&timeout_always_visible).to_glib_none().0,
); );
@ -317,9 +300,9 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_extra_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_extra_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPSession, this: *mut ffi::GstRTSPSession,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPSession>, P: IsA<RTSPSession>,
{ {
@ -344,9 +327,9 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPSession, this: *mut ffi::GstRTSPSession,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPSession>, P: IsA<RTSPSession>,
{ {
@ -374,9 +357,9 @@ impl<O: IsA<RTSPSession>> RTSPSessionExt for O {
P, P,
F: Fn(&P) + Send + Sync + 'static, F: Fn(&P) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPSession, this: *mut ffi::GstRTSPSession,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPSession>, P: IsA<RTSPSession>,
{ {

View file

@ -2,21 +2,17 @@
// 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
use glib; use crate::RTSPMedia;
use crate::RTSPStreamTransport;
use glib::object::IsA; use glib::object::IsA;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use gst;
use gst_rtsp_server_sys;
use std::mem; use std::mem;
use RTSPMedia;
use RTSPStreamTransport;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPSessionMedia(Object<gst_rtsp_server_sys::GstRTSPSessionMedia, gst_rtsp_server_sys::GstRTSPSessionMediaClass>); pub struct RTSPSessionMedia(Object<ffi::GstRTSPSessionMedia, ffi::GstRTSPSessionMediaClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_session_media_get_type(), get_type => || ffi::gst_rtsp_session_media_get_type(),
} }
} }
@ -24,7 +20,7 @@ impl RTSPSessionMedia {
pub fn new<P: IsA<RTSPMedia>>(path: &str, media: &P) -> RTSPSessionMedia { pub fn new<P: IsA<RTSPMedia>>(path: &str, media: &P) -> RTSPSessionMedia {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_media_new( from_glib_full(ffi::gst_rtsp_session_media_new(
path.to_glib_none().0, path.to_glib_none().0,
media.as_ref().to_glib_full(), media.as_ref().to_glib_full(),
)) ))
@ -44,7 +40,7 @@ pub trait RTSPSessionMediaExt: 'static {
fn get_media(&self) -> Option<RTSPMedia>; fn get_media(&self) -> Option<RTSPMedia>;
fn get_rtpinfo(&self) -> Option<GString>; fn get_rtpinfo(&self) -> Option<glib::GString>;
//fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState; //fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState;
@ -65,12 +61,12 @@ pub trait RTSPSessionMediaExt: 'static {
impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O { impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O {
//fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool { //fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_alloc_channels() } // unsafe { TODO: call ffi:gst_rtsp_session_media_alloc_channels() }
//} //}
fn get_base_time(&self) -> gst::ClockTime { fn get_base_time(&self) -> gst::ClockTime {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_session_media_get_base_time( from_glib(ffi::gst_rtsp_session_media_get_base_time(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -78,27 +74,27 @@ impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O {
fn get_media(&self) -> Option<RTSPMedia> { fn get_media(&self) -> Option<RTSPMedia> {
unsafe { unsafe {
from_glib_none(gst_rtsp_server_sys::gst_rtsp_session_media_get_media( from_glib_none(ffi::gst_rtsp_session_media_get_media(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_rtpinfo(&self) -> Option<GString> { fn get_rtpinfo(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_media_get_rtpinfo( from_glib_full(ffi::gst_rtsp_session_media_get_rtpinfo(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
//fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState { //fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_get_rtsp_state() } // unsafe { TODO: call ffi:gst_rtsp_session_media_get_rtsp_state() }
//} //}
fn get_transport(&self, idx: u32) -> Option<RTSPStreamTransport> { fn get_transport(&self, idx: u32) -> Option<RTSPStreamTransport> {
unsafe { unsafe {
from_glib_none(gst_rtsp_server_sys::gst_rtsp_session_media_get_transport( from_glib_none(ffi::gst_rtsp_session_media_get_transport(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
idx, idx,
)) ))
@ -109,18 +105,16 @@ impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
fn get_transports(&self) -> Vec<RTSPStreamTransport> { fn get_transports(&self) -> Vec<RTSPStreamTransport> {
unsafe { unsafe {
FromGlibPtrContainer::from_glib_full( FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_session_media_get_transports(
gst_rtsp_server_sys::gst_rtsp_session_media_get_transports( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn matches(&self, path: &str) -> Option<i32> { fn matches(&self, path: &str) -> Option<i32> {
unsafe { unsafe {
let mut matched = mem::MaybeUninit::uninit(); let mut matched = mem::MaybeUninit::uninit();
let ret = from_glib(gst_rtsp_server_sys::gst_rtsp_session_media_matches( let ret = from_glib(ffi::gst_rtsp_session_media_matches(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
path.to_glib_none().0, path.to_glib_none().0,
matched.as_mut_ptr(), matched.as_mut_ptr(),
@ -135,13 +129,13 @@ impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O {
} }
//fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState) { //fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_set_rtsp_state() } // unsafe { TODO: call ffi:gst_rtsp_session_media_set_rtsp_state() }
//} //}
fn set_state(&self, state: gst::State) -> Result<(), glib::error::BoolError> { fn set_state(&self, state: gst::State) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_session_media_set_state( ffi::gst_rtsp_session_media_set_state(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
state.to_glib() state.to_glib()
), ),
@ -151,6 +145,6 @@ impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O {
} }
//fn set_transport<P: IsA<RTSPStream>>(&self, stream: &P, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option<RTSPStreamTransport> { //fn set_transport<P: IsA<RTSPStream>>(&self, stream: &P, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option<RTSPStreamTransport> {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_set_transport() } // unsafe { TODO: call ffi:gst_rtsp_session_media_set_transport() }
//} //}
} }

View file

@ -2,31 +2,28 @@
// 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
use glib; use crate::RTSPFilterResult;
use crate::RTSPSession;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib_sys;
use gst_rtsp_server_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem::transmute; use std::mem::transmute;
use RTSPFilterResult;
use RTSPSession;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPSessionPool(Object<gst_rtsp_server_sys::GstRTSPSessionPool, gst_rtsp_server_sys::GstRTSPSessionPoolClass>); pub struct RTSPSessionPool(Object<ffi::GstRTSPSessionPool, ffi::GstRTSPSessionPoolClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_session_pool_get_type(), get_type => || ffi::gst_rtsp_session_pool_get_type(),
} }
} }
impl RTSPSessionPool { impl RTSPSessionPool {
pub fn new() -> RTSPSessionPool { pub fn new() -> RTSPSessionPool {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_pool_new()) } unsafe { from_glib_full(ffi::gst_rtsp_session_pool_new()) }
} }
} }
@ -74,17 +71,15 @@ pub trait RTSPSessionPoolExt: 'static {
impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O { impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
fn cleanup(&self) -> u32 { fn cleanup(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_session_pool_cleanup(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_session_pool_cleanup(self.as_ref().to_glib_none().0)
}
} }
fn create(&self) -> Result<RTSPSession, glib::BoolError> { fn create(&self) -> Result<RTSPSession, glib::BoolError> {
unsafe { unsafe {
Option::<_>::from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_pool_create( Option::<_>::from_glib_full(ffi::gst_rtsp_session_pool_create(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
.ok_or_else(|| glib_bool_error!("Failed to create session pool")) .ok_or_else(|| glib::glib_bool_error!("Failed to create session pool"))
} }
} }
@ -96,10 +91,10 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
&mut dyn (FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult),
> = func; > = func;
unsafe extern "C" fn func_func( unsafe extern "C" fn func_func(
pool: *mut gst_rtsp_server_sys::GstRTSPSessionPool, pool: *mut ffi::GstRTSPSessionPool,
session: *mut gst_rtsp_server_sys::GstRTSPSession, session: *mut ffi::GstRTSPSession,
user_data: glib_sys::gpointer, user_data: glib::ffi::gpointer,
) -> gst_rtsp_server_sys::GstRTSPFilterResult { ) -> ffi::GstRTSPFilterResult {
let pool = from_glib_borrow(pool); let pool = from_glib_borrow(pool);
let session = from_glib_borrow(session); let session = from_glib_borrow(session);
let callback: *mut Option< let callback: *mut Option<
@ -124,7 +119,7 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
&mut dyn (FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult),
> = &func_data; > = &func_data;
unsafe { unsafe {
FromGlibPtrContainer::from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_pool_filter( FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_session_pool_filter(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
func, func,
super_callback0 as *const _ as usize as *mut _, super_callback0 as *const _ as usize as *mut _,
@ -134,7 +129,7 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
fn find(&self, sessionid: &str) -> Option<RTSPSession> { fn find(&self, sessionid: &str) -> Option<RTSPSession> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_pool_find( from_glib_full(ffi::gst_rtsp_session_pool_find(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
sessionid.to_glib_none().0, sessionid.to_glib_none().0,
)) ))
@ -142,25 +137,17 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
} }
fn get_max_sessions(&self) -> u32 { fn get_max_sessions(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_session_pool_get_max_sessions(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_session_pool_get_max_sessions(
self.as_ref().to_glib_none().0,
)
}
} }
fn get_n_sessions(&self) -> u32 { fn get_n_sessions(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_session_pool_get_n_sessions(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_session_pool_get_n_sessions(
self.as_ref().to_glib_none().0,
)
}
} }
fn remove<P: IsA<RTSPSession>>(&self, sess: &P) -> Result<(), glib::error::BoolError> { fn remove<P: IsA<RTSPSession>>(&self, sess: &P) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_session_pool_remove( ffi::gst_rtsp_session_pool_remove(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
sess.as_ref().to_glib_none().0 sess.as_ref().to_glib_none().0
), ),
@ -171,10 +158,7 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
fn set_max_sessions(&self, max: u32) { fn set_max_sessions(&self, max: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_session_pool_set_max_sessions( ffi::gst_rtsp_session_pool_set_max_sessions(self.as_ref().to_glib_none().0, max);
self.as_ref().to_glib_none().0,
max,
);
} }
} }
@ -186,9 +170,9 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
P, P,
F: Fn(&P, &RTSPSession) + Send + Sync + 'static, F: Fn(&P, &RTSPSession) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPSessionPool, this: *mut ffi::GstRTSPSessionPool,
object: *mut gst_rtsp_server_sys::GstRTSPSession, object: *mut ffi::GstRTSPSession,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPSessionPool>, P: IsA<RTSPSessionPool>,
{ {
@ -216,9 +200,9 @@ impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_max_sessions_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_max_sessions_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPSessionPool, this: *mut ffi::GstRTSPSessionPool,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPSessionPool>, P: IsA<RTSPSessionPool>,
{ {

View file

@ -2,33 +2,25 @@
// 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
use gio; use crate::RTSPAddress;
use glib; use crate::RTSPAddressPool;
use crate::RTSPFilterResult;
use crate::RTSPPublishClockMode;
use crate::RTSPStreamTransport;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use glib_sys;
use gst;
use gst_rtsp;
use gst_rtsp_server_sys;
use gst_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem; use std::mem;
use std::mem::transmute; use std::mem::transmute;
use RTSPAddress;
use RTSPAddressPool;
use RTSPFilterResult;
use RTSPPublishClockMode;
use RTSPStreamTransport;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPStream(Object<gst_rtsp_server_sys::GstRTSPStream, gst_rtsp_server_sys::GstRTSPStreamClass>); pub struct RTSPStream(Object<ffi::GstRTSPStream, ffi::GstRTSPStreamClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_stream_get_type(), get_type => || ffi::gst_rtsp_stream_get_type(),
} }
} }
@ -40,7 +32,7 @@ impl RTSPStream {
) -> RTSPStream { ) -> RTSPStream {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_new( from_glib_full(ffi::gst_rtsp_stream_new(
idx, idx,
payloader.as_ref().to_glib_none().0, payloader.as_ref().to_glib_none().0,
pad.as_ref().to_glib_none().0, pad.as_ref().to_glib_none().0,
@ -82,7 +74,7 @@ pub trait RTSPStreamExt: 'static {
fn get_caps(&self) -> Option<gst::Caps>; fn get_caps(&self) -> Option<gst::Caps>;
fn get_control(&self) -> Option<GString>; fn get_control(&self) -> Option<glib::GString>;
fn get_current_seqnum(&self) -> u16; fn get_current_seqnum(&self) -> u16;
@ -102,9 +94,9 @@ pub trait RTSPStreamExt: 'static {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_multicast_client_addresses(&self) -> Option<GString>; fn get_multicast_client_addresses(&self) -> Option<glib::GString>;
fn get_multicast_iface(&self) -> Option<GString>; fn get_multicast_iface(&self) -> Option<glib::GString>;
fn get_profiles(&self) -> gst_rtsp::RTSPProfile; fn get_profiles(&self) -> gst_rtsp::RTSPProfile;
@ -345,15 +337,13 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
family: gio::SocketFamily, family: gio::SocketFamily,
) -> bool { ) -> bool {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_stream_add_multicast_client_address(
gst_rtsp_server_sys::gst_rtsp_stream_add_multicast_client_address( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, destination.to_glib_none().0,
destination.to_glib_none().0, rtp_port,
rtp_port, rtcp_port,
rtcp_port, family.to_glib(),
family.to_glib(), ))
),
)
} }
} }
@ -362,8 +352,8 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
trans: &P, trans: &P,
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_add_transport( ffi::gst_rtsp_stream_add_transport(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
trans.as_ref().to_glib_none().0 trans.as_ref().to_glib_none().0
), ),
@ -373,62 +363,58 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
} }
//fn allocate_udp_sockets(&self, family: gio::SocketFamily, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport, use_client_settings: bool) -> bool { //fn allocate_udp_sockets(&self, family: gio::SocketFamily, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport, use_client_settings: bool) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_allocate_udp_sockets() } // unsafe { TODO: call ffi:gst_rtsp_stream_allocate_udp_sockets() }
//} //}
//#[cfg(any(feature = "v1_14", feature = "dox"))] //#[cfg(any(feature = "v1_14", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
//fn complete_stream(&self, transport: /*Ignored*/&gst_rtsp::RTSPTransport) -> bool { //fn complete_stream(&self, transport: /*Ignored*/&gst_rtsp::RTSPTransport) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_complete_stream() } // unsafe { TODO: call ffi:gst_rtsp_stream_complete_stream() }
//} //}
fn get_address_pool(&self) -> Option<RTSPAddressPool> { fn get_address_pool(&self) -> Option<RTSPAddressPool> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_address_pool( from_glib_full(ffi::gst_rtsp_stream_get_address_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_buffer_size(&self) -> u32 { fn get_buffer_size(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_stream_get_buffer_size(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_stream_get_buffer_size(self.as_ref().to_glib_none().0)
}
} }
fn get_caps(&self) -> Option<gst::Caps> { fn get_caps(&self) -> Option<gst::Caps> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_caps( from_glib_full(ffi::gst_rtsp_stream_get_caps(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_control(&self) -> Option<GString> { fn get_control(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_control( from_glib_full(ffi::gst_rtsp_stream_get_control(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_current_seqnum(&self) -> u16 { fn get_current_seqnum(&self) -> u16 {
unsafe { unsafe { ffi::gst_rtsp_stream_get_current_seqnum(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_stream_get_current_seqnum(self.as_ref().to_glib_none().0)
}
} }
fn get_dscp_qos(&self) -> i32 { fn get_dscp_qos(&self) -> i32 {
unsafe { gst_rtsp_server_sys::gst_rtsp_stream_get_dscp_qos(self.as_ref().to_glib_none().0) } unsafe { ffi::gst_rtsp_stream_get_dscp_qos(self.as_ref().to_glib_none().0) }
} }
fn get_index(&self) -> u32 { fn get_index(&self) -> u32 {
unsafe { gst_rtsp_server_sys::gst_rtsp_stream_get_index(self.as_ref().to_glib_none().0) } unsafe { ffi::gst_rtsp_stream_get_index(self.as_ref().to_glib_none().0) }
} }
fn get_joined_bin(&self) -> Option<gst::Bin> { fn get_joined_bin(&self) -> Option<gst::Bin> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_joined_bin( from_glib_full(ffi::gst_rtsp_stream_get_joined_bin(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -437,18 +423,16 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_max_mcast_ttl(&self) -> u32 { fn get_max_mcast_ttl(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_stream_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_stream_get_max_mcast_ttl(self.as_ref().to_glib_none().0)
}
} }
fn get_mtu(&self) -> u32 { fn get_mtu(&self) -> u32 {
unsafe { gst_rtsp_server_sys::gst_rtsp_stream_get_mtu(self.as_ref().to_glib_none().0) } unsafe { ffi::gst_rtsp_stream_get_mtu(self.as_ref().to_glib_none().0) }
} }
fn get_multicast_address(&self, family: gio::SocketFamily) -> Option<RTSPAddress> { fn get_multicast_address(&self, family: gio::SocketFamily) -> Option<RTSPAddress> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_multicast_address( from_glib_full(ffi::gst_rtsp_stream_get_multicast_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
family.to_glib(), family.to_glib(),
)) ))
@ -457,19 +441,17 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_multicast_client_addresses(&self) -> Option<GString> { fn get_multicast_client_addresses(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full( from_glib_full(ffi::gst_rtsp_stream_get_multicast_client_addresses(
gst_rtsp_server_sys::gst_rtsp_stream_get_multicast_client_addresses( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
fn get_multicast_iface(&self) -> Option<GString> { fn get_multicast_iface(&self) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_multicast_iface( from_glib_full(ffi::gst_rtsp_stream_get_multicast_iface(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -477,7 +459,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_profiles(&self) -> gst_rtsp::RTSPProfile { fn get_profiles(&self) -> gst_rtsp::RTSPProfile {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_get_profiles( from_glib(ffi::gst_rtsp_stream_get_profiles(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -485,19 +467,19 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans { fn get_protocols(&self) -> gst_rtsp::RTSPLowerTrans {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_get_protocols( from_glib(ffi::gst_rtsp_stream_get_protocols(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
fn get_pt(&self) -> u32 { fn get_pt(&self) -> u32 {
unsafe { gst_rtsp_server_sys::gst_rtsp_stream_get_pt(self.as_ref().to_glib_none().0) } unsafe { ffi::gst_rtsp_stream_get_pt(self.as_ref().to_glib_none().0) }
} }
fn get_publish_clock_mode(&self) -> RTSPPublishClockMode { fn get_publish_clock_mode(&self) -> RTSPPublishClockMode {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_get_publish_clock_mode( from_glib(ffi::gst_rtsp_stream_get_publish_clock_mode(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -507,7 +489,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn get_rate_control(&self) -> bool { fn get_rate_control(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_get_rate_control( from_glib(ffi::gst_rtsp_stream_get_rate_control(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -519,7 +501,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
unsafe { unsafe {
let mut rate = mem::MaybeUninit::uninit(); let mut rate = mem::MaybeUninit::uninit();
let mut applied_rate = mem::MaybeUninit::uninit(); let mut applied_rate = mem::MaybeUninit::uninit();
let ret = from_glib(gst_rtsp_server_sys::gst_rtsp_stream_get_rates( let ret = from_glib(ffi::gst_rtsp_stream_get_rates(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
rate.as_mut_ptr(), rate.as_mut_ptr(),
applied_rate.as_mut_ptr(), applied_rate.as_mut_ptr(),
@ -535,20 +517,14 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
} }
fn get_retransmission_pt(&self) -> u32 { fn get_retransmission_pt(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_stream_get_retransmission_pt(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_stream_get_retransmission_pt(
self.as_ref().to_glib_none().0,
)
}
} }
fn get_retransmission_time(&self) -> gst::ClockTime { fn get_retransmission_time(&self) -> gst::ClockTime {
unsafe { unsafe {
from_glib( from_glib(ffi::gst_rtsp_stream_get_retransmission_time(
gst_rtsp_server_sys::gst_rtsp_stream_get_retransmission_time( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, ))
),
)
} }
} }
@ -556,18 +532,16 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
fn get_rtcp_multicast_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> { fn get_rtcp_multicast_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> {
unsafe { unsafe {
from_glib_full( from_glib_full(ffi::gst_rtsp_stream_get_rtcp_multicast_socket(
gst_rtsp_server_sys::gst_rtsp_stream_get_rtcp_multicast_socket( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, family.to_glib(),
family.to_glib(), ))
),
)
} }
} }
fn get_rtcp_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> { fn get_rtcp_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_rtcp_socket( from_glib_full(ffi::gst_rtsp_stream_get_rtcp_socket(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
family.to_glib(), family.to_glib(),
)) ))
@ -576,18 +550,16 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_rtp_multicast_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> { fn get_rtp_multicast_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> {
unsafe { unsafe {
from_glib_full( from_glib_full(ffi::gst_rtsp_stream_get_rtp_multicast_socket(
gst_rtsp_server_sys::gst_rtsp_stream_get_rtp_multicast_socket( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, family.to_glib(),
family.to_glib(), ))
),
)
} }
} }
fn get_rtp_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> { fn get_rtp_socket(&self, family: gio::SocketFamily) -> Option<gio::Socket> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_rtp_socket( from_glib_full(ffi::gst_rtsp_stream_get_rtp_socket(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
family.to_glib(), family.to_glib(),
)) ))
@ -600,7 +572,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
let mut seq = mem::MaybeUninit::uninit(); let mut seq = mem::MaybeUninit::uninit();
let mut clock_rate = mem::MaybeUninit::uninit(); let mut clock_rate = mem::MaybeUninit::uninit();
let mut running_time = mem::MaybeUninit::uninit(); let mut running_time = mem::MaybeUninit::uninit();
let ret = from_glib(gst_rtsp_server_sys::gst_rtsp_stream_get_rtpinfo( let ret = from_glib(ffi::gst_rtsp_stream_get_rtpinfo(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
rtptime.as_mut_ptr(), rtptime.as_mut_ptr(),
seq.as_mut_ptr(), seq.as_mut_ptr(),
@ -621,19 +593,19 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_rtpsession(&self) -> Option<glib::Object> { fn get_rtpsession(&self) -> Option<glib::Object> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_rtpsession( from_glib_full(ffi::gst_rtsp_stream_get_rtpsession(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
//fn get_server_port(&self, server_port: /*Ignored*/gst_rtsp::RTSPRange, family: gio::SocketFamily) { //fn get_server_port(&self, server_port: /*Ignored*/gst_rtsp::RTSPRange, family: gio::SocketFamily) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_get_server_port() } // unsafe { TODO: call ffi:gst_rtsp_stream_get_server_port() }
//} //}
fn get_sinkpad(&self) -> Option<gst::Pad> { fn get_sinkpad(&self) -> Option<gst::Pad> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_sinkpad( from_glib_full(ffi::gst_rtsp_stream_get_sinkpad(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -641,7 +613,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_srcpad(&self) -> Option<gst::Pad> { fn get_srcpad(&self) -> Option<gst::Pad> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_srcpad( from_glib_full(ffi::gst_rtsp_stream_get_srcpad(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -649,7 +621,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_srtp_encoder(&self) -> Option<gst::Element> { fn get_srtp_encoder(&self) -> Option<gst::Element> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_get_srtp_encoder( from_glib_full(ffi::gst_rtsp_stream_get_srtp_encoder(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -658,10 +630,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_ssrc(&self) -> u32 { fn get_ssrc(&self) -> u32 {
unsafe { unsafe {
let mut ssrc = mem::MaybeUninit::uninit(); let mut ssrc = mem::MaybeUninit::uninit();
gst_rtsp_server_sys::gst_rtsp_stream_get_ssrc( ffi::gst_rtsp_stream_get_ssrc(self.as_ref().to_glib_none().0, ssrc.as_mut_ptr());
self.as_ref().to_glib_none().0,
ssrc.as_mut_ptr(),
);
let ssrc = ssrc.assume_init(); let ssrc = ssrc.assume_init();
ssrc ssrc
} }
@ -669,7 +638,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn get_ulpfec_enabled(&self) -> bool { fn get_ulpfec_enabled(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_get_ulpfec_enabled( from_glib(ffi::gst_rtsp_stream_get_ulpfec_enabled(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -678,26 +647,20 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_ulpfec_percentage(&self) -> u32 { fn get_ulpfec_percentage(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_stream_get_ulpfec_percentage(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_stream_get_ulpfec_percentage(
self.as_ref().to_glib_none().0,
)
}
} }
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn get_ulpfec_pt(&self) -> u32 { fn get_ulpfec_pt(&self) -> u32 {
unsafe { unsafe { ffi::gst_rtsp_stream_get_ulpfec_pt(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_stream_get_ulpfec_pt(self.as_ref().to_glib_none().0)
}
} }
#[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn handle_keymgmt(&self, keymgmt: &str) -> bool { fn handle_keymgmt(&self, keymgmt: &str) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_handle_keymgmt( from_glib(ffi::gst_rtsp_stream_handle_keymgmt(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
keymgmt.to_glib_none().0, keymgmt.to_glib_none().0,
)) ))
@ -706,7 +669,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn has_control(&self, control: Option<&str>) -> bool { fn has_control(&self, control: Option<&str>) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_has_control( from_glib(ffi::gst_rtsp_stream_has_control(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
control.to_glib_none().0, control.to_glib_none().0,
)) ))
@ -717,7 +680,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn is_bind_mcast_address(&self) -> bool { fn is_bind_mcast_address(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_is_bind_mcast_address( from_glib(ffi::gst_rtsp_stream_is_bind_mcast_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -725,7 +688,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn is_blocking(&self) -> bool { fn is_blocking(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_is_blocking( from_glib(ffi::gst_rtsp_stream_is_blocking(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -733,7 +696,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn is_client_side(&self) -> bool { fn is_client_side(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_is_client_side( from_glib(ffi::gst_rtsp_stream_is_client_side(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -743,7 +706,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
fn is_complete(&self) -> bool { fn is_complete(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_is_complete( from_glib(ffi::gst_rtsp_stream_is_complete(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -753,7 +716,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
fn is_receiver(&self) -> bool { fn is_receiver(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_is_receiver( from_glib(ffi::gst_rtsp_stream_is_receiver(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -763,14 +726,14 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
fn is_sender(&self) -> bool { fn is_sender(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_is_sender( from_glib(ffi::gst_rtsp_stream_is_sender(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
//fn is_transport_supported(&self, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> bool { //fn is_transport_supported(&self, transport: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_is_transport_supported() } // unsafe { TODO: call ffi:gst_rtsp_stream_is_transport_supported() }
//} //}
fn join_bin<P: IsA<gst::Bin>, Q: IsA<gst::Element>>( fn join_bin<P: IsA<gst::Bin>, Q: IsA<gst::Element>>(
@ -780,8 +743,8 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
state: gst::State, state: gst::State,
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_join_bin( ffi::gst_rtsp_stream_join_bin(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
bin.as_ref().to_glib_none().0, bin.as_ref().to_glib_none().0,
rtpbin.as_ref().to_glib_none().0, rtpbin.as_ref().to_glib_none().0,
@ -798,8 +761,8 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
rtpbin: &Q, rtpbin: &Q,
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_leave_bin( ffi::gst_rtsp_stream_leave_bin(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
bin.as_ref().to_glib_none().0, bin.as_ref().to_glib_none().0,
rtpbin.as_ref().to_glib_none().0 rtpbin.as_ref().to_glib_none().0
@ -814,8 +777,8 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
trans: &P, trans: &P,
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_remove_transport( ffi::gst_rtsp_stream_remove_transport(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
trans.as_ref().to_glib_none().0 trans.as_ref().to_glib_none().0
), ),
@ -828,7 +791,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn request_aux_receiver(&self, sessid: u32) -> Option<gst::Element> { fn request_aux_receiver(&self, sessid: u32) -> Option<gst::Element> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_request_aux_receiver( from_glib_full(ffi::gst_rtsp_stream_request_aux_receiver(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
sessid, sessid,
)) ))
@ -837,7 +800,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn request_aux_sender(&self, sessid: u32) -> Option<gst::Element> { fn request_aux_sender(&self, sessid: u32) -> Option<gst::Element> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_request_aux_sender( from_glib_full(ffi::gst_rtsp_stream_request_aux_sender(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
sessid, sessid,
)) ))
@ -852,7 +815,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
sessid: u32, sessid: u32,
) -> Option<gst::Element> { ) -> Option<gst::Element> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_request_ulpfec_decoder( from_glib_full(ffi::gst_rtsp_stream_request_ulpfec_decoder(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
rtpbin.as_ref().to_glib_none().0, rtpbin.as_ref().to_glib_none().0,
sessid, sessid,
@ -864,7 +827,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn request_ulpfec_encoder(&self, sessid: u32) -> Option<gst::Element> { fn request_ulpfec_encoder(&self, sessid: u32) -> Option<gst::Element> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_request_ulpfec_encoder( from_glib_full(ffi::gst_rtsp_stream_request_ulpfec_encoder(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
sessid, sessid,
)) ))
@ -879,7 +842,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
ttl: u32, ttl: u32,
) -> Option<RTSPAddress> { ) -> Option<RTSPAddress> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_reserve_address( from_glib_full(ffi::gst_rtsp_stream_reserve_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
address.to_glib_none().0, address.to_glib_none().0,
port, port,
@ -893,7 +856,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
fn seekable(&self) -> bool { fn seekable(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_seekable( from_glib(ffi::gst_rtsp_stream_seekable(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -901,7 +864,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_address_pool<P: IsA<RTSPAddressPool>>(&self, pool: Option<&P>) { fn set_address_pool<P: IsA<RTSPAddressPool>>(&self, pool: Option<&P>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_address_pool( ffi::gst_rtsp_stream_set_address_pool(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
pool.map(|p| p.as_ref()).to_glib_none().0, pool.map(|p| p.as_ref()).to_glib_none().0,
); );
@ -912,7 +875,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_bind_mcast_address(&self, bind_mcast_addr: bool) { fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_bind_mcast_address( ffi::gst_rtsp_stream_set_bind_mcast_address(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
bind_mcast_addr.to_glib(), bind_mcast_addr.to_glib(),
); );
@ -921,11 +884,8 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_blocked(&self, blocked: bool) -> Result<(), glib::error::BoolError> { fn set_blocked(&self, blocked: bool) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_set_blocked( ffi::gst_rtsp_stream_set_blocked(self.as_ref().to_glib_none().0, blocked.to_glib()),
self.as_ref().to_glib_none().0,
blocked.to_glib()
),
"Failed to block/unblock the dataflow" "Failed to block/unblock the dataflow"
) )
} }
@ -933,16 +893,13 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_buffer_size(&self, size: u32) { fn set_buffer_size(&self, size: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_buffer_size( ffi::gst_rtsp_stream_set_buffer_size(self.as_ref().to_glib_none().0, size);
self.as_ref().to_glib_none().0,
size,
);
} }
} }
fn set_client_side(&self, client_side: bool) { fn set_client_side(&self, client_side: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_client_side( ffi::gst_rtsp_stream_set_client_side(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
client_side.to_glib(), client_side.to_glib(),
); );
@ -951,7 +908,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_control(&self, control: Option<&str>) { fn set_control(&self, control: Option<&str>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_control( ffi::gst_rtsp_stream_set_control(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
control.to_glib_none().0, control.to_glib_none().0,
); );
@ -960,10 +917,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_dscp_qos(&self, dscp_qos: i32) { fn set_dscp_qos(&self, dscp_qos: i32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_dscp_qos( ffi::gst_rtsp_stream_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
self.as_ref().to_glib_none().0,
dscp_qos,
);
} }
} }
@ -971,7 +925,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_max_mcast_ttl(&self, ttl: u32) -> bool { fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_set_max_mcast_ttl( from_glib(ffi::gst_rtsp_stream_set_max_mcast_ttl(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
ttl, ttl,
)) ))
@ -980,13 +934,13 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_mtu(&self, mtu: u32) { fn set_mtu(&self, mtu: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_mtu(self.as_ref().to_glib_none().0, mtu); ffi::gst_rtsp_stream_set_mtu(self.as_ref().to_glib_none().0, mtu);
} }
} }
fn set_multicast_iface(&self, multicast_iface: Option<&str>) { fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_multicast_iface( ffi::gst_rtsp_stream_set_multicast_iface(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
multicast_iface.to_glib_none().0, multicast_iface.to_glib_none().0,
); );
@ -995,25 +949,19 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) { fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_profiles( ffi::gst_rtsp_stream_set_profiles(self.as_ref().to_glib_none().0, profiles.to_glib());
self.as_ref().to_glib_none().0,
profiles.to_glib(),
);
} }
} }
fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) { fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_protocols( ffi::gst_rtsp_stream_set_protocols(self.as_ref().to_glib_none().0, protocols.to_glib());
self.as_ref().to_glib_none().0,
protocols.to_glib(),
);
} }
} }
fn set_pt_map(&self, pt: u32, caps: &gst::Caps) { fn set_pt_map(&self, pt: u32, caps: &gst::Caps) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_pt_map( ffi::gst_rtsp_stream_set_pt_map(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
pt, pt,
caps.to_glib_none().0, caps.to_glib_none().0,
@ -1023,7 +971,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) { fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_publish_clock_mode( ffi::gst_rtsp_stream_set_publish_clock_mode(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
mode.to_glib(), mode.to_glib(),
); );
@ -1034,7 +982,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn set_rate_control(&self, enabled: bool) { fn set_rate_control(&self, enabled: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_rate_control( ffi::gst_rtsp_stream_set_rate_control(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
enabled.to_glib(), enabled.to_glib(),
); );
@ -1043,16 +991,13 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_retransmission_pt(&self, rtx_pt: u32) { fn set_retransmission_pt(&self, rtx_pt: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_retransmission_pt( ffi::gst_rtsp_stream_set_retransmission_pt(self.as_ref().to_glib_none().0, rtx_pt);
self.as_ref().to_glib_none().0,
rtx_pt,
);
} }
} }
fn set_retransmission_time(&self, time: gst::ClockTime) { fn set_retransmission_time(&self, time: gst::ClockTime) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_retransmission_time( ffi::gst_rtsp_stream_set_retransmission_time(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
time.to_glib(), time.to_glib(),
); );
@ -1061,10 +1006,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
fn set_seqnum_offset(&self, seqnum: u16) { fn set_seqnum_offset(&self, seqnum: u16) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_seqnum_offset( ffi::gst_rtsp_stream_set_seqnum_offset(self.as_ref().to_glib_none().0, seqnum);
self.as_ref().to_glib_none().0,
seqnum,
);
} }
} }
@ -1072,10 +1014,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_ulpfec_percentage(&self, percentage: u32) { fn set_ulpfec_percentage(&self, percentage: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_ulpfec_percentage( ffi::gst_rtsp_stream_set_ulpfec_percentage(self.as_ref().to_glib_none().0, percentage);
self.as_ref().to_glib_none().0,
percentage,
);
} }
} }
@ -1083,7 +1022,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn set_ulpfec_pt(&self, pt: u32) { fn set_ulpfec_pt(&self, pt: u32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_set_ulpfec_pt(self.as_ref().to_glib_none().0, pt); ffi::gst_rtsp_stream_set_ulpfec_pt(self.as_ref().to_glib_none().0, pt);
} }
} }
@ -1095,10 +1034,10 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
&mut dyn (FnMut(&RTSPStream, &RTSPStreamTransport) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPStream, &RTSPStreamTransport) -> RTSPFilterResult),
> = func; > = func;
unsafe extern "C" fn func_func( unsafe extern "C" fn func_func(
stream: *mut gst_rtsp_server_sys::GstRTSPStream, stream: *mut ffi::GstRTSPStream,
trans: *mut gst_rtsp_server_sys::GstRTSPStreamTransport, trans: *mut ffi::GstRTSPStreamTransport,
user_data: glib_sys::gpointer, user_data: glib::ffi::gpointer,
) -> gst_rtsp_server_sys::GstRTSPFilterResult { ) -> ffi::GstRTSPFilterResult {
let stream = from_glib_borrow(stream); let stream = from_glib_borrow(stream);
let trans = from_glib_borrow(trans); let trans = from_glib_borrow(trans);
let callback: *mut Option< let callback: *mut Option<
@ -1123,20 +1062,18 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
&mut dyn (FnMut(&RTSPStream, &RTSPStreamTransport) -> RTSPFilterResult), &mut dyn (FnMut(&RTSPStream, &RTSPStreamTransport) -> RTSPFilterResult),
> = &func_data; > = &func_data;
unsafe { unsafe {
FromGlibPtrContainer::from_glib_full( FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_stream_transport_filter(
gst_rtsp_server_sys::gst_rtsp_stream_transport_filter( self.as_ref().to_glib_none().0,
self.as_ref().to_glib_none().0, func,
func, super_callback0 as *const _ as usize as *mut _,
super_callback0 as *const _ as usize as *mut _, ))
),
)
} }
} }
fn unblock_linked(&self) -> Result<(), glib::error::BoolError> { fn unblock_linked(&self) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_unblock_linked(self.as_ref().to_glib_none().0), ffi::gst_rtsp_stream_unblock_linked(self.as_ref().to_glib_none().0),
"Failed to unblock the dataflow" "Failed to unblock the dataflow"
) )
} }
@ -1148,8 +1085,8 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
crypto: Option<&gst::Caps>, crypto: Option<&gst::Caps>,
) -> Result<(), glib::error::BoolError> { ) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_update_crypto( ffi::gst_rtsp_stream_update_crypto(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
ssrc, ssrc,
crypto.to_glib_none().0 crypto.to_glib_none().0
@ -1163,7 +1100,7 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn verify_mcast_ttl(&self, ttl: u32) -> bool { fn verify_mcast_ttl(&self, ttl: u32) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_verify_mcast_ttl( from_glib(ffi::gst_rtsp_stream_verify_mcast_ttl(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
ttl, ttl,
)) ))
@ -1178,9 +1115,9 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
P, P,
F: Fn(&P, &gst::Element) + Send + Sync + 'static, F: Fn(&P, &gst::Element) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPStream, this: *mut ffi::GstRTSPStream,
object: *mut gst_sys::GstElement, object: *mut gst::ffi::GstElement,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPStream>, P: IsA<RTSPStream>,
{ {
@ -1211,9 +1148,9 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
P, P,
F: Fn(&P, &gst::Element) + Send + Sync + 'static, F: Fn(&P, &gst::Element) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPStream, this: *mut ffi::GstRTSPStream,
object: *mut gst_sys::GstElement, object: *mut gst::ffi::GstElement,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPStream>, P: IsA<RTSPStream>,
{ {
@ -1244,9 +1181,9 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
P, P,
F: Fn(&P, &gst::Element) + Send + Sync + 'static, F: Fn(&P, &gst::Element) + Send + Sync + 'static,
>( >(
this: *mut gst_rtsp_server_sys::GstRTSPStream, this: *mut ffi::GstRTSPStream,
object: *mut gst_sys::GstElement, object: *mut gst::ffi::GstElement,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPStream>, P: IsA<RTSPStream>,
{ {
@ -1274,9 +1211,9 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_control_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_control_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPStream, this: *mut ffi::GstRTSPStream,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPStream>, P: IsA<RTSPStream>,
{ {
@ -1301,9 +1238,9 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_profiles_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_profiles_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPStream, this: *mut ffi::GstRTSPStream,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPStream>, P: IsA<RTSPStream>,
{ {
@ -1328,9 +1265,9 @@ impl<O: IsA<RTSPStream>> RTSPStreamExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_protocols_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_protocols_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPStream, this: *mut ffi::GstRTSPStream,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPStream>, P: IsA<RTSPStream>,
{ {

View file

@ -2,34 +2,29 @@
// 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
use glib; use crate::RTSPStream;
use glib::object::IsA; use glib::object::IsA;
use glib::translate::*; use glib::translate::*;
use glib::GString;
use gst;
use gst_rtsp;
use gst_rtsp_server_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use RTSPStream;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPStreamTransport(Object<gst_rtsp_server_sys::GstRTSPStreamTransport, gst_rtsp_server_sys::GstRTSPStreamTransportClass>); pub struct RTSPStreamTransport(Object<ffi::GstRTSPStreamTransport, ffi::GstRTSPStreamTransportClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_stream_transport_get_type(), get_type => || ffi::gst_rtsp_stream_transport_get_type(),
} }
} }
impl RTSPStreamTransport { impl RTSPStreamTransport {
//pub fn new<P: IsA<RTSPStream>>(stream: &P, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> RTSPStreamTransport { //pub fn new<P: IsA<RTSPStream>>(stream: &P, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> RTSPStreamTransport {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_new() } // unsafe { TODO: call ffi:gst_rtsp_stream_transport_new() }
//} //}
} }
pub const NONE_RTSP_STREAM_TRANSPORT: Option<&RTSPStreamTransport> = None; pub const NONE_RTSP_STREAM_TRANSPORT: Option<&RTSPStreamTransport> = None;
pub trait RTSPStreamTransportExt: 'static { pub trait RTSPStreamTransportExt: 'static {
fn get_rtpinfo(&self, start_time: gst::ClockTime) -> Option<GString>; fn get_rtpinfo(&self, start_time: gst::ClockTime) -> Option<glib::GString>;
fn get_stream(&self) -> Option<RTSPStream>; fn get_stream(&self) -> Option<RTSPStream>;
@ -81,9 +76,9 @@ pub trait RTSPStreamTransportExt: 'static {
} }
impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O { impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
fn get_rtpinfo(&self, start_time: gst::ClockTime) -> Option<GString> { fn get_rtpinfo(&self, start_time: gst::ClockTime) -> Option<glib::GString> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_stream_transport_get_rtpinfo( from_glib_full(ffi::gst_rtsp_stream_transport_get_rtpinfo(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
start_time.to_glib(), start_time.to_glib(),
)) ))
@ -92,19 +87,19 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
fn get_stream(&self) -> Option<RTSPStream> { fn get_stream(&self) -> Option<RTSPStream> {
unsafe { unsafe {
from_glib_none(gst_rtsp_server_sys::gst_rtsp_stream_transport_get_stream( from_glib_none(ffi::gst_rtsp_stream_transport_get_stream(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
} }
//fn get_transport(&self) -> /*Ignored*/Option<gst_rtsp::RTSPTransport> { //fn get_transport(&self) -> /*Ignored*/Option<gst_rtsp::RTSPTransport> {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_get_transport() } // unsafe { TODO: call ffi:gst_rtsp_stream_transport_get_transport() }
//} //}
fn get_url(&self) -> Option<gst_rtsp::RTSPUrl> { fn get_url(&self) -> Option<gst_rtsp::RTSPUrl> {
unsafe { unsafe {
from_glib_none(gst_rtsp_server_sys::gst_rtsp_stream_transport_get_url( from_glib_none(ffi::gst_rtsp_stream_transport_get_url(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -112,7 +107,7 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
fn is_timed_out(&self) -> bool { fn is_timed_out(&self) -> bool {
unsafe { unsafe {
from_glib(gst_rtsp_server_sys::gst_rtsp_stream_transport_is_timed_out( from_glib(ffi::gst_rtsp_stream_transport_is_timed_out(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
)) ))
} }
@ -120,9 +115,7 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
fn keep_alive(&self) { fn keep_alive(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_transport_keep_alive( ffi::gst_rtsp_stream_transport_keep_alive(self.as_ref().to_glib_none().0);
self.as_ref().to_glib_none().0,
);
} }
} }
@ -130,16 +123,14 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
fn message_sent(&self) { fn message_sent(&self) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_transport_message_sent( ffi::gst_rtsp_stream_transport_message_sent(self.as_ref().to_glib_none().0);
self.as_ref().to_glib_none().0,
);
} }
} }
fn send_rtcp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> { fn send_rtcp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_transport_send_rtcp( ffi::gst_rtsp_stream_transport_send_rtcp(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
buffer.to_glib_none().0 buffer.to_glib_none().0
), ),
@ -151,13 +142,13 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
//#[cfg(any(feature = "v1_16", feature = "dox"))] //#[cfg(any(feature = "v1_16", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
//fn send_rtcp_list(&self, buffer_list: /*Ignored*/&gst::BufferList) -> bool { //fn send_rtcp_list(&self, buffer_list: /*Ignored*/&gst::BufferList) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_send_rtcp_list() } // unsafe { TODO: call ffi:gst_rtsp_stream_transport_send_rtcp_list() }
//} //}
fn send_rtp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> { fn send_rtp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_transport_send_rtp( ffi::gst_rtsp_stream_transport_send_rtp(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
buffer.to_glib_none().0 buffer.to_glib_none().0
), ),
@ -169,13 +160,13 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
//#[cfg(any(feature = "v1_16", feature = "dox"))] //#[cfg(any(feature = "v1_16", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
//fn send_rtp_list(&self, buffer_list: /*Ignored*/&gst::BufferList) -> bool { //fn send_rtp_list(&self, buffer_list: /*Ignored*/&gst::BufferList) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_send_rtp_list() } // unsafe { TODO: call ffi:gst_rtsp_stream_transport_send_rtp_list() }
//} //}
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> { fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> {
unsafe { unsafe {
glib_result_from_gboolean!( glib::glib_result_from_gboolean!(
gst_rtsp_server_sys::gst_rtsp_stream_transport_set_active( ffi::gst_rtsp_stream_transport_set_active(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
active.to_glib() active.to_glib()
), ),
@ -185,23 +176,23 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
} }
//fn set_callbacks<P: Fn(&gst::Buffer, u8) -> bool + 'static, Q: Fn(&gst::Buffer, u8) -> bool + 'static>(&self, send_rtp: P, send_rtcp: Q) { //fn set_callbacks<P: Fn(&gst::Buffer, u8) -> bool + 'static, Q: Fn(&gst::Buffer, u8) -> bool + 'static>(&self, send_rtp: P, send_rtcp: Q) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_set_callbacks() } // unsafe { TODO: call ffi:gst_rtsp_stream_transport_set_callbacks() }
//} //}
fn set_keepalive<P: Fn() + 'static>(&self, keep_alive: P) { fn set_keepalive<P: Fn() + 'static>(&self, keep_alive: P) {
let keep_alive_data: Box_<P> = Box_::new(keep_alive); let keep_alive_data: Box_<P> = Box_::new(keep_alive);
unsafe extern "C" fn keep_alive_func<P: Fn() + 'static>(user_data: glib_sys::gpointer) { unsafe extern "C" fn keep_alive_func<P: Fn() + 'static>(user_data: glib::ffi::gpointer) {
let callback: &P = &*(user_data as *mut _); let callback: &P = &*(user_data as *mut _);
(*callback)(); (*callback)();
} }
let keep_alive = Some(keep_alive_func::<P> as _); let keep_alive = Some(keep_alive_func::<P> as _);
unsafe extern "C" fn notify_func<P: Fn() + 'static>(data: glib_sys::gpointer) { unsafe extern "C" fn notify_func<P: Fn() + 'static>(data: glib::ffi::gpointer) {
let _callback: Box_<P> = Box_::from_raw(data as *mut _); let _callback: Box_<P> = Box_::from_raw(data as *mut _);
} }
let destroy_call3 = Some(notify_func::<P> as _); let destroy_call3 = Some(notify_func::<P> as _);
let super_callback0: Box_<P> = keep_alive_data; let super_callback0: Box_<P> = keep_alive_data;
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_transport_set_keepalive( ffi::gst_rtsp_stream_transport_set_keepalive(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
keep_alive, keep_alive,
Box_::into_raw(super_callback0) as *mut _, Box_::into_raw(super_callback0) as *mut _,
@ -213,23 +204,23 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
//#[cfg(any(feature = "v1_16", feature = "dox"))] //#[cfg(any(feature = "v1_16", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
//fn set_list_callbacks(&self, send_rtp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, send_rtcp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) { //fn set_list_callbacks(&self, send_rtp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, send_rtcp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_set_list_callbacks() } // unsafe { TODO: call ffi:gst_rtsp_stream_transport_set_list_callbacks() }
//} //}
fn set_message_sent<P: Fn() + 'static>(&self, message_sent: P) { fn set_message_sent<P: Fn() + 'static>(&self, message_sent: P) {
let message_sent_data: Box_<P> = Box_::new(message_sent); let message_sent_data: Box_<P> = Box_::new(message_sent);
unsafe extern "C" fn message_sent_func<P: Fn() + 'static>(user_data: glib_sys::gpointer) { unsafe extern "C" fn message_sent_func<P: Fn() + 'static>(user_data: glib::ffi::gpointer) {
let callback: &P = &*(user_data as *mut _); let callback: &P = &*(user_data as *mut _);
(*callback)(); (*callback)();
} }
let message_sent = Some(message_sent_func::<P> as _); let message_sent = Some(message_sent_func::<P> as _);
unsafe extern "C" fn notify_func<P: Fn() + 'static>(data: glib_sys::gpointer) { unsafe extern "C" fn notify_func<P: Fn() + 'static>(data: glib::ffi::gpointer) {
let _callback: Box_<P> = Box_::from_raw(data as *mut _); let _callback: Box_<P> = Box_::from_raw(data as *mut _);
} }
let destroy_call3 = Some(notify_func::<P> as _); let destroy_call3 = Some(notify_func::<P> as _);
let super_callback0: Box_<P> = message_sent_data; let super_callback0: Box_<P> = message_sent_data;
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_transport_set_message_sent( ffi::gst_rtsp_stream_transport_set_message_sent(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
message_sent, message_sent,
Box_::into_raw(super_callback0) as *mut _, Box_::into_raw(super_callback0) as *mut _,
@ -243,8 +234,8 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
fn set_message_sent_full<P: Fn(&RTSPStreamTransport) + 'static>(&self, message_sent: P) { fn set_message_sent_full<P: Fn(&RTSPStreamTransport) + 'static>(&self, message_sent: P) {
let message_sent_data: Box_<P> = Box_::new(message_sent); let message_sent_data: Box_<P> = Box_::new(message_sent);
unsafe extern "C" fn message_sent_func<P: Fn(&RTSPStreamTransport) + 'static>( unsafe extern "C" fn message_sent_func<P: Fn(&RTSPStreamTransport) + 'static>(
trans: *mut gst_rtsp_server_sys::GstRTSPStreamTransport, trans: *mut ffi::GstRTSPStreamTransport,
user_data: glib_sys::gpointer, user_data: glib::ffi::gpointer,
) { ) {
let trans = from_glib_borrow(trans); let trans = from_glib_borrow(trans);
let callback: &P = &*(user_data as *mut _); let callback: &P = &*(user_data as *mut _);
@ -252,14 +243,14 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
} }
let message_sent = Some(message_sent_func::<P> as _); let message_sent = Some(message_sent_func::<P> as _);
unsafe extern "C" fn notify_func<P: Fn(&RTSPStreamTransport) + 'static>( unsafe extern "C" fn notify_func<P: Fn(&RTSPStreamTransport) + 'static>(
data: glib_sys::gpointer, data: glib::ffi::gpointer,
) { ) {
let _callback: Box_<P> = Box_::from_raw(data as *mut _); let _callback: Box_<P> = Box_::from_raw(data as *mut _);
} }
let destroy_call3 = Some(notify_func::<P> as _); let destroy_call3 = Some(notify_func::<P> as _);
let super_callback0: Box_<P> = message_sent_data; let super_callback0: Box_<P> = message_sent_data;
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_transport_set_message_sent_full( ffi::gst_rtsp_stream_transport_set_message_sent_full(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
message_sent, message_sent,
Box_::into_raw(super_callback0) as *mut _, Box_::into_raw(super_callback0) as *mut _,
@ -270,7 +261,7 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
fn set_timed_out(&self, timedout: bool) { fn set_timed_out(&self, timedout: bool) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_transport_set_timed_out( ffi::gst_rtsp_stream_transport_set_timed_out(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
timedout.to_glib(), timedout.to_glib(),
); );
@ -278,12 +269,12 @@ impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {
} }
//fn set_transport(&self, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) { //fn set_transport(&self, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_set_transport() } // unsafe { TODO: call ffi:gst_rtsp_stream_transport_set_transport() }
//} //}
fn set_url(&self, url: Option<&gst_rtsp::RTSPUrl>) { fn set_url(&self, url: Option<&gst_rtsp::RTSPUrl>) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_stream_transport_set_url( ffi::gst_rtsp_stream_transport_set_url(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
url.to_glib_none().0, url.to_glib_none().0,
); );

View file

@ -2,37 +2,35 @@
// 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
use crate::RTSPContext;
use crate::RTSPThread;
use crate::RTSPThreadType;
use glib::object::Cast; use glib::object::Cast;
use glib::object::IsA; use glib::object::IsA;
use glib::signal::connect_raw; use glib::signal::connect_raw;
use glib::signal::SignalHandlerId; use glib::signal::SignalHandlerId;
use glib::translate::*; use glib::translate::*;
use glib_sys;
use gst_rtsp_server_sys;
use std::boxed::Box as Box_; use std::boxed::Box as Box_;
use std::mem::transmute; use std::mem::transmute;
use RTSPContext;
use RTSPThread;
use RTSPThreadType;
glib_wrapper! { glib::glib_wrapper! {
pub struct RTSPThreadPool(Object<gst_rtsp_server_sys::GstRTSPThreadPool, gst_rtsp_server_sys::GstRTSPThreadPoolClass>); pub struct RTSPThreadPool(Object<ffi::GstRTSPThreadPool, ffi::GstRTSPThreadPoolClass>);
match fn { match fn {
get_type => || gst_rtsp_server_sys::gst_rtsp_thread_pool_get_type(), get_type => || ffi::gst_rtsp_thread_pool_get_type(),
} }
} }
impl RTSPThreadPool { impl RTSPThreadPool {
pub fn new() -> RTSPThreadPool { pub fn new() -> RTSPThreadPool {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_thread_pool_new()) } unsafe { from_glib_full(ffi::gst_rtsp_thread_pool_new()) }
} }
pub fn cleanup() { pub fn cleanup() {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_thread_pool_cleanup(); ffi::gst_rtsp_thread_pool_cleanup();
} }
} }
} }
@ -63,16 +61,12 @@ pub trait RTSPThreadPoolExt: 'static {
impl<O: IsA<RTSPThreadPool>> RTSPThreadPoolExt for O { impl<O: IsA<RTSPThreadPool>> RTSPThreadPoolExt for O {
fn get_max_threads(&self) -> i32 { fn get_max_threads(&self) -> i32 {
unsafe { unsafe { ffi::gst_rtsp_thread_pool_get_max_threads(self.as_ref().to_glib_none().0) }
gst_rtsp_server_sys::gst_rtsp_thread_pool_get_max_threads(
self.as_ref().to_glib_none().0,
)
}
} }
fn get_thread(&self, type_: RTSPThreadType, ctx: &RTSPContext) -> Option<RTSPThread> { fn get_thread(&self, type_: RTSPThreadType, ctx: &RTSPContext) -> Option<RTSPThread> {
unsafe { unsafe {
from_glib_full(gst_rtsp_server_sys::gst_rtsp_thread_pool_get_thread( from_glib_full(ffi::gst_rtsp_thread_pool_get_thread(
self.as_ref().to_glib_none().0, self.as_ref().to_glib_none().0,
type_.to_glib(), type_.to_glib(),
ctx.to_glib_none().0, ctx.to_glib_none().0,
@ -82,10 +76,7 @@ impl<O: IsA<RTSPThreadPool>> RTSPThreadPoolExt for O {
fn set_max_threads(&self, max_threads: i32) { fn set_max_threads(&self, max_threads: i32) {
unsafe { unsafe {
gst_rtsp_server_sys::gst_rtsp_thread_pool_set_max_threads( ffi::gst_rtsp_thread_pool_set_max_threads(self.as_ref().to_glib_none().0, max_threads);
self.as_ref().to_glib_none().0,
max_threads,
);
} }
} }
@ -94,9 +85,9 @@ impl<O: IsA<RTSPThreadPool>> RTSPThreadPoolExt for O {
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
unsafe extern "C" fn notify_max_threads_trampoline<P, F: Fn(&P) + Send + Sync + 'static>( unsafe extern "C" fn notify_max_threads_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_rtsp_server_sys::GstRTSPThreadPool, this: *mut ffi::GstRTSPThreadPool,
_param_spec: glib_sys::gpointer, _param_spec: glib::ffi::gpointer,
f: glib_sys::gpointer, f: glib::ffi::gpointer,
) where ) where
P: IsA<RTSPThreadPool>, P: IsA<RTSPThreadPool>,
{ {

View file

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6) Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8)
from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5) from gir-files (https://github.com/gtk-rs/gir-files @ 6278d819)