1#![allow(deprecated)]
6
7use crate::{
8 ffi, PlayAudioInfo, PlayColorBalanceType, PlayMediaInfo, PlaySubtitleInfo, PlayVideoInfo,
9 PlayVideoRenderer, PlayVisualization,
10};
11use glib::{
12 prelude::*,
13 signal::{connect_raw, SignalHandlerId},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 #[doc(alias = "GstPlay")]
20 pub struct Play(Object<ffi::GstPlay, ffi::GstPlayClass>) @extends gst::Object;
21
22 match fn {
23 type_ => || ffi::gst_play_get_type(),
24 }
25}
26
27impl Play {
28 #[doc(alias = "gst_play_new")]
29 pub fn new(video_renderer: Option<impl IsA<PlayVideoRenderer>>) -> Play {
30 assert_initialized_main_thread!();
31 unsafe {
32 from_glib_full(ffi::gst_play_new(
33 video_renderer.map(|p| p.upcast()).into_glib_ptr(),
34 ))
35 }
36 }
37
38 #[doc(alias = "gst_play_get_audio_video_offset")]
39 #[doc(alias = "get_audio_video_offset")]
40 #[doc(alias = "audio-video-offset")]
41 pub fn audio_video_offset(&self) -> i64 {
42 unsafe { ffi::gst_play_get_audio_video_offset(self.to_glib_none().0) }
43 }
44
45 #[doc(alias = "gst_play_get_color_balance")]
46 #[doc(alias = "get_color_balance")]
47 pub fn color_balance(&self, type_: PlayColorBalanceType) -> f64 {
48 unsafe { ffi::gst_play_get_color_balance(self.to_glib_none().0, type_.into_glib()) }
49 }
50
51 #[doc(alias = "gst_play_get_current_audio_track")]
52 #[doc(alias = "get_current_audio_track")]
53 #[doc(alias = "current-audio-track")]
54 pub fn current_audio_track(&self) -> Option<PlayAudioInfo> {
55 unsafe { from_glib_full(ffi::gst_play_get_current_audio_track(self.to_glib_none().0)) }
56 }
57
58 #[doc(alias = "gst_play_get_current_subtitle_track")]
59 #[doc(alias = "get_current_subtitle_track")]
60 #[doc(alias = "current-subtitle-track")]
61 pub fn current_subtitle_track(&self) -> Option<PlaySubtitleInfo> {
62 unsafe {
63 from_glib_full(ffi::gst_play_get_current_subtitle_track(
64 self.to_glib_none().0,
65 ))
66 }
67 }
68
69 #[doc(alias = "gst_play_get_current_video_track")]
70 #[doc(alias = "get_current_video_track")]
71 #[doc(alias = "current-video-track")]
72 pub fn current_video_track(&self) -> Option<PlayVideoInfo> {
73 unsafe { from_glib_full(ffi::gst_play_get_current_video_track(self.to_glib_none().0)) }
74 }
75
76 #[doc(alias = "gst_play_get_current_visualization")]
77 #[doc(alias = "get_current_visualization")]
78 pub fn current_visualization(&self) -> Option<glib::GString> {
79 unsafe {
80 from_glib_full(ffi::gst_play_get_current_visualization(
81 self.to_glib_none().0,
82 ))
83 }
84 }
85
86 #[doc(alias = "gst_play_get_duration")]
87 #[doc(alias = "get_duration")]
88 pub fn duration(&self) -> Option<gst::ClockTime> {
89 unsafe { from_glib(ffi::gst_play_get_duration(self.to_glib_none().0)) }
90 }
91
92 #[doc(alias = "gst_play_get_media_info")]
93 #[doc(alias = "get_media_info")]
94 #[doc(alias = "media-info")]
95 pub fn media_info(&self) -> Option<PlayMediaInfo> {
96 unsafe { from_glib_full(ffi::gst_play_get_media_info(self.to_glib_none().0)) }
97 }
98
99 #[doc(alias = "gst_play_get_message_bus")]
100 #[doc(alias = "get_message_bus")]
101 pub fn message_bus(&self) -> gst::Bus {
102 unsafe { from_glib_full(ffi::gst_play_get_message_bus(self.to_glib_none().0)) }
103 }
104
105 #[doc(alias = "gst_play_get_multiview_flags")]
106 #[doc(alias = "get_multiview_flags")]
107 pub fn multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
108 unsafe { from_glib(ffi::gst_play_get_multiview_flags(self.to_glib_none().0)) }
109 }
110
111 #[doc(alias = "gst_play_get_multiview_mode")]
112 #[doc(alias = "get_multiview_mode")]
113 pub fn multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
114 unsafe { from_glib(ffi::gst_play_get_multiview_mode(self.to_glib_none().0)) }
115 }
116
117 #[doc(alias = "gst_play_get_mute")]
118 #[doc(alias = "get_mute")]
119 #[doc(alias = "mute")]
120 pub fn is_muted(&self) -> bool {
121 unsafe { from_glib(ffi::gst_play_get_mute(self.to_glib_none().0)) }
122 }
123
124 #[doc(alias = "gst_play_get_pipeline")]
125 #[doc(alias = "get_pipeline")]
126 pub fn pipeline(&self) -> gst::Element {
127 unsafe { from_glib_full(ffi::gst_play_get_pipeline(self.to_glib_none().0)) }
128 }
129
130 #[doc(alias = "gst_play_get_position")]
131 #[doc(alias = "get_position")]
132 pub fn position(&self) -> Option<gst::ClockTime> {
133 unsafe { from_glib(ffi::gst_play_get_position(self.to_glib_none().0)) }
134 }
135
136 #[doc(alias = "gst_play_get_rate")]
137 #[doc(alias = "get_rate")]
138 pub fn rate(&self) -> f64 {
139 unsafe { ffi::gst_play_get_rate(self.to_glib_none().0) }
140 }
141
142 #[doc(alias = "gst_play_get_subtitle_uri")]
143 #[doc(alias = "get_subtitle_uri")]
144 pub fn subtitle_uri(&self) -> Option<glib::GString> {
145 unsafe { from_glib_full(ffi::gst_play_get_subtitle_uri(self.to_glib_none().0)) }
146 }
147
148 #[doc(alias = "gst_play_get_subtitle_video_offset")]
149 #[doc(alias = "get_subtitle_video_offset")]
150 #[doc(alias = "subtitle-video-offset")]
151 pub fn subtitle_video_offset(&self) -> i64 {
152 unsafe { ffi::gst_play_get_subtitle_video_offset(self.to_glib_none().0) }
153 }
154
155 #[doc(alias = "gst_play_get_uri")]
156 #[doc(alias = "get_uri")]
157 pub fn uri(&self) -> Option<glib::GString> {
158 unsafe { from_glib_full(ffi::gst_play_get_uri(self.to_glib_none().0)) }
159 }
160
161 #[doc(alias = "gst_play_get_volume")]
162 #[doc(alias = "get_volume")]
163 pub fn volume(&self) -> f64 {
164 unsafe { ffi::gst_play_get_volume(self.to_glib_none().0) }
165 }
166
167 #[doc(alias = "gst_play_has_color_balance")]
168 pub fn has_color_balance(&self) -> bool {
169 unsafe { from_glib(ffi::gst_play_has_color_balance(self.to_glib_none().0)) }
170 }
171
172 #[doc(alias = "gst_play_pause")]
173 pub fn pause(&self) {
174 unsafe {
175 ffi::gst_play_pause(self.to_glib_none().0);
176 }
177 }
178
179 #[doc(alias = "gst_play_play")]
180 pub fn play(&self) {
181 unsafe {
182 ffi::gst_play_play(self.to_glib_none().0);
183 }
184 }
185
186 #[doc(alias = "gst_play_seek")]
187 pub fn seek(&self, position: gst::ClockTime) {
188 unsafe {
189 ffi::gst_play_seek(self.to_glib_none().0, position.into_glib());
190 }
191 }
192
193 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
194 #[allow(deprecated)]
195 #[doc(alias = "gst_play_set_audio_track")]
196 pub fn set_audio_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
197 unsafe {
198 glib::result_from_gboolean!(
199 ffi::gst_play_set_audio_track(self.to_glib_none().0, stream_index),
200 "Failed to set audio track"
201 )
202 }
203 }
204
205 #[doc(alias = "gst_play_set_audio_track_enabled")]
206 pub fn set_audio_track_enabled(&self, enabled: bool) {
207 unsafe {
208 ffi::gst_play_set_audio_track_enabled(self.to_glib_none().0, enabled.into_glib());
209 }
210 }
211
212 #[cfg(feature = "v1_26")]
213 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
214 #[doc(alias = "gst_play_set_audio_track_id")]
215 pub fn set_audio_track_id(
216 &self,
217 stream_id: Option<&str>,
218 ) -> Result<(), glib::error::BoolError> {
219 unsafe {
220 glib::result_from_gboolean!(
221 ffi::gst_play_set_audio_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
222 "Failed to set audio track"
223 )
224 }
225 }
226
227 #[doc(alias = "gst_play_set_audio_video_offset")]
228 #[doc(alias = "audio-video-offset")]
229 pub fn set_audio_video_offset(&self, offset: i64) {
230 unsafe {
231 ffi::gst_play_set_audio_video_offset(self.to_glib_none().0, offset);
232 }
233 }
234
235 #[doc(alias = "gst_play_set_color_balance")]
236 pub fn set_color_balance(&self, type_: PlayColorBalanceType, value: f64) {
237 unsafe {
238 ffi::gst_play_set_color_balance(self.to_glib_none().0, type_.into_glib(), value);
239 }
240 }
241
242 #[doc(alias = "gst_play_set_multiview_flags")]
243 pub fn set_multiview_flags(&self, flags: gst_video::VideoMultiviewFlags) {
244 unsafe {
245 ffi::gst_play_set_multiview_flags(self.to_glib_none().0, flags.into_glib());
246 }
247 }
248
249 #[doc(alias = "gst_play_set_multiview_mode")]
250 pub fn set_multiview_mode(&self, mode: gst_video::VideoMultiviewFramePacking) {
251 unsafe {
252 ffi::gst_play_set_multiview_mode(self.to_glib_none().0, mode.into_glib());
253 }
254 }
255
256 #[doc(alias = "gst_play_set_mute")]
257 #[doc(alias = "mute")]
258 pub fn set_mute(&self, val: bool) {
259 unsafe {
260 ffi::gst_play_set_mute(self.to_glib_none().0, val.into_glib());
261 }
262 }
263
264 #[doc(alias = "gst_play_set_rate")]
265 #[doc(alias = "rate")]
266 pub fn set_rate(&self, rate: f64) {
267 unsafe {
268 ffi::gst_play_set_rate(self.to_glib_none().0, rate);
269 }
270 }
271
272 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
273 #[allow(deprecated)]
274 #[doc(alias = "gst_play_set_subtitle_track")]
275 pub fn set_subtitle_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
276 unsafe {
277 glib::result_from_gboolean!(
278 ffi::gst_play_set_subtitle_track(self.to_glib_none().0, stream_index),
279 "Failed to set subtitle track"
280 )
281 }
282 }
283
284 #[doc(alias = "gst_play_set_subtitle_track_enabled")]
285 pub fn set_subtitle_track_enabled(&self, enabled: bool) {
286 unsafe {
287 ffi::gst_play_set_subtitle_track_enabled(self.to_glib_none().0, enabled.into_glib());
288 }
289 }
290
291 #[cfg(feature = "v1_26")]
292 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
293 #[doc(alias = "gst_play_set_subtitle_track_id")]
294 pub fn set_subtitle_track_id(
295 &self,
296 stream_id: Option<&str>,
297 ) -> Result<(), glib::error::BoolError> {
298 unsafe {
299 glib::result_from_gboolean!(
300 ffi::gst_play_set_subtitle_track_id(
301 self.to_glib_none().0,
302 stream_id.to_glib_none().0
303 ),
304 "Failed to set subtitle track"
305 )
306 }
307 }
308
309 #[doc(alias = "gst_play_set_subtitle_uri")]
310 pub fn set_subtitle_uri(&self, uri: Option<&str>) {
311 unsafe {
312 ffi::gst_play_set_subtitle_uri(self.to_glib_none().0, uri.to_glib_none().0);
313 }
314 }
315
316 #[doc(alias = "gst_play_set_subtitle_video_offset")]
317 #[doc(alias = "subtitle-video-offset")]
318 pub fn set_subtitle_video_offset(&self, offset: i64) {
319 unsafe {
320 ffi::gst_play_set_subtitle_video_offset(self.to_glib_none().0, offset);
321 }
322 }
323
324 #[cfg(feature = "v1_26")]
325 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
326 #[doc(alias = "gst_play_set_track_ids")]
327 pub fn set_track_ids(
328 &self,
329 audio_stream_id: Option<&str>,
330 video_stream_id: Option<&str>,
331 subtitle_stream_id: Option<&str>,
332 ) -> Result<(), glib::error::BoolError> {
333 unsafe {
334 glib::result_from_gboolean!(
335 ffi::gst_play_set_track_ids(
336 self.to_glib_none().0,
337 audio_stream_id.to_glib_none().0,
338 video_stream_id.to_glib_none().0,
339 subtitle_stream_id.to_glib_none().0
340 ),
341 "Failed to set tracks"
342 )
343 }
344 }
345
346 #[doc(alias = "gst_play_set_uri")]
347 #[doc(alias = "uri")]
348 pub fn set_uri(&self, uri: Option<&str>) {
349 unsafe {
350 ffi::gst_play_set_uri(self.to_glib_none().0, uri.to_glib_none().0);
351 }
352 }
353
354 #[cfg_attr(feature = "v1_26", deprecated = "Since 1.26")]
355 #[allow(deprecated)]
356 #[doc(alias = "gst_play_set_video_track")]
357 pub fn set_video_track(&self, stream_index: i32) -> Result<(), glib::error::BoolError> {
358 unsafe {
359 glib::result_from_gboolean!(
360 ffi::gst_play_set_video_track(self.to_glib_none().0, stream_index),
361 "Failed to set video track"
362 )
363 }
364 }
365
366 #[doc(alias = "gst_play_set_video_track_enabled")]
367 pub fn set_video_track_enabled(&self, enabled: bool) {
368 unsafe {
369 ffi::gst_play_set_video_track_enabled(self.to_glib_none().0, enabled.into_glib());
370 }
371 }
372
373 #[cfg(feature = "v1_26")]
374 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
375 #[doc(alias = "gst_play_set_video_track_id")]
376 pub fn set_video_track_id(
377 &self,
378 stream_id: Option<&str>,
379 ) -> Result<(), glib::error::BoolError> {
380 unsafe {
381 glib::result_from_gboolean!(
382 ffi::gst_play_set_video_track_id(self.to_glib_none().0, stream_id.to_glib_none().0),
383 "Failed to set video track"
384 )
385 }
386 }
387
388 #[doc(alias = "gst_play_set_visualization")]
389 pub fn set_visualization(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
390 unsafe {
391 glib::result_from_gboolean!(
392 ffi::gst_play_set_visualization(self.to_glib_none().0, name.to_glib_none().0),
393 "Failed to set visualization"
394 )
395 }
396 }
397
398 #[doc(alias = "gst_play_set_visualization_enabled")]
399 pub fn set_visualization_enabled(&self, enabled: bool) {
400 unsafe {
401 ffi::gst_play_set_visualization_enabled(self.to_glib_none().0, enabled.into_glib());
402 }
403 }
404
405 #[doc(alias = "gst_play_set_volume")]
406 #[doc(alias = "volume")]
407 pub fn set_volume(&self, val: f64) {
408 unsafe {
409 ffi::gst_play_set_volume(self.to_glib_none().0, val);
410 }
411 }
412
413 #[doc(alias = "gst_play_stop")]
414 pub fn stop(&self) {
415 unsafe {
416 ffi::gst_play_stop(self.to_glib_none().0);
417 }
418 }
419
420 pub fn suburi(&self) -> Option<glib::GString> {
421 ObjectExt::property(self, "suburi")
422 }
423
424 pub fn set_suburi(&self, suburi: Option<&str>) {
425 ObjectExt::set_property(self, "suburi", suburi)
426 }
427
428 #[doc(alias = "video-multiview-flags")]
429 pub fn video_multiview_flags(&self) -> gst_video::VideoMultiviewFlags {
430 ObjectExt::property(self, "video-multiview-flags")
431 }
432
433 #[doc(alias = "video-multiview-flags")]
434 pub fn set_video_multiview_flags(&self, video_multiview_flags: gst_video::VideoMultiviewFlags) {
435 ObjectExt::set_property(self, "video-multiview-flags", video_multiview_flags)
436 }
437
438 #[doc(alias = "video-multiview-mode")]
439 pub fn video_multiview_mode(&self) -> gst_video::VideoMultiviewFramePacking {
440 ObjectExt::property(self, "video-multiview-mode")
441 }
442
443 #[doc(alias = "video-multiview-mode")]
444 pub fn set_video_multiview_mode(
445 &self,
446 video_multiview_mode: gst_video::VideoMultiviewFramePacking,
447 ) {
448 ObjectExt::set_property(self, "video-multiview-mode", video_multiview_mode)
449 }
450
451 #[doc(alias = "video-renderer")]
452 pub fn video_renderer(&self) -> Option<PlayVideoRenderer> {
453 ObjectExt::property(self, "video-renderer")
454 }
455
456 #[doc(alias = "video-renderer")]
457 pub fn set_video_renderer<P: IsA<PlayVideoRenderer>>(&self, video_renderer: Option<&P>) {
458 ObjectExt::set_property(self, "video-renderer", video_renderer)
459 }
460
461 #[doc(alias = "gst_play_get_audio_streams")]
462 #[doc(alias = "get_audio_streams")]
463 pub fn audio_streams(info: &PlayMediaInfo) -> Vec<PlayAudioInfo> {
464 skip_assert_initialized!();
465 unsafe {
466 FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_audio_streams(
467 info.to_glib_none().0,
468 ))
469 }
470 }
471
472 #[doc(alias = "gst_play_get_subtitle_streams")]
473 #[doc(alias = "get_subtitle_streams")]
474 pub fn subtitle_streams(info: &PlayMediaInfo) -> Vec<PlaySubtitleInfo> {
475 skip_assert_initialized!();
476 unsafe {
477 FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_subtitle_streams(
478 info.to_glib_none().0,
479 ))
480 }
481 }
482
483 #[doc(alias = "gst_play_get_video_streams")]
484 #[doc(alias = "get_video_streams")]
485 pub fn video_streams(info: &PlayMediaInfo) -> Vec<PlayVideoInfo> {
486 skip_assert_initialized!();
487 unsafe {
488 FromGlibPtrContainer::from_glib_none(ffi::gst_play_get_video_streams(
489 info.to_glib_none().0,
490 ))
491 }
492 }
493
494 #[doc(alias = "gst_play_is_play_message")]
495 pub fn is_play_message(msg: &gst::Message) -> bool {
496 assert_initialized_main_thread!();
497 unsafe { from_glib(ffi::gst_play_is_play_message(msg.to_glib_none().0)) }
498 }
499
500 #[doc(alias = "gst_play_visualizations_get")]
501 pub fn visualizations_get() -> Vec<PlayVisualization> {
502 assert_initialized_main_thread!();
503 unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_play_visualizations_get()) }
504 }
505
506 #[doc(alias = "audio-video-offset")]
507 pub fn connect_audio_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
508 &self,
509 f: F,
510 ) -> SignalHandlerId {
511 unsafe extern "C" fn notify_audio_video_offset_trampoline<
512 F: Fn(&Play) + Send + Sync + 'static,
513 >(
514 this: *mut ffi::GstPlay,
515 _param_spec: glib::ffi::gpointer,
516 f: glib::ffi::gpointer,
517 ) {
518 let f: &F = &*(f as *const F);
519 f(&from_glib_borrow(this))
520 }
521 unsafe {
522 let f: Box_<F> = Box_::new(f);
523 connect_raw(
524 self.as_ptr() as *mut _,
525 b"notify::audio-video-offset\0".as_ptr() as *const _,
526 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
527 notify_audio_video_offset_trampoline::<F> as *const (),
528 )),
529 Box_::into_raw(f),
530 )
531 }
532 }
533
534 #[doc(alias = "current-audio-track")]
535 pub fn connect_current_audio_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
536 &self,
537 f: F,
538 ) -> SignalHandlerId {
539 unsafe extern "C" fn notify_current_audio_track_trampoline<
540 F: Fn(&Play) + Send + Sync + 'static,
541 >(
542 this: *mut ffi::GstPlay,
543 _param_spec: glib::ffi::gpointer,
544 f: glib::ffi::gpointer,
545 ) {
546 let f: &F = &*(f as *const F);
547 f(&from_glib_borrow(this))
548 }
549 unsafe {
550 let f: Box_<F> = Box_::new(f);
551 connect_raw(
552 self.as_ptr() as *mut _,
553 b"notify::current-audio-track\0".as_ptr() as *const _,
554 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
555 notify_current_audio_track_trampoline::<F> as *const (),
556 )),
557 Box_::into_raw(f),
558 )
559 }
560 }
561
562 #[doc(alias = "current-subtitle-track")]
563 pub fn connect_current_subtitle_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
564 &self,
565 f: F,
566 ) -> SignalHandlerId {
567 unsafe extern "C" fn notify_current_subtitle_track_trampoline<
568 F: Fn(&Play) + Send + Sync + 'static,
569 >(
570 this: *mut ffi::GstPlay,
571 _param_spec: glib::ffi::gpointer,
572 f: glib::ffi::gpointer,
573 ) {
574 let f: &F = &*(f as *const F);
575 f(&from_glib_borrow(this))
576 }
577 unsafe {
578 let f: Box_<F> = Box_::new(f);
579 connect_raw(
580 self.as_ptr() as *mut _,
581 b"notify::current-subtitle-track\0".as_ptr() as *const _,
582 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
583 notify_current_subtitle_track_trampoline::<F> as *const (),
584 )),
585 Box_::into_raw(f),
586 )
587 }
588 }
589
590 #[doc(alias = "current-video-track")]
591 pub fn connect_current_video_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
592 &self,
593 f: F,
594 ) -> SignalHandlerId {
595 unsafe extern "C" fn notify_current_video_track_trampoline<
596 F: Fn(&Play) + Send + Sync + 'static,
597 >(
598 this: *mut ffi::GstPlay,
599 _param_spec: glib::ffi::gpointer,
600 f: glib::ffi::gpointer,
601 ) {
602 let f: &F = &*(f as *const F);
603 f(&from_glib_borrow(this))
604 }
605 unsafe {
606 let f: Box_<F> = Box_::new(f);
607 connect_raw(
608 self.as_ptr() as *mut _,
609 b"notify::current-video-track\0".as_ptr() as *const _,
610 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
611 notify_current_video_track_trampoline::<F> as *const (),
612 )),
613 Box_::into_raw(f),
614 )
615 }
616 }
617
618 #[doc(alias = "duration")]
619 pub fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
620 &self,
621 f: F,
622 ) -> SignalHandlerId {
623 unsafe extern "C" fn notify_duration_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
624 this: *mut ffi::GstPlay,
625 _param_spec: glib::ffi::gpointer,
626 f: glib::ffi::gpointer,
627 ) {
628 let f: &F = &*(f as *const F);
629 f(&from_glib_borrow(this))
630 }
631 unsafe {
632 let f: Box_<F> = Box_::new(f);
633 connect_raw(
634 self.as_ptr() as *mut _,
635 b"notify::duration\0".as_ptr() as *const _,
636 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
637 notify_duration_trampoline::<F> as *const (),
638 )),
639 Box_::into_raw(f),
640 )
641 }
642 }
643
644 #[doc(alias = "media-info")]
645 pub fn connect_media_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
646 &self,
647 f: F,
648 ) -> SignalHandlerId {
649 unsafe extern "C" fn notify_media_info_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
650 this: *mut ffi::GstPlay,
651 _param_spec: glib::ffi::gpointer,
652 f: glib::ffi::gpointer,
653 ) {
654 let f: &F = &*(f as *const F);
655 f(&from_glib_borrow(this))
656 }
657 unsafe {
658 let f: Box_<F> = Box_::new(f);
659 connect_raw(
660 self.as_ptr() as *mut _,
661 b"notify::media-info\0".as_ptr() as *const _,
662 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
663 notify_media_info_trampoline::<F> as *const (),
664 )),
665 Box_::into_raw(f),
666 )
667 }
668 }
669
670 #[doc(alias = "mute")]
671 pub fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
672 &self,
673 f: F,
674 ) -> SignalHandlerId {
675 unsafe extern "C" fn notify_mute_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
676 this: *mut ffi::GstPlay,
677 _param_spec: glib::ffi::gpointer,
678 f: glib::ffi::gpointer,
679 ) {
680 let f: &F = &*(f as *const F);
681 f(&from_glib_borrow(this))
682 }
683 unsafe {
684 let f: Box_<F> = Box_::new(f);
685 connect_raw(
686 self.as_ptr() as *mut _,
687 b"notify::mute\0".as_ptr() as *const _,
688 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
689 notify_mute_trampoline::<F> as *const (),
690 )),
691 Box_::into_raw(f),
692 )
693 }
694 }
695
696 #[doc(alias = "pipeline")]
697 pub fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
698 &self,
699 f: F,
700 ) -> SignalHandlerId {
701 unsafe extern "C" fn notify_pipeline_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
702 this: *mut ffi::GstPlay,
703 _param_spec: glib::ffi::gpointer,
704 f: glib::ffi::gpointer,
705 ) {
706 let f: &F = &*(f as *const F);
707 f(&from_glib_borrow(this))
708 }
709 unsafe {
710 let f: Box_<F> = Box_::new(f);
711 connect_raw(
712 self.as_ptr() as *mut _,
713 b"notify::pipeline\0".as_ptr() as *const _,
714 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
715 notify_pipeline_trampoline::<F> as *const (),
716 )),
717 Box_::into_raw(f),
718 )
719 }
720 }
721
722 #[doc(alias = "position")]
723 pub fn connect_position_notify<F: Fn(&Self) + Send + Sync + 'static>(
724 &self,
725 f: F,
726 ) -> SignalHandlerId {
727 unsafe extern "C" fn notify_position_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
728 this: *mut ffi::GstPlay,
729 _param_spec: glib::ffi::gpointer,
730 f: glib::ffi::gpointer,
731 ) {
732 let f: &F = &*(f as *const F);
733 f(&from_glib_borrow(this))
734 }
735 unsafe {
736 let f: Box_<F> = Box_::new(f);
737 connect_raw(
738 self.as_ptr() as *mut _,
739 b"notify::position\0".as_ptr() as *const _,
740 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
741 notify_position_trampoline::<F> as *const (),
742 )),
743 Box_::into_raw(f),
744 )
745 }
746 }
747
748 #[doc(alias = "rate")]
749 pub fn connect_rate_notify<F: Fn(&Self) + Send + Sync + 'static>(
750 &self,
751 f: F,
752 ) -> SignalHandlerId {
753 unsafe extern "C" fn notify_rate_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
754 this: *mut ffi::GstPlay,
755 _param_spec: glib::ffi::gpointer,
756 f: glib::ffi::gpointer,
757 ) {
758 let f: &F = &*(f as *const F);
759 f(&from_glib_borrow(this))
760 }
761 unsafe {
762 let f: Box_<F> = Box_::new(f);
763 connect_raw(
764 self.as_ptr() as *mut _,
765 b"notify::rate\0".as_ptr() as *const _,
766 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
767 notify_rate_trampoline::<F> as *const (),
768 )),
769 Box_::into_raw(f),
770 )
771 }
772 }
773
774 #[doc(alias = "subtitle-video-offset")]
775 pub fn connect_subtitle_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
776 &self,
777 f: F,
778 ) -> SignalHandlerId {
779 unsafe extern "C" fn notify_subtitle_video_offset_trampoline<
780 F: Fn(&Play) + Send + Sync + 'static,
781 >(
782 this: *mut ffi::GstPlay,
783 _param_spec: glib::ffi::gpointer,
784 f: glib::ffi::gpointer,
785 ) {
786 let f: &F = &*(f as *const F);
787 f(&from_glib_borrow(this))
788 }
789 unsafe {
790 let f: Box_<F> = Box_::new(f);
791 connect_raw(
792 self.as_ptr() as *mut _,
793 b"notify::subtitle-video-offset\0".as_ptr() as *const _,
794 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
795 notify_subtitle_video_offset_trampoline::<F> as *const (),
796 )),
797 Box_::into_raw(f),
798 )
799 }
800 }
801
802 #[doc(alias = "suburi")]
803 pub fn connect_suburi_notify<F: Fn(&Self) + Send + Sync + 'static>(
804 &self,
805 f: F,
806 ) -> SignalHandlerId {
807 unsafe extern "C" fn notify_suburi_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
808 this: *mut ffi::GstPlay,
809 _param_spec: glib::ffi::gpointer,
810 f: glib::ffi::gpointer,
811 ) {
812 let f: &F = &*(f as *const F);
813 f(&from_glib_borrow(this))
814 }
815 unsafe {
816 let f: Box_<F> = Box_::new(f);
817 connect_raw(
818 self.as_ptr() as *mut _,
819 b"notify::suburi\0".as_ptr() as *const _,
820 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
821 notify_suburi_trampoline::<F> as *const (),
822 )),
823 Box_::into_raw(f),
824 )
825 }
826 }
827
828 #[doc(alias = "uri")]
829 pub fn connect_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
830 &self,
831 f: F,
832 ) -> SignalHandlerId {
833 unsafe extern "C" fn notify_uri_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
834 this: *mut ffi::GstPlay,
835 _param_spec: glib::ffi::gpointer,
836 f: glib::ffi::gpointer,
837 ) {
838 let f: &F = &*(f as *const F);
839 f(&from_glib_borrow(this))
840 }
841 unsafe {
842 let f: Box_<F> = Box_::new(f);
843 connect_raw(
844 self.as_ptr() as *mut _,
845 b"notify::uri\0".as_ptr() as *const _,
846 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
847 notify_uri_trampoline::<F> as *const (),
848 )),
849 Box_::into_raw(f),
850 )
851 }
852 }
853
854 #[doc(alias = "video-multiview-flags")]
855 pub fn connect_video_multiview_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
856 &self,
857 f: F,
858 ) -> SignalHandlerId {
859 unsafe extern "C" fn notify_video_multiview_flags_trampoline<
860 F: Fn(&Play) + Send + Sync + 'static,
861 >(
862 this: *mut ffi::GstPlay,
863 _param_spec: glib::ffi::gpointer,
864 f: glib::ffi::gpointer,
865 ) {
866 let f: &F = &*(f as *const F);
867 f(&from_glib_borrow(this))
868 }
869 unsafe {
870 let f: Box_<F> = Box_::new(f);
871 connect_raw(
872 self.as_ptr() as *mut _,
873 b"notify::video-multiview-flags\0".as_ptr() as *const _,
874 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
875 notify_video_multiview_flags_trampoline::<F> as *const (),
876 )),
877 Box_::into_raw(f),
878 )
879 }
880 }
881
882 #[doc(alias = "video-multiview-mode")]
883 pub fn connect_video_multiview_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
884 &self,
885 f: F,
886 ) -> SignalHandlerId {
887 unsafe extern "C" fn notify_video_multiview_mode_trampoline<
888 F: Fn(&Play) + Send + Sync + 'static,
889 >(
890 this: *mut ffi::GstPlay,
891 _param_spec: glib::ffi::gpointer,
892 f: glib::ffi::gpointer,
893 ) {
894 let f: &F = &*(f as *const F);
895 f(&from_glib_borrow(this))
896 }
897 unsafe {
898 let f: Box_<F> = Box_::new(f);
899 connect_raw(
900 self.as_ptr() as *mut _,
901 b"notify::video-multiview-mode\0".as_ptr() as *const _,
902 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
903 notify_video_multiview_mode_trampoline::<F> as *const (),
904 )),
905 Box_::into_raw(f),
906 )
907 }
908 }
909
910 #[doc(alias = "video-renderer")]
911 pub fn connect_video_renderer_notify<F: Fn(&Self) + Send + Sync + 'static>(
912 &self,
913 f: F,
914 ) -> SignalHandlerId {
915 unsafe extern "C" fn notify_video_renderer_trampoline<
916 F: Fn(&Play) + Send + Sync + 'static,
917 >(
918 this: *mut ffi::GstPlay,
919 _param_spec: glib::ffi::gpointer,
920 f: glib::ffi::gpointer,
921 ) {
922 let f: &F = &*(f as *const F);
923 f(&from_glib_borrow(this))
924 }
925 unsafe {
926 let f: Box_<F> = Box_::new(f);
927 connect_raw(
928 self.as_ptr() as *mut _,
929 b"notify::video-renderer\0".as_ptr() as *const _,
930 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
931 notify_video_renderer_trampoline::<F> as *const (),
932 )),
933 Box_::into_raw(f),
934 )
935 }
936 }
937
938 #[doc(alias = "volume")]
939 pub fn connect_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
940 &self,
941 f: F,
942 ) -> SignalHandlerId {
943 unsafe extern "C" fn notify_volume_trampoline<F: Fn(&Play) + Send + Sync + 'static>(
944 this: *mut ffi::GstPlay,
945 _param_spec: glib::ffi::gpointer,
946 f: glib::ffi::gpointer,
947 ) {
948 let f: &F = &*(f as *const F);
949 f(&from_glib_borrow(this))
950 }
951 unsafe {
952 let f: Box_<F> = Box_::new(f);
953 connect_raw(
954 self.as_ptr() as *mut _,
955 b"notify::volume\0".as_ptr() as *const _,
956 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
957 notify_volume_trampoline::<F> as *const (),
958 )),
959 Box_::into_raw(f),
960 )
961 }
962 }
963}
964
965unsafe impl Send for Play {}
966unsafe impl Sync for Play {}