2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2023-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, subclass::prelude::*, translate::*};
|
|
|
|
|
2024-06-02 08:48:53 +00:00
|
|
|
use crate::{ffi, RTSPClient};
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2024-10-19 19:18:53 +00:00
|
|
|
pub trait RTSPClientImpl: ObjectImpl + ObjectSubclass<Type: IsA<RTSPClient>> + Send + Sync {
|
2022-10-08 18:50:06 +00:00
|
|
|
fn create_sdp(&self, media: &crate::RTSPMedia) -> Option<gst_sdp::SDPMessage> {
|
|
|
|
self.parent_create_sdp(media)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn configure_client_media(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
media: &crate::RTSPMedia,
|
|
|
|
stream: &crate::RTSPStream,
|
|
|
|
ctx: &crate::RTSPContext,
|
2020-02-23 10:53:33 +00:00
|
|
|
) -> Result<(), gst::LoggableError> {
|
2022-10-08 18:50:06 +00:00
|
|
|
self.parent_configure_client_media(media, stream, ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: configure_client_transport
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn params_set(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPResult {
|
|
|
|
self.parent_params_set(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn params_get(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPResult {
|
|
|
|
self.parent_params_get(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn make_path_from_uri(&self, url: &gst_rtsp::RTSPUrl) -> Option<glib::GString> {
|
|
|
|
self.parent_make_path_from_uri(url)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn closed(&self) {
|
|
|
|
self.parent_closed();
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn new_session(&self, session: &crate::RTSPSession) {
|
|
|
|
self.parent_new_session(session);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn options_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_options_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn describe_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_describe_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn setup_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_setup_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn play_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_play_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pause_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_pause_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn teardown_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_teardown_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn set_parameter_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_set_parameter_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parameter_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_parameter_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn announce_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_announce_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn record_request(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_record_request(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn handle_response(&self, ctx: &crate::RTSPContext) {
|
|
|
|
self.parent_handle_response(ctx);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: tunnel_http_response
|
|
|
|
// TODO: send_message
|
|
|
|
|
|
|
|
fn handle_sdp(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
ctx: &crate::RTSPContext,
|
|
|
|
media: &crate::RTSPMedia,
|
2020-02-23 10:53:33 +00:00
|
|
|
sdp: &gst_sdp::SDPMessageRef,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
2022-10-08 18:50:06 +00:00
|
|
|
self.parent_handle_sdp(ctx, media, sdp)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn check_requirements(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
ctx: &crate::RTSPContext,
|
2020-02-23 10:53:33 +00:00
|
|
|
arr: &[String],
|
|
|
|
) -> Option<glib::GString> {
|
2022-10-08 18:50:06 +00:00
|
|
|
self.parent_check_requirements(ctx, arr)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_options_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_options_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_describe_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_describe_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_setup_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_setup_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_play_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_play_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_pause_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_pause_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_teardown_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_teardown_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_set_parameter_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_set_parameter_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_get_parameter_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_get_parameter_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_announce_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_announce_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn pre_record_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_pre_record_request(ctx)
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
2022-10-12 12:09:47 +00:00
|
|
|
|
2023-05-04 05:55:48 +00:00
|
|
|
#[cfg(feature = "v1_22")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
2022-10-12 12:09:47 +00:00
|
|
|
fn adjust_error_code(
|
|
|
|
&self,
|
|
|
|
ctx: &crate::RTSPContext,
|
|
|
|
status_code: gst_rtsp::RTSPStatusCode,
|
|
|
|
) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
self.parent_adjust_error_code(ctx, status_code)
|
|
|
|
}
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2024-10-19 19:18:53 +00:00
|
|
|
pub trait RTSPClientImplExt: RTSPClientImpl {
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_create_sdp(&self, media: &crate::RTSPMedia) -> Option<gst_sdp::SDPMessage> {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
let f = (*parent_class)
|
|
|
|
.create_sdp
|
|
|
|
.expect("No `create_rtpbin` virtual method implementation in parent class");
|
|
|
|
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib_full(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
media.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_configure_client_media(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
media: &crate::RTSPMedia,
|
|
|
|
stream: &crate::RTSPStream,
|
|
|
|
ctx: &crate::RTSPContext,
|
2020-02-23 10:53:33 +00:00
|
|
|
) -> Result<(), gst::LoggableError> {
|
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
let f = (*parent_class).configure_client_media.expect(
|
|
|
|
"No `configure_client_media` virtual method implementation in parent class",
|
|
|
|
);
|
|
|
|
|
2020-12-20 15:09:22 +00:00
|
|
|
gst::result_from_gboolean!(
|
2020-02-23 10:53:33 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-02-23 10:53:33 +00:00
|
|
|
media.to_glib_none().0,
|
|
|
|
stream.to_glib_none().0,
|
|
|
|
ctx.to_glib_none().0
|
|
|
|
),
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Parent function `configure_client_media` failed"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: configure_client_transport
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_params_set(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPResult {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
let f = (*parent_class)
|
|
|
|
.params_set
|
|
|
|
.expect("No `params_set` virtual method implementation in parent class");
|
|
|
|
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_params_get(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPResult {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
let f = (*parent_class)
|
|
|
|
.params_get
|
|
|
|
.expect("No `params_get` virtual method implementation in parent class");
|
|
|
|
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_make_path_from_uri(&self, url: &gst_rtsp::RTSPUrl) -> Option<glib::GString> {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
let f = (*parent_class)
|
|
|
|
.make_path_from_uri
|
|
|
|
.expect("No `make_path_from_uri` virtual method implementation in parent class");
|
|
|
|
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib_full(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
url.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_closed(&self) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).closed {
|
2022-10-23 19:59:23 +00:00
|
|
|
f(self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_new_session(&self, session: &crate::RTSPSession) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).new_session {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
session.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_options_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).options_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_describe_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).describe_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_setup_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).setup_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_play_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).play_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pause_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pause_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_teardown_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).teardown_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_set_parameter_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).set_parameter_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_parameter_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).get_parameter_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_announce_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).announce_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_record_request(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).record_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_handle_response(&self, ctx: &crate::RTSPContext) {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).handle_response {
|
2020-11-14 16:31:21 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
);
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: tunnel_http_response
|
|
|
|
// TODO: send_message
|
|
|
|
|
|
|
|
fn parent_handle_sdp(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
ctx: &crate::RTSPContext,
|
|
|
|
media: &crate::RTSPMedia,
|
2020-02-23 10:53:33 +00:00
|
|
|
sdp: &gst_sdp::SDPMessageRef,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
let f = (*parent_class)
|
|
|
|
.handle_sdp
|
|
|
|
.expect("No `handle_sdp` virtual method implementation in parent class");
|
|
|
|
|
2020-12-20 15:09:22 +00:00
|
|
|
gst::result_from_gboolean!(
|
2020-02-23 10:53:33 +00:00
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-02-23 10:53:33 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
media.to_glib_none().0,
|
|
|
|
sdp as *const _ as *mut _
|
|
|
|
),
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Parent function `handle_sdp` failed"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_check_requirements(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
ctx: &crate::RTSPContext,
|
2020-02-23 10:53:33 +00:00
|
|
|
arr: &[String],
|
|
|
|
) -> Option<glib::GString> {
|
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).check_requirements {
|
|
|
|
from_glib_full(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-02-23 10:53:33 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
arr.to_glib_none().0,
|
|
|
|
))
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_options_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_options_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_describe_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_describe_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_setup_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_setup_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_play_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_play_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_pause_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_pause_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_teardown_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_teardown_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_pre_set_parameter_request(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
ctx: &crate::RTSPContext,
|
2020-02-23 10:53:33 +00:00
|
|
|
) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_set_parameter_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_pre_get_parameter_request(
|
|
|
|
&self,
|
2020-11-22 10:45:51 +00:00
|
|
|
ctx: &crate::RTSPContext,
|
2020-02-23 10:53:33 +00:00
|
|
|
) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_get_parameter_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_announce_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_announce_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_pre_record_request(&self, ctx: &crate::RTSPContext) -> gst_rtsp::RTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
unsafe {
|
2021-04-29 20:06:41 +00:00
|
|
|
let data = Self::type_data();
|
2021-04-11 19:39:50 +00:00
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
2020-02-23 10:53:33 +00:00
|
|
|
if let Some(f) = (*parent_class).pre_record_request {
|
2020-11-14 16:31:21 +00:00
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2020-11-14 16:31:21 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
))
|
2020-02-23 10:53:33 +00:00
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-10-12 12:09:47 +00:00
|
|
|
|
2023-05-04 05:55:48 +00:00
|
|
|
#[cfg(feature = "v1_22")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
2022-10-12 12:09:47 +00:00
|
|
|
fn parent_adjust_error_code(
|
|
|
|
&self,
|
|
|
|
ctx: &crate::RTSPContext,
|
|
|
|
status_code: gst_rtsp::RTSPStatusCode,
|
|
|
|
) -> gst_rtsp::RTSPStatusCode {
|
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
|
|
|
|
if let Some(f) = (*parent_class).adjust_error_code {
|
|
|
|
from_glib(f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
|
2022-10-12 12:09:47 +00:00
|
|
|
ctx.to_glib_none().0,
|
|
|
|
status_code.into_glib(),
|
|
|
|
))
|
|
|
|
} else {
|
|
|
|
gst_rtsp::RTSPStatusCode::Ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
2023-07-05 20:21:43 +00:00
|
|
|
|
|
|
|
impl<T: RTSPClientImpl> RTSPClientImplExt for T {}
|
|
|
|
|
2020-11-05 13:18:19 +00:00
|
|
|
unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClient {
|
2021-03-08 10:06:56 +00:00
|
|
|
fn class_init(klass: &mut glib::Class<Self>) {
|
2021-08-24 05:55:37 +00:00
|
|
|
Self::parent_class_init::<T>(klass);
|
2020-11-05 17:07:31 +00:00
|
|
|
let klass = klass.as_mut();
|
2023-03-09 16:22:25 +00:00
|
|
|
|
|
|
|
// There was unintentional ABI breakage in 1.18 so let's work around that
|
|
|
|
// for now by casting to the old struct layout.
|
|
|
|
#[cfg(not(feature = "v1_18"))]
|
|
|
|
{
|
|
|
|
if gst::version() < (1, 18, 0, 0) {
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct CompatClass {
|
|
|
|
pub parent_class: glib::gobject_ffi::GObjectClass,
|
|
|
|
pub create_sdp: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPMedia,
|
|
|
|
)
|
|
|
|
-> *mut gst_sdp::ffi::GstSDPMessage,
|
|
|
|
>,
|
|
|
|
pub configure_client_media: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPMedia,
|
|
|
|
*mut ffi::GstRTSPStream,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
) -> glib::ffi::gboolean,
|
|
|
|
>,
|
|
|
|
pub configure_client_transport: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
*mut gst_rtsp::ffi::GstRTSPTransport,
|
|
|
|
) -> glib::ffi::gboolean,
|
|
|
|
>,
|
|
|
|
pub params_set: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPResult,
|
|
|
|
>,
|
|
|
|
pub params_get: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPResult,
|
|
|
|
>,
|
|
|
|
pub make_path_from_uri: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*const gst_rtsp::ffi::GstRTSPUrl,
|
|
|
|
) -> *mut libc::c_char,
|
|
|
|
>,
|
|
|
|
pub closed: Option<unsafe extern "C" fn(*mut ffi::GstRTSPClient)>,
|
|
|
|
pub new_session: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPSession),
|
|
|
|
>,
|
|
|
|
pub options_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub describe_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub setup_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub play_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub pause_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub teardown_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub set_parameter_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub get_parameter_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub handle_response: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub tunnel_http_response: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut gst_rtsp::ffi::GstRTSPMessage,
|
|
|
|
*mut gst_rtsp::ffi::GstRTSPMessage,
|
|
|
|
),
|
|
|
|
>,
|
|
|
|
pub send_message: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
*mut gst_rtsp::ffi::GstRTSPMessage,
|
|
|
|
),
|
|
|
|
>,
|
|
|
|
pub handle_sdp: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
*mut ffi::GstRTSPMedia,
|
|
|
|
*mut gst_sdp::ffi::GstSDPMessage,
|
|
|
|
) -> glib::ffi::gboolean,
|
|
|
|
>,
|
|
|
|
pub announce_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub record_request: Option<
|
|
|
|
unsafe extern "C" fn(*mut ffi::GstRTSPClient, *mut ffi::GstRTSPContext),
|
|
|
|
>,
|
|
|
|
pub check_requirements: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
*mut *mut libc::c_char,
|
|
|
|
) -> *mut libc::c_char,
|
|
|
|
>,
|
|
|
|
pub pre_options_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_describe_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_setup_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_play_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_pause_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_teardown_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_set_parameter_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_get_parameter_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_announce_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub pre_record_request: Option<
|
|
|
|
unsafe extern "C" fn(
|
|
|
|
*mut ffi::GstRTSPClient,
|
|
|
|
*mut ffi::GstRTSPContext,
|
|
|
|
)
|
|
|
|
-> gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
>,
|
|
|
|
pub _gst_reserved: [glib::ffi::gpointer; 4],
|
|
|
|
}
|
|
|
|
|
|
|
|
let klass = unsafe {
|
|
|
|
std::mem::transmute::<&mut ffi::GstRTSPClientClass, &mut CompatClass>(klass)
|
|
|
|
};
|
|
|
|
|
|
|
|
klass.create_sdp = Some(client_create_sdp::<T>);
|
|
|
|
klass.configure_client_media = Some(client_configure_client_media::<T>);
|
|
|
|
klass.params_set = Some(client_params_set::<T>);
|
|
|
|
klass.params_get = Some(client_params_get::<T>);
|
|
|
|
klass.make_path_from_uri = Some(client_make_path_from_uri::<T>);
|
|
|
|
klass.closed = Some(client_closed::<T>);
|
|
|
|
klass.new_session = Some(client_new_session::<T>);
|
|
|
|
klass.options_request = Some(client_options_request::<T>);
|
|
|
|
klass.describe_request = Some(client_describe_request::<T>);
|
|
|
|
klass.setup_request = Some(client_setup_request::<T>);
|
|
|
|
klass.play_request = Some(client_play_request::<T>);
|
|
|
|
klass.pause_request = Some(client_pause_request::<T>);
|
|
|
|
klass.teardown_request = Some(client_teardown_request::<T>);
|
|
|
|
klass.set_parameter_request = Some(client_set_parameter_request::<T>);
|
|
|
|
klass.get_parameter_request = Some(client_get_parameter_request::<T>);
|
|
|
|
klass.announce_request = Some(client_announce_request::<T>);
|
|
|
|
klass.record_request = Some(client_record_request::<T>);
|
|
|
|
klass.handle_response = Some(client_handle_response::<T>);
|
|
|
|
klass.handle_sdp = Some(client_handle_sdp::<T>);
|
|
|
|
klass.check_requirements = Some(client_check_requirements::<T>);
|
|
|
|
klass.pre_options_request = Some(client_pre_options_request::<T>);
|
|
|
|
klass.pre_describe_request = Some(client_pre_describe_request::<T>);
|
|
|
|
klass.pre_setup_request = Some(client_pre_setup_request::<T>);
|
|
|
|
klass.pre_play_request = Some(client_pre_play_request::<T>);
|
|
|
|
klass.pre_pause_request = Some(client_pre_pause_request::<T>);
|
|
|
|
klass.pre_teardown_request = Some(client_pre_teardown_request::<T>);
|
|
|
|
klass.pre_set_parameter_request = Some(client_pre_set_parameter_request::<T>);
|
|
|
|
klass.pre_get_parameter_request = Some(client_pre_get_parameter_request::<T>);
|
|
|
|
klass.pre_announce_request = Some(client_pre_announce_request::<T>);
|
|
|
|
klass.pre_record_request = Some(client_pre_record_request::<T>);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-05 17:07:31 +00:00
|
|
|
klass.create_sdp = Some(client_create_sdp::<T>);
|
|
|
|
klass.configure_client_media = Some(client_configure_client_media::<T>);
|
|
|
|
klass.params_set = Some(client_params_set::<T>);
|
|
|
|
klass.params_get = Some(client_params_get::<T>);
|
|
|
|
klass.make_path_from_uri = Some(client_make_path_from_uri::<T>);
|
|
|
|
klass.closed = Some(client_closed::<T>);
|
|
|
|
klass.new_session = Some(client_new_session::<T>);
|
|
|
|
klass.options_request = Some(client_options_request::<T>);
|
|
|
|
klass.describe_request = Some(client_describe_request::<T>);
|
|
|
|
klass.setup_request = Some(client_setup_request::<T>);
|
|
|
|
klass.play_request = Some(client_play_request::<T>);
|
|
|
|
klass.pause_request = Some(client_pause_request::<T>);
|
|
|
|
klass.teardown_request = Some(client_teardown_request::<T>);
|
|
|
|
klass.set_parameter_request = Some(client_set_parameter_request::<T>);
|
|
|
|
klass.get_parameter_request = Some(client_get_parameter_request::<T>);
|
|
|
|
klass.announce_request = Some(client_announce_request::<T>);
|
|
|
|
klass.record_request = Some(client_record_request::<T>);
|
|
|
|
klass.handle_response = Some(client_handle_response::<T>);
|
|
|
|
klass.handle_sdp = Some(client_handle_sdp::<T>);
|
|
|
|
klass.check_requirements = Some(client_check_requirements::<T>);
|
|
|
|
klass.pre_options_request = Some(client_pre_options_request::<T>);
|
|
|
|
klass.pre_describe_request = Some(client_pre_describe_request::<T>);
|
|
|
|
klass.pre_setup_request = Some(client_pre_setup_request::<T>);
|
|
|
|
klass.pre_play_request = Some(client_pre_play_request::<T>);
|
|
|
|
klass.pre_pause_request = Some(client_pre_pause_request::<T>);
|
|
|
|
klass.pre_teardown_request = Some(client_pre_teardown_request::<T>);
|
|
|
|
klass.pre_set_parameter_request = Some(client_pre_set_parameter_request::<T>);
|
|
|
|
klass.pre_get_parameter_request = Some(client_pre_get_parameter_request::<T>);
|
|
|
|
klass.pre_announce_request = Some(client_pre_announce_request::<T>);
|
|
|
|
klass.pre_record_request = Some(client_pre_record_request::<T>);
|
2023-05-04 05:55:48 +00:00
|
|
|
#[cfg(feature = "v1_22")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
2022-10-12 12:09:47 +00:00
|
|
|
{
|
|
|
|
klass.adjust_error_code = Some(client_adjust_error_code::<T>);
|
|
|
|
}
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_create_sdp<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
media: *mut ffi::GstRTSPMedia,
|
|
|
|
) -> *mut gst_sdp::ffi::GstSDPMessage {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2023-01-17 07:59:02 +00:00
|
|
|
imp.create_sdp(&from_glib_borrow(media)).into_glib_ptr()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_configure_client_media<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
media: *mut ffi::GstRTSPMedia,
|
|
|
|
stream: *mut ffi::GstRTSPStream,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> glib::ffi::gboolean {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
|
|
|
match imp.configure_client_media(
|
|
|
|
&from_glib_borrow(media),
|
|
|
|
&from_glib_borrow(stream),
|
|
|
|
&from_glib_borrow(ctx),
|
|
|
|
) {
|
2020-11-22 10:45:51 +00:00
|
|
|
Ok(()) => glib::ffi::GTRUE,
|
2020-02-23 10:53:33 +00:00
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2020-11-22 10:45:51 +00:00
|
|
|
glib::ffi::GFALSE
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_params_set<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPResult {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.params_set(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_params_get<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPResult {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.params_get(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_make_path_from_uri<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
url: *const gst_rtsp::ffi::GstRTSPUrl,
|
2020-07-25 08:02:04 +00:00
|
|
|
) -> *mut std::os::raw::c_char {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.make_path_from_uri(&from_glib_borrow(url))
|
2023-01-04 16:11:27 +00:00
|
|
|
.into_glib_ptr()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
unsafe extern "C" fn client_closed<T: RTSPClientImpl>(ptr: *mut ffi::GstRTSPClient) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.closed();
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_new_session<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
session: *mut ffi::GstRTSPSession,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.new_session(&from_glib_borrow(session));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_options_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.options_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_describe_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.describe_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_setup_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.setup_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_play_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.play_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pause_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pause_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_teardown_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.teardown_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_set_parameter_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.set_parameter_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_get_parameter_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.parameter_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_announce_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.announce_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_record_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.record_request(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_handle_response<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-07-25 08:02:04 +00:00
|
|
|
) {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.handle_response(&from_glib_borrow(ctx));
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_handle_sdp<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
media: *mut ffi::GstRTSPMedia,
|
|
|
|
sdp: *mut gst_sdp::ffi::GstSDPMessage,
|
|
|
|
) -> glib::ffi::gboolean {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
|
|
|
match imp.handle_sdp(
|
|
|
|
&from_glib_borrow(ctx),
|
|
|
|
&from_glib_borrow(media),
|
|
|
|
&*(sdp as *mut _),
|
|
|
|
) {
|
2020-11-22 10:45:51 +00:00
|
|
|
Ok(()) => glib::ffi::GTRUE,
|
2020-02-23 10:53:33 +00:00
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2020-11-22 10:45:51 +00:00
|
|
|
glib::ffi::GFALSE
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_check_requirements<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
2020-02-23 10:53:33 +00:00
|
|
|
arr: *mut *mut std::os::raw::c_char,
|
2020-07-25 08:02:04 +00:00
|
|
|
) -> *mut std::os::raw::c_char {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.check_requirements(&from_glib_borrow(ctx), Vec::from_glib_none(arr).as_slice())
|
2023-01-04 16:11:27 +00:00
|
|
|
.into_glib_ptr()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_options_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_options_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_describe_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_describe_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_setup_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_setup_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_play_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_play_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_pause_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_pause_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_teardown_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_teardown_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_set_parameter_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_set_parameter_request(&from_glib_borrow(ctx))
|
2021-04-27 15:15:46 +00:00
|
|
|
.into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_get_parameter_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_get_parameter_request(&from_glib_borrow(ctx))
|
2021-04-27 15:15:46 +00:00
|
|
|
.into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_announce_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_announce_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 08:02:04 +00:00
|
|
|
unsafe extern "C" fn client_pre_record_request<T: RTSPClientImpl>(
|
2020-11-22 10:45:51 +00:00
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
2020-02-23 10:53:33 +00:00
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
2021-12-28 15:50:06 +00:00
|
|
|
let imp = instance.imp();
|
2020-02-23 10:53:33 +00:00
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
imp.pre_record_request(&from_glib_borrow(ctx)).into_glib()
|
2020-02-23 10:53:33 +00:00
|
|
|
}
|
2022-10-12 12:09:47 +00:00
|
|
|
|
2023-05-04 05:55:48 +00:00
|
|
|
#[cfg(feature = "v1_22")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
2022-10-12 12:09:47 +00:00
|
|
|
unsafe extern "C" fn client_adjust_error_code<T: RTSPClientImpl>(
|
|
|
|
ptr: *mut ffi::GstRTSPClient,
|
|
|
|
ctx: *mut ffi::GstRTSPContext,
|
|
|
|
status_code: gst_rtsp::ffi::GstRTSPStatusCode,
|
|
|
|
) -> gst_rtsp::ffi::GstRTSPStatusCode {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
|
|
|
imp.adjust_error_code(&from_glib_borrow(ctx), from_glib(status_code))
|
|
|
|
.into_glib()
|
|
|
|
}
|