00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef VLC_VOUT_DISPLAY_H
00025 #define VLC_VOUT_DISPLAY_H 1
00026
00027
00028
00029
00030
00031
00032 #include <vlc_es.h>
00033 #include <vlc_picture.h>
00034 #include <vlc_subpicture.h>
00035 #include <vlc_keys.h>
00036 #include <vlc_mouse.h>
00037 #include <vlc_vout_window.h>
00038
00039
00040
00041
00042
00043
00044 typedef struct vout_display_t vout_display_t;
00045 typedef struct vout_display_sys_t vout_display_sys_t;
00046 typedef struct vout_display_owner_t vout_display_owner_t;
00047 typedef struct vout_display_owner_sys_t vout_display_owner_sys_t;
00048
00049
00050
00051
00052 typedef enum
00053 {
00054 VOUT_DISPLAY_ALIGN_CENTER,
00055
00056 VOUT_DISPLAY_ALIGN_LEFT,
00057 VOUT_DISPLAY_ALIGN_RIGHT,
00058
00059 VOUT_DISPLAY_ALIGN_TOP,
00060 VOUT_DISPLAY_ALIGN_BOTTOM,
00061 } vout_display_align_t;
00062
00063
00064
00065
00066 typedef struct {
00067 bool is_fullscreen;
00068
00069
00070 struct {
00071
00072 const char *title;
00073
00074
00075 unsigned width;
00076 unsigned height;
00077
00078
00079 struct {
00080 unsigned num;
00081 unsigned den;
00082 } sar;
00083 } display;
00084
00085
00086 struct {
00087 int horizontal;
00088 int vertical;
00089 } align;
00090
00091
00092 bool is_display_filled;
00093
00094
00095
00096
00097 struct {
00098 int num;
00099 int den;
00100 } zoom;
00101
00102 } vout_display_cfg_t;
00103
00104
00105
00106
00107
00108
00109
00110
00111 typedef struct {
00112 bool is_slow;
00113 bool has_double_click;
00114 bool has_hide_mouse;
00115 bool has_pictures_invalid;
00116 } vout_display_info_t;
00117
00118
00119
00120
00121 enum {
00122
00123
00124 VOUT_DISPLAY_HIDE_MOUSE,
00125
00126
00127
00128
00129 VOUT_DISPLAY_RESET_PICTURES,
00130
00131
00132
00133 VOUT_DISPLAY_CHANGE_FULLSCREEN,
00134
00135
00136
00137 VOUT_DISPLAY_CHANGE_ON_TOP,
00138
00139
00140
00141 VOUT_DISPLAY_CHANGE_DISPLAY_SIZE,
00142
00143
00144
00145 VOUT_DISPLAY_CHANGE_DISPLAY_FILLED,
00146
00147
00148
00149 VOUT_DISPLAY_CHANGE_ZOOM,
00150
00151
00152
00153 VOUT_DISPLAY_CHANGE_SOURCE_ASPECT,
00154
00155
00156
00157
00158
00159 VOUT_DISPLAY_CHANGE_SOURCE_CROP,
00160 };
00161
00162
00163
00164
00165
00166
00167
00168 enum {
00169
00170
00171
00172
00173 VOUT_DISPLAY_EVENT_PICTURES_INVALID,
00174
00175 VOUT_DISPLAY_EVENT_FULLSCREEN,
00176 VOUT_DISPLAY_EVENT_ON_TOP,
00177
00178 VOUT_DISPLAY_EVENT_DISPLAY_SIZE,
00179
00180
00181 VOUT_DISPLAY_EVENT_CLOSE,
00182 VOUT_DISPLAY_EVENT_KEY,
00183
00184
00185
00186
00187
00188 VOUT_DISPLAY_EVENT_MOUSE_STATE,
00189
00190
00191 VOUT_DISPLAY_EVENT_MOUSE_MOVED,
00192 VOUT_DISPLAY_EVENT_MOUSE_PRESSED,
00193 VOUT_DISPLAY_EVENT_MOUSE_RELEASED,
00194 VOUT_DISPLAY_EVENT_MOUSE_DOUBLE_CLICK,
00195 };
00196
00197
00198
00199
00200 struct vout_display_owner_t {
00201
00202
00203 vout_display_owner_sys_t *sys;
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216 void (*event)(vout_display_t *, int, va_list);
00217
00218
00219
00220
00221
00222
00223 vout_window_t *(*window_new)(vout_display_t *, const vout_window_cfg_t *);
00224 void (*window_del)(vout_display_t *, vout_window_t *);
00225 };
00226
00227 struct vout_display_t {
00228 VLC_COMMON_MEMBERS
00229
00230
00231 module_t *module;
00232
00233
00234
00235
00236
00237
00238
00239 const vout_display_cfg_t *cfg;
00240
00241
00242
00243
00244
00245
00246 video_format_t source;
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 video_format_t fmt;
00258
00259
00260
00261
00262
00263 vout_display_info_t info;
00264
00265
00266
00267
00268
00269
00270
00271
00272 picture_t *(*get)(vout_display_t *);
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282 void (*prepare)(vout_display_t *, picture_t *);
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292 void (*display)(vout_display_t *, picture_t *);
00293
00294
00295 int (*control)(vout_display_t *, int, va_list);
00296
00297
00298 void (*manage)(vout_display_t *);
00299
00300
00301
00302
00303
00304 vout_display_sys_t *sys;
00305
00306
00307
00308
00309
00310 vout_display_owner_t owner;
00311 };
00312
00313 static inline void vout_display_SendEvent(vout_display_t *vd, int query, ...)
00314 {
00315 va_list args;
00316 va_start(args, query);
00317 vd->owner.event(vd, query, args);
00318 va_end(args);
00319 }
00320
00321 static inline void vout_display_SendEventDisplaySize(vout_display_t *vd, int width, int height, bool is_fullscreen)
00322 {
00323 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_DISPLAY_SIZE, width, height, is_fullscreen);
00324 }
00325 static inline void vout_display_SendEventPicturesInvalid(vout_display_t *vd)
00326 {
00327 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_PICTURES_INVALID);
00328 }
00329 static inline void vout_display_SendEventClose(vout_display_t *vd)
00330 {
00331 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_CLOSE);
00332 }
00333 static inline void vout_display_SendEventKey(vout_display_t *vd, int key)
00334 {
00335 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_KEY, key);
00336 }
00337 static inline void vout_display_SendEventFullscreen(vout_display_t *vd, bool is_fullscreen)
00338 {
00339 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_FULLSCREEN, is_fullscreen);
00340 }
00341 static inline void vout_display_SendEventOnTop(vout_display_t *vd, bool is_on_top)
00342 {
00343 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_ON_TOP, is_on_top);
00344 }
00345
00346 static inline void vout_display_SendEventMouseState(vout_display_t *vd, int x, int y, int button_mask)
00347 {
00348 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_MOUSE_STATE, x, y, button_mask);
00349 }
00350 static inline void vout_display_SendEventMouseMoved(vout_display_t *vd, int x, int y)
00351 {
00352 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_MOUSE_MOVED, x, y);
00353 }
00354 static inline void vout_display_SendEventMousePressed(vout_display_t *vd, int button)
00355 {
00356 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_MOUSE_PRESSED, button);
00357 }
00358 static inline void vout_display_SendEventMouseReleased(vout_display_t *vd, int button)
00359 {
00360 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_MOUSE_RELEASED, button);
00361 }
00362 static inline void vout_display_SendEventMouseDoubleClick(vout_display_t *vd)
00363 {
00364 vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_MOUSE_DOUBLE_CLICK);
00365 }
00366
00367
00368
00369
00370
00371
00372 static inline vout_window_t *vout_display_NewWindow(vout_display_t *vd, const vout_window_cfg_t *cfg)
00373 {
00374 return vd->owner.window_new(vd, cfg);
00375 }
00376 static inline void vout_display_DeleteWindow(vout_display_t *vd,
00377 vout_window_t *window)
00378 {
00379 vd->owner.window_del(vd, window);
00380 }
00381
00382
00383
00384
00385
00386
00387
00388 VLC_EXPORT( void, vout_display_GetDefaultDisplaySize, (unsigned *width, unsigned *height, const video_format_t *source, const vout_display_cfg_t *) );
00389
00390
00391
00392
00393
00394 typedef struct {
00395 int x;
00396 int y;
00397 unsigned width;
00398 unsigned height;
00399 } vout_display_place_t;
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411 VLC_EXPORT( void, vout_display_PlacePicture, (vout_display_place_t *place, const video_format_t *source, const vout_display_cfg_t *cfg, bool do_clipping) );
00412
00413 #endif
00414