gstreamer-rs/gstreamer-webrtc/src/auto/web_rtcice_transport.rs

193 lines
6.3 KiB
Rust
Raw Normal View History

2018-04-23 17:34:22 +00:00
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
2018-03-15 16:04:49 +00:00
// DO NOT EDIT
use crate::{WebRTCICEComponent, WebRTCICEConnectionState, WebRTCICEGatheringState};
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
use std::{boxed::Box as Box_, mem::transmute};
2018-03-15 16:04:49 +00:00
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstWebRTCICETransport")]
2020-11-22 10:46:23 +00:00
pub struct WebRTCICETransport(Object<ffi::GstWebRTCICETransport, ffi::GstWebRTCICETransportClass>);
2018-03-15 16:04:49 +00:00
match fn {
type_ => || ffi::gst_webrtc_ice_transport_get_type(),
2018-03-15 16:04:49 +00:00
}
}
impl WebRTCICETransport {
#[doc(alias = "gst_webrtc_ice_transport_connection_state_change")]
pub fn connection_state_change(&self, new_state: WebRTCICEConnectionState) {
unsafe {
ffi::gst_webrtc_ice_transport_connection_state_change(
self.to_glib_none().0,
new_state.into_glib(),
);
}
}
#[doc(alias = "gst_webrtc_ice_transport_gathering_state_change")]
pub fn gathering_state_change(&self, new_state: WebRTCICEGatheringState) {
unsafe {
ffi::gst_webrtc_ice_transport_gathering_state_change(
self.to_glib_none().0,
new_state.into_glib(),
);
}
}
#[doc(alias = "gst_webrtc_ice_transport_new_candidate")]
pub fn new_candidate(&self, stream_id: u32, component: WebRTCICEComponent, attr: &str) {
unsafe {
ffi::gst_webrtc_ice_transport_new_candidate(
self.to_glib_none().0,
stream_id,
component.into_glib(),
attr.to_glib_none().0,
);
}
}
#[doc(alias = "gst_webrtc_ice_transport_selected_pair_change")]
pub fn selected_pair_change(&self) {
unsafe {
ffi::gst_webrtc_ice_transport_selected_pair_change(self.to_glib_none().0);
}
}
2021-04-11 19:38:18 +00:00
pub fn component(&self) -> WebRTCICEComponent {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self, "component")
}
#[doc(alias = "gathering-state")]
2021-04-11 19:38:18 +00:00
pub fn gathering_state(&self) -> WebRTCICEGatheringState {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self, "gathering-state")
}
2021-04-11 19:38:18 +00:00
pub fn state(&self) -> WebRTCICEConnectionState {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self, "state")
}
#[doc(alias = "on-new-candidate")]
pub fn connect_on_new_candidate<F: Fn(&Self, &str) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn on_new_candidate_trampoline<
F: Fn(&WebRTCICETransport, &str) + Send + Sync + 'static,
>(
2020-11-22 10:46:23 +00:00
this: *mut ffi::GstWebRTCICETransport,
object: *mut libc::c_char,
2020-11-22 10:46:23 +00:00
f: glib::ffi::gpointer,
) {
2019-06-18 10:10:46 +00:00
let f: &F = &*(f as *const F);
2020-11-22 10:46:23 +00:00
f(
&from_glib_borrow(this),
&glib::GString::from_glib_borrow(object),
)
2019-06-18 10:10:46 +00:00
}
2018-03-15 16:04:49 +00:00
unsafe {
2019-01-29 13:53:44 +00:00
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"on-new-candidate\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
on_new_candidate_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
2018-03-15 16:04:49 +00:00
}
}
#[doc(alias = "on-selected-candidate-pair-change")]
pub fn connect_on_selected_candidate_pair_change<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn on_selected_candidate_pair_change_trampoline<
F: Fn(&WebRTCICETransport) + Send + Sync + 'static,
>(
2020-11-22 10:46:23 +00:00
this: *mut ffi::GstWebRTCICETransport,
f: glib::ffi::gpointer,
) {
2019-06-18 10:10:46 +00:00
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
2018-03-15 16:04:49 +00:00
unsafe {
2019-01-29 13:53:44 +00:00
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"on-selected-candidate-pair-change\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
on_selected_candidate_pair_change_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
2018-03-15 16:04:49 +00:00
}
}
#[doc(alias = "gathering-state")]
pub fn connect_gathering_state_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_gathering_state_trampoline<
F: Fn(&WebRTCICETransport) + Send + Sync + 'static,
>(
2020-11-22 10:46:23 +00:00
this: *mut ffi::GstWebRTCICETransport,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2019-06-18 10:10:46 +00:00
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
2019-01-29 13:53:44 +00:00
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::gathering-state\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_gathering_state_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "state")]
pub fn connect_state_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_state_trampoline<
F: Fn(&WebRTCICETransport) + Send + Sync + 'static,
>(
2020-11-22 10:46:23 +00:00
this: *mut ffi::GstWebRTCICETransport,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2019-06-18 10:10:46 +00:00
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
2019-01-29 13:53:44 +00:00
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::state\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_state_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
2018-03-15 16:04:49 +00:00
}
unsafe impl Send for WebRTCICETransport {}
unsafe impl Sync for WebRTCICETransport {}