• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  *
3  * Copyright (C) 2015 Brijesh Singh <brijesh.ksingh@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_PLAY_MEDIA_INFO_H__
22 #define __GST_PLAY_MEDIA_INFO_H__
23 
24 #include <gst/gst.h>
25 #include <gst/play/play-prelude.h>
26 
27 G_BEGIN_DECLS
28 
29 /**
30  * GST_TYPE_PLAY_STREAM_INFO:
31  * Since: 1.20
32  */
33 #define GST_TYPE_PLAY_STREAM_INFO \
34   (gst_play_stream_info_get_type ())
35 #define GST_PLAY_STREAM_INFO(obj) \
36   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAY_STREAM_INFO,GstPlayStreamInfo))
37 #define GST_PLAY_STREAM_INFO_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAY_STREAM_INFO,GstPlayStreamInfo))
39 #define GST_IS_PLAY_STREAM_INFO(obj) \
40   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_STREAM_INFO))
41 #define GST_IS_PLAY_STREAM_INFO_CLASS(klass) \
42   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAY_STREAM_INFO))
43 
44 /**
45  * GstPlayStreamInfo:
46  *
47  * Base structure for information concerning a media stream. Depending on
48  * the stream type, one can find more media-specific information in
49  * #GstPlayVideoInfo, #GstPlayAudioInfo, #GstPlaySubtitleInfo.
50  * Since: 1.20
51  */
52 typedef struct _GstPlayStreamInfo GstPlayStreamInfo;
53 typedef struct _GstPlayStreamInfoClass GstPlayStreamInfoClass;
54 
55 GST_PLAY_API
56 GType         gst_play_stream_info_get_type (void);
57 
58 GST_PLAY_API
59 gint          gst_play_stream_info_get_index (const GstPlayStreamInfo *info);
60 
61 GST_PLAY_API
62 const gchar*  gst_play_stream_info_get_stream_type (const GstPlayStreamInfo *info);
63 
64 GST_PLAY_API
65 GstTagList*   gst_play_stream_info_get_tags  (const GstPlayStreamInfo *info);
66 
67 GST_PLAY_API
68 GstCaps*      gst_play_stream_info_get_caps  (const GstPlayStreamInfo *info);
69 
70 GST_PLAY_API
71 const gchar*  gst_play_stream_info_get_codec (const GstPlayStreamInfo *info);
72 
73 /**
74  * GST_TYPE_PLAY_VIDEO_INFO:
75  * Since: 1.20
76  */
77 #define GST_TYPE_PLAY_VIDEO_INFO \
78   (gst_play_video_info_get_type ())
79 #define GST_PLAY_VIDEO_INFO(obj) \
80   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAY_VIDEO_INFO, GstPlayVideoInfo))
81 #define GST_PLAY_VIDEO_INFO_CLASS(klass) \
82   (G_TYPE_CHECK_CLASS_CAST((obj),GST_TYPE_PLAY_VIDEO_INFO, GstPlayVideoInfoClass))
83 #define GST_IS_PLAY_VIDEO_INFO(obj) \
84   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_VIDEO_INFO))
85 #define GST_IS_PLAY_VIDEO_INFO_CLASS(klass) \
86   (G_TYPE_CHECK_CLASS_TYPE((obj),GST_TYPE_PLAY_VIDEO_INFO))
87 
88 /**
89  * GstPlayVideoInfo:
90  *
91  * #GstPlayStreamInfo specific to video streams.
92  * Since: 1.20
93  */
94 typedef struct _GstPlayVideoInfo GstPlayVideoInfo;
95 typedef struct _GstPlayVideoInfoClass GstPlayVideoInfoClass;
96 
97 GST_PLAY_API
98 GType         gst_play_video_info_get_type (void);
99 
100 GST_PLAY_API
101 gint          gst_play_video_info_get_bitrate     (const GstPlayVideoInfo * info);
102 
103 GST_PLAY_API
104 gint          gst_play_video_info_get_max_bitrate (const GstPlayVideoInfo * info);
105 
106 GST_PLAY_API
107 gint          gst_play_video_info_get_width       (const GstPlayVideoInfo * info);
108 
109 GST_PLAY_API
110 gint          gst_play_video_info_get_height      (const GstPlayVideoInfo * info);
111 
112 GST_PLAY_API
113 void          gst_play_video_info_get_framerate   (const GstPlayVideoInfo * info,
114                                                      gint * fps_n,
115                                                      gint * fps_d);
116 
117 GST_PLAY_API
118 void          gst_play_video_info_get_pixel_aspect_ratio (const GstPlayVideoInfo * info,
119                                                             guint * par_n,
120                                                             guint * par_d);
121 
122 /**
123  * GST_TYPE_PLAY_AUDIO_INFO:
124  * Since: 1.20
125  */
126 #define GST_TYPE_PLAY_AUDIO_INFO \
127   (gst_play_audio_info_get_type ())
128 #define GST_PLAY_AUDIO_INFO(obj) \
129   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAY_AUDIO_INFO, GstPlayAudioInfo))
130 #define GST_PLAY_AUDIO_INFO_CLASS(klass) \
131   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAY_AUDIO_INFO, GstPlayAudioInfoClass))
132 #define GST_IS_PLAY_AUDIO_INFO(obj) \
133   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_AUDIO_INFO))
134 #define GST_IS_PLAY_AUDIO_INFO_CLASS(klass) \
135   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAY_AUDIO_INFO))
136 
137 /**
138  * GstPlayAudioInfo:
139  *
140  * #GstPlayStreamInfo specific to audio streams.
141  * Since: 1.20
142  */
143 typedef struct _GstPlayAudioInfo GstPlayAudioInfo;
144 typedef struct _GstPlayAudioInfoClass GstPlayAudioInfoClass;
145 
146 GST_PLAY_API
147 GType         gst_play_audio_info_get_type (void);
148 
149 GST_PLAY_API
150 gint          gst_play_audio_info_get_channels    (const GstPlayAudioInfo* info);
151 
152 GST_PLAY_API
153 gint          gst_play_audio_info_get_sample_rate (const GstPlayAudioInfo* info);
154 
155 GST_PLAY_API
156 gint          gst_play_audio_info_get_bitrate     (const GstPlayAudioInfo* info);
157 
158 GST_PLAY_API
159 gint          gst_play_audio_info_get_max_bitrate (const GstPlayAudioInfo* info);
160 
161 GST_PLAY_API
162 const gchar*  gst_play_audio_info_get_language    (const GstPlayAudioInfo* info);
163 
164 /**
165  * GST_TYPE_PLAY_SUBTITLE_INFO:
166  * Since: 1.20
167  */
168 #define GST_TYPE_PLAY_SUBTITLE_INFO \
169   (gst_play_subtitle_info_get_type ())
170 #define GST_PLAY_SUBTITLE_INFO(obj) \
171   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAY_SUBTITLE_INFO, GstPlaySubtitleInfo))
172 #define GST_PLAY_SUBTITLE_INFO_CLASS(klass) \
173   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAY_SUBTITLE_INFO,GstPlaySubtitleInfoClass))
174 #define GST_IS_PLAY_SUBTITLE_INFO(obj) \
175   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_SUBTITLE_INFO))
176 #define GST_IS_PLAY_SUBTITLE_INFO_CLASS(klass) \
177   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAY_SUBTITLE_INFO))
178 
179 /**
180  * GstPlaySubtitleInfo:
181  *
182  * #GstPlayStreamInfo specific to subtitle streams.
183  * Since: 1.20
184  */
185 typedef struct _GstPlaySubtitleInfo GstPlaySubtitleInfo;
186 typedef struct _GstPlaySubtitleInfoClass GstPlaySubtitleInfoClass;
187 
188 GST_PLAY_API
189 GType         gst_play_subtitle_info_get_type (void);
190 
191 GST_PLAY_API
192 const gchar * gst_play_subtitle_info_get_language (const GstPlaySubtitleInfo* info);
193 
194 /**
195  * GST_TYPE_PLAY_MEDIA_INFO:
196  * Since: 1.20
197  */
198 #define GST_TYPE_PLAY_MEDIA_INFO \
199   (gst_play_media_info_get_type())
200 #define GST_PLAY_MEDIA_INFO(obj) \
201   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAY_MEDIA_INFO,GstPlayMediaInfo))
202 #define GST_PLAY_MEDIA_INFO_CLASS(klass) \
203   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAY_MEDIA_INFO,GstPlayMediaInfoClass))
204 #define GST_IS_PLAY_MEDIA_INFO(obj) \
205   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_MEDIA_INFO))
206 #define GST_IS_PLAY_MEDIA_INFO_CLASS(klass) \
207   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAY_MEDIA_INFO))
208 
209 /**
210  * GstPlayMediaInfo:
211  *
212  * Structure containing the media information of a URI.
213  * Since: 1.20
214  */
215 typedef struct _GstPlayMediaInfo GstPlayMediaInfo;
216 typedef struct _GstPlayMediaInfoClass GstPlayMediaInfoClass;
217 
218 GST_PLAY_API
219 GType         gst_play_media_info_get_type (void);
220 
221 GST_PLAY_API
222 const gchar * gst_play_media_info_get_uri (const GstPlayMediaInfo *info);
223 
224 GST_PLAY_API
225 gboolean      gst_play_media_info_is_seekable (const GstPlayMediaInfo *info);
226 
227 GST_PLAY_API
228 gboolean      gst_play_media_info_is_live (const GstPlayMediaInfo *info);
229 
230 GST_PLAY_API
231 GstClockTime  gst_play_media_info_get_duration (const GstPlayMediaInfo *info);
232 
233 GST_PLAY_API
234 GList*        gst_play_media_info_get_stream_list (const GstPlayMediaInfo *info);
235 
236 GST_PLAY_API
237 guint         gst_play_media_info_get_number_of_streams (const GstPlayMediaInfo *info);
238 
239 GST_PLAY_API
240 GList*        gst_play_media_info_get_video_streams (const GstPlayMediaInfo *info);
241 
242 GST_PLAY_API
243 guint         gst_play_media_info_get_number_of_video_streams (const GstPlayMediaInfo *info);
244 
245 GST_PLAY_API
246 GList*        gst_play_media_info_get_audio_streams (const GstPlayMediaInfo *info);
247 
248 GST_PLAY_API
249 guint         gst_play_media_info_get_number_of_audio_streams (const GstPlayMediaInfo *info);
250 
251 GST_PLAY_API
252 GList*        gst_play_media_info_get_subtitle_streams (const GstPlayMediaInfo *info);
253 
254 GST_PLAY_API
255 guint         gst_play_media_info_get_number_of_subtitle_streams (const GstPlayMediaInfo *info);
256 
257 GST_PLAY_API
258 GstTagList*   gst_play_media_info_get_tags (const GstPlayMediaInfo *info);
259 
260 GST_PLAY_API
261 const gchar*  gst_play_media_info_get_title (const GstPlayMediaInfo *info);
262 
263 GST_PLAY_API
264 const gchar*  gst_play_media_info_get_container_format (const GstPlayMediaInfo *info);
265 
266 GST_PLAY_API
267 GstSample*    gst_play_media_info_get_image_sample (const GstPlayMediaInfo *info);
268 
269 GST_PLAY_DEPRECATED_FOR(gst_play_media_info_get_video_streams)
270 GList*        gst_play_get_video_streams    (const GstPlayMediaInfo *info);
271 
272 GST_PLAY_DEPRECATED_FOR(gst_play_media_info_get_audio_streams)
273 GList*        gst_play_get_audio_streams    (const GstPlayMediaInfo *info);
274 
275 GST_PLAY_DEPRECATED_FOR(gst_play_media_info_get_subtitle_streams)
276 GList*        gst_play_get_subtitle_streams (const GstPlayMediaInfo *info);
277 
278 G_END_DECLS
279 
280 #endif /* __GST_PLAY_MEDIA_INFO_H */
281