• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavfilter/libmpcodecs/libvo/video_out.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) Aaron Holtzman - Aug 1999
00003  * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
00004  * (C) MPlayer developers
00005  *
00006  * This file is part of MPlayer.
00007  *
00008  * MPlayer is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * MPlayer is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License along
00019  * with MPlayer; if not, write to the Free Software Foundation, Inc.,
00020  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00021  */
00022 
00023 #ifndef MPLAYER_VIDEO_OUT_H
00024 #define MPLAYER_VIDEO_OUT_H
00025 
00026 #include <inttypes.h>
00027 #include <stdarg.h>
00028 
00029 //#include "sub/font_load.h"
00030 #include "../img_format.h"
00031 //#include "vidix/vidix.h"
00032 
00033 #define VO_EVENT_EXPOSE 1
00034 #define VO_EVENT_RESIZE 2
00035 #define VO_EVENT_KEYPRESS 4
00036 #define VO_EVENT_REINIT 8
00037 #define VO_EVENT_MOVE 16
00038 
00039 /* Obsolete: VOCTRL_QUERY_VAA 1 */
00040 /* does the device support the required format */
00041 #define VOCTRL_QUERY_FORMAT 2
00042 /* signal a device reset seek */
00043 #define VOCTRL_RESET 3
00044 /* true if vo driver can use GUI created windows */
00045 #define VOCTRL_GUISUPPORT 4
00046 #define VOCTRL_GUI_NOWINDOW 19
00047 /* used to switch to fullscreen */
00048 #define VOCTRL_FULLSCREEN 5
00049 /* signal a device pause */
00050 #define VOCTRL_PAUSE 7
00051 /* start/resume playback */
00052 #define VOCTRL_RESUME 8
00053 /* libmpcodecs direct rendering: */
00054 #define VOCTRL_GET_IMAGE 9
00055 #define VOCTRL_DRAW_IMAGE 13
00056 #define VOCTRL_SET_SPU_PALETTE 14
00057 /* decoding ahead: */
00058 #define VOCTRL_GET_NUM_FRAMES 10
00059 #define VOCTRL_GET_FRAME_NUM  11
00060 #define VOCTRL_SET_FRAME_NUM  12
00061 #define VOCTRL_GET_PANSCAN 15
00062 #define VOCTRL_SET_PANSCAN 16
00063 /* equalizer controls */
00064 #define VOCTRL_SET_EQUALIZER 17
00065 #define VOCTRL_GET_EQUALIZER 18
00066 //#define VOCTRL_GUI_NOWINDOW 19
00067 /* Frame duplication */
00068 #define VOCTRL_DUPLICATE_FRAME 20
00069 // ... 21
00070 #define VOCTRL_START_SLICE 21
00071 
00072 #define VOCTRL_ONTOP 25
00073 #define VOCTRL_ROOTWIN 26
00074 #define VOCTRL_BORDER 27
00075 #define VOCTRL_DRAW_EOSD 28
00076 #define VOCTRL_GET_EOSD_RES 29
00077 
00078 #define VOCTRL_SET_DEINTERLACE 30
00079 #define VOCTRL_GET_DEINTERLACE 31
00080 
00081 #define VOCTRL_UPDATE_SCREENINFO 32
00082 
00083 // Vo can be used by xover
00084 #define VOCTRL_XOVERLAY_SUPPORT 22
00085 
00086 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
00087 typedef struct {
00088   uint32_t x11; // The raw x11 color
00089   uint16_t r,g,b;
00090 } mp_colorkey_t;
00091 
00092 #define VOCTRL_XOVERLAY_SET_WIN 23
00093 typedef struct {
00094   int x,y;
00095   int w,h;
00096 } mp_win_t;
00097 
00098 #define VO_TRUE      1
00099 #define VO_FALSE     0
00100 #define VO_ERROR    -1
00101 #define VO_NOTAVAIL -2
00102 #define VO_NOTIMPL  -3
00103 
00104 #define VOFLAG_FULLSCREEN         0x01
00105 #define VOFLAG_MODESWITCHING      0x02
00106 #define VOFLAG_SWSCALE            0x04
00107 #define VOFLAG_FLIPPING           0x08
00108 #define VOFLAG_HIDDEN             0x10  //< Use to create a hidden window
00109 #define VOFLAG_STEREO             0x20  //< Use to create a stereo-capable window
00110 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
00111 
00112 typedef struct vo_info_s
00113 {
00114     /* driver name ("Matrox Millennium G200/G400" */
00115     const char *name;
00116     /* short name (for config strings) ("mga") */
00117     const char *short_name;
00118     /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
00119     const char *author;
00120     /* any additional comments */
00121     const char *comment;
00122 } vo_info_t;
00123 
00124 typedef struct vo_functions_s
00125 {
00126     const vo_info_t *info;
00127     /*
00128      * Preinitializes driver (real INITIALIZATION)
00129      *   arg - currently it's vo_subdevice
00130      *   returns: zero on successful initialization, non-zero on error.
00131      */
00132     int (*preinit)(const char *arg);
00133     /*
00134      * Initialize (means CONFIGURE) the display driver.
00135      * params:
00136      *   width,height: image source size
00137      *   d_width,d_height: size of the requested window size, just a hint
00138      *   fullscreen: flag, 0=windowd 1=fullscreen, just a hint
00139      *   title: window title, if available
00140      *   format: fourcc of pixel format
00141      * returns : zero on successful initialization, non-zero on error.
00142      */
00143     int (*config)(uint32_t width, uint32_t height, uint32_t d_width,
00144                   uint32_t d_height, uint32_t fullscreen, char *title,
00145                   uint32_t format);
00146 
00147     /*
00148      * Control interface
00149      */
00150     int (*control)(uint32_t request, void *data, ...);
00151 
00152     /*
00153      * Display a new RGB/BGR frame of the video to the screen.
00154      * params:
00155      *   src[0] - pointer to the image
00156      */
00157     int (*draw_frame)(uint8_t *src[]);
00158 
00159     /*
00160      * Draw a planar YUV slice to the buffer:
00161      * params:
00162      *   src[3] = source image planes (Y,U,V)
00163      *   stride[3] = source image planes line widths (in bytes)
00164      *   w,h = width*height of area to be copied (in Y pixels)
00165      *   x,y = position at the destination image (in Y pixels)
00166      */
00167     int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
00168 
00169     /*
00170      * Draws OSD to the screen buffer
00171      */
00172     void (*draw_osd)(void);
00173 
00174     /*
00175      * Blit/Flip buffer to the screen. Must be called after each frame!
00176      */
00177     void (*flip_page)(void);
00178 
00179     /*
00180      * This func is called after every frames to handle keyboard and
00181      * other events. It's called in PAUSE mode too!
00182      */
00183     void (*check_events)(void);
00184 
00185     /*
00186      * Closes driver. Should restore the original state of the system.
00187      */
00188     void (*uninit)(void);
00189 } vo_functions_t;
00190 
00191 const vo_functions_t* init_best_video_out(char** vo_list);
00192 int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
00193                      uint32_t d_width, uint32_t d_height, uint32_t flags,
00194                      char *title, uint32_t format);
00195 void list_video_out(void);
00196 
00197 // NULL terminated array of all drivers
00198 extern const vo_functions_t* const video_out_drivers[];
00199 
00200 extern int vo_flags;
00201 
00202 extern int vo_config_count;
00203 
00204 extern int xinerama_screen;
00205 extern int xinerama_x;
00206 extern int xinerama_y;
00207 
00208 // correct resolution/bpp on screen:  (should be autodetected by vo_init())
00209 extern int vo_depthonscreen;
00210 extern int vo_screenwidth;
00211 extern int vo_screenheight;
00212 
00213 // requested resolution/bpp:  (-x -y -bpp options)
00214 extern int vo_dx;
00215 extern int vo_dy;
00216 extern int vo_dwidth;
00217 extern int vo_dheight;
00218 extern int vo_dbpp;
00219 
00220 extern int vo_grabpointer;
00221 extern int vo_doublebuffering;
00222 extern int vo_directrendering;
00223 extern int vo_vsync;
00224 extern int vo_fs;
00225 extern int vo_fsmode;
00226 extern float vo_panscan;
00227 extern int vo_adapter_num;
00228 extern int vo_refresh_rate;
00229 extern int vo_keepaspect;
00230 extern int vo_rootwin;
00231 extern int vo_ontop;
00232 extern int vo_border;
00233 
00234 extern int vo_gamma_gamma;
00235 extern int vo_gamma_brightness;
00236 extern int vo_gamma_saturation;
00237 extern int vo_gamma_contrast;
00238 extern int vo_gamma_hue;
00239 extern int vo_gamma_red_intensity;
00240 extern int vo_gamma_green_intensity;
00241 extern int vo_gamma_blue_intensity;
00242 
00243 extern int vo_nomouse_input;
00244 extern int enable_mouse_movements;
00245 
00246 extern int vo_pts;
00247 extern float vo_fps;
00248 
00249 extern char *vo_subdevice;
00250 
00251 extern int vo_colorkey;
00252 
00253 extern char *vo_winname;
00254 extern char *vo_wintitle;
00255 
00256 extern int64_t WinID;
00257 
00258 typedef struct {
00259         float min;
00260         float max;
00261         } range_t;
00262 
00263 float range_max(range_t *r);
00264 int in_range(range_t *r, float f);
00265 range_t *str2range(char *s);
00266 extern char *monitor_hfreq_str;
00267 extern char *monitor_vfreq_str;
00268 extern char *monitor_dotclock_str;
00269 
00270 struct mp_keymap {
00271   int from;
00272   int to;
00273 };
00274 int lookup_keymap_table(const struct mp_keymap *map, int key);
00275 struct vo_rect {
00276   int left, right, top, bottom, width, height;
00277 };
00278 void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, struct vo_rect *dst,
00279                         struct vo_rect *borders, const struct vo_rect *crop);
00280 void vo_mouse_movement(int posx, int posy);
00281 
00282 static inline int aspect_scaling(void)
00283 {
00284   return vo_fs;
00285 }
00286 
00287 #endif /* MPLAYER_VIDEO_OUT_H */
Generated on Fri Feb 1 2013 14:34:48 for FFmpeg by doxygen 1.7.1