1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::{PlayerAudioInfo, PlayerStreamInfo, PlayerSubtitleInfo, PlayerVideoInfo};
use glib::translate::*;

glib::wrapper! {
    #[doc(alias = "GstPlayerMediaInfo")]
    pub struct PlayerMediaInfo(Object<ffi::GstPlayerMediaInfo, ffi::GstPlayerMediaInfoClass>);

    match fn {
        type_ => || ffi::gst_player_media_info_get_type(),
    }
}

impl PlayerMediaInfo {
    #[doc(alias = "gst_player_media_info_get_audio_streams")]
    #[doc(alias = "get_audio_streams")]
    pub fn audio_streams(&self) -> Vec<PlayerAudioInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_audio_streams(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_player_media_info_get_container_format")]
    #[doc(alias = "get_container_format")]
    pub fn container_format(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::gst_player_media_info_get_container_format(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_player_media_info_get_duration")]
    #[doc(alias = "get_duration")]
    pub fn duration(&self) -> Option<gst::ClockTime> {
        unsafe {
            from_glib(ffi::gst_player_media_info_get_duration(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_player_media_info_get_image_sample")]
    #[doc(alias = "get_image_sample")]
    pub fn image_sample(&self) -> Option<gst::Sample> {
        unsafe {
            from_glib_none(ffi::gst_player_media_info_get_image_sample(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_player_media_info_get_number_of_audio_streams")]
    #[doc(alias = "get_number_of_audio_streams")]
    pub fn number_of_audio_streams(&self) -> u32 {
        unsafe { ffi::gst_player_media_info_get_number_of_audio_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_player_media_info_get_number_of_streams")]
    #[doc(alias = "get_number_of_streams")]
    pub fn number_of_streams(&self) -> u32 {
        unsafe { ffi::gst_player_media_info_get_number_of_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_player_media_info_get_number_of_subtitle_streams")]
    #[doc(alias = "get_number_of_subtitle_streams")]
    pub fn number_of_subtitle_streams(&self) -> u32 {
        unsafe { ffi::gst_player_media_info_get_number_of_subtitle_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_player_media_info_get_number_of_video_streams")]
    #[doc(alias = "get_number_of_video_streams")]
    pub fn number_of_video_streams(&self) -> u32 {
        unsafe { ffi::gst_player_media_info_get_number_of_video_streams(self.to_glib_none().0) }
    }

    #[doc(alias = "gst_player_media_info_get_stream_list")]
    #[doc(alias = "get_stream_list")]
    pub fn stream_list(&self) -> Vec<PlayerStreamInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_stream_list(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_player_media_info_get_subtitle_streams")]
    #[doc(alias = "get_subtitle_streams")]
    pub fn subtitle_streams(&self) -> Vec<PlayerSubtitleInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_subtitle_streams(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_player_media_info_get_tags")]
    #[doc(alias = "get_tags")]
    pub fn tags(&self) -> Option<gst::TagList> {
        unsafe { from_glib_none(ffi::gst_player_media_info_get_tags(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_player_media_info_get_title")]
    #[doc(alias = "get_title")]
    pub fn title(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::gst_player_media_info_get_title(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_player_media_info_get_uri")]
    #[doc(alias = "get_uri")]
    pub fn uri(&self) -> glib::GString {
        unsafe { from_glib_none(ffi::gst_player_media_info_get_uri(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_player_media_info_get_video_streams")]
    #[doc(alias = "get_video_streams")]
    pub fn video_streams(&self) -> Vec<PlayerVideoInfo> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_player_media_info_get_video_streams(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "gst_player_media_info_is_live")]
    pub fn is_live(&self) -> bool {
        unsafe { from_glib(ffi::gst_player_media_info_is_live(self.to_glib_none().0)) }
    }

    #[doc(alias = "gst_player_media_info_is_seekable")]
    pub fn is_seekable(&self) -> bool {
        unsafe {
            from_glib(ffi::gst_player_media_info_is_seekable(
                self.to_glib_none().0,
            ))
        }
    }
}

unsafe impl Send for PlayerMediaInfo {}
unsafe impl Sync for PlayerMediaInfo {}