1use crate::{
7 ffi, RTSPAddressPool, RTSPMediaStatus, RTSPPublishClockMode, RTSPStream, RTSPStreamTransport,
8 RTSPSuspendMode, RTSPThread, RTSPTransportMode,
9};
10use glib::{
11 object::ObjectType as _,
12 prelude::*,
13 signal::{connect_raw, SignalHandlerId},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 #[doc(alias = "GstRTSPMedia")]
20 pub struct RTSPMedia(Object<ffi::GstRTSPMedia, ffi::GstRTSPMediaClass>);
21
22 match fn {
23 type_ => || ffi::gst_rtsp_media_get_type(),
24 }
25}
26
27impl RTSPMedia {
28 pub const NONE: Option<&'static RTSPMedia> = None;
29
30 #[doc(alias = "gst_rtsp_media_new")]
31 pub fn new(element: impl IsA<gst::Element>) -> RTSPMedia {
32 assert_initialized_main_thread!();
33 unsafe { from_glib_full(ffi::gst_rtsp_media_new(element.upcast().into_glib_ptr())) }
34 }
35}
36
37unsafe impl Send for RTSPMedia {}
38unsafe impl Sync for RTSPMedia {}
39
40pub trait RTSPMediaExt: IsA<RTSPMedia> + 'static {
41 #[cfg(feature = "v1_24")]
42 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
43 #[doc(alias = "gst_rtsp_media_can_be_shared")]
44 fn can_be_shared(&self) -> bool {
45 unsafe {
46 from_glib(ffi::gst_rtsp_media_can_be_shared(
47 self.as_ref().to_glib_none().0,
48 ))
49 }
50 }
51
52 #[doc(alias = "gst_rtsp_media_collect_streams")]
53 fn collect_streams(&self) {
54 unsafe {
55 ffi::gst_rtsp_media_collect_streams(self.as_ref().to_glib_none().0);
56 }
57 }
58
59 #[doc(alias = "gst_rtsp_media_create_stream")]
65 fn create_stream(
66 &self,
67 payloader: &impl IsA<gst::Element>,
68 pad: &impl IsA<gst::Pad>,
69 ) -> RTSPStream {
70 unsafe {
71 from_glib_none(ffi::gst_rtsp_media_create_stream(
72 self.as_ref().to_glib_none().0,
73 payloader.as_ref().to_glib_none().0,
74 pad.as_ref().to_glib_none().0,
75 ))
76 }
77 }
78
79 #[doc(alias = "gst_rtsp_media_find_stream")]
80 fn find_stream(&self, control: &str) -> Option<RTSPStream> {
81 unsafe {
82 from_glib_none(ffi::gst_rtsp_media_find_stream(
83 self.as_ref().to_glib_none().0,
84 control.to_glib_none().0,
85 ))
86 }
87 }
88
89 #[doc(alias = "gst_rtsp_media_get_address_pool")]
90 #[doc(alias = "get_address_pool")]
91 fn address_pool(&self) -> Option<RTSPAddressPool> {
92 unsafe {
93 from_glib_full(ffi::gst_rtsp_media_get_address_pool(
94 self.as_ref().to_glib_none().0,
95 ))
96 }
97 }
98
99 #[doc(alias = "gst_rtsp_media_get_base_time")]
100 #[doc(alias = "get_base_time")]
101 fn base_time(&self) -> Option<gst::ClockTime> {
102 unsafe {
103 from_glib(ffi::gst_rtsp_media_get_base_time(
104 self.as_ref().to_glib_none().0,
105 ))
106 }
107 }
108
109 #[doc(alias = "gst_rtsp_media_get_buffer_size")]
110 #[doc(alias = "get_buffer_size")]
111 #[doc(alias = "buffer-size")]
112 fn buffer_size(&self) -> u32 {
113 unsafe { ffi::gst_rtsp_media_get_buffer_size(self.as_ref().to_glib_none().0) }
114 }
115
116 #[doc(alias = "gst_rtsp_media_get_clock")]
117 #[doc(alias = "get_clock")]
118 fn clock(&self) -> Option<gst::Clock> {
119 unsafe {
120 from_glib_full(ffi::gst_rtsp_media_get_clock(
121 self.as_ref().to_glib_none().0,
122 ))
123 }
124 }
125
126 #[cfg(feature = "v1_16")]
127 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
128 #[doc(alias = "gst_rtsp_media_get_do_retransmission")]
129 #[doc(alias = "get_do_retransmission")]
130 fn does_retransmission(&self) -> bool {
131 unsafe {
132 from_glib(ffi::gst_rtsp_media_get_do_retransmission(
133 self.as_ref().to_glib_none().0,
134 ))
135 }
136 }
137
138 #[cfg(feature = "v1_18")]
139 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
140 #[doc(alias = "gst_rtsp_media_get_dscp_qos")]
141 #[doc(alias = "get_dscp_qos")]
142 #[doc(alias = "dscp-qos")]
143 fn dscp_qos(&self) -> i32 {
144 unsafe { ffi::gst_rtsp_media_get_dscp_qos(self.as_ref().to_glib_none().0) }
145 }
146
147 #[doc(alias = "gst_rtsp_media_get_element")]
148 #[doc(alias = "get_element")]
149 fn element(&self) -> gst::Element {
150 unsafe {
151 from_glib_full(ffi::gst_rtsp_media_get_element(
152 self.as_ref().to_glib_none().0,
153 ))
154 }
155 }
156
157 #[cfg(feature = "v1_24")]
158 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
159 #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start")]
160 #[doc(alias = "get_ensure_keyunit_on_start")]
161 #[doc(alias = "ensure-keyunit-on-start")]
162 fn is_ensure_keyunit_on_start(&self) -> bool {
163 unsafe {
164 from_glib(ffi::gst_rtsp_media_get_ensure_keyunit_on_start(
165 self.as_ref().to_glib_none().0,
166 ))
167 }
168 }
169
170 #[cfg(feature = "v1_24")]
171 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
172 #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start_timeout")]
173 #[doc(alias = "get_ensure_keyunit_on_start_timeout")]
174 #[doc(alias = "ensure-keyunit-on-start-timeout")]
175 fn ensure_keyunit_on_start_timeout(&self) -> u32 {
176 unsafe {
177 ffi::gst_rtsp_media_get_ensure_keyunit_on_start_timeout(self.as_ref().to_glib_none().0)
178 }
179 }
180
181 #[doc(alias = "gst_rtsp_media_get_latency")]
182 #[doc(alias = "get_latency")]
183 fn latency(&self) -> u32 {
184 unsafe { ffi::gst_rtsp_media_get_latency(self.as_ref().to_glib_none().0) }
185 }
186
187 #[cfg(feature = "v1_16")]
188 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
189 #[doc(alias = "gst_rtsp_media_get_max_mcast_ttl")]
190 #[doc(alias = "get_max_mcast_ttl")]
191 #[doc(alias = "max-mcast-ttl")]
192 fn max_mcast_ttl(&self) -> u32 {
193 unsafe { ffi::gst_rtsp_media_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
194 }
195
196 #[doc(alias = "gst_rtsp_media_get_multicast_iface")]
197 #[doc(alias = "get_multicast_iface")]
198 fn multicast_iface(&self) -> Option<glib::GString> {
199 unsafe {
200 from_glib_full(ffi::gst_rtsp_media_get_multicast_iface(
201 self.as_ref().to_glib_none().0,
202 ))
203 }
204 }
205
206 #[doc(alias = "gst_rtsp_media_get_profiles")]
213 #[doc(alias = "get_profiles")]
214 fn profiles(&self) -> gst_rtsp::RTSPProfile {
215 unsafe {
216 from_glib(ffi::gst_rtsp_media_get_profiles(
217 self.as_ref().to_glib_none().0,
218 ))
219 }
220 }
221
222 #[doc(alias = "gst_rtsp_media_get_protocols")]
223 #[doc(alias = "get_protocols")]
224 fn protocols(&self) -> gst_rtsp::RTSPLowerTrans {
225 unsafe {
226 from_glib(ffi::gst_rtsp_media_get_protocols(
227 self.as_ref().to_glib_none().0,
228 ))
229 }
230 }
231
232 #[doc(alias = "gst_rtsp_media_get_publish_clock_mode")]
233 #[doc(alias = "get_publish_clock_mode")]
234 fn publish_clock_mode(&self) -> RTSPPublishClockMode {
235 unsafe {
236 from_glib(ffi::gst_rtsp_media_get_publish_clock_mode(
237 self.as_ref().to_glib_none().0,
238 ))
239 }
240 }
241
242 #[doc(alias = "gst_rtsp_media_get_range_string")]
243 #[doc(alias = "get_range_string")]
244 fn range_string(&self, play: bool, unit: gst_rtsp::RTSPRangeUnit) -> Option<glib::GString> {
245 unsafe {
246 from_glib_full(ffi::gst_rtsp_media_get_range_string(
247 self.as_ref().to_glib_none().0,
248 play.into_glib(),
249 unit.into_glib(),
250 ))
251 }
252 }
253
254 #[cfg(feature = "v1_18")]
255 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
256 #[doc(alias = "gst_rtsp_media_get_rate_control")]
257 #[doc(alias = "get_rate_control")]
258 fn is_rate_control(&self) -> bool {
259 unsafe {
260 from_glib(ffi::gst_rtsp_media_get_rate_control(
261 self.as_ref().to_glib_none().0,
262 ))
263 }
264 }
265
266 #[cfg(feature = "v1_18")]
267 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
268 #[doc(alias = "gst_rtsp_media_get_rates")]
269 #[doc(alias = "get_rates")]
270 fn rates(&self) -> Option<(f64, f64)> {
271 unsafe {
272 let mut rate = std::mem::MaybeUninit::uninit();
273 let mut applied_rate = std::mem::MaybeUninit::uninit();
274 let ret = from_glib(ffi::gst_rtsp_media_get_rates(
275 self.as_ref().to_glib_none().0,
276 rate.as_mut_ptr(),
277 applied_rate.as_mut_ptr(),
278 ));
279 if ret {
280 Some((rate.assume_init(), applied_rate.assume_init()))
281 } else {
282 None
283 }
284 }
285 }
286
287 #[doc(alias = "gst_rtsp_media_get_retransmission_time")]
288 #[doc(alias = "get_retransmission_time")]
289 fn retransmission_time(&self) -> Option<gst::ClockTime> {
290 unsafe {
291 from_glib(ffi::gst_rtsp_media_get_retransmission_time(
292 self.as_ref().to_glib_none().0,
293 ))
294 }
295 }
296
297 #[doc(alias = "gst_rtsp_media_get_status")]
298 #[doc(alias = "get_status")]
299 fn status(&self) -> RTSPMediaStatus {
300 unsafe {
301 from_glib(ffi::gst_rtsp_media_get_status(
302 self.as_ref().to_glib_none().0,
303 ))
304 }
305 }
306
307 #[doc(alias = "gst_rtsp_media_get_stream")]
308 #[doc(alias = "get_stream")]
309 fn stream(&self, idx: u32) -> Option<RTSPStream> {
310 unsafe {
311 from_glib_none(ffi::gst_rtsp_media_get_stream(
312 self.as_ref().to_glib_none().0,
313 idx,
314 ))
315 }
316 }
317
318 #[doc(alias = "gst_rtsp_media_get_suspend_mode")]
319 #[doc(alias = "get_suspend_mode")]
320 #[doc(alias = "suspend-mode")]
321 fn suspend_mode(&self) -> RTSPSuspendMode {
322 unsafe {
323 from_glib(ffi::gst_rtsp_media_get_suspend_mode(
324 self.as_ref().to_glib_none().0,
325 ))
326 }
327 }
328
329 #[doc(alias = "gst_rtsp_media_get_time_provider")]
330 #[doc(alias = "get_time_provider")]
331 #[doc(alias = "time-provider")]
332 fn time_provider(&self, address: Option<&str>, port: u16) -> Option<gst_net::NetTimeProvider> {
333 unsafe {
334 from_glib_full(ffi::gst_rtsp_media_get_time_provider(
335 self.as_ref().to_glib_none().0,
336 address.to_glib_none().0,
337 port,
338 ))
339 }
340 }
341
342 #[doc(alias = "gst_rtsp_media_get_transport_mode")]
343 #[doc(alias = "get_transport_mode")]
344 #[doc(alias = "transport-mode")]
345 fn transport_mode(&self) -> RTSPTransportMode {
346 unsafe {
347 from_glib(ffi::gst_rtsp_media_get_transport_mode(
348 self.as_ref().to_glib_none().0,
349 ))
350 }
351 }
352
353 #[cfg(feature = "v1_18")]
359 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
360 #[doc(alias = "gst_rtsp_media_has_completed_sender")]
361 fn has_completed_sender(&self) -> bool {
362 unsafe {
363 from_glib(ffi::gst_rtsp_media_has_completed_sender(
364 self.as_ref().to_glib_none().0,
365 ))
366 }
367 }
368
369 #[cfg(feature = "v1_16")]
370 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
371 #[doc(alias = "gst_rtsp_media_is_bind_mcast_address")]
372 #[doc(alias = "bind-mcast-address")]
373 fn is_bind_mcast_address(&self) -> bool {
374 unsafe {
375 from_glib(ffi::gst_rtsp_media_is_bind_mcast_address(
376 self.as_ref().to_glib_none().0,
377 ))
378 }
379 }
380
381 #[doc(alias = "gst_rtsp_media_is_eos_shutdown")]
382 #[doc(alias = "eos-shutdown")]
383 fn is_eos_shutdown(&self) -> bool {
384 unsafe {
385 from_glib(ffi::gst_rtsp_media_is_eos_shutdown(
386 self.as_ref().to_glib_none().0,
387 ))
388 }
389 }
390
391 #[cfg(feature = "v1_18")]
392 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
393 #[doc(alias = "gst_rtsp_media_is_receive_only")]
394 fn is_receive_only(&self) -> bool {
395 unsafe {
396 from_glib(ffi::gst_rtsp_media_is_receive_only(
397 self.as_ref().to_glib_none().0,
398 ))
399 }
400 }
401
402 #[doc(alias = "gst_rtsp_media_is_reusable")]
403 #[doc(alias = "reusable")]
404 fn is_reusable(&self) -> bool {
405 unsafe {
406 from_glib(ffi::gst_rtsp_media_is_reusable(
407 self.as_ref().to_glib_none().0,
408 ))
409 }
410 }
411
412 #[doc(alias = "gst_rtsp_media_is_shared")]
413 #[doc(alias = "shared")]
414 fn is_shared(&self) -> bool {
415 unsafe {
416 from_glib(ffi::gst_rtsp_media_is_shared(
417 self.as_ref().to_glib_none().0,
418 ))
419 }
420 }
421
422 #[doc(alias = "gst_rtsp_media_is_stop_on_disconnect")]
423 #[doc(alias = "stop-on-disconnect")]
424 fn is_stop_on_disconnect(&self) -> bool {
425 unsafe {
426 from_glib(ffi::gst_rtsp_media_is_stop_on_disconnect(
427 self.as_ref().to_glib_none().0,
428 ))
429 }
430 }
431
432 #[doc(alias = "gst_rtsp_media_is_time_provider")]
433 #[doc(alias = "time-provider")]
434 fn is_time_provider(&self) -> bool {
435 unsafe {
436 from_glib(ffi::gst_rtsp_media_is_time_provider(
437 self.as_ref().to_glib_none().0,
438 ))
439 }
440 }
441
442 #[cfg(feature = "v1_18")]
443 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
444 #[doc(alias = "gst_rtsp_media_lock")]
445 fn lock(&self) {
446 unsafe {
447 ffi::gst_rtsp_media_lock(self.as_ref().to_glib_none().0);
448 }
449 }
450
451 #[doc(alias = "gst_rtsp_media_n_streams")]
452 fn n_streams(&self) -> u32 {
453 unsafe { ffi::gst_rtsp_media_n_streams(self.as_ref().to_glib_none().0) }
454 }
455
456 #[doc(alias = "gst_rtsp_media_prepare")]
457 fn prepare(&self, thread: Option<RTSPThread>) -> Result<(), glib::error::BoolError> {
458 unsafe {
459 glib::result_from_gboolean!(
460 ffi::gst_rtsp_media_prepare(self.as_ref().to_glib_none().0, thread.into_glib_ptr()),
461 "Failed to prepare media"
462 )
463 }
464 }
465
466 #[doc(alias = "gst_rtsp_media_set_address_pool")]
491 fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) {
492 unsafe {
493 ffi::gst_rtsp_media_set_address_pool(
494 self.as_ref().to_glib_none().0,
495 pool.map(|p| p.as_ref()).to_glib_none().0,
496 );
497 }
498 }
499
500 #[cfg(feature = "v1_16")]
501 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
502 #[doc(alias = "gst_rtsp_media_set_bind_mcast_address")]
503 #[doc(alias = "bind-mcast-address")]
504 fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
505 unsafe {
506 ffi::gst_rtsp_media_set_bind_mcast_address(
507 self.as_ref().to_glib_none().0,
508 bind_mcast_addr.into_glib(),
509 );
510 }
511 }
512
513 #[doc(alias = "gst_rtsp_media_set_buffer_size")]
514 #[doc(alias = "buffer-size")]
515 fn set_buffer_size(&self, size: u32) {
516 unsafe {
517 ffi::gst_rtsp_media_set_buffer_size(self.as_ref().to_glib_none().0, size);
518 }
519 }
520
521 #[doc(alias = "gst_rtsp_media_set_clock")]
522 #[doc(alias = "clock")]
523 fn set_clock(&self, clock: Option<&impl IsA<gst::Clock>>) {
524 unsafe {
525 ffi::gst_rtsp_media_set_clock(
526 self.as_ref().to_glib_none().0,
527 clock.map(|p| p.as_ref()).to_glib_none().0,
528 );
529 }
530 }
531
532 #[cfg(feature = "v1_16")]
533 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
534 #[doc(alias = "gst_rtsp_media_set_do_retransmission")]
535 fn set_do_retransmission(&self, do_retransmission: bool) {
536 unsafe {
537 ffi::gst_rtsp_media_set_do_retransmission(
538 self.as_ref().to_glib_none().0,
539 do_retransmission.into_glib(),
540 );
541 }
542 }
543
544 #[cfg(feature = "v1_18")]
545 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
546 #[doc(alias = "gst_rtsp_media_set_dscp_qos")]
547 #[doc(alias = "dscp-qos")]
548 fn set_dscp_qos(&self, dscp_qos: i32) {
549 unsafe {
550 ffi::gst_rtsp_media_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
551 }
552 }
553
554 #[cfg(feature = "v1_24")]
555 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
556 #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start")]
557 #[doc(alias = "ensure-keyunit-on-start")]
558 fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) {
559 unsafe {
560 ffi::gst_rtsp_media_set_ensure_keyunit_on_start(
561 self.as_ref().to_glib_none().0,
562 ensure_keyunit_on_start.into_glib(),
563 );
564 }
565 }
566
567 #[cfg(feature = "v1_24")]
568 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
569 #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start_timeout")]
570 #[doc(alias = "ensure-keyunit-on-start-timeout")]
571 fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) {
572 unsafe {
573 ffi::gst_rtsp_media_set_ensure_keyunit_on_start_timeout(
574 self.as_ref().to_glib_none().0,
575 timeout,
576 );
577 }
578 }
579
580 #[doc(alias = "gst_rtsp_media_set_eos_shutdown")]
581 #[doc(alias = "eos-shutdown")]
582 fn set_eos_shutdown(&self, eos_shutdown: bool) {
583 unsafe {
584 ffi::gst_rtsp_media_set_eos_shutdown(
585 self.as_ref().to_glib_none().0,
586 eos_shutdown.into_glib(),
587 );
588 }
589 }
590
591 #[doc(alias = "gst_rtsp_media_set_latency")]
592 #[doc(alias = "latency")]
593 fn set_latency(&self, latency: u32) {
594 unsafe {
595 ffi::gst_rtsp_media_set_latency(self.as_ref().to_glib_none().0, latency);
596 }
597 }
598
599 #[cfg(feature = "v1_16")]
600 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
601 #[doc(alias = "gst_rtsp_media_set_max_mcast_ttl")]
602 #[doc(alias = "max-mcast-ttl")]
603 fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
604 unsafe {
605 from_glib(ffi::gst_rtsp_media_set_max_mcast_ttl(
606 self.as_ref().to_glib_none().0,
607 ttl,
608 ))
609 }
610 }
611
612 #[doc(alias = "gst_rtsp_media_set_multicast_iface")]
613 fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
614 unsafe {
615 ffi::gst_rtsp_media_set_multicast_iface(
616 self.as_ref().to_glib_none().0,
617 multicast_iface.to_glib_none().0,
618 );
619 }
620 }
621
622 #[doc(alias = "gst_rtsp_media_set_pipeline_state")]
628 fn set_pipeline_state(&self, state: gst::State) {
629 unsafe {
630 ffi::gst_rtsp_media_set_pipeline_state(
631 self.as_ref().to_glib_none().0,
632 state.into_glib(),
633 );
634 }
635 }
636
637 #[doc(alias = "gst_rtsp_media_set_profiles")]
638 #[doc(alias = "profiles")]
639 fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
640 unsafe {
641 ffi::gst_rtsp_media_set_profiles(self.as_ref().to_glib_none().0, profiles.into_glib());
642 }
643 }
644
645 #[doc(alias = "gst_rtsp_media_set_protocols")]
646 #[doc(alias = "protocols")]
647 fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
648 unsafe {
649 ffi::gst_rtsp_media_set_protocols(
650 self.as_ref().to_glib_none().0,
651 protocols.into_glib(),
652 );
653 }
654 }
655
656 #[doc(alias = "gst_rtsp_media_set_publish_clock_mode")]
657 fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
658 unsafe {
659 ffi::gst_rtsp_media_set_publish_clock_mode(
660 self.as_ref().to_glib_none().0,
661 mode.into_glib(),
662 );
663 }
664 }
665
666 #[cfg(feature = "v1_18")]
667 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
668 #[doc(alias = "gst_rtsp_media_set_rate_control")]
669 fn set_rate_control(&self, enabled: bool) {
670 unsafe {
671 ffi::gst_rtsp_media_set_rate_control(
672 self.as_ref().to_glib_none().0,
673 enabled.into_glib(),
674 );
675 }
676 }
677
678 #[doc(alias = "gst_rtsp_media_set_retransmission_time")]
679 fn set_retransmission_time(&self, time: impl Into<Option<gst::ClockTime>>) {
680 unsafe {
681 ffi::gst_rtsp_media_set_retransmission_time(
682 self.as_ref().to_glib_none().0,
683 time.into().into_glib(),
684 );
685 }
686 }
687
688 #[doc(alias = "gst_rtsp_media_set_reusable")]
689 #[doc(alias = "reusable")]
690 fn set_reusable(&self, reusable: bool) {
691 unsafe {
692 ffi::gst_rtsp_media_set_reusable(self.as_ref().to_glib_none().0, reusable.into_glib());
693 }
694 }
695
696 #[doc(alias = "gst_rtsp_media_set_shared")]
697 #[doc(alias = "shared")]
698 fn set_shared(&self, shared: bool) {
699 unsafe {
700 ffi::gst_rtsp_media_set_shared(self.as_ref().to_glib_none().0, shared.into_glib());
701 }
702 }
703
704 #[doc(alias = "gst_rtsp_media_set_state")]
705 fn set_state(&self, state: gst::State, transports: &[RTSPStreamTransport]) -> bool {
706 unsafe {
707 from_glib(ffi::gst_rtsp_media_set_state(
708 self.as_ref().to_glib_none().0,
709 state.into_glib(),
710 transports.to_glib_none().0,
711 ))
712 }
713 }
714
715 #[doc(alias = "gst_rtsp_media_set_stop_on_disconnect")]
716 #[doc(alias = "stop-on-disconnect")]
717 fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
718 unsafe {
719 ffi::gst_rtsp_media_set_stop_on_disconnect(
720 self.as_ref().to_glib_none().0,
721 stop_on_disconnect.into_glib(),
722 );
723 }
724 }
725
726 #[doc(alias = "gst_rtsp_media_set_suspend_mode")]
727 #[doc(alias = "suspend-mode")]
728 fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
729 unsafe {
730 ffi::gst_rtsp_media_set_suspend_mode(self.as_ref().to_glib_none().0, mode.into_glib());
731 }
732 }
733
734 #[doc(alias = "gst_rtsp_media_set_transport_mode")]
735 #[doc(alias = "transport-mode")]
736 fn set_transport_mode(&self, mode: RTSPTransportMode) {
737 unsafe {
738 ffi::gst_rtsp_media_set_transport_mode(
739 self.as_ref().to_glib_none().0,
740 mode.into_glib(),
741 );
742 }
743 }
744
745 #[doc(alias = "gst_rtsp_media_suspend")]
751 fn suspend(&self) -> Result<(), glib::error::BoolError> {
752 unsafe {
753 glib::result_from_gboolean!(
754 ffi::gst_rtsp_media_suspend(self.as_ref().to_glib_none().0),
755 "Failed to suspend media"
756 )
757 }
758 }
759
760 #[cfg(feature = "v1_18")]
761 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
762 #[doc(alias = "gst_rtsp_media_unlock")]
763 fn unlock(&self) {
764 unsafe {
765 ffi::gst_rtsp_media_unlock(self.as_ref().to_glib_none().0);
766 }
767 }
768
769 #[doc(alias = "gst_rtsp_media_unprepare")]
770 fn unprepare(&self) -> Result<(), glib::error::BoolError> {
771 unsafe {
772 glib::result_from_gboolean!(
773 ffi::gst_rtsp_media_unprepare(self.as_ref().to_glib_none().0),
774 "Failed to unprepare media"
775 )
776 }
777 }
778
779 #[doc(alias = "gst_rtsp_media_unsuspend")]
780 fn unsuspend(&self) -> Result<(), glib::error::BoolError> {
781 unsafe {
782 glib::result_from_gboolean!(
783 ffi::gst_rtsp_media_unsuspend(self.as_ref().to_glib_none().0),
784 "Failed to unsuspend media"
785 )
786 }
787 }
788
789 #[doc(alias = "gst_rtsp_media_use_time_provider")]
790 fn use_time_provider(&self, time_provider: bool) {
791 unsafe {
792 ffi::gst_rtsp_media_use_time_provider(
793 self.as_ref().to_glib_none().0,
794 time_provider.into_glib(),
795 );
796 }
797 }
798
799 #[cfg(not(feature = "v1_16"))]
800 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
801 #[doc(alias = "bind-mcast-address")]
802 fn is_bind_mcast_address(&self) -> bool {
803 ObjectExt::property(self.as_ref(), "bind-mcast-address")
804 }
805
806 #[cfg(not(feature = "v1_16"))]
807 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
808 #[doc(alias = "bind-mcast-address")]
809 fn set_bind_mcast_address(&self, bind_mcast_address: bool) {
810 ObjectExt::set_property(self.as_ref(), "bind-mcast-address", bind_mcast_address)
811 }
812
813 #[cfg(not(feature = "v1_18"))]
814 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
815 #[doc(alias = "dscp-qos")]
816 fn dscp_qos(&self) -> i32 {
817 ObjectExt::property(self.as_ref(), "dscp-qos")
818 }
819
820 #[cfg(not(feature = "v1_18"))]
821 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
822 #[doc(alias = "dscp-qos")]
823 fn set_dscp_qos(&self, dscp_qos: i32) {
824 ObjectExt::set_property(self.as_ref(), "dscp-qos", dscp_qos)
825 }
826
827 #[cfg(not(feature = "v1_16"))]
828 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
829 #[doc(alias = "max-mcast-ttl")]
830 fn max_mcast_ttl(&self) -> u32 {
831 ObjectExt::property(self.as_ref(), "max-mcast-ttl")
832 }
833
834 #[cfg(not(feature = "v1_16"))]
835 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
836 #[doc(alias = "max-mcast-ttl")]
837 fn set_max_mcast_ttl(&self, max_mcast_ttl: u32) {
838 ObjectExt::set_property(self.as_ref(), "max-mcast-ttl", max_mcast_ttl)
839 }
840
841 #[doc(alias = "time-provider")]
842 fn set_time_provider(&self, time_provider: bool) {
843 ObjectExt::set_property(self.as_ref(), "time-provider", time_provider)
844 }
845
846 #[cfg(feature = "v1_22")]
847 #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
848 #[doc(alias = "handle-message")]
849 fn connect_handle_message<F: Fn(&Self, &gst::Message) -> bool + Send + Sync + 'static>(
850 &self,
851 detail: Option<&str>,
852 f: F,
853 ) -> SignalHandlerId {
854 unsafe extern "C" fn handle_message_trampoline<
855 P: IsA<RTSPMedia>,
856 F: Fn(&P, &gst::Message) -> bool + Send + Sync + 'static,
857 >(
858 this: *mut ffi::GstRTSPMedia,
859 message: *mut gst::ffi::GstMessage,
860 f: glib::ffi::gpointer,
861 ) -> glib::ffi::gboolean {
862 let f: &F = &*(f as *const F);
863 f(
864 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
865 &from_glib_borrow(message),
866 )
867 .into_glib()
868 }
869 unsafe {
870 let f: Box_<F> = Box_::new(f);
871 let detailed_signal_name = detail.map(|name| format!("handle-message::{name}\0"));
872 let signal_name: &[u8] = detailed_signal_name
873 .as_ref()
874 .map_or(c"handle-message".to_bytes(), |n| n.as_bytes());
875 connect_raw(
876 self.as_ptr() as *mut _,
877 signal_name.as_ptr() as *const _,
878 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
879 handle_message_trampoline::<Self, F> as *const (),
880 )),
881 Box_::into_raw(f),
882 )
883 }
884 }
885
886 #[doc(alias = "new-state")]
887 fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
888 &self,
889 f: F,
890 ) -> SignalHandlerId {
891 unsafe extern "C" fn new_state_trampoline<
892 P: IsA<RTSPMedia>,
893 F: Fn(&P, i32) + Send + Sync + 'static,
894 >(
895 this: *mut ffi::GstRTSPMedia,
896 object: std::ffi::c_int,
897 f: glib::ffi::gpointer,
898 ) {
899 let f: &F = &*(f as *const F);
900 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
901 }
902 unsafe {
903 let f: Box_<F> = Box_::new(f);
904 connect_raw(
905 self.as_ptr() as *mut _,
906 c"new-state".as_ptr() as *const _,
907 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
908 new_state_trampoline::<Self, F> as *const (),
909 )),
910 Box_::into_raw(f),
911 )
912 }
913 }
914
915 #[doc(alias = "new-stream")]
916 fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
917 &self,
918 f: F,
919 ) -> SignalHandlerId {
920 unsafe extern "C" fn new_stream_trampoline<
921 P: IsA<RTSPMedia>,
922 F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
923 >(
924 this: *mut ffi::GstRTSPMedia,
925 object: *mut ffi::GstRTSPStream,
926 f: glib::ffi::gpointer,
927 ) {
928 let f: &F = &*(f as *const F);
929 f(
930 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
931 &from_glib_borrow(object),
932 )
933 }
934 unsafe {
935 let f: Box_<F> = Box_::new(f);
936 connect_raw(
937 self.as_ptr() as *mut _,
938 c"new-stream".as_ptr() as *const _,
939 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
940 new_stream_trampoline::<Self, F> as *const (),
941 )),
942 Box_::into_raw(f),
943 )
944 }
945 }
946
947 #[doc(alias = "prepared")]
948 fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
949 unsafe extern "C" fn prepared_trampoline<
950 P: IsA<RTSPMedia>,
951 F: Fn(&P) + Send + Sync + 'static,
952 >(
953 this: *mut ffi::GstRTSPMedia,
954 f: glib::ffi::gpointer,
955 ) {
956 let f: &F = &*(f as *const F);
957 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
958 }
959 unsafe {
960 let f: Box_<F> = Box_::new(f);
961 connect_raw(
962 self.as_ptr() as *mut _,
963 c"prepared".as_ptr() as *const _,
964 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
965 prepared_trampoline::<Self, F> as *const (),
966 )),
967 Box_::into_raw(f),
968 )
969 }
970 }
971
972 #[doc(alias = "removed-stream")]
973 fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
974 &self,
975 f: F,
976 ) -> SignalHandlerId {
977 unsafe extern "C" fn removed_stream_trampoline<
978 P: IsA<RTSPMedia>,
979 F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
980 >(
981 this: *mut ffi::GstRTSPMedia,
982 object: *mut ffi::GstRTSPStream,
983 f: glib::ffi::gpointer,
984 ) {
985 let f: &F = &*(f as *const F);
986 f(
987 RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
988 &from_glib_borrow(object),
989 )
990 }
991 unsafe {
992 let f: Box_<F> = Box_::new(f);
993 connect_raw(
994 self.as_ptr() as *mut _,
995 c"removed-stream".as_ptr() as *const _,
996 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
997 removed_stream_trampoline::<Self, F> as *const (),
998 )),
999 Box_::into_raw(f),
1000 )
1001 }
1002 }
1003
1004 #[doc(alias = "target-state")]
1005 fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1006 &self,
1007 f: F,
1008 ) -> SignalHandlerId {
1009 unsafe extern "C" fn target_state_trampoline<
1010 P: IsA<RTSPMedia>,
1011 F: Fn(&P, i32) + Send + Sync + 'static,
1012 >(
1013 this: *mut ffi::GstRTSPMedia,
1014 object: std::ffi::c_int,
1015 f: glib::ffi::gpointer,
1016 ) {
1017 let f: &F = &*(f as *const F);
1018 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1019 }
1020 unsafe {
1021 let f: Box_<F> = Box_::new(f);
1022 connect_raw(
1023 self.as_ptr() as *mut _,
1024 c"target-state".as_ptr() as *const _,
1025 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1026 target_state_trampoline::<Self, F> as *const (),
1027 )),
1028 Box_::into_raw(f),
1029 )
1030 }
1031 }
1032
1033 #[doc(alias = "unprepared")]
1034 fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1035 unsafe extern "C" fn unprepared_trampoline<
1036 P: IsA<RTSPMedia>,
1037 F: Fn(&P) + Send + Sync + 'static,
1038 >(
1039 this: *mut ffi::GstRTSPMedia,
1040 f: glib::ffi::gpointer,
1041 ) {
1042 let f: &F = &*(f as *const F);
1043 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1044 }
1045 unsafe {
1046 let f: Box_<F> = Box_::new(f);
1047 connect_raw(
1048 self.as_ptr() as *mut _,
1049 c"unprepared".as_ptr() as *const _,
1050 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1051 unprepared_trampoline::<Self, F> as *const (),
1052 )),
1053 Box_::into_raw(f),
1054 )
1055 }
1056 }
1057
1058 #[doc(alias = "bind-mcast-address")]
1059 fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1060 &self,
1061 f: F,
1062 ) -> SignalHandlerId {
1063 unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1064 P: IsA<RTSPMedia>,
1065 F: Fn(&P) + Send + Sync + 'static,
1066 >(
1067 this: *mut ffi::GstRTSPMedia,
1068 _param_spec: glib::ffi::gpointer,
1069 f: glib::ffi::gpointer,
1070 ) {
1071 let f: &F = &*(f as *const F);
1072 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1073 }
1074 unsafe {
1075 let f: Box_<F> = Box_::new(f);
1076 connect_raw(
1077 self.as_ptr() as *mut _,
1078 c"notify::bind-mcast-address".as_ptr() as *const _,
1079 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1080 notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1081 )),
1082 Box_::into_raw(f),
1083 )
1084 }
1085 }
1086
1087 #[doc(alias = "buffer-size")]
1088 fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1089 &self,
1090 f: F,
1091 ) -> SignalHandlerId {
1092 unsafe extern "C" fn notify_buffer_size_trampoline<
1093 P: IsA<RTSPMedia>,
1094 F: Fn(&P) + Send + Sync + 'static,
1095 >(
1096 this: *mut ffi::GstRTSPMedia,
1097 _param_spec: glib::ffi::gpointer,
1098 f: glib::ffi::gpointer,
1099 ) {
1100 let f: &F = &*(f as *const F);
1101 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1102 }
1103 unsafe {
1104 let f: Box_<F> = Box_::new(f);
1105 connect_raw(
1106 self.as_ptr() as *mut _,
1107 c"notify::buffer-size".as_ptr() as *const _,
1108 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1109 notify_buffer_size_trampoline::<Self, F> as *const (),
1110 )),
1111 Box_::into_raw(f),
1112 )
1113 }
1114 }
1115
1116 #[doc(alias = "clock")]
1117 fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1118 unsafe extern "C" fn notify_clock_trampoline<
1119 P: IsA<RTSPMedia>,
1120 F: Fn(&P) + Send + Sync + 'static,
1121 >(
1122 this: *mut ffi::GstRTSPMedia,
1123 _param_spec: glib::ffi::gpointer,
1124 f: glib::ffi::gpointer,
1125 ) {
1126 let f: &F = &*(f as *const F);
1127 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1128 }
1129 unsafe {
1130 let f: Box_<F> = Box_::new(f);
1131 connect_raw(
1132 self.as_ptr() as *mut _,
1133 c"notify::clock".as_ptr() as *const _,
1134 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1135 notify_clock_trampoline::<Self, F> as *const (),
1136 )),
1137 Box_::into_raw(f),
1138 )
1139 }
1140 }
1141
1142 #[doc(alias = "dscp-qos")]
1143 fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1144 &self,
1145 f: F,
1146 ) -> SignalHandlerId {
1147 unsafe extern "C" fn notify_dscp_qos_trampoline<
1148 P: IsA<RTSPMedia>,
1149 F: Fn(&P) + Send + Sync + 'static,
1150 >(
1151 this: *mut ffi::GstRTSPMedia,
1152 _param_spec: glib::ffi::gpointer,
1153 f: glib::ffi::gpointer,
1154 ) {
1155 let f: &F = &*(f as *const F);
1156 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1157 }
1158 unsafe {
1159 let f: Box_<F> = Box_::new(f);
1160 connect_raw(
1161 self.as_ptr() as *mut _,
1162 c"notify::dscp-qos".as_ptr() as *const _,
1163 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1164 notify_dscp_qos_trampoline::<Self, F> as *const (),
1165 )),
1166 Box_::into_raw(f),
1167 )
1168 }
1169 }
1170
1171 #[cfg(feature = "v1_24")]
1172 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1173 #[doc(alias = "ensure-keyunit-on-start")]
1174 fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1175 &self,
1176 f: F,
1177 ) -> SignalHandlerId {
1178 unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1179 P: IsA<RTSPMedia>,
1180 F: Fn(&P) + Send + Sync + 'static,
1181 >(
1182 this: *mut ffi::GstRTSPMedia,
1183 _param_spec: glib::ffi::gpointer,
1184 f: glib::ffi::gpointer,
1185 ) {
1186 let f: &F = &*(f as *const F);
1187 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1188 }
1189 unsafe {
1190 let f: Box_<F> = Box_::new(f);
1191 connect_raw(
1192 self.as_ptr() as *mut _,
1193 c"notify::ensure-keyunit-on-start".as_ptr() as *const _,
1194 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1195 notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1196 )),
1197 Box_::into_raw(f),
1198 )
1199 }
1200 }
1201
1202 #[cfg(feature = "v1_24")]
1203 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1204 #[doc(alias = "ensure-keyunit-on-start-timeout")]
1205 fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1206 &self,
1207 f: F,
1208 ) -> SignalHandlerId {
1209 unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1210 P: IsA<RTSPMedia>,
1211 F: Fn(&P) + Send + Sync + 'static,
1212 >(
1213 this: *mut ffi::GstRTSPMedia,
1214 _param_spec: glib::ffi::gpointer,
1215 f: glib::ffi::gpointer,
1216 ) {
1217 let f: &F = &*(f as *const F);
1218 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1219 }
1220 unsafe {
1221 let f: Box_<F> = Box_::new(f);
1222 connect_raw(
1223 self.as_ptr() as *mut _,
1224 c"notify::ensure-keyunit-on-start-timeout".as_ptr() as *const _,
1225 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1226 notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1227 )),
1228 Box_::into_raw(f),
1229 )
1230 }
1231 }
1232
1233 #[doc(alias = "eos-shutdown")]
1234 fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1235 &self,
1236 f: F,
1237 ) -> SignalHandlerId {
1238 unsafe extern "C" fn notify_eos_shutdown_trampoline<
1239 P: IsA<RTSPMedia>,
1240 F: Fn(&P) + Send + Sync + 'static,
1241 >(
1242 this: *mut ffi::GstRTSPMedia,
1243 _param_spec: glib::ffi::gpointer,
1244 f: glib::ffi::gpointer,
1245 ) {
1246 let f: &F = &*(f as *const F);
1247 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1248 }
1249 unsafe {
1250 let f: Box_<F> = Box_::new(f);
1251 connect_raw(
1252 self.as_ptr() as *mut _,
1253 c"notify::eos-shutdown".as_ptr() as *const _,
1254 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1255 notify_eos_shutdown_trampoline::<Self, F> as *const (),
1256 )),
1257 Box_::into_raw(f),
1258 )
1259 }
1260 }
1261
1262 #[doc(alias = "latency")]
1263 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1264 &self,
1265 f: F,
1266 ) -> SignalHandlerId {
1267 unsafe extern "C" fn notify_latency_trampoline<
1268 P: IsA<RTSPMedia>,
1269 F: Fn(&P) + Send + Sync + 'static,
1270 >(
1271 this: *mut ffi::GstRTSPMedia,
1272 _param_spec: glib::ffi::gpointer,
1273 f: glib::ffi::gpointer,
1274 ) {
1275 let f: &F = &*(f as *const F);
1276 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1277 }
1278 unsafe {
1279 let f: Box_<F> = Box_::new(f);
1280 connect_raw(
1281 self.as_ptr() as *mut _,
1282 c"notify::latency".as_ptr() as *const _,
1283 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1284 notify_latency_trampoline::<Self, F> as *const (),
1285 )),
1286 Box_::into_raw(f),
1287 )
1288 }
1289 }
1290
1291 #[doc(alias = "max-mcast-ttl")]
1292 fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1293 &self,
1294 f: F,
1295 ) -> SignalHandlerId {
1296 unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
1297 P: IsA<RTSPMedia>,
1298 F: Fn(&P) + Send + Sync + 'static,
1299 >(
1300 this: *mut ffi::GstRTSPMedia,
1301 _param_spec: glib::ffi::gpointer,
1302 f: glib::ffi::gpointer,
1303 ) {
1304 let f: &F = &*(f as *const F);
1305 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1306 }
1307 unsafe {
1308 let f: Box_<F> = Box_::new(f);
1309 connect_raw(
1310 self.as_ptr() as *mut _,
1311 c"notify::max-mcast-ttl".as_ptr() as *const _,
1312 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1313 notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1314 )),
1315 Box_::into_raw(f),
1316 )
1317 }
1318 }
1319
1320 #[doc(alias = "profiles")]
1321 fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1322 &self,
1323 f: F,
1324 ) -> SignalHandlerId {
1325 unsafe extern "C" fn notify_profiles_trampoline<
1326 P: IsA<RTSPMedia>,
1327 F: Fn(&P) + Send + Sync + 'static,
1328 >(
1329 this: *mut ffi::GstRTSPMedia,
1330 _param_spec: glib::ffi::gpointer,
1331 f: glib::ffi::gpointer,
1332 ) {
1333 let f: &F = &*(f as *const F);
1334 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1335 }
1336 unsafe {
1337 let f: Box_<F> = Box_::new(f);
1338 connect_raw(
1339 self.as_ptr() as *mut _,
1340 c"notify::profiles".as_ptr() as *const _,
1341 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1342 notify_profiles_trampoline::<Self, F> as *const (),
1343 )),
1344 Box_::into_raw(f),
1345 )
1346 }
1347 }
1348
1349 #[doc(alias = "protocols")]
1350 fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1351 &self,
1352 f: F,
1353 ) -> SignalHandlerId {
1354 unsafe extern "C" fn notify_protocols_trampoline<
1355 P: IsA<RTSPMedia>,
1356 F: Fn(&P) + Send + Sync + 'static,
1357 >(
1358 this: *mut ffi::GstRTSPMedia,
1359 _param_spec: glib::ffi::gpointer,
1360 f: glib::ffi::gpointer,
1361 ) {
1362 let f: &F = &*(f as *const F);
1363 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1364 }
1365 unsafe {
1366 let f: Box_<F> = Box_::new(f);
1367 connect_raw(
1368 self.as_ptr() as *mut _,
1369 c"notify::protocols".as_ptr() as *const _,
1370 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1371 notify_protocols_trampoline::<Self, F> as *const (),
1372 )),
1373 Box_::into_raw(f),
1374 )
1375 }
1376 }
1377
1378 #[doc(alias = "reusable")]
1379 fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
1380 &self,
1381 f: F,
1382 ) -> SignalHandlerId {
1383 unsafe extern "C" fn notify_reusable_trampoline<
1384 P: IsA<RTSPMedia>,
1385 F: Fn(&P) + Send + Sync + 'static,
1386 >(
1387 this: *mut ffi::GstRTSPMedia,
1388 _param_spec: glib::ffi::gpointer,
1389 f: glib::ffi::gpointer,
1390 ) {
1391 let f: &F = &*(f as *const F);
1392 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1393 }
1394 unsafe {
1395 let f: Box_<F> = Box_::new(f);
1396 connect_raw(
1397 self.as_ptr() as *mut _,
1398 c"notify::reusable".as_ptr() as *const _,
1399 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1400 notify_reusable_trampoline::<Self, F> as *const (),
1401 )),
1402 Box_::into_raw(f),
1403 )
1404 }
1405 }
1406
1407 #[doc(alias = "shared")]
1408 fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1409 unsafe extern "C" fn notify_shared_trampoline<
1410 P: IsA<RTSPMedia>,
1411 F: Fn(&P) + Send + Sync + 'static,
1412 >(
1413 this: *mut ffi::GstRTSPMedia,
1414 _param_spec: glib::ffi::gpointer,
1415 f: glib::ffi::gpointer,
1416 ) {
1417 let f: &F = &*(f as *const F);
1418 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1419 }
1420 unsafe {
1421 let f: Box_<F> = Box_::new(f);
1422 connect_raw(
1423 self.as_ptr() as *mut _,
1424 c"notify::shared".as_ptr() as *const _,
1425 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1426 notify_shared_trampoline::<Self, F> as *const (),
1427 )),
1428 Box_::into_raw(f),
1429 )
1430 }
1431 }
1432
1433 #[doc(alias = "stop-on-disconnect")]
1434 fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1435 &self,
1436 f: F,
1437 ) -> SignalHandlerId {
1438 unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1439 P: IsA<RTSPMedia>,
1440 F: Fn(&P) + Send + Sync + 'static,
1441 >(
1442 this: *mut ffi::GstRTSPMedia,
1443 _param_spec: glib::ffi::gpointer,
1444 f: glib::ffi::gpointer,
1445 ) {
1446 let f: &F = &*(f as *const F);
1447 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1448 }
1449 unsafe {
1450 let f: Box_<F> = Box_::new(f);
1451 connect_raw(
1452 self.as_ptr() as *mut _,
1453 c"notify::stop-on-disconnect".as_ptr() as *const _,
1454 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1455 notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1456 )),
1457 Box_::into_raw(f),
1458 )
1459 }
1460 }
1461
1462 #[doc(alias = "suspend-mode")]
1463 fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1464 &self,
1465 f: F,
1466 ) -> SignalHandlerId {
1467 unsafe extern "C" fn notify_suspend_mode_trampoline<
1468 P: IsA<RTSPMedia>,
1469 F: Fn(&P) + Send + Sync + 'static,
1470 >(
1471 this: *mut ffi::GstRTSPMedia,
1472 _param_spec: glib::ffi::gpointer,
1473 f: glib::ffi::gpointer,
1474 ) {
1475 let f: &F = &*(f as *const F);
1476 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1477 }
1478 unsafe {
1479 let f: Box_<F> = Box_::new(f);
1480 connect_raw(
1481 self.as_ptr() as *mut _,
1482 c"notify::suspend-mode".as_ptr() as *const _,
1483 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1484 notify_suspend_mode_trampoline::<Self, F> as *const (),
1485 )),
1486 Box_::into_raw(f),
1487 )
1488 }
1489 }
1490
1491 #[doc(alias = "time-provider")]
1492 fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
1493 &self,
1494 f: F,
1495 ) -> SignalHandlerId {
1496 unsafe extern "C" fn notify_time_provider_trampoline<
1497 P: IsA<RTSPMedia>,
1498 F: Fn(&P) + Send + Sync + 'static,
1499 >(
1500 this: *mut ffi::GstRTSPMedia,
1501 _param_spec: glib::ffi::gpointer,
1502 f: glib::ffi::gpointer,
1503 ) {
1504 let f: &F = &*(f as *const F);
1505 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1506 }
1507 unsafe {
1508 let f: Box_<F> = Box_::new(f);
1509 connect_raw(
1510 self.as_ptr() as *mut _,
1511 c"notify::time-provider".as_ptr() as *const _,
1512 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1513 notify_time_provider_trampoline::<Self, F> as *const (),
1514 )),
1515 Box_::into_raw(f),
1516 )
1517 }
1518 }
1519
1520 #[doc(alias = "transport-mode")]
1521 fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1522 &self,
1523 f: F,
1524 ) -> SignalHandlerId {
1525 unsafe extern "C" fn notify_transport_mode_trampoline<
1526 P: IsA<RTSPMedia>,
1527 F: Fn(&P) + Send + Sync + 'static,
1528 >(
1529 this: *mut ffi::GstRTSPMedia,
1530 _param_spec: glib::ffi::gpointer,
1531 f: glib::ffi::gpointer,
1532 ) {
1533 let f: &F = &*(f as *const F);
1534 f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1535 }
1536 unsafe {
1537 let f: Box_<F> = Box_::new(f);
1538 connect_raw(
1539 self.as_ptr() as *mut _,
1540 c"notify::transport-mode".as_ptr() as *const _,
1541 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1542 notify_transport_mode_trampoline::<Self, F> as *const (),
1543 )),
1544 Box_::into_raw(f),
1545 )
1546 }
1547 }
1548}
1549
1550impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {}