1/* GStreamer
2 *
3 * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.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_H__
22#define __GST_PLAYER_H__
23
24#include <gst/gst.h>
25#include <gst/video/video.h>
26#include <gst/player/player-prelude.h>
27#include <gst/player/gstplayer-types.h>
28#include <gst/player/gstplayer-signal-dispatcher.h>
29#include <gst/player/gstplayer-video-renderer.h>
30#include <gst/player/gstplayer-media-info.h>
31
32G_BEGIN_DECLS
33
34GST_PLAYER_API
35GType gst_player_state_get_type (void);
36#define GST_TYPE_PLAYER_STATE (gst_player_state_get_type ())
37
38/**
39 * GstPlayerState:
40 * @GST_PLAYER_STATE_STOPPED: the player is stopped.
41 * @GST_PLAYER_STATE_BUFFERING: the player is buffering.
42 * @GST_PLAYER_STATE_PAUSED: the player is paused.
43 * @GST_PLAYER_STATE_PLAYING: the player is currently playing a
44 * stream.
45 */
46typedef enum
47{
48 GST_PLAYER_STATE_STOPPED,
49 GST_PLAYER_STATE_BUFFERING,
50 GST_PLAYER_STATE_PAUSED,
51 GST_PLAYER_STATE_PLAYING
52} GstPlayerState;
53
54GST_PLAYER_API
55const gchar *gst_player_state_get_name (GstPlayerState state);
56
57GST_PLAYER_API
58GQuark gst_player_error_quark (void);
59
60GST_PLAYER_API
61GType gst_player_error_get_type (void);
62#define GST_PLAYER_ERROR (gst_player_error_quark ())
63#define GST_TYPE_PLAYER_ERROR (gst_player_error_get_type ())
64
65/**
66 * GstPlayerError:
67 * @GST_PLAYER_ERROR_FAILED: generic error.
68 */
69typedef enum {
70 GST_PLAYER_ERROR_FAILED = 0
71} GstPlayerError;
72
73GST_PLAYER_API
74const gchar *gst_player_error_get_name (GstPlayerError error);
75
76GST_PLAYER_API
77GType gst_player_color_balance_type_get_type (void);
78#define GST_TYPE_PLAYER_COLOR_BALANCE_TYPE (gst_player_color_balance_type_get_type ())
79
80/**
81 * GstPlayerColorBalanceType:
82 * @GST_PLAYER_COLOR_BALANCE_BRIGHTNESS: brightness or black level.
83 * @GST_PLAYER_COLOR_BALANCE_CONTRAST: contrast or luma gain.
84 * @GST_PLAYER_COLOR_BALANCE_SATURATION: color saturation or chroma
85 * gain.
86 * @GST_PLAYER_COLOR_BALANCE_HUE: hue or color balance.
87 */
88typedef enum
89{
90 GST_PLAYER_COLOR_BALANCE_BRIGHTNESS,
91 GST_PLAYER_COLOR_BALANCE_CONTRAST,
92 GST_PLAYER_COLOR_BALANCE_SATURATION,
93 GST_PLAYER_COLOR_BALANCE_HUE,
94} GstPlayerColorBalanceType;
95
96GST_PLAYER_API
97const gchar *gst_player_color_balance_type_get_name (GstPlayerColorBalanceType type);
98
99#define GST_TYPE_PLAYER (gst_player_get_type ())
100#define GST_IS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER))
101#define GST_IS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAYER))
102#define GST_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAYER, GstPlayerClass))
103#define GST_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER, GstPlayer))
104#define GST_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAYER, GstPlayerClass))
105#define GST_PLAYER_CAST(obj) ((GstPlayer*)(obj))
106
107#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
108G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPlayer, gst_object_unref)
109#endif
110
111GST_PLAYER_API
112GType gst_player_get_type (void);
113
114GST_PLAYER_API
115GstPlayer * gst_player_new (GstPlayerVideoRenderer * video_renderer, GstPlayerSignalDispatcher * signal_dispatcher);
116
117GST_PLAYER_API
118void gst_player_play (GstPlayer * player);
119
120GST_PLAYER_API
121void gst_player_pause (GstPlayer * player);
122
123GST_PLAYER_API
124void gst_player_stop (GstPlayer * player);
125
126GST_PLAYER_API
127void gst_player_seek (GstPlayer * player,
128 GstClockTime position);
129
130GST_PLAYER_API
131void gst_player_set_rate (GstPlayer * player,
132 gdouble rate);
133
134GST_PLAYER_API
135gdouble gst_player_get_rate (GstPlayer * player);
136
137GST_PLAYER_API
138gchar * gst_player_get_uri (GstPlayer * player);
139
140GST_PLAYER_API
141void gst_player_set_uri (GstPlayer * player,
142 const gchar * uri);
143
144GST_PLAYER_API
145gchar * gst_player_get_subtitle_uri (GstPlayer * player);
146
147GST_PLAYER_API
148void gst_player_set_subtitle_uri (GstPlayer * player,
149 const gchar *uri);
150
151GST_PLAYER_API
152GstClockTime gst_player_get_position (GstPlayer * player);
153
154GST_PLAYER_API
155GstClockTime gst_player_get_duration (GstPlayer * player);
156
157GST_PLAYER_API
158gdouble gst_player_get_volume (GstPlayer * player);
159
160GST_PLAYER_API
161void gst_player_set_volume (GstPlayer * player,
162 gdouble val);
163
164GST_PLAYER_API
165gboolean gst_player_get_mute (GstPlayer * player);
166
167GST_PLAYER_API
168void gst_player_set_mute (GstPlayer * player,
169 gboolean val);
170
171GST_PLAYER_API
172GstElement * gst_player_get_pipeline (GstPlayer * player);
173
174GST_PLAYER_API
175void gst_player_set_video_track_enabled (GstPlayer * player,
176 gboolean enabled);
177
178GST_PLAYER_API
179void gst_player_set_audio_track_enabled (GstPlayer * player,
180 gboolean enabled);
181
182GST_PLAYER_API
183void gst_player_set_subtitle_track_enabled (GstPlayer * player,
184 gboolean enabled);
185
186GST_PLAYER_API
187gboolean gst_player_set_audio_track (GstPlayer *player,
188 gint stream_index);
189
190GST_PLAYER_API
191gboolean gst_player_set_video_track (GstPlayer *player,
192 gint stream_index);
193
194GST_PLAYER_API
195gboolean gst_player_set_subtitle_track (GstPlayer *player,
196 gint stream_index);
197
198GST_PLAYER_API
199GstPlayerMediaInfo * gst_player_get_media_info (GstPlayer * player);
200
201GST_PLAYER_API
202GstPlayerAudioInfo * gst_player_get_current_audio_track (GstPlayer * player);
203
204GST_PLAYER_API
205GstPlayerVideoInfo * gst_player_get_current_video_track (GstPlayer * player);
206
207GST_PLAYER_API
208GstPlayerSubtitleInfo * gst_player_get_current_subtitle_track (GstPlayer * player);
209
210GST_PLAYER_API
211gboolean gst_player_set_visualization (GstPlayer * player,
212 const gchar *name);
213
214GST_PLAYER_API
215void gst_player_set_visualization_enabled (GstPlayer * player,
216 gboolean enabled);
217
218GST_PLAYER_API
219gchar * gst_player_get_current_visualization (GstPlayer * player);
220
221GST_PLAYER_API
222gboolean gst_player_has_color_balance (GstPlayer * player);
223
224GST_PLAYER_API
225void gst_player_set_color_balance (GstPlayer * player,
226 GstPlayerColorBalanceType type,
227 gdouble value);
228
229GST_PLAYER_API
230gdouble gst_player_get_color_balance (GstPlayer * player,
231 GstPlayerColorBalanceType type);
232
233
234GST_PLAYER_API
235GstVideoMultiviewFramePacking gst_player_get_multiview_mode (GstPlayer * player);
236
237GST_PLAYER_API
238void gst_player_set_multiview_mode (GstPlayer * player,
239 GstVideoMultiviewFramePacking mode);
240
241GST_PLAYER_API
242GstVideoMultiviewFlags gst_player_get_multiview_flags (GstPlayer * player);
243
244GST_PLAYER_API
245void gst_player_set_multiview_flags (GstPlayer * player,
246 GstVideoMultiviewFlags flags);
247
248GST_PLAYER_API
249gint64 gst_player_get_audio_video_offset (GstPlayer * player);
250
251GST_PLAYER_API
252void gst_player_set_audio_video_offset (GstPlayer * player,
253 gint64 offset);
254
255GST_PLAYER_API
256gint64 gst_player_get_subtitle_video_offset (GstPlayer * player);
257
258GST_PLAYER_API
259void gst_player_set_subtitle_video_offset (GstPlayer * player,
260 gint64 offset);
261
262GST_PLAYER_API
263gboolean gst_player_set_config (GstPlayer * player,
264 GstStructure * config);
265
266GST_PLAYER_API
267GstStructure * gst_player_get_config (GstPlayer * player);
268
269/* helpers for configuring the config structure */
270
271GST_PLAYER_API
272void gst_player_config_set_user_agent (GstStructure * config,
273 const gchar * agent);
274
275GST_PLAYER_API
276gchar * gst_player_config_get_user_agent (const GstStructure * config);
277
278GST_PLAYER_API
279void gst_player_config_set_position_update_interval (GstStructure * config,
280 guint interval);
281
282GST_PLAYER_API
283guint gst_player_config_get_position_update_interval (const GstStructure * config);
284
285GST_PLAYER_API
286void gst_player_config_set_seek_accurate (GstStructure * config, gboolean accurate);
287
288GST_PLAYER_API
289gboolean gst_player_config_get_seek_accurate (const GstStructure * config);
290
291typedef enum
292{
293 GST_PLAYER_THUMBNAIL_RAW_NATIVE = 0,
294 GST_PLAYER_THUMBNAIL_RAW_xRGB,
295 GST_PLAYER_THUMBNAIL_RAW_BGRx,
296 GST_PLAYER_THUMBNAIL_JPG,
297 GST_PLAYER_THUMBNAIL_PNG
298} GstPlayerSnapshotFormat;
299
300GST_PLAYER_API
301GstSample * gst_player_get_video_snapshot (GstPlayer * player,
302 GstPlayerSnapshotFormat format, const GstStructure * config);
303
304G_END_DECLS
305
306#endif /* __GST_PLAYER_H__ */
307

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