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_PLAYER_MEDIA_INFO_H__
22#define __GST_PLAYER_MEDIA_INFO_H__
23
24#include <gst/gst.h>
25#include <gst/player/player-prelude.h>
26
27G_BEGIN_DECLS
28
29#define GST_TYPE_PLAYER_STREAM_INFO \
30 (gst_player_stream_info_get_type ())
31#define GST_PLAYER_STREAM_INFO(obj) \
32 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_STREAM_INFO,GstPlayerStreamInfo))
33#define GST_PLAYER_STREAM_INFO_CLASS(klass) \
34 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_STREAM_INFO,GstPlayerStreamInfo))
35#define GST_IS_PLAYER_STREAM_INFO(obj) \
36 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_STREAM_INFO))
37#define GST_IS_PLAYER_STREAM_INFO_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_STREAM_INFO))
39
40/**
41 * GstPlayerStreamInfo:
42 *
43 * Base structure for information concerning a media stream. Depending on
44 * the stream type, one can find more media-specific information in
45 * #GstPlayerVideoInfo, #GstPlayerAudioInfo, #GstPlayerSubtitleInfo.
46 */
47typedef struct _GstPlayerStreamInfo GstPlayerStreamInfo;
48typedef struct _GstPlayerStreamInfoClass GstPlayerStreamInfoClass;
49
50GST_PLAYER_API
51GType gst_player_stream_info_get_type (void);
52
53GST_PLAYER_API
54gint gst_player_stream_info_get_index (const GstPlayerStreamInfo *info);
55
56GST_PLAYER_API
57const gchar* gst_player_stream_info_get_stream_type (const GstPlayerStreamInfo *info);
58
59GST_PLAYER_API
60GstTagList* gst_player_stream_info_get_tags (const GstPlayerStreamInfo *info);
61
62GST_PLAYER_API
63GstCaps* gst_player_stream_info_get_caps (const GstPlayerStreamInfo *info);
64
65GST_PLAYER_API
66const gchar* gst_player_stream_info_get_codec (const GstPlayerStreamInfo *info);
67
68#define GST_TYPE_PLAYER_VIDEO_INFO \
69 (gst_player_video_info_get_type ())
70#define GST_PLAYER_VIDEO_INFO(obj) \
71 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_VIDEO_INFO, GstPlayerVideoInfo))
72#define GST_PLAYER_VIDEO_INFO_CLASS(klass) \
73 (G_TYPE_CHECK_CLASS_CAST((obj),GST_TYPE_PLAYER_VIDEO_INFO, GstPlayerVideoInfoClass))
74#define GST_IS_PLAYER_VIDEO_INFO(obj) \
75 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_VIDEO_INFO))
76#define GST_IS_PLAYER_VIDEO_INFO_CLASS(klass) \
77 (G_TYPE_CHECK_CLASS_TYPE((obj),GST_TYPE_PLAYER_VIDEO_INFO))
78
79/**
80 * GstPlayerVideoInfo:
81 *
82 * #GstPlayerStreamInfo specific to video streams.
83 */
84typedef struct _GstPlayerVideoInfo GstPlayerVideoInfo;
85typedef struct _GstPlayerVideoInfoClass GstPlayerVideoInfoClass;
86
87GST_PLAYER_API
88GType gst_player_video_info_get_type (void);
89
90GST_PLAYER_API
91gint gst_player_video_info_get_bitrate (const GstPlayerVideoInfo * info);
92
93GST_PLAYER_API
94gint gst_player_video_info_get_max_bitrate (const GstPlayerVideoInfo * info);
95
96GST_PLAYER_API
97gint gst_player_video_info_get_width (const GstPlayerVideoInfo * info);
98
99GST_PLAYER_API
100gint gst_player_video_info_get_height (const GstPlayerVideoInfo * info);
101
102GST_PLAYER_API
103void gst_player_video_info_get_framerate (const GstPlayerVideoInfo * info,
104 gint * fps_n,
105 gint * fps_d);
106
107GST_PLAYER_API
108void gst_player_video_info_get_pixel_aspect_ratio (const GstPlayerVideoInfo * info,
109 guint * par_n,
110 guint * par_d);
111
112#define GST_TYPE_PLAYER_AUDIO_INFO \
113 (gst_player_audio_info_get_type ())
114#define GST_PLAYER_AUDIO_INFO(obj) \
115 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_AUDIO_INFO, GstPlayerAudioInfo))
116#define GST_PLAYER_AUDIO_INFO_CLASS(klass) \
117 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_AUDIO_INFO, GstPlayerAudioInfoClass))
118#define GST_IS_PLAYER_AUDIO_INFO(obj) \
119 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_AUDIO_INFO))
120#define GST_IS_PLAYER_AUDIO_INFO_CLASS(klass) \
121 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_AUDIO_INFO))
122
123/**
124 * GstPlayerAudioInfo:
125 *
126 * #GstPlayerStreamInfo specific to audio streams.
127 */
128typedef struct _GstPlayerAudioInfo GstPlayerAudioInfo;
129typedef struct _GstPlayerAudioInfoClass GstPlayerAudioInfoClass;
130
131GST_PLAYER_API
132GType gst_player_audio_info_get_type (void);
133
134GST_PLAYER_API
135gint gst_player_audio_info_get_channels (const GstPlayerAudioInfo* info);
136
137GST_PLAYER_API
138gint gst_player_audio_info_get_sample_rate (const GstPlayerAudioInfo* info);
139
140GST_PLAYER_API
141gint gst_player_audio_info_get_bitrate (const GstPlayerAudioInfo* info);
142
143GST_PLAYER_API
144gint gst_player_audio_info_get_max_bitrate (const GstPlayerAudioInfo* info);
145
146GST_PLAYER_API
147const gchar* gst_player_audio_info_get_language (const GstPlayerAudioInfo* info);
148
149#define GST_TYPE_PLAYER_SUBTITLE_INFO \
150 (gst_player_subtitle_info_get_type ())
151#define GST_PLAYER_SUBTITLE_INFO(obj) \
152 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_SUBTITLE_INFO, GstPlayerSubtitleInfo))
153#define GST_PLAYER_SUBTITLE_INFO_CLASS(klass) \
154 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_SUBTITLE_INFO,GstPlayerSubtitleInfoClass))
155#define GST_IS_PLAYER_SUBTITLE_INFO(obj) \
156 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_SUBTITLE_INFO))
157#define GST_IS_PLAYER_SUBTITLE_INFO_CLASS(klass) \
158 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_SUBTITLE_INFO))
159
160/**
161 * GstPlayerSubtitleInfo:
162 *
163 * #GstPlayerStreamInfo specific to subtitle streams.
164 */
165typedef struct _GstPlayerSubtitleInfo GstPlayerSubtitleInfo;
166typedef struct _GstPlayerSubtitleInfoClass GstPlayerSubtitleInfoClass;
167
168GST_PLAYER_API
169GType gst_player_subtitle_info_get_type (void);
170
171GST_PLAYER_API
172const gchar * gst_player_subtitle_info_get_language (const GstPlayerSubtitleInfo* info);
173
174#define GST_TYPE_PLAYER_MEDIA_INFO \
175 (gst_player_media_info_get_type())
176#define GST_PLAYER_MEDIA_INFO(obj) \
177 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_MEDIA_INFO,GstPlayerMediaInfo))
178#define GST_PLAYER_MEDIA_INFO_CLASS(klass) \
179 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_MEDIA_INFO,GstPlayerMediaInfoClass))
180#define GST_IS_PLAYER_MEDIA_INFO(obj) \
181 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_MEDIA_INFO))
182#define GST_IS_PLAYER_MEDIA_INFO_CLASS(klass) \
183 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_MEDIA_INFO))
184
185/**
186 * GstPlayerMediaInfo:
187 *
188 * Structure containing the media information of a URI.
189 */
190typedef struct _GstPlayerMediaInfo GstPlayerMediaInfo;
191typedef struct _GstPlayerMediaInfoClass GstPlayerMediaInfoClass;
192
193GST_PLAYER_API
194GType gst_player_media_info_get_type (void);
195
196GST_PLAYER_API
197const gchar * gst_player_media_info_get_uri (const GstPlayerMediaInfo *info);
198
199GST_PLAYER_API
200gboolean gst_player_media_info_is_seekable (const GstPlayerMediaInfo *info);
201
202GST_PLAYER_API
203gboolean gst_player_media_info_is_live (const GstPlayerMediaInfo *info);
204
205GST_PLAYER_API
206GstClockTime gst_player_media_info_get_duration (const GstPlayerMediaInfo *info);
207
208GST_PLAYER_API
209GList* gst_player_media_info_get_stream_list (const GstPlayerMediaInfo *info);
210
211GST_PLAYER_API
212guint gst_player_media_info_get_number_of_streams (const GstPlayerMediaInfo *info);
213
214GST_PLAYER_API
215GList* gst_player_media_info_get_video_streams (const GstPlayerMediaInfo *info);
216
217GST_PLAYER_API
218guint gst_player_media_info_get_number_of_video_streams (const GstPlayerMediaInfo *info);
219
220GST_PLAYER_API
221GList* gst_player_media_info_get_audio_streams (const GstPlayerMediaInfo *info);
222
223GST_PLAYER_API
224guint gst_player_media_info_get_number_of_audio_streams (const GstPlayerMediaInfo *info);
225
226GST_PLAYER_API
227GList* gst_player_media_info_get_subtitle_streams (const GstPlayerMediaInfo *info);
228
229GST_PLAYER_API
230guint gst_player_media_info_get_number_of_subtitle_streams (const GstPlayerMediaInfo *info);
231
232GST_PLAYER_API
233GstTagList* gst_player_media_info_get_tags (const GstPlayerMediaInfo *info);
234
235GST_PLAYER_API
236const gchar* gst_player_media_info_get_title (const GstPlayerMediaInfo *info);
237
238GST_PLAYER_API
239const gchar* gst_player_media_info_get_container_format (const GstPlayerMediaInfo *info);
240
241GST_PLAYER_API
242GstSample* gst_player_media_info_get_image_sample (const GstPlayerMediaInfo *info);
243
244GST_PLAYER_DEPRECATED_FOR(gst_player_media_info_get_video_streams)
245GList* gst_player_get_video_streams (const GstPlayerMediaInfo *info);
246
247GST_PLAYER_DEPRECATED_FOR(gst_player_media_info_get_audio_streams)
248GList* gst_player_get_audio_streams (const GstPlayerMediaInfo *info);
249
250GST_PLAYER_DEPRECATED_FOR(gst_player_media_info_get_subtitle_streams)
251GList* gst_player_get_subtitle_streams (const GstPlayerMediaInfo *info);
252
253G_END_DECLS
254
255#endif /* __GST_PLAYER_MEDIA_INFO_H */
256

source code of include/gstreamer-1.0/gst/player/gstplayer-media-info.h