1#[cfg(feature = "v1_18")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
8use crate::RTSPStreamTransport;
9use crate::{
10 ffi, RTSPAuth, RTSPContext, RTSPFilterResult, RTSPMountPoints, RTSPSession, RTSPSessionPool,
11 RTSPThreadPool,
12};
13use glib::{
14 object::ObjectType as _,
15 prelude::*,
16 signal::{connect_raw, SignalHandlerId},
17 translate::*,
18};
19use std::boxed::Box as Box_;
20
21glib::wrapper! {
22 #[doc(alias = "GstRTSPClient")]
23 pub struct RTSPClient(Object<ffi::GstRTSPClient, ffi::GstRTSPClientClass>);
24
25 match fn {
26 type_ => || ffi::gst_rtsp_client_get_type(),
27 }
28}
29
30impl RTSPClient {
31 pub const NONE: Option<&'static RTSPClient> = None;
32
33 #[doc(alias = "gst_rtsp_client_new")]
34 pub fn new() -> RTSPClient {
35 assert_initialized_main_thread!();
36 unsafe { from_glib_full(ffi::gst_rtsp_client_new()) }
37 }
38}
39
40impl Default for RTSPClient {
41 fn default() -> Self {
42 Self::new()
43 }
44}
45
46unsafe impl Send for RTSPClient {}
47unsafe impl Sync for RTSPClient {}
48
49pub trait RTSPClientExt: IsA<RTSPClient> + 'static {
50 #[doc(alias = "gst_rtsp_client_close")]
51 fn close(&self) {
52 unsafe {
53 ffi::gst_rtsp_client_close(self.as_ref().to_glib_none().0);
54 }
55 }
56
57 #[doc(alias = "gst_rtsp_client_get_auth")]
58 #[doc(alias = "get_auth")]
59 fn auth(&self) -> Option<RTSPAuth> {
60 unsafe {
61 from_glib_full(ffi::gst_rtsp_client_get_auth(
62 self.as_ref().to_glib_none().0,
63 ))
64 }
65 }
66
67 #[cfg(feature = "v1_18")]
74 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
75 #[doc(alias = "gst_rtsp_client_get_content_length_limit")]
76 #[doc(alias = "get_content_length_limit")]
77 fn content_length_limit(&self) -> u32 {
78 unsafe { ffi::gst_rtsp_client_get_content_length_limit(self.as_ref().to_glib_none().0) }
79 }
80
81 #[doc(alias = "gst_rtsp_client_get_mount_points")]
82 #[doc(alias = "get_mount_points")]
83 #[doc(alias = "mount-points")]
84 fn mount_points(&self) -> Option<RTSPMountPoints> {
85 unsafe {
86 from_glib_full(ffi::gst_rtsp_client_get_mount_points(
87 self.as_ref().to_glib_none().0,
88 ))
89 }
90 }
91
92 #[doc(alias = "gst_rtsp_client_get_session_pool")]
93 #[doc(alias = "get_session_pool")]
94 #[doc(alias = "session-pool")]
95 fn session_pool(&self) -> Option<RTSPSessionPool> {
96 unsafe {
97 from_glib_full(ffi::gst_rtsp_client_get_session_pool(
98 self.as_ref().to_glib_none().0,
99 ))
100 }
101 }
102
103 #[cfg(feature = "v1_18")]
104 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
105 #[doc(alias = "gst_rtsp_client_get_stream_transport")]
106 #[doc(alias = "get_stream_transport")]
107 fn stream_transport(&self, channel: u8) -> Option<RTSPStreamTransport> {
108 unsafe {
109 from_glib_none(ffi::gst_rtsp_client_get_stream_transport(
110 self.as_ref().to_glib_none().0,
111 channel,
112 ))
113 }
114 }
115
116 #[doc(alias = "gst_rtsp_client_get_thread_pool")]
117 #[doc(alias = "get_thread_pool")]
118 fn thread_pool(&self) -> Option<RTSPThreadPool> {
119 unsafe {
120 from_glib_full(ffi::gst_rtsp_client_get_thread_pool(
121 self.as_ref().to_glib_none().0,
122 ))
123 }
124 }
125
126 #[doc(alias = "gst_rtsp_client_session_filter")]
137 fn session_filter(
138 &self,
139 func: Option<&mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult>,
140 ) -> Vec<RTSPSession> {
141 let mut func_data: Option<&mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult> =
142 func;
143 unsafe extern "C" fn func_func(
144 client: *mut ffi::GstRTSPClient,
145 sess: *mut ffi::GstRTSPSession,
146 user_data: glib::ffi::gpointer,
147 ) -> ffi::GstRTSPFilterResult {
148 let client = from_glib_borrow(client);
149 let sess = from_glib_borrow(sess);
150 let callback = user_data
151 as *mut Option<&mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult>;
152 if let Some(ref mut callback) = *callback {
153 callback(&client, &sess)
154 } else {
155 panic!("cannot get closure...")
156 }
157 .into_glib()
158 }
159 let func = if func_data.is_some() {
160 Some(func_func as _)
161 } else {
162 None
163 };
164 let super_callback0: &mut Option<
165 &mut dyn FnMut(&RTSPClient, &RTSPSession) -> RTSPFilterResult,
166 > = &mut func_data;
167 unsafe {
168 FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_client_session_filter(
169 self.as_ref().to_glib_none().0,
170 func,
171 super_callback0 as *mut _ as *mut _,
172 ))
173 }
174 }
175
176 #[doc(alias = "gst_rtsp_client_set_auth")]
177 fn set_auth(&self, auth: Option<&impl IsA<RTSPAuth>>) {
178 unsafe {
179 ffi::gst_rtsp_client_set_auth(
180 self.as_ref().to_glib_none().0,
181 auth.map(|p| p.as_ref()).to_glib_none().0,
182 );
183 }
184 }
185
186 #[cfg(feature = "v1_18")]
192 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
193 #[doc(alias = "gst_rtsp_client_set_content_length_limit")]
194 fn set_content_length_limit(&self, limit: u32) {
195 unsafe {
196 ffi::gst_rtsp_client_set_content_length_limit(self.as_ref().to_glib_none().0, limit);
197 }
198 }
199
200 #[doc(alias = "gst_rtsp_client_set_mount_points")]
201 #[doc(alias = "mount-points")]
202 fn set_mount_points(&self, mounts: Option<&impl IsA<RTSPMountPoints>>) {
203 unsafe {
204 ffi::gst_rtsp_client_set_mount_points(
205 self.as_ref().to_glib_none().0,
206 mounts.map(|p| p.as_ref()).to_glib_none().0,
207 );
208 }
209 }
210
211 #[doc(alias = "gst_rtsp_client_set_session_pool")]
219 #[doc(alias = "session-pool")]
220 fn set_session_pool(&self, pool: Option<&impl IsA<RTSPSessionPool>>) {
221 unsafe {
222 ffi::gst_rtsp_client_set_session_pool(
223 self.as_ref().to_glib_none().0,
224 pool.map(|p| p.as_ref()).to_glib_none().0,
225 );
226 }
227 }
228
229 #[doc(alias = "gst_rtsp_client_set_thread_pool")]
230 fn set_thread_pool(&self, pool: Option<&impl IsA<RTSPThreadPool>>) {
231 unsafe {
232 ffi::gst_rtsp_client_set_thread_pool(
233 self.as_ref().to_glib_none().0,
234 pool.map(|p| p.as_ref()).to_glib_none().0,
235 );
236 }
237 }
238
239 #[doc(alias = "drop-backlog")]
240 fn is_drop_backlog(&self) -> bool {
241 ObjectExt::property(self.as_ref(), "drop-backlog")
242 }
243
244 #[doc(alias = "drop-backlog")]
245 fn set_drop_backlog(&self, drop_backlog: bool) {
246 ObjectExt::set_property(self.as_ref(), "drop-backlog", drop_backlog)
247 }
248
249 #[doc(alias = "post-session-timeout")]
250 fn post_session_timeout(&self) -> i32 {
251 ObjectExt::property(self.as_ref(), "post-session-timeout")
252 }
253
254 #[doc(alias = "post-session-timeout")]
255 fn set_post_session_timeout(&self, post_session_timeout: i32) {
256 ObjectExt::set_property(self.as_ref(), "post-session-timeout", post_session_timeout)
257 }
258
259 #[doc(alias = "announce-request")]
260 fn connect_announce_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
261 &self,
262 f: F,
263 ) -> SignalHandlerId {
264 unsafe extern "C" fn announce_request_trampoline<
265 P: IsA<RTSPClient>,
266 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
267 >(
268 this: *mut ffi::GstRTSPClient,
269 ctx: *mut ffi::GstRTSPContext,
270 f: glib::ffi::gpointer,
271 ) {
272 let f: &F = &*(f as *const F);
273 f(
274 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
275 &from_glib_borrow(ctx),
276 )
277 }
278 unsafe {
279 let f: Box_<F> = Box_::new(f);
280 connect_raw(
281 self.as_ptr() as *mut _,
282 c"announce-request".as_ptr() as *const _,
283 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
284 announce_request_trampoline::<Self, F> as *const (),
285 )),
286 Box_::into_raw(f),
287 )
288 }
289 }
290
291 #[doc(alias = "closed")]
297 fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
298 unsafe extern "C" fn closed_trampoline<
299 P: IsA<RTSPClient>,
300 F: Fn(&P) + Send + Sync + 'static,
301 >(
302 this: *mut ffi::GstRTSPClient,
303 f: glib::ffi::gpointer,
304 ) {
305 let f: &F = &*(f as *const F);
306 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
307 }
308 unsafe {
309 let f: Box_<F> = Box_::new(f);
310 connect_raw(
311 self.as_ptr() as *mut _,
312 c"closed".as_ptr() as *const _,
313 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
314 closed_trampoline::<Self, F> as *const (),
315 )),
316 Box_::into_raw(f),
317 )
318 }
319 }
320
321 #[doc(alias = "describe-request")]
322 fn connect_describe_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
323 &self,
324 f: F,
325 ) -> SignalHandlerId {
326 unsafe extern "C" fn describe_request_trampoline<
327 P: IsA<RTSPClient>,
328 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
329 >(
330 this: *mut ffi::GstRTSPClient,
331 ctx: *mut ffi::GstRTSPContext,
332 f: glib::ffi::gpointer,
333 ) {
334 let f: &F = &*(f as *const F);
335 f(
336 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
337 &from_glib_borrow(ctx),
338 )
339 }
340 unsafe {
341 let f: Box_<F> = Box_::new(f);
342 connect_raw(
343 self.as_ptr() as *mut _,
344 c"describe-request".as_ptr() as *const _,
345 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
346 describe_request_trampoline::<Self, F> as *const (),
347 )),
348 Box_::into_raw(f),
349 )
350 }
351 }
352
353 #[doc(alias = "get-parameter-request")]
354 fn connect_get_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
355 &self,
356 f: F,
357 ) -> SignalHandlerId {
358 unsafe extern "C" fn get_parameter_request_trampoline<
359 P: IsA<RTSPClient>,
360 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
361 >(
362 this: *mut ffi::GstRTSPClient,
363 ctx: *mut ffi::GstRTSPContext,
364 f: glib::ffi::gpointer,
365 ) {
366 let f: &F = &*(f as *const F);
367 f(
368 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
369 &from_glib_borrow(ctx),
370 )
371 }
372 unsafe {
373 let f: Box_<F> = Box_::new(f);
374 connect_raw(
375 self.as_ptr() as *mut _,
376 c"get-parameter-request".as_ptr() as *const _,
377 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
378 get_parameter_request_trampoline::<Self, F> as *const (),
379 )),
380 Box_::into_raw(f),
381 )
382 }
383 }
384
385 #[doc(alias = "handle-response")]
386 fn connect_handle_response<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
387 &self,
388 f: F,
389 ) -> SignalHandlerId {
390 unsafe extern "C" fn handle_response_trampoline<
391 P: IsA<RTSPClient>,
392 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
393 >(
394 this: *mut ffi::GstRTSPClient,
395 ctx: *mut ffi::GstRTSPContext,
396 f: glib::ffi::gpointer,
397 ) {
398 let f: &F = &*(f as *const F);
399 f(
400 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
401 &from_glib_borrow(ctx),
402 )
403 }
404 unsafe {
405 let f: Box_<F> = Box_::new(f);
406 connect_raw(
407 self.as_ptr() as *mut _,
408 c"handle-response".as_ptr() as *const _,
409 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
410 handle_response_trampoline::<Self, F> as *const (),
411 )),
412 Box_::into_raw(f),
413 )
414 }
415 }
416
417 #[doc(alias = "new-session")]
418 fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
419 &self,
420 f: F,
421 ) -> SignalHandlerId {
422 unsafe extern "C" fn new_session_trampoline<
423 P: IsA<RTSPClient>,
424 F: Fn(&P, &RTSPSession) + Send + Sync + 'static,
425 >(
426 this: *mut ffi::GstRTSPClient,
427 object: *mut ffi::GstRTSPSession,
428 f: glib::ffi::gpointer,
429 ) {
430 let f: &F = &*(f as *const F);
431 f(
432 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
433 &from_glib_borrow(object),
434 )
435 }
436 unsafe {
437 let f: Box_<F> = Box_::new(f);
438 connect_raw(
439 self.as_ptr() as *mut _,
440 c"new-session".as_ptr() as *const _,
441 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
442 new_session_trampoline::<Self, F> as *const (),
443 )),
444 Box_::into_raw(f),
445 )
446 }
447 }
448
449 #[doc(alias = "options-request")]
450 fn connect_options_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
451 &self,
452 f: F,
453 ) -> SignalHandlerId {
454 unsafe extern "C" fn options_request_trampoline<
455 P: IsA<RTSPClient>,
456 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
457 >(
458 this: *mut ffi::GstRTSPClient,
459 ctx: *mut ffi::GstRTSPContext,
460 f: glib::ffi::gpointer,
461 ) {
462 let f: &F = &*(f as *const F);
463 f(
464 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
465 &from_glib_borrow(ctx),
466 )
467 }
468 unsafe {
469 let f: Box_<F> = Box_::new(f);
470 connect_raw(
471 self.as_ptr() as *mut _,
472 c"options-request".as_ptr() as *const _,
473 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
474 options_request_trampoline::<Self, F> as *const (),
475 )),
476 Box_::into_raw(f),
477 )
478 }
479 }
480
481 #[doc(alias = "pause-request")]
482 fn connect_pause_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
483 &self,
484 f: F,
485 ) -> SignalHandlerId {
486 unsafe extern "C" fn pause_request_trampoline<
487 P: IsA<RTSPClient>,
488 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
489 >(
490 this: *mut ffi::GstRTSPClient,
491 ctx: *mut ffi::GstRTSPContext,
492 f: glib::ffi::gpointer,
493 ) {
494 let f: &F = &*(f as *const F);
495 f(
496 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
497 &from_glib_borrow(ctx),
498 )
499 }
500 unsafe {
501 let f: Box_<F> = Box_::new(f);
502 connect_raw(
503 self.as_ptr() as *mut _,
504 c"pause-request".as_ptr() as *const _,
505 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
506 pause_request_trampoline::<Self, F> as *const (),
507 )),
508 Box_::into_raw(f),
509 )
510 }
511 }
512
513 #[doc(alias = "play-request")]
514 fn connect_play_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
515 &self,
516 f: F,
517 ) -> SignalHandlerId {
518 unsafe extern "C" fn play_request_trampoline<
519 P: IsA<RTSPClient>,
520 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
521 >(
522 this: *mut ffi::GstRTSPClient,
523 ctx: *mut ffi::GstRTSPContext,
524 f: glib::ffi::gpointer,
525 ) {
526 let f: &F = &*(f as *const F);
527 f(
528 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
529 &from_glib_borrow(ctx),
530 )
531 }
532 unsafe {
533 let f: Box_<F> = Box_::new(f);
534 connect_raw(
535 self.as_ptr() as *mut _,
536 c"play-request".as_ptr() as *const _,
537 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
538 play_request_trampoline::<Self, F> as *const (),
539 )),
540 Box_::into_raw(f),
541 )
542 }
543 }
544
545 #[doc(alias = "pre-announce-request")]
546 fn connect_pre_announce_request<
547 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
548 >(
549 &self,
550 f: F,
551 ) -> SignalHandlerId {
552 unsafe extern "C" fn pre_announce_request_trampoline<
553 P: IsA<RTSPClient>,
554 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
555 >(
556 this: *mut ffi::GstRTSPClient,
557 ctx: *mut ffi::GstRTSPContext,
558 f: glib::ffi::gpointer,
559 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
560 let f: &F = &*(f as *const F);
561 f(
562 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
563 &from_glib_borrow(ctx),
564 )
565 .into_glib()
566 }
567 unsafe {
568 let f: Box_<F> = Box_::new(f);
569 connect_raw(
570 self.as_ptr() as *mut _,
571 c"pre-announce-request".as_ptr() as *const _,
572 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
573 pre_announce_request_trampoline::<Self, F> as *const (),
574 )),
575 Box_::into_raw(f),
576 )
577 }
578 }
579
580 #[doc(alias = "pre-describe-request")]
581 fn connect_pre_describe_request<
582 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
583 >(
584 &self,
585 f: F,
586 ) -> SignalHandlerId {
587 unsafe extern "C" fn pre_describe_request_trampoline<
588 P: IsA<RTSPClient>,
589 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
590 >(
591 this: *mut ffi::GstRTSPClient,
592 ctx: *mut ffi::GstRTSPContext,
593 f: glib::ffi::gpointer,
594 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
595 let f: &F = &*(f as *const F);
596 f(
597 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
598 &from_glib_borrow(ctx),
599 )
600 .into_glib()
601 }
602 unsafe {
603 let f: Box_<F> = Box_::new(f);
604 connect_raw(
605 self.as_ptr() as *mut _,
606 c"pre-describe-request".as_ptr() as *const _,
607 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
608 pre_describe_request_trampoline::<Self, F> as *const (),
609 )),
610 Box_::into_raw(f),
611 )
612 }
613 }
614
615 #[doc(alias = "pre-get-parameter-request")]
616 fn connect_pre_get_parameter_request<
617 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
618 >(
619 &self,
620 f: F,
621 ) -> SignalHandlerId {
622 unsafe extern "C" fn pre_get_parameter_request_trampoline<
623 P: IsA<RTSPClient>,
624 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
625 >(
626 this: *mut ffi::GstRTSPClient,
627 ctx: *mut ffi::GstRTSPContext,
628 f: glib::ffi::gpointer,
629 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
630 let f: &F = &*(f as *const F);
631 f(
632 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
633 &from_glib_borrow(ctx),
634 )
635 .into_glib()
636 }
637 unsafe {
638 let f: Box_<F> = Box_::new(f);
639 connect_raw(
640 self.as_ptr() as *mut _,
641 c"pre-get-parameter-request".as_ptr() as *const _,
642 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
643 pre_get_parameter_request_trampoline::<Self, F> as *const (),
644 )),
645 Box_::into_raw(f),
646 )
647 }
648 }
649
650 #[doc(alias = "pre-options-request")]
651 fn connect_pre_options_request<
652 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
653 >(
654 &self,
655 f: F,
656 ) -> SignalHandlerId {
657 unsafe extern "C" fn pre_options_request_trampoline<
658 P: IsA<RTSPClient>,
659 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
660 >(
661 this: *mut ffi::GstRTSPClient,
662 ctx: *mut ffi::GstRTSPContext,
663 f: glib::ffi::gpointer,
664 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
665 let f: &F = &*(f as *const F);
666 f(
667 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
668 &from_glib_borrow(ctx),
669 )
670 .into_glib()
671 }
672 unsafe {
673 let f: Box_<F> = Box_::new(f);
674 connect_raw(
675 self.as_ptr() as *mut _,
676 c"pre-options-request".as_ptr() as *const _,
677 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
678 pre_options_request_trampoline::<Self, F> as *const (),
679 )),
680 Box_::into_raw(f),
681 )
682 }
683 }
684
685 #[doc(alias = "pre-pause-request")]
686 fn connect_pre_pause_request<
687 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
688 >(
689 &self,
690 f: F,
691 ) -> SignalHandlerId {
692 unsafe extern "C" fn pre_pause_request_trampoline<
693 P: IsA<RTSPClient>,
694 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
695 >(
696 this: *mut ffi::GstRTSPClient,
697 ctx: *mut ffi::GstRTSPContext,
698 f: glib::ffi::gpointer,
699 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
700 let f: &F = &*(f as *const F);
701 f(
702 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
703 &from_glib_borrow(ctx),
704 )
705 .into_glib()
706 }
707 unsafe {
708 let f: Box_<F> = Box_::new(f);
709 connect_raw(
710 self.as_ptr() as *mut _,
711 c"pre-pause-request".as_ptr() as *const _,
712 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
713 pre_pause_request_trampoline::<Self, F> as *const (),
714 )),
715 Box_::into_raw(f),
716 )
717 }
718 }
719
720 #[doc(alias = "pre-play-request")]
721 fn connect_pre_play_request<
722 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
723 >(
724 &self,
725 f: F,
726 ) -> SignalHandlerId {
727 unsafe extern "C" fn pre_play_request_trampoline<
728 P: IsA<RTSPClient>,
729 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
730 >(
731 this: *mut ffi::GstRTSPClient,
732 ctx: *mut ffi::GstRTSPContext,
733 f: glib::ffi::gpointer,
734 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
735 let f: &F = &*(f as *const F);
736 f(
737 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
738 &from_glib_borrow(ctx),
739 )
740 .into_glib()
741 }
742 unsafe {
743 let f: Box_<F> = Box_::new(f);
744 connect_raw(
745 self.as_ptr() as *mut _,
746 c"pre-play-request".as_ptr() as *const _,
747 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
748 pre_play_request_trampoline::<Self, F> as *const (),
749 )),
750 Box_::into_raw(f),
751 )
752 }
753 }
754
755 #[doc(alias = "pre-record-request")]
756 fn connect_pre_record_request<
757 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
758 >(
759 &self,
760 f: F,
761 ) -> SignalHandlerId {
762 unsafe extern "C" fn pre_record_request_trampoline<
763 P: IsA<RTSPClient>,
764 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
765 >(
766 this: *mut ffi::GstRTSPClient,
767 ctx: *mut ffi::GstRTSPContext,
768 f: glib::ffi::gpointer,
769 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
770 let f: &F = &*(f as *const F);
771 f(
772 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
773 &from_glib_borrow(ctx),
774 )
775 .into_glib()
776 }
777 unsafe {
778 let f: Box_<F> = Box_::new(f);
779 connect_raw(
780 self.as_ptr() as *mut _,
781 c"pre-record-request".as_ptr() as *const _,
782 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
783 pre_record_request_trampoline::<Self, F> as *const (),
784 )),
785 Box_::into_raw(f),
786 )
787 }
788 }
789
790 #[doc(alias = "pre-set-parameter-request")]
791 fn connect_pre_set_parameter_request<
792 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
793 >(
794 &self,
795 f: F,
796 ) -> SignalHandlerId {
797 unsafe extern "C" fn pre_set_parameter_request_trampoline<
798 P: IsA<RTSPClient>,
799 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
800 >(
801 this: *mut ffi::GstRTSPClient,
802 ctx: *mut ffi::GstRTSPContext,
803 f: glib::ffi::gpointer,
804 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
805 let f: &F = &*(f as *const F);
806 f(
807 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
808 &from_glib_borrow(ctx),
809 )
810 .into_glib()
811 }
812 unsafe {
813 let f: Box_<F> = Box_::new(f);
814 connect_raw(
815 self.as_ptr() as *mut _,
816 c"pre-set-parameter-request".as_ptr() as *const _,
817 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
818 pre_set_parameter_request_trampoline::<Self, F> as *const (),
819 )),
820 Box_::into_raw(f),
821 )
822 }
823 }
824
825 #[doc(alias = "pre-setup-request")]
826 fn connect_pre_setup_request<
827 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
828 >(
829 &self,
830 f: F,
831 ) -> SignalHandlerId {
832 unsafe extern "C" fn pre_setup_request_trampoline<
833 P: IsA<RTSPClient>,
834 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
835 >(
836 this: *mut ffi::GstRTSPClient,
837 ctx: *mut ffi::GstRTSPContext,
838 f: glib::ffi::gpointer,
839 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
840 let f: &F = &*(f as *const F);
841 f(
842 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
843 &from_glib_borrow(ctx),
844 )
845 .into_glib()
846 }
847 unsafe {
848 let f: Box_<F> = Box_::new(f);
849 connect_raw(
850 self.as_ptr() as *mut _,
851 c"pre-setup-request".as_ptr() as *const _,
852 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
853 pre_setup_request_trampoline::<Self, F> as *const (),
854 )),
855 Box_::into_raw(f),
856 )
857 }
858 }
859
860 #[doc(alias = "pre-teardown-request")]
861 fn connect_pre_teardown_request<
862 F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
863 >(
864 &self,
865 f: F,
866 ) -> SignalHandlerId {
867 unsafe extern "C" fn pre_teardown_request_trampoline<
868 P: IsA<RTSPClient>,
869 F: Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static,
870 >(
871 this: *mut ffi::GstRTSPClient,
872 ctx: *mut ffi::GstRTSPContext,
873 f: glib::ffi::gpointer,
874 ) -> gst_rtsp::ffi::GstRTSPStatusCode {
875 let f: &F = &*(f as *const F);
876 f(
877 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
878 &from_glib_borrow(ctx),
879 )
880 .into_glib()
881 }
882 unsafe {
883 let f: Box_<F> = Box_::new(f);
884 connect_raw(
885 self.as_ptr() as *mut _,
886 c"pre-teardown-request".as_ptr() as *const _,
887 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
888 pre_teardown_request_trampoline::<Self, F> as *const (),
889 )),
890 Box_::into_raw(f),
891 )
892 }
893 }
894
895 #[doc(alias = "record-request")]
896 fn connect_record_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
897 &self,
898 f: F,
899 ) -> SignalHandlerId {
900 unsafe extern "C" fn record_request_trampoline<
901 P: IsA<RTSPClient>,
902 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
903 >(
904 this: *mut ffi::GstRTSPClient,
905 ctx: *mut ffi::GstRTSPContext,
906 f: glib::ffi::gpointer,
907 ) {
908 let f: &F = &*(f as *const F);
909 f(
910 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
911 &from_glib_borrow(ctx),
912 )
913 }
914 unsafe {
915 let f: Box_<F> = Box_::new(f);
916 connect_raw(
917 self.as_ptr() as *mut _,
918 c"record-request".as_ptr() as *const _,
919 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
920 record_request_trampoline::<Self, F> as *const (),
921 )),
922 Box_::into_raw(f),
923 )
924 }
925 }
926
927 #[doc(alias = "set-parameter-request")]
933 fn connect_set_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
934 &self,
935 f: F,
936 ) -> SignalHandlerId {
937 unsafe extern "C" fn set_parameter_request_trampoline<
938 P: IsA<RTSPClient>,
939 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
940 >(
941 this: *mut ffi::GstRTSPClient,
942 ctx: *mut ffi::GstRTSPContext,
943 f: glib::ffi::gpointer,
944 ) {
945 let f: &F = &*(f as *const F);
946 f(
947 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
948 &from_glib_borrow(ctx),
949 )
950 }
951 unsafe {
952 let f: Box_<F> = Box_::new(f);
953 connect_raw(
954 self.as_ptr() as *mut _,
955 c"set-parameter-request".as_ptr() as *const _,
956 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
957 set_parameter_request_trampoline::<Self, F> as *const (),
958 )),
959 Box_::into_raw(f),
960 )
961 }
962 }
963
964 #[doc(alias = "setup-request")]
965 fn connect_setup_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
966 &self,
967 f: F,
968 ) -> SignalHandlerId {
969 unsafe extern "C" fn setup_request_trampoline<
970 P: IsA<RTSPClient>,
971 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
972 >(
973 this: *mut ffi::GstRTSPClient,
974 ctx: *mut ffi::GstRTSPContext,
975 f: glib::ffi::gpointer,
976 ) {
977 let f: &F = &*(f as *const F);
978 f(
979 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
980 &from_glib_borrow(ctx),
981 )
982 }
983 unsafe {
984 let f: Box_<F> = Box_::new(f);
985 connect_raw(
986 self.as_ptr() as *mut _,
987 c"setup-request".as_ptr() as *const _,
988 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
989 setup_request_trampoline::<Self, F> as *const (),
990 )),
991 Box_::into_raw(f),
992 )
993 }
994 }
995
996 #[doc(alias = "teardown-request")]
997 fn connect_teardown_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(
998 &self,
999 f: F,
1000 ) -> SignalHandlerId {
1001 unsafe extern "C" fn teardown_request_trampoline<
1002 P: IsA<RTSPClient>,
1003 F: Fn(&P, &RTSPContext) + Send + Sync + 'static,
1004 >(
1005 this: *mut ffi::GstRTSPClient,
1006 ctx: *mut ffi::GstRTSPContext,
1007 f: glib::ffi::gpointer,
1008 ) {
1009 let f: &F = &*(f as *const F);
1010 f(
1011 RTSPClient::from_glib_borrow(this).unsafe_cast_ref(),
1012 &from_glib_borrow(ctx),
1013 )
1014 }
1015 unsafe {
1016 let f: Box_<F> = Box_::new(f);
1017 connect_raw(
1018 self.as_ptr() as *mut _,
1019 c"teardown-request".as_ptr() as *const _,
1020 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1021 teardown_request_trampoline::<Self, F> as *const (),
1022 )),
1023 Box_::into_raw(f),
1024 )
1025 }
1026 }
1027
1028 #[doc(alias = "drop-backlog")]
1029 fn connect_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(
1030 &self,
1031 f: F,
1032 ) -> SignalHandlerId {
1033 unsafe extern "C" fn notify_drop_backlog_trampoline<
1034 P: IsA<RTSPClient>,
1035 F: Fn(&P) + Send + Sync + 'static,
1036 >(
1037 this: *mut ffi::GstRTSPClient,
1038 _param_spec: glib::ffi::gpointer,
1039 f: glib::ffi::gpointer,
1040 ) {
1041 let f: &F = &*(f as *const F);
1042 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1043 }
1044 unsafe {
1045 let f: Box_<F> = Box_::new(f);
1046 connect_raw(
1047 self.as_ptr() as *mut _,
1048 c"notify::drop-backlog".as_ptr() as *const _,
1049 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1050 notify_drop_backlog_trampoline::<Self, F> as *const (),
1051 )),
1052 Box_::into_raw(f),
1053 )
1054 }
1055 }
1056
1057 #[doc(alias = "mount-points")]
1058 fn connect_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(
1059 &self,
1060 f: F,
1061 ) -> SignalHandlerId {
1062 unsafe extern "C" fn notify_mount_points_trampoline<
1063 P: IsA<RTSPClient>,
1064 F: Fn(&P) + Send + Sync + 'static,
1065 >(
1066 this: *mut ffi::GstRTSPClient,
1067 _param_spec: glib::ffi::gpointer,
1068 f: glib::ffi::gpointer,
1069 ) {
1070 let f: &F = &*(f as *const F);
1071 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1072 }
1073 unsafe {
1074 let f: Box_<F> = Box_::new(f);
1075 connect_raw(
1076 self.as_ptr() as *mut _,
1077 c"notify::mount-points".as_ptr() as *const _,
1078 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1079 notify_mount_points_trampoline::<Self, F> as *const (),
1080 )),
1081 Box_::into_raw(f),
1082 )
1083 }
1084 }
1085
1086 #[doc(alias = "post-session-timeout")]
1087 fn connect_post_session_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1088 &self,
1089 f: F,
1090 ) -> SignalHandlerId {
1091 unsafe extern "C" fn notify_post_session_timeout_trampoline<
1092 P: IsA<RTSPClient>,
1093 F: Fn(&P) + Send + Sync + 'static,
1094 >(
1095 this: *mut ffi::GstRTSPClient,
1096 _param_spec: glib::ffi::gpointer,
1097 f: glib::ffi::gpointer,
1098 ) {
1099 let f: &F = &*(f as *const F);
1100 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1101 }
1102 unsafe {
1103 let f: Box_<F> = Box_::new(f);
1104 connect_raw(
1105 self.as_ptr() as *mut _,
1106 c"notify::post-session-timeout".as_ptr() as *const _,
1107 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1108 notify_post_session_timeout_trampoline::<Self, F> as *const (),
1109 )),
1110 Box_::into_raw(f),
1111 )
1112 }
1113 }
1114
1115 #[doc(alias = "session-pool")]
1116 fn connect_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(
1117 &self,
1118 f: F,
1119 ) -> SignalHandlerId {
1120 unsafe extern "C" fn notify_session_pool_trampoline<
1121 P: IsA<RTSPClient>,
1122 F: Fn(&P) + Send + Sync + 'static,
1123 >(
1124 this: *mut ffi::GstRTSPClient,
1125 _param_spec: glib::ffi::gpointer,
1126 f: glib::ffi::gpointer,
1127 ) {
1128 let f: &F = &*(f as *const F);
1129 f(RTSPClient::from_glib_borrow(this).unsafe_cast_ref())
1130 }
1131 unsafe {
1132 let f: Box_<F> = Box_::new(f);
1133 connect_raw(
1134 self.as_ptr() as *mut _,
1135 c"notify::session-pool".as_ptr() as *const _,
1136 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1137 notify_session_pool_trampoline::<Self, F> as *const (),
1138 )),
1139 Box_::into_raw(f),
1140 )
1141 }
1142 }
1143}
1144
1145impl<O: IsA<RTSPClient>> RTSPClientExt for O {}