1use crate::{
7 ffi, RTSPAddressPool, RTSPMedia, RTSPPublishClockMode, RTSPSuspendMode, RTSPTransportMode,
8};
9use glib::{
10 object::ObjectType as _,
11 prelude::*,
12 signal::{connect_raw, SignalHandlerId},
13 translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18 #[doc(alias = "GstRTSPMediaFactory")]
19 pub struct RTSPMediaFactory(Object<ffi::GstRTSPMediaFactory, ffi::GstRTSPMediaFactoryClass>);
20
21 match fn {
22 type_ => || ffi::gst_rtsp_media_factory_get_type(),
23 }
24}
25
26impl RTSPMediaFactory {
27 pub const NONE: Option<&'static RTSPMediaFactory> = None;
28
29 #[doc(alias = "gst_rtsp_media_factory_new")]
30 pub fn new() -> RTSPMediaFactory {
31 assert_initialized_main_thread!();
32 unsafe { from_glib_full(ffi::gst_rtsp_media_factory_new()) }
33 }
34}
35
36impl Default for RTSPMediaFactory {
37 fn default() -> Self {
38 Self::new()
39 }
40}
41
42unsafe impl Send for RTSPMediaFactory {}
43unsafe impl Sync for RTSPMediaFactory {}
44
45pub trait RTSPMediaFactoryExt: IsA<RTSPMediaFactory> + 'static {
46 #[doc(alias = "gst_rtsp_media_factory_construct")]
52 fn construct(&self, url: &gst_rtsp::RTSPUrl) -> Result<RTSPMedia, glib::BoolError> {
53 unsafe {
54 Option::<_>::from_glib_full(ffi::gst_rtsp_media_factory_construct(
55 self.as_ref().to_glib_none().0,
56 url.to_glib_none().0,
57 ))
58 .ok_or_else(|| glib::bool_error!("Failed to construct media"))
59 }
60 }
61
62 #[doc(alias = "gst_rtsp_media_factory_create_element")]
63 fn create_element(&self, url: &gst_rtsp::RTSPUrl) -> Result<gst::Element, glib::BoolError> {
64 unsafe {
65 Option::<_>::from_glib_none(ffi::gst_rtsp_media_factory_create_element(
66 self.as_ref().to_glib_none().0,
67 url.to_glib_none().0,
68 ))
69 .ok_or_else(|| glib::bool_error!("Failed to create media element"))
70 }
71 }
72
73 #[doc(alias = "gst_rtsp_media_factory_get_address_pool")]
74 #[doc(alias = "get_address_pool")]
75 fn address_pool(&self) -> Option<RTSPAddressPool> {
76 unsafe {
77 from_glib_full(ffi::gst_rtsp_media_factory_get_address_pool(
78 self.as_ref().to_glib_none().0,
79 ))
80 }
81 }
82
83 #[doc(alias = "gst_rtsp_media_factory_get_buffer_size")]
84 #[doc(alias = "get_buffer_size")]
85 #[doc(alias = "buffer-size")]
86 fn buffer_size(&self) -> u32 {
87 unsafe { ffi::gst_rtsp_media_factory_get_buffer_size(self.as_ref().to_glib_none().0) }
88 }
89
90 #[doc(alias = "gst_rtsp_media_factory_get_clock")]
91 #[doc(alias = "get_clock")]
92 fn clock(&self) -> Option<gst::Clock> {
93 unsafe {
94 from_glib_full(ffi::gst_rtsp_media_factory_get_clock(
95 self.as_ref().to_glib_none().0,
96 ))
97 }
98 }
99
100 #[cfg(feature = "v1_16")]
101 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
102 #[doc(alias = "gst_rtsp_media_factory_get_do_retransmission")]
103 #[doc(alias = "get_do_retransmission")]
104 fn does_retransmission(&self) -> bool {
105 unsafe {
106 from_glib(ffi::gst_rtsp_media_factory_get_do_retransmission(
107 self.as_ref().to_glib_none().0,
108 ))
109 }
110 }
111
112 #[cfg(feature = "v1_18")]
113 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
114 #[doc(alias = "gst_rtsp_media_factory_get_dscp_qos")]
115 #[doc(alias = "get_dscp_qos")]
116 #[doc(alias = "dscp-qos")]
117 fn dscp_qos(&self) -> i32 {
118 unsafe { ffi::gst_rtsp_media_factory_get_dscp_qos(self.as_ref().to_glib_none().0) }
119 }
120
121 #[cfg(feature = "v1_24")]
122 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
123 #[doc(alias = "gst_rtsp_media_factory_get_ensure_keyunit_on_start")]
124 #[doc(alias = "get_ensure_keyunit_on_start")]
125 #[doc(alias = "ensure-keyunit-on-start")]
126 fn is_ensure_keyunit_on_start(&self) -> bool {
127 unsafe {
128 from_glib(ffi::gst_rtsp_media_factory_get_ensure_keyunit_on_start(
129 self.as_ref().to_glib_none().0,
130 ))
131 }
132 }
133
134 #[cfg(feature = "v1_24")]
135 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
136 #[doc(alias = "gst_rtsp_media_factory_get_ensure_keyunit_on_start_timeout")]
137 #[doc(alias = "get_ensure_keyunit_on_start_timeout")]
138 #[doc(alias = "ensure-keyunit-on-start-timeout")]
139 fn ensure_keyunit_on_start_timeout(&self) -> u32 {
140 unsafe {
141 ffi::gst_rtsp_media_factory_get_ensure_keyunit_on_start_timeout(
142 self.as_ref().to_glib_none().0,
143 )
144 }
145 }
146
147 #[doc(alias = "gst_rtsp_media_factory_get_latency")]
148 #[doc(alias = "get_latency")]
149 fn latency(&self) -> u32 {
150 unsafe { ffi::gst_rtsp_media_factory_get_latency(self.as_ref().to_glib_none().0) }
151 }
152
153 #[doc(alias = "gst_rtsp_media_factory_get_launch")]
154 #[doc(alias = "get_launch")]
155 fn launch(&self) -> Option<glib::GString> {
156 unsafe {
157 from_glib_full(ffi::gst_rtsp_media_factory_get_launch(
158 self.as_ref().to_glib_none().0,
159 ))
160 }
161 }
162
163 #[cfg(feature = "v1_16")]
164 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
165 #[doc(alias = "gst_rtsp_media_factory_get_max_mcast_ttl")]
166 #[doc(alias = "get_max_mcast_ttl")]
167 #[doc(alias = "max-mcast-ttl")]
168 fn max_mcast_ttl(&self) -> u32 {
169 unsafe { ffi::gst_rtsp_media_factory_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
170 }
171
172 #[doc(alias = "gst_rtsp_media_factory_get_media_gtype")]
173 #[doc(alias = "get_media_gtype")]
174 fn media_gtype(&self) -> glib::types::Type {
175 unsafe {
176 from_glib(ffi::gst_rtsp_media_factory_get_media_gtype(
177 self.as_ref().to_glib_none().0,
178 ))
179 }
180 }
181
182 #[doc(alias = "gst_rtsp_media_factory_get_multicast_iface")]
183 #[doc(alias = "get_multicast_iface")]
184 fn multicast_iface(&self) -> Option<glib::GString> {
185 unsafe {
186 from_glib_full(ffi::gst_rtsp_media_factory_get_multicast_iface(
187 self.as_ref().to_glib_none().0,
188 ))
189 }
190 }
191
192 #[doc(alias = "gst_rtsp_media_factory_get_profiles")]
199 #[doc(alias = "get_profiles")]
200 fn profiles(&self) -> gst_rtsp::RTSPProfile {
201 unsafe {
202 from_glib(ffi::gst_rtsp_media_factory_get_profiles(
203 self.as_ref().to_glib_none().0,
204 ))
205 }
206 }
207
208 #[doc(alias = "gst_rtsp_media_factory_get_protocols")]
209 #[doc(alias = "get_protocols")]
210 fn protocols(&self) -> gst_rtsp::RTSPLowerTrans {
211 unsafe {
212 from_glib(ffi::gst_rtsp_media_factory_get_protocols(
213 self.as_ref().to_glib_none().0,
214 ))
215 }
216 }
217
218 #[doc(alias = "gst_rtsp_media_factory_get_publish_clock_mode")]
219 #[doc(alias = "get_publish_clock_mode")]
220 fn publish_clock_mode(&self) -> RTSPPublishClockMode {
221 unsafe {
222 from_glib(ffi::gst_rtsp_media_factory_get_publish_clock_mode(
223 self.as_ref().to_glib_none().0,
224 ))
225 }
226 }
227
228 #[doc(alias = "gst_rtsp_media_factory_get_retransmission_time")]
229 #[doc(alias = "get_retransmission_time")]
230 fn retransmission_time(&self) -> Option<gst::ClockTime> {
231 unsafe {
232 from_glib(ffi::gst_rtsp_media_factory_get_retransmission_time(
233 self.as_ref().to_glib_none().0,
234 ))
235 }
236 }
237
238 #[doc(alias = "gst_rtsp_media_factory_get_suspend_mode")]
239 #[doc(alias = "get_suspend_mode")]
240 #[doc(alias = "suspend-mode")]
241 fn suspend_mode(&self) -> RTSPSuspendMode {
242 unsafe {
243 from_glib(ffi::gst_rtsp_media_factory_get_suspend_mode(
244 self.as_ref().to_glib_none().0,
245 ))
246 }
247 }
248
249 #[doc(alias = "gst_rtsp_media_factory_get_transport_mode")]
250 #[doc(alias = "get_transport_mode")]
251 #[doc(alias = "transport-mode")]
252 fn transport_mode(&self) -> RTSPTransportMode {
253 unsafe {
254 from_glib(ffi::gst_rtsp_media_factory_get_transport_mode(
255 self.as_ref().to_glib_none().0,
256 ))
257 }
258 }
259
260 #[cfg(feature = "v1_16")]
261 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
262 #[doc(alias = "gst_rtsp_media_factory_is_bind_mcast_address")]
263 #[doc(alias = "bind-mcast-address")]
264 fn is_bind_mcast_address(&self) -> bool {
265 unsafe {
266 from_glib(ffi::gst_rtsp_media_factory_is_bind_mcast_address(
267 self.as_ref().to_glib_none().0,
268 ))
269 }
270 }
271
272 #[cfg(feature = "v1_20")]
273 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
274 #[doc(alias = "gst_rtsp_media_factory_is_enable_rtcp")]
275 #[doc(alias = "enable-rtcp")]
276 fn is_enable_rtcp(&self) -> bool {
277 unsafe {
278 from_glib(ffi::gst_rtsp_media_factory_is_enable_rtcp(
279 self.as_ref().to_glib_none().0,
280 ))
281 }
282 }
283
284 #[doc(alias = "gst_rtsp_media_factory_is_eos_shutdown")]
285 #[doc(alias = "eos-shutdown")]
286 fn is_eos_shutdown(&self) -> bool {
287 unsafe {
288 from_glib(ffi::gst_rtsp_media_factory_is_eos_shutdown(
289 self.as_ref().to_glib_none().0,
290 ))
291 }
292 }
293
294 #[doc(alias = "gst_rtsp_media_factory_is_shared")]
295 #[doc(alias = "shared")]
296 fn is_shared(&self) -> bool {
297 unsafe {
298 from_glib(ffi::gst_rtsp_media_factory_is_shared(
299 self.as_ref().to_glib_none().0,
300 ))
301 }
302 }
303
304 #[doc(alias = "gst_rtsp_media_factory_is_stop_on_disonnect")]
305 fn is_stop_on_disonnect(&self) -> bool {
306 unsafe {
307 from_glib(ffi::gst_rtsp_media_factory_is_stop_on_disonnect(
308 self.as_ref().to_glib_none().0,
309 ))
310 }
311 }
312
313 #[doc(alias = "gst_rtsp_media_factory_set_address_pool")]
314 fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) {
315 unsafe {
316 ffi::gst_rtsp_media_factory_set_address_pool(
317 self.as_ref().to_glib_none().0,
318 pool.map(|p| p.as_ref()).to_glib_none().0,
319 );
320 }
321 }
322
323 #[cfg(feature = "v1_16")]
324 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
325 #[doc(alias = "gst_rtsp_media_factory_set_bind_mcast_address")]
326 #[doc(alias = "bind-mcast-address")]
327 fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
328 unsafe {
329 ffi::gst_rtsp_media_factory_set_bind_mcast_address(
330 self.as_ref().to_glib_none().0,
331 bind_mcast_addr.into_glib(),
332 );
333 }
334 }
335
336 #[doc(alias = "gst_rtsp_media_factory_set_buffer_size")]
337 #[doc(alias = "buffer-size")]
338 fn set_buffer_size(&self, size: u32) {
339 unsafe {
340 ffi::gst_rtsp_media_factory_set_buffer_size(self.as_ref().to_glib_none().0, size);
341 }
342 }
343
344 #[doc(alias = "gst_rtsp_media_factory_set_clock")]
345 #[doc(alias = "clock")]
346 fn set_clock(&self, clock: Option<&impl IsA<gst::Clock>>) {
347 unsafe {
348 ffi::gst_rtsp_media_factory_set_clock(
349 self.as_ref().to_glib_none().0,
350 clock.map(|p| p.as_ref()).to_glib_none().0,
351 );
352 }
353 }
354
355 #[cfg(feature = "v1_16")]
356 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
357 #[doc(alias = "gst_rtsp_media_factory_set_do_retransmission")]
358 fn set_do_retransmission(&self, do_retransmission: bool) {
359 unsafe {
360 ffi::gst_rtsp_media_factory_set_do_retransmission(
361 self.as_ref().to_glib_none().0,
362 do_retransmission.into_glib(),
363 );
364 }
365 }
366
367 #[cfg(feature = "v1_18")]
368 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
369 #[doc(alias = "gst_rtsp_media_factory_set_dscp_qos")]
370 #[doc(alias = "dscp-qos")]
371 fn set_dscp_qos(&self, dscp_qos: i32) {
372 unsafe {
373 ffi::gst_rtsp_media_factory_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
374 }
375 }
376
377 #[cfg(feature = "v1_20")]
378 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
379 #[doc(alias = "gst_rtsp_media_factory_set_enable_rtcp")]
380 #[doc(alias = "enable-rtcp")]
381 fn set_enable_rtcp(&self, enable: bool) {
382 unsafe {
383 ffi::gst_rtsp_media_factory_set_enable_rtcp(
384 self.as_ref().to_glib_none().0,
385 enable.into_glib(),
386 );
387 }
388 }
389
390 #[cfg(feature = "v1_24")]
391 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
392 #[doc(alias = "gst_rtsp_media_factory_set_ensure_keyunit_on_start")]
393 #[doc(alias = "ensure-keyunit-on-start")]
394 fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) {
395 unsafe {
396 ffi::gst_rtsp_media_factory_set_ensure_keyunit_on_start(
397 self.as_ref().to_glib_none().0,
398 ensure_keyunit_on_start.into_glib(),
399 );
400 }
401 }
402
403 #[cfg(feature = "v1_24")]
404 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
405 #[doc(alias = "gst_rtsp_media_factory_set_ensure_keyunit_on_start_timeout")]
406 #[doc(alias = "ensure-keyunit-on-start-timeout")]
407 fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) {
408 unsafe {
409 ffi::gst_rtsp_media_factory_set_ensure_keyunit_on_start_timeout(
410 self.as_ref().to_glib_none().0,
411 timeout,
412 );
413 }
414 }
415
416 #[doc(alias = "gst_rtsp_media_factory_set_eos_shutdown")]
417 #[doc(alias = "eos-shutdown")]
418 fn set_eos_shutdown(&self, eos_shutdown: bool) {
419 unsafe {
420 ffi::gst_rtsp_media_factory_set_eos_shutdown(
421 self.as_ref().to_glib_none().0,
422 eos_shutdown.into_glib(),
423 );
424 }
425 }
426
427 #[doc(alias = "gst_rtsp_media_factory_set_latency")]
428 #[doc(alias = "latency")]
429 fn set_latency(&self, latency: u32) {
430 unsafe {
431 ffi::gst_rtsp_media_factory_set_latency(self.as_ref().to_glib_none().0, latency);
432 }
433 }
434
435 #[doc(alias = "gst_rtsp_media_factory_set_launch")]
436 #[doc(alias = "launch")]
437 fn set_launch(&self, launch: &str) {
438 unsafe {
439 ffi::gst_rtsp_media_factory_set_launch(
440 self.as_ref().to_glib_none().0,
441 launch.to_glib_none().0,
442 );
443 }
444 }
445
446 #[cfg(feature = "v1_16")]
447 #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
448 #[doc(alias = "gst_rtsp_media_factory_set_max_mcast_ttl")]
449 #[doc(alias = "max-mcast-ttl")]
450 fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
451 unsafe {
452 from_glib(ffi::gst_rtsp_media_factory_set_max_mcast_ttl(
453 self.as_ref().to_glib_none().0,
454 ttl,
455 ))
456 }
457 }
458
459 #[doc(alias = "gst_rtsp_media_factory_set_media_gtype")]
460 fn set_media_gtype(&self, media_gtype: glib::types::Type) {
461 unsafe {
462 ffi::gst_rtsp_media_factory_set_media_gtype(
463 self.as_ref().to_glib_none().0,
464 media_gtype.into_glib(),
465 );
466 }
467 }
468
469 #[doc(alias = "gst_rtsp_media_factory_set_multicast_iface")]
470 fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
471 unsafe {
472 ffi::gst_rtsp_media_factory_set_multicast_iface(
473 self.as_ref().to_glib_none().0,
474 multicast_iface.to_glib_none().0,
475 );
476 }
477 }
478
479 #[doc(alias = "gst_rtsp_media_factory_set_profiles")]
485 #[doc(alias = "profiles")]
486 fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
487 unsafe {
488 ffi::gst_rtsp_media_factory_set_profiles(
489 self.as_ref().to_glib_none().0,
490 profiles.into_glib(),
491 );
492 }
493 }
494
495 #[doc(alias = "gst_rtsp_media_factory_set_protocols")]
496 #[doc(alias = "protocols")]
497 fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
498 unsafe {
499 ffi::gst_rtsp_media_factory_set_protocols(
500 self.as_ref().to_glib_none().0,
501 protocols.into_glib(),
502 );
503 }
504 }
505
506 #[doc(alias = "gst_rtsp_media_factory_set_publish_clock_mode")]
507 fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
508 unsafe {
509 ffi::gst_rtsp_media_factory_set_publish_clock_mode(
510 self.as_ref().to_glib_none().0,
511 mode.into_glib(),
512 );
513 }
514 }
515
516 #[doc(alias = "gst_rtsp_media_factory_set_retransmission_time")]
517 fn set_retransmission_time(&self, time: impl Into<Option<gst::ClockTime>>) {
518 unsafe {
519 ffi::gst_rtsp_media_factory_set_retransmission_time(
520 self.as_ref().to_glib_none().0,
521 time.into().into_glib(),
522 );
523 }
524 }
525
526 #[doc(alias = "gst_rtsp_media_factory_set_shared")]
527 #[doc(alias = "shared")]
528 fn set_shared(&self, shared: bool) {
529 unsafe {
530 ffi::gst_rtsp_media_factory_set_shared(
531 self.as_ref().to_glib_none().0,
532 shared.into_glib(),
533 );
534 }
535 }
536
537 #[doc(alias = "gst_rtsp_media_factory_set_stop_on_disconnect")]
538 #[doc(alias = "stop-on-disconnect")]
539 fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
540 unsafe {
541 ffi::gst_rtsp_media_factory_set_stop_on_disconnect(
542 self.as_ref().to_glib_none().0,
543 stop_on_disconnect.into_glib(),
544 );
545 }
546 }
547
548 #[doc(alias = "gst_rtsp_media_factory_set_suspend_mode")]
549 #[doc(alias = "suspend-mode")]
550 fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
551 unsafe {
552 ffi::gst_rtsp_media_factory_set_suspend_mode(
553 self.as_ref().to_glib_none().0,
554 mode.into_glib(),
555 );
556 }
557 }
558
559 #[doc(alias = "gst_rtsp_media_factory_set_transport_mode")]
560 #[doc(alias = "transport-mode")]
561 fn set_transport_mode(&self, mode: RTSPTransportMode) {
562 unsafe {
563 ffi::gst_rtsp_media_factory_set_transport_mode(
564 self.as_ref().to_glib_none().0,
565 mode.into_glib(),
566 );
567 }
568 }
569
570 #[cfg(not(feature = "v1_16"))]
571 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
572 #[doc(alias = "bind-mcast-address")]
573 fn is_bind_mcast_address(&self) -> bool {
574 ObjectExt::property(self.as_ref(), "bind-mcast-address")
575 }
576
577 #[cfg(not(feature = "v1_16"))]
578 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
579 #[doc(alias = "bind-mcast-address")]
580 fn set_bind_mcast_address(&self, bind_mcast_address: bool) {
581 ObjectExt::set_property(self.as_ref(), "bind-mcast-address", bind_mcast_address)
582 }
583
584 #[cfg(not(feature = "v1_18"))]
585 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
586 #[doc(alias = "dscp-qos")]
587 fn dscp_qos(&self) -> i32 {
588 ObjectExt::property(self.as_ref(), "dscp-qos")
589 }
590
591 #[cfg(not(feature = "v1_18"))]
592 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
593 #[doc(alias = "dscp-qos")]
594 fn set_dscp_qos(&self, dscp_qos: i32) {
595 ObjectExt::set_property(self.as_ref(), "dscp-qos", dscp_qos)
596 }
597
598 #[cfg(not(feature = "v1_16"))]
599 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
600 #[doc(alias = "max-mcast-ttl")]
601 fn max_mcast_ttl(&self) -> u32 {
602 ObjectExt::property(self.as_ref(), "max-mcast-ttl")
603 }
604
605 #[cfg(not(feature = "v1_16"))]
606 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
607 #[doc(alias = "max-mcast-ttl")]
608 fn set_max_mcast_ttl(&self, max_mcast_ttl: u32) {
609 ObjectExt::set_property(self.as_ref(), "max-mcast-ttl", max_mcast_ttl)
610 }
611
612 #[doc(alias = "stop-on-disconnect")]
613 fn is_stop_on_disconnect(&self) -> bool {
614 ObjectExt::property(self.as_ref(), "stop-on-disconnect")
615 }
616
617 #[doc(alias = "media-configure")]
618 fn connect_media_configure<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(
619 &self,
620 f: F,
621 ) -> SignalHandlerId {
622 unsafe extern "C" fn media_configure_trampoline<
623 P: IsA<RTSPMediaFactory>,
624 F: Fn(&P, &RTSPMedia) + Send + Sync + 'static,
625 >(
626 this: *mut ffi::GstRTSPMediaFactory,
627 object: *mut ffi::GstRTSPMedia,
628 f: glib::ffi::gpointer,
629 ) {
630 let f: &F = &*(f as *const F);
631 f(
632 RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref(),
633 &from_glib_borrow(object),
634 )
635 }
636 unsafe {
637 let f: Box_<F> = Box_::new(f);
638 connect_raw(
639 self.as_ptr() as *mut _,
640 c"media-configure".as_ptr() as *const _,
641 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
642 media_configure_trampoline::<Self, F> as *const (),
643 )),
644 Box_::into_raw(f),
645 )
646 }
647 }
648
649 #[doc(alias = "media-constructed")]
650 fn connect_media_constructed<F: Fn(&Self, &RTSPMedia) + Send + Sync + 'static>(
651 &self,
652 f: F,
653 ) -> SignalHandlerId {
654 unsafe extern "C" fn media_constructed_trampoline<
655 P: IsA<RTSPMediaFactory>,
656 F: Fn(&P, &RTSPMedia) + Send + Sync + 'static,
657 >(
658 this: *mut ffi::GstRTSPMediaFactory,
659 object: *mut ffi::GstRTSPMedia,
660 f: glib::ffi::gpointer,
661 ) {
662 let f: &F = &*(f as *const F);
663 f(
664 RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref(),
665 &from_glib_borrow(object),
666 )
667 }
668 unsafe {
669 let f: Box_<F> = Box_::new(f);
670 connect_raw(
671 self.as_ptr() as *mut _,
672 c"media-constructed".as_ptr() as *const _,
673 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
674 media_constructed_trampoline::<Self, F> as *const (),
675 )),
676 Box_::into_raw(f),
677 )
678 }
679 }
680
681 #[doc(alias = "bind-mcast-address")]
682 fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
683 &self,
684 f: F,
685 ) -> SignalHandlerId {
686 unsafe extern "C" fn notify_bind_mcast_address_trampoline<
687 P: IsA<RTSPMediaFactory>,
688 F: Fn(&P) + Send + Sync + 'static,
689 >(
690 this: *mut ffi::GstRTSPMediaFactory,
691 _param_spec: glib::ffi::gpointer,
692 f: glib::ffi::gpointer,
693 ) {
694 let f: &F = &*(f as *const F);
695 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
696 }
697 unsafe {
698 let f: Box_<F> = Box_::new(f);
699 connect_raw(
700 self.as_ptr() as *mut _,
701 c"notify::bind-mcast-address".as_ptr() as *const _,
702 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
703 notify_bind_mcast_address_trampoline::<Self, F> as *const (),
704 )),
705 Box_::into_raw(f),
706 )
707 }
708 }
709
710 #[doc(alias = "buffer-size")]
711 fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
712 &self,
713 f: F,
714 ) -> SignalHandlerId {
715 unsafe extern "C" fn notify_buffer_size_trampoline<
716 P: IsA<RTSPMediaFactory>,
717 F: Fn(&P) + Send + Sync + 'static,
718 >(
719 this: *mut ffi::GstRTSPMediaFactory,
720 _param_spec: glib::ffi::gpointer,
721 f: glib::ffi::gpointer,
722 ) {
723 let f: &F = &*(f as *const F);
724 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
725 }
726 unsafe {
727 let f: Box_<F> = Box_::new(f);
728 connect_raw(
729 self.as_ptr() as *mut _,
730 c"notify::buffer-size".as_ptr() as *const _,
731 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
732 notify_buffer_size_trampoline::<Self, F> as *const (),
733 )),
734 Box_::into_raw(f),
735 )
736 }
737 }
738
739 #[doc(alias = "clock")]
740 fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
741 unsafe extern "C" fn notify_clock_trampoline<
742 P: IsA<RTSPMediaFactory>,
743 F: Fn(&P) + Send + Sync + 'static,
744 >(
745 this: *mut ffi::GstRTSPMediaFactory,
746 _param_spec: glib::ffi::gpointer,
747 f: glib::ffi::gpointer,
748 ) {
749 let f: &F = &*(f as *const F);
750 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
751 }
752 unsafe {
753 let f: Box_<F> = Box_::new(f);
754 connect_raw(
755 self.as_ptr() as *mut _,
756 c"notify::clock".as_ptr() as *const _,
757 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
758 notify_clock_trampoline::<Self, F> as *const (),
759 )),
760 Box_::into_raw(f),
761 )
762 }
763 }
764
765 #[doc(alias = "dscp-qos")]
766 fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
767 &self,
768 f: F,
769 ) -> SignalHandlerId {
770 unsafe extern "C" fn notify_dscp_qos_trampoline<
771 P: IsA<RTSPMediaFactory>,
772 F: Fn(&P) + Send + Sync + 'static,
773 >(
774 this: *mut ffi::GstRTSPMediaFactory,
775 _param_spec: glib::ffi::gpointer,
776 f: glib::ffi::gpointer,
777 ) {
778 let f: &F = &*(f as *const F);
779 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
780 }
781 unsafe {
782 let f: Box_<F> = Box_::new(f);
783 connect_raw(
784 self.as_ptr() as *mut _,
785 c"notify::dscp-qos".as_ptr() as *const _,
786 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
787 notify_dscp_qos_trampoline::<Self, F> as *const (),
788 )),
789 Box_::into_raw(f),
790 )
791 }
792 }
793
794 #[cfg(feature = "v1_20")]
795 #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
796 #[doc(alias = "enable-rtcp")]
797 fn connect_enable_rtcp_notify<F: Fn(&Self) + Send + Sync + 'static>(
798 &self,
799 f: F,
800 ) -> SignalHandlerId {
801 unsafe extern "C" fn notify_enable_rtcp_trampoline<
802 P: IsA<RTSPMediaFactory>,
803 F: Fn(&P) + Send + Sync + 'static,
804 >(
805 this: *mut ffi::GstRTSPMediaFactory,
806 _param_spec: glib::ffi::gpointer,
807 f: glib::ffi::gpointer,
808 ) {
809 let f: &F = &*(f as *const F);
810 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
811 }
812 unsafe {
813 let f: Box_<F> = Box_::new(f);
814 connect_raw(
815 self.as_ptr() as *mut _,
816 c"notify::enable-rtcp".as_ptr() as *const _,
817 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
818 notify_enable_rtcp_trampoline::<Self, F> as *const (),
819 )),
820 Box_::into_raw(f),
821 )
822 }
823 }
824
825 #[cfg(feature = "v1_24")]
826 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
827 #[doc(alias = "ensure-keyunit-on-start")]
828 fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
829 &self,
830 f: F,
831 ) -> SignalHandlerId {
832 unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
833 P: IsA<RTSPMediaFactory>,
834 F: Fn(&P) + Send + Sync + 'static,
835 >(
836 this: *mut ffi::GstRTSPMediaFactory,
837 _param_spec: glib::ffi::gpointer,
838 f: glib::ffi::gpointer,
839 ) {
840 let f: &F = &*(f as *const F);
841 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
842 }
843 unsafe {
844 let f: Box_<F> = Box_::new(f);
845 connect_raw(
846 self.as_ptr() as *mut _,
847 c"notify::ensure-keyunit-on-start".as_ptr() as *const _,
848 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
849 notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
850 )),
851 Box_::into_raw(f),
852 )
853 }
854 }
855
856 #[cfg(feature = "v1_24")]
857 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
858 #[doc(alias = "ensure-keyunit-on-start-timeout")]
859 fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
860 &self,
861 f: F,
862 ) -> SignalHandlerId {
863 unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
864 P: IsA<RTSPMediaFactory>,
865 F: Fn(&P) + Send + Sync + 'static,
866 >(
867 this: *mut ffi::GstRTSPMediaFactory,
868 _param_spec: glib::ffi::gpointer,
869 f: glib::ffi::gpointer,
870 ) {
871 let f: &F = &*(f as *const F);
872 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
873 }
874 unsafe {
875 let f: Box_<F> = Box_::new(f);
876 connect_raw(
877 self.as_ptr() as *mut _,
878 c"notify::ensure-keyunit-on-start-timeout".as_ptr() as *const _,
879 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
880 notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
881 )),
882 Box_::into_raw(f),
883 )
884 }
885 }
886
887 #[doc(alias = "eos-shutdown")]
888 fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
889 &self,
890 f: F,
891 ) -> SignalHandlerId {
892 unsafe extern "C" fn notify_eos_shutdown_trampoline<
893 P: IsA<RTSPMediaFactory>,
894 F: Fn(&P) + Send + Sync + 'static,
895 >(
896 this: *mut ffi::GstRTSPMediaFactory,
897 _param_spec: glib::ffi::gpointer,
898 f: glib::ffi::gpointer,
899 ) {
900 let f: &F = &*(f as *const F);
901 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
902 }
903 unsafe {
904 let f: Box_<F> = Box_::new(f);
905 connect_raw(
906 self.as_ptr() as *mut _,
907 c"notify::eos-shutdown".as_ptr() as *const _,
908 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
909 notify_eos_shutdown_trampoline::<Self, F> as *const (),
910 )),
911 Box_::into_raw(f),
912 )
913 }
914 }
915
916 #[doc(alias = "latency")]
917 fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
918 &self,
919 f: F,
920 ) -> SignalHandlerId {
921 unsafe extern "C" fn notify_latency_trampoline<
922 P: IsA<RTSPMediaFactory>,
923 F: Fn(&P) + Send + Sync + 'static,
924 >(
925 this: *mut ffi::GstRTSPMediaFactory,
926 _param_spec: glib::ffi::gpointer,
927 f: glib::ffi::gpointer,
928 ) {
929 let f: &F = &*(f as *const F);
930 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
931 }
932 unsafe {
933 let f: Box_<F> = Box_::new(f);
934 connect_raw(
935 self.as_ptr() as *mut _,
936 c"notify::latency".as_ptr() as *const _,
937 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
938 notify_latency_trampoline::<Self, F> as *const (),
939 )),
940 Box_::into_raw(f),
941 )
942 }
943 }
944
945 #[doc(alias = "launch")]
946 fn connect_launch_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
947 unsafe extern "C" fn notify_launch_trampoline<
948 P: IsA<RTSPMediaFactory>,
949 F: Fn(&P) + Send + Sync + 'static,
950 >(
951 this: *mut ffi::GstRTSPMediaFactory,
952 _param_spec: glib::ffi::gpointer,
953 f: glib::ffi::gpointer,
954 ) {
955 let f: &F = &*(f as *const F);
956 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
957 }
958 unsafe {
959 let f: Box_<F> = Box_::new(f);
960 connect_raw(
961 self.as_ptr() as *mut _,
962 c"notify::launch".as_ptr() as *const _,
963 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
964 notify_launch_trampoline::<Self, F> as *const (),
965 )),
966 Box_::into_raw(f),
967 )
968 }
969 }
970
971 #[doc(alias = "max-mcast-ttl")]
972 fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
973 &self,
974 f: F,
975 ) -> SignalHandlerId {
976 unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
977 P: IsA<RTSPMediaFactory>,
978 F: Fn(&P) + Send + Sync + 'static,
979 >(
980 this: *mut ffi::GstRTSPMediaFactory,
981 _param_spec: glib::ffi::gpointer,
982 f: glib::ffi::gpointer,
983 ) {
984 let f: &F = &*(f as *const F);
985 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
986 }
987 unsafe {
988 let f: Box_<F> = Box_::new(f);
989 connect_raw(
990 self.as_ptr() as *mut _,
991 c"notify::max-mcast-ttl".as_ptr() as *const _,
992 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
993 notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
994 )),
995 Box_::into_raw(f),
996 )
997 }
998 }
999
1000 #[doc(alias = "profiles")]
1001 fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1002 &self,
1003 f: F,
1004 ) -> SignalHandlerId {
1005 unsafe extern "C" fn notify_profiles_trampoline<
1006 P: IsA<RTSPMediaFactory>,
1007 F: Fn(&P) + Send + Sync + 'static,
1008 >(
1009 this: *mut ffi::GstRTSPMediaFactory,
1010 _param_spec: glib::ffi::gpointer,
1011 f: glib::ffi::gpointer,
1012 ) {
1013 let f: &F = &*(f as *const F);
1014 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1015 }
1016 unsafe {
1017 let f: Box_<F> = Box_::new(f);
1018 connect_raw(
1019 self.as_ptr() as *mut _,
1020 c"notify::profiles".as_ptr() as *const _,
1021 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1022 notify_profiles_trampoline::<Self, F> as *const (),
1023 )),
1024 Box_::into_raw(f),
1025 )
1026 }
1027 }
1028
1029 #[doc(alias = "protocols")]
1030 fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1031 &self,
1032 f: F,
1033 ) -> SignalHandlerId {
1034 unsafe extern "C" fn notify_protocols_trampoline<
1035 P: IsA<RTSPMediaFactory>,
1036 F: Fn(&P) + Send + Sync + 'static,
1037 >(
1038 this: *mut ffi::GstRTSPMediaFactory,
1039 _param_spec: glib::ffi::gpointer,
1040 f: glib::ffi::gpointer,
1041 ) {
1042 let f: &F = &*(f as *const F);
1043 f(RTSPMediaFactory::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"notify::protocols".as_ptr() as *const _,
1050 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1051 notify_protocols_trampoline::<Self, F> as *const (),
1052 )),
1053 Box_::into_raw(f),
1054 )
1055 }
1056 }
1057
1058 #[doc(alias = "shared")]
1059 fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1060 unsafe extern "C" fn notify_shared_trampoline<
1061 P: IsA<RTSPMediaFactory>,
1062 F: Fn(&P) + Send + Sync + 'static,
1063 >(
1064 this: *mut ffi::GstRTSPMediaFactory,
1065 _param_spec: glib::ffi::gpointer,
1066 f: glib::ffi::gpointer,
1067 ) {
1068 let f: &F = &*(f as *const F);
1069 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1070 }
1071 unsafe {
1072 let f: Box_<F> = Box_::new(f);
1073 connect_raw(
1074 self.as_ptr() as *mut _,
1075 c"notify::shared".as_ptr() as *const _,
1076 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1077 notify_shared_trampoline::<Self, F> as *const (),
1078 )),
1079 Box_::into_raw(f),
1080 )
1081 }
1082 }
1083
1084 #[doc(alias = "stop-on-disconnect")]
1085 fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1086 &self,
1087 f: F,
1088 ) -> SignalHandlerId {
1089 unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1090 P: IsA<RTSPMediaFactory>,
1091 F: Fn(&P) + Send + Sync + 'static,
1092 >(
1093 this: *mut ffi::GstRTSPMediaFactory,
1094 _param_spec: glib::ffi::gpointer,
1095 f: glib::ffi::gpointer,
1096 ) {
1097 let f: &F = &*(f as *const F);
1098 f(RTSPMediaFactory::from_glib_borrow(this).unsafe_cast_ref())
1099 }
1100 unsafe {
1101 let f: Box_<F> = Box_::new(f);
1102 connect_raw(
1103 self.as_ptr() as *mut _,
1104 c"notify::stop-on-disconnect".as_ptr() as *const _,
1105 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1106 notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1107 )),
1108 Box_::into_raw(f),
1109 )
1110 }
1111 }
1112
1113 #[doc(alias = "suspend-mode")]
1114 fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1115 &self,
1116 f: F,
1117 ) -> SignalHandlerId {
1118 unsafe extern "C" fn notify_suspend_mode_trampoline<
1119 P: IsA<RTSPMediaFactory>,
1120 F: Fn(&P) + Send + Sync + 'static,
1121 >(
1122 this: *mut ffi::GstRTSPMediaFactory,
1123 _param_spec: glib::ffi::gpointer,
1124 f: glib::ffi::gpointer,
1125 ) {
1126 let f: &F = &*(f as *const F);
1127 f(RTSPMediaFactory::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::suspend-mode".as_ptr() as *const _,
1134 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1135 notify_suspend_mode_trampoline::<Self, F> as *const (),
1136 )),
1137 Box_::into_raw(f),
1138 )
1139 }
1140 }
1141
1142 #[doc(alias = "transport-mode")]
1143 fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
1144 &self,
1145 f: F,
1146 ) -> SignalHandlerId {
1147 unsafe extern "C" fn notify_transport_mode_trampoline<
1148 P: IsA<RTSPMediaFactory>,
1149 F: Fn(&P) + Send + Sync + 'static,
1150 >(
1151 this: *mut ffi::GstRTSPMediaFactory,
1152 _param_spec: glib::ffi::gpointer,
1153 f: glib::ffi::gpointer,
1154 ) {
1155 let f: &F = &*(f as *const F);
1156 f(RTSPMediaFactory::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::transport-mode".as_ptr() as *const _,
1163 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1164 notify_transport_mode_trampoline::<Self, F> as *const (),
1165 )),
1166 Box_::into_raw(f),
1167 )
1168 }
1169 }
1170}
1171
1172impl<O: IsA<RTSPMediaFactory>> RTSPMediaFactoryExt for O {}