~ubuntu-branches/ubuntu/saucy/totem/saucy-proposed

« back to all changes in this revision

Viewing changes to src/bacon-video-widget.h

  • Committer: Bazaar Package Importer
  • Author(s): Loic Minier, Sebastien Bacher, Loic Minier
  • Date: 2007-03-08 14:51:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070308145155-cnu1r0s1z4ffcxza
Tags: 2.16.5-3
[ Sebastien Bacher ]
* debian/patches/30_dlopen_noremove_dbus_glib.dpatch:
  - fix "crash because NPPVpluginKeepLibraryInMemory is broken in gecko",
    patch from Alexander Sack (GNOME bug #415389)

[ Loic Minier ]
* Urgency medium.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
 * Copyright (C) 2001-2002 the xine project
3
 
 *      Heavily modified by Bastien Nocera <hadess@hadess.net>
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program 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
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
 
 *
19
 
 * $Id: bacon-video-widget.h,v 1.53 2004/12/30 20:25:33 hadess Exp $
20
 
 *
21
 
 * the xine engine in a widget - header
22
 
 */
23
 
 
24
 
#ifndef HAVE_BACON_VIDEO_WIDGET_H
25
 
#define HAVE_BACON_VIDEO_WIDGET_H
26
 
 
27
 
#include <gtk/gtkbox.h>
28
 
#include <popt.h>
29
 
 
30
 
/* for optical disc enumeration type */
31
 
#include "totem-disc.h"
32
 
 
33
 
G_BEGIN_DECLS
34
 
 
35
 
#define BACON_VIDEO_WIDGET(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), bacon_video_widget_get_type (), BaconVideoWidget))
36
 
#define BACON_VIDEO_WIDGET_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), bacon_video_widget_get_type (), BaconVideoWidgetClass))
37
 
#define BACON_IS_VIDEO_WIDGET(obj)           (G_TYPE_CHECK_INSTANCE_TYPE (obj, bacon_video_widget_get_type ()))
38
 
#define BACON_IS_VIDEO_WIDGET_CLASS(klass)   (G_CHECK_INSTANCE_GET_CLASS ((klass), bacon_video_widget_get_type ()))
39
 
#define BVW_ERROR bacon_video_widget_error_quark ()
40
 
 
41
 
typedef struct BaconVideoWidgetPrivate BaconVideoWidgetPrivate;
42
 
 
43
 
typedef struct {
44
 
        GtkBox parent;
45
 
        BaconVideoWidgetPrivate *priv;
46
 
} BaconVideoWidget;
47
 
 
48
 
typedef struct {
49
 
        GtkBoxClass parent_class;
50
 
 
51
 
        void (*error) (GtkWidget *bvw, const char *message,
52
 
                       gboolean playback_stopped, gboolean fatal);
53
 
        void (*eos) (GtkWidget *bvw);
54
 
        void (*got_metadata) (GtkWidget *bvw);
55
 
        void (*title_change) (GtkWidget *bvw, const char *title);
56
 
        void (*channels_change) (GtkWidget *bvw);
57
 
        void (*tick) (GtkWidget *bvw, gint64 current_time, gint64 stream_length,
58
 
                        float current_position, gboolean seekable);
59
 
        void (*buffering) (GtkWidget *bvw, guint progress);
60
 
        void (*speed_warning) (GtkWidget *bvw);
61
 
} BaconVideoWidgetClass;
62
 
 
63
 
typedef enum {
64
 
        /* Plugins */
65
 
        BVW_ERROR_AUDIO_PLUGIN,
66
 
        BVW_ERROR_NO_PLUGIN_FOR_FILE,
67
 
        BVW_ERROR_VIDEO_PLUGIN,
68
 
        BVW_ERROR_AUDIO_BUSY,
69
 
        /* File */
70
 
        BVW_ERROR_BROKEN_FILE,
71
 
        BVW_ERROR_FILE_GENERIC,
72
 
        BVW_ERROR_FILE_PERMISSION,
73
 
        BVW_ERROR_FILE_ENCRYPTED,
74
 
        BVW_ERROR_FILE_NOT_FOUND,
75
 
        /* Devices */
76
 
        BVW_ERROR_DVD_ENCRYPTED,
77
 
        BVW_ERROR_INVALID_DEVICE,
78
 
        /* Network */
79
 
        BVW_ERROR_UNKNOWN_HOST,
80
 
        BVW_ERROR_NETWORK_UNREACHABLE,
81
 
        BVW_ERROR_CONNECTION_REFUSED,
82
 
        /* Generic */
83
 
        BVW_ERROR_UNVALID_LOCATION,
84
 
        BVW_ERROR_GENERIC,
85
 
        BVW_ERROR_CODEC_NOT_HANDLED,
86
 
        BVW_ERROR_AUDIO_ONLY,
87
 
        BVW_ERROR_CANNOT_CAPTURE,
88
 
        BVW_ERROR_READ_ERROR,
89
 
        BVW_ERROR_PLUGIN_LOAD,
90
 
        BVW_ERROR_STILL_IMAGE
91
 
} BvwError;
92
 
 
93
 
GQuark bacon_video_widget_error_quark            (void) G_GNUC_CONST;
94
 
GType bacon_video_widget_get_type                (void);
95
 
struct poptOption *bacon_video_widget_get_popt_table    (void);
96
 
 
97
 
typedef enum {
98
 
        BVW_USE_TYPE_VIDEO,
99
 
        BVW_USE_TYPE_AUDIO,
100
 
        BVW_USE_TYPE_CAPTURE,
101
 
        BVW_USE_TYPE_METADATA
102
 
} BvwUseType;
103
 
 
104
 
GtkWidget *bacon_video_widget_new                (int width, int height,
105
 
                                                  BvwUseType type,
106
 
                                                  GError **error);
107
 
 
108
 
char *bacon_video_widget_get_backend_name (BaconVideoWidget *bvw);
109
 
 
110
 
/* Actions */
111
 
gboolean bacon_video_widget_open                 (BaconVideoWidget *bvw,
112
 
                                                  const char *mrl,
113
 
                                                  GError **error);
114
 
gboolean bacon_video_widget_play                 (BaconVideoWidget *bvw,
115
 
                                                  GError **error);
116
 
void bacon_video_widget_pause                    (BaconVideoWidget *bvw);
117
 
gboolean bacon_video_widget_is_playing           (BaconVideoWidget *bvw);
118
 
 
119
 
/* Seeking and length */
120
 
gboolean bacon_video_widget_is_seekable          (BaconVideoWidget *bvw);
121
 
gboolean bacon_video_widget_seek                 (BaconVideoWidget *bvw,
122
 
                                                  float position,
123
 
                                                  GError **error);
124
 
gboolean bacon_video_widget_seek_time            (BaconVideoWidget *bvw,
125
 
                                                  gint64 time,
126
 
                                                  GError **error);
127
 
float bacon_video_widget_get_position            (BaconVideoWidget *bvw);
128
 
gint64 bacon_video_widget_get_current_time       (BaconVideoWidget *bvw);
129
 
gint64 bacon_video_widget_get_stream_length      (BaconVideoWidget *bvw);
130
 
 
131
 
void bacon_video_widget_stop                     (BaconVideoWidget *bvw);
132
 
void bacon_video_widget_close                    (BaconVideoWidget *bvw);
133
 
 
134
 
/* Audio volume */
135
 
gboolean bacon_video_widget_can_set_volume       (BaconVideoWidget *bvw);
136
 
void bacon_video_widget_set_volume               (BaconVideoWidget *bvw,
137
 
                                                  int volume);
138
 
int bacon_video_widget_get_volume                (BaconVideoWidget *bvw);
139
 
 
140
 
/* Properties */
141
 
void bacon_video_widget_set_logo                 (BaconVideoWidget *bvw,
142
 
                                                  char *filename);
143
 
void  bacon_video_widget_set_logo_mode           (BaconVideoWidget *bvw,
144
 
                                                  gboolean logo_mode);
145
 
gboolean bacon_video_widget_get_logo_mode        (BaconVideoWidget *bvw);
146
 
 
147
 
void bacon_video_widget_set_proprietary_plugins_path
148
 
                                                 (BaconVideoWidget *bvw,
149
 
                                                  const char *path);
150
 
 
151
 
void bacon_video_widget_set_fullscreen           (BaconVideoWidget *bvw,
152
 
                                                  gboolean fullscreen);
153
 
 
154
 
void bacon_video_widget_set_show_cursor          (BaconVideoWidget *bvw,
155
 
                                                  gboolean use_cursor);
156
 
gboolean bacon_video_widget_get_show_cursor      (BaconVideoWidget *bvw);
157
 
 
158
 
gboolean bacon_video_widget_get_auto_resize      (BaconVideoWidget *bvw);
159
 
void bacon_video_widget_set_auto_resize          (BaconVideoWidget *bvw,
160
 
                                                  gboolean auto_resize);
161
 
 
162
 
void bacon_video_widget_set_connection_speed     (BaconVideoWidget *bvw,
163
 
                                                  int speed);
164
 
int bacon_video_widget_get_connection_speed      (BaconVideoWidget *bvw);
165
 
 
166
 
void bacon_video_widget_set_media_device         (BaconVideoWidget *bvw,
167
 
                                                  const char *path);
168
 
gboolean bacon_video_widget_can_play             (BaconVideoWidget *bvw,
169
 
                                                  MediaType type);
170
 
G_CONST_RETURN gchar **bacon_video_widget_get_mrls
171
 
                                                 (BaconVideoWidget *bvw,
172
 
                                                  MediaType type);
173
 
 
174
 
/* Video devices */
175
 
void bacon_video_widget_set_video_device         (BaconVideoWidget *bvw,
176
 
                                                  const char *path);
177
 
 
178
 
/* Metadata */
179
 
typedef enum {
180
 
        BVW_INFO_TITLE,
181
 
        BVW_INFO_ARTIST,
182
 
        BVW_INFO_YEAR,
183
 
        BVW_INFO_ALBUM,
184
 
        BVW_INFO_DURATION,
185
 
        BVW_INFO_CDINDEX,
186
 
        /* Video */
187
 
        BVW_INFO_HAS_VIDEO,
188
 
        BVW_INFO_DIMENSION_X,
189
 
        BVW_INFO_DIMENSION_Y,
190
 
        BVW_INFO_VIDEO_CODEC,
191
 
        BVW_INFO_FPS,
192
 
        /* Audio */
193
 
        BVW_INFO_HAS_AUDIO,
194
 
        BVW_INFO_BITRATE,
195
 
        BVW_INFO_AUDIO_CODEC,
196
 
} BaconVideoWidgetMetadataType;
197
 
 
198
 
void bacon_video_widget_get_metadata             (BaconVideoWidget *bvw,
199
 
                                                  BaconVideoWidgetMetadataType
200
 
                                                  type,
201
 
                                                  GValue *value);
202
 
 
203
 
/* Visualisation functions */
204
 
typedef enum {
205
 
        VISUAL_SMALL,
206
 
        VISUAL_NORMAL,
207
 
        VISUAL_LARGE,
208
 
        VISUAL_EXTRA_LARGE
209
 
} VisualsQuality;
210
 
 
211
 
gboolean bacon_video_widget_set_show_visuals      (BaconVideoWidget *bvw,
212
 
                                                   gboolean show_visuals);
213
 
GList *bacon_video_widget_get_visuals_list        (BaconVideoWidget *bvw);
214
 
gboolean bacon_video_widget_set_visuals           (BaconVideoWidget *bvw,
215
 
                                                   const char *name);
216
 
void bacon_video_widget_set_visuals_quality       (BaconVideoWidget *bvw,
217
 
                                                   VisualsQuality quality);
218
 
 
219
 
/* Picture settings */
220
 
typedef enum {
221
 
        BVW_VIDEO_BRIGHTNESS,
222
 
        BVW_VIDEO_CONTRAST,
223
 
        BVW_VIDEO_SATURATION,
224
 
        BVW_VIDEO_HUE
225
 
} BaconVideoWidgetVideoProperty;
226
 
 
227
 
typedef enum {
228
 
        BVW_RATIO_AUTO,
229
 
        BVW_RATIO_SQUARE,
230
 
        BVW_RATIO_FOURBYTHREE,
231
 
        BVW_RATIO_ANAMORPHIC,
232
 
        BVW_RATIO_DVB
233
 
} BaconVideoWidgetAspectRatio;
234
 
 
235
 
void bacon_video_widget_set_deinterlacing        (BaconVideoWidget *bvw,
236
 
                                                  gboolean deinterlace);
237
 
gboolean bacon_video_widget_get_deinterlacing    (BaconVideoWidget *bvw);
238
 
 
239
 
void bacon_video_widget_set_aspect_ratio         (BaconVideoWidget *bvw,
240
 
                                                  BaconVideoWidgetAspectRatio
241
 
                                                  ratio);
242
 
BaconVideoWidgetAspectRatio bacon_video_widget_get_aspect_ratio
243
 
                                                 (BaconVideoWidget *bvw);
244
 
 
245
 
void bacon_video_widget_set_scale_ratio          (BaconVideoWidget *bvw,
246
 
                                                  float ratio);
247
 
 
248
 
gboolean bacon_video_widget_can_set_zoom         (BaconVideoWidget *bvw);
249
 
void bacon_video_widget_set_zoom                 (BaconVideoWidget *bvw,
250
 
                                                  int zoom);
251
 
int bacon_video_widget_get_zoom                  (BaconVideoWidget *bvw);
252
 
 
253
 
int bacon_video_widget_get_video_property        (BaconVideoWidget *bvw,
254
 
                                                  BaconVideoWidgetVideoProperty
255
 
                                                  type);
256
 
void bacon_video_widget_set_video_property       (BaconVideoWidget *bvw,
257
 
                                                  BaconVideoWidgetVideoProperty
258
 
                                                  type,
259
 
                                                  int value);
260
 
 
261
 
/* DVD functions */
262
 
typedef enum {
263
 
        BVW_DVD_ROOT_MENU,
264
 
        BVW_DVD_TITLE_MENU,
265
 
        BVW_DVD_SUBPICTURE_MENU,
266
 
        BVW_DVD_AUDIO_MENU,
267
 
        BVW_DVD_ANGLE_MENU,
268
 
        BVW_DVD_CHAPTER_MENU,
269
 
        BVW_DVD_NEXT_CHAPTER,
270
 
        BVW_DVD_PREV_CHAPTER,
271
 
        BVW_DVD_NEXT_TITLE,
272
 
        BVW_DVD_PREV_TITLE,
273
 
        BVW_DVD_NEXT_ANGLE,
274
 
        BVW_DVD_PREV_ANGLE
275
 
} BaconVideoWidgetDVDEvent;
276
 
 
277
 
void bacon_video_widget_dvd_event                (BaconVideoWidget *bvw,
278
 
                                                  BaconVideoWidgetDVDEvent
279
 
                                                  type);
280
 
GList *bacon_video_widget_get_languages          (BaconVideoWidget *bvw);
281
 
int bacon_video_widget_get_language              (BaconVideoWidget *bvw);
282
 
void bacon_video_widget_set_language             (BaconVideoWidget *bvw,
283
 
                                                  int language);
284
 
 
285
 
GList *bacon_video_widget_get_subtitles          (BaconVideoWidget *bvw);
286
 
int bacon_video_widget_get_subtitle              (BaconVideoWidget *bvw);
287
 
void bacon_video_widget_set_subtitle             (BaconVideoWidget *bvw,
288
 
                                                  int subtitle);
289
 
 
290
 
/* Screenshot functions */
291
 
gboolean bacon_video_widget_can_get_frames       (BaconVideoWidget *bvw,
292
 
                                                  GError **error);
293
 
GdkPixbuf *bacon_video_widget_get_current_frame (BaconVideoWidget *bvw);
294
 
 
295
 
/* TV-Out functions */
296
 
typedef enum {
297
 
        TV_OUT_NONE,
298
 
        TV_OUT_DXR3,
299
 
        TV_OUT_NVTV_PAL,
300
 
        TV_OUT_NVTV_NTSC
301
 
} TvOutType;
302
 
 
303
 
gboolean bacon_video_widget_fullscreen_mode_available (BaconVideoWidget *bvw,
304
 
                                                       TvOutType tvout);
305
 
 
306
 
gboolean bacon_video_widget_set_tv_out           (BaconVideoWidget *bvw,
307
 
                                                  TvOutType tvout);
308
 
TvOutType bacon_video_widget_get_tv_out          (BaconVideoWidget *bvw);
309
 
 
310
 
/* Audio-out functions */
311
 
typedef enum {
312
 
        BVW_AUDIO_SOUND_STEREO,
313
 
        BVW_AUDIO_SOUND_4CHANNEL,
314
 
        BVW_AUDIO_SOUND_41CHANNEL,
315
 
        BVW_AUDIO_SOUND_5CHANNEL,
316
 
        BVW_AUDIO_SOUND_51CHANNEL,
317
 
        BVW_AUDIO_SOUND_AC3PASSTHRU
318
 
} BaconVideoWidgetAudioOutType;
319
 
 
320
 
BaconVideoWidgetAudioOutType bacon_video_widget_get_audio_out_type
321
 
                                                 (BaconVideoWidget *bvw);
322
 
void bacon_video_widget_set_audio_out_type       (BaconVideoWidget *bvw,
323
 
                                                  BaconVideoWidgetAudioOutType
324
 
                                                  type);
325
 
 
326
 
G_END_DECLS
327
 
 
328
 
#endif                          /* HAVE_BACON_VIDEO_WIDGET_H */