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