2001-02-24 21:28:24 +01:00
|
|
|
/*
|
|
|
|
* video_out.h
|
|
|
|
*
|
|
|
|
* Copyright (C) Aaron Holtzman - Aug 1999
|
2001-03-03 22:46:39 +01:00
|
|
|
* Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
|
2002-07-24 20:19:39 +02:00
|
|
|
* (C) MPlayer Developers
|
2001-02-24 21:28:24 +01:00
|
|
|
*
|
|
|
|
*/
|
2002-03-03 19:47:29 +01:00
|
|
|
|
2008-02-22 10:09:46 +01:00
|
|
|
#ifndef MPLAYER_VIDEO_OUT_H
|
|
|
|
#define MPLAYER_VIDEO_OUT_H
|
2001-02-24 21:28:24 +01:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
2002-02-09 01:47:26 +01:00
|
|
|
#include <stdarg.h>
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2002-03-24 01:32:13 +01:00
|
|
|
//#include "font_load.h"
|
2006-08-18 15:58:03 +02:00
|
|
|
#include "libmpcodecs/img_format.h"
|
2004-10-28 03:15:53 +02:00
|
|
|
//#include "vidix/vidix.h"
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2001-03-03 22:46:39 +01:00
|
|
|
#define VO_EVENT_EXPOSE 1
|
|
|
|
#define VO_EVENT_RESIZE 2
|
|
|
|
#define VO_EVENT_KEYPRESS 4
|
|
|
|
|
2002-08-28 23:32:32 +02:00
|
|
|
/* Obsolete: VOCTRL_QUERY_VAA 1 */
|
2002-07-24 20:19:39 +02:00
|
|
|
/* does the device support the required format */
|
2002-02-09 01:47:26 +01:00
|
|
|
#define VOCTRL_QUERY_FORMAT 2
|
2002-02-18 18:34:20 +01:00
|
|
|
/* signal a device reset seek */
|
2002-02-09 01:47:26 +01:00
|
|
|
#define VOCTRL_RESET 3
|
2002-02-09 23:38:36 +01:00
|
|
|
/* true if vo driver can use GUI created windows */
|
|
|
|
#define VOCTRL_GUISUPPORT 4
|
2002-08-15 01:02:45 +02:00
|
|
|
#define VOCTRL_GUI_NOWINDOW 19
|
2002-02-17 01:33:50 +01:00
|
|
|
/* used to switch to fullscreen */
|
|
|
|
#define VOCTRL_FULLSCREEN 5
|
2002-02-18 18:34:20 +01:00
|
|
|
/* signal a device pause */
|
|
|
|
#define VOCTRL_PAUSE 7
|
|
|
|
/* start/resume playback */
|
|
|
|
#define VOCTRL_RESUME 8
|
2002-03-07 03:44:16 +01:00
|
|
|
/* libmpcodecs direct rendering: */
|
|
|
|
#define VOCTRL_GET_IMAGE 9
|
2002-04-06 21:08:52 +02:00
|
|
|
#define VOCTRL_DRAW_IMAGE 13
|
2002-05-18 01:47:27 +02:00
|
|
|
#define VOCTRL_SET_SPU_PALETTE 14
|
2002-03-09 18:27:37 +01:00
|
|
|
/* decoding ahead: */
|
|
|
|
#define VOCTRL_GET_NUM_FRAMES 10
|
|
|
|
#define VOCTRL_GET_FRAME_NUM 11
|
|
|
|
#define VOCTRL_SET_FRAME_NUM 12
|
2002-06-06 00:47:15 +02:00
|
|
|
#define VOCTRL_GET_PANSCAN 15
|
|
|
|
#define VOCTRL_SET_PANSCAN 16
|
2002-07-24 20:19:39 +02:00
|
|
|
/* equalizer controls */
|
|
|
|
#define VOCTRL_SET_EQUALIZER 17
|
2008-04-02 17:51:38 +02:00
|
|
|
struct voctrl_set_equalizer_args {
|
|
|
|
const char *name;
|
|
|
|
int value;
|
|
|
|
};
|
2002-07-24 20:19:39 +02:00
|
|
|
#define VOCTRL_GET_EQUALIZER 18
|
2008-04-02 17:51:38 +02:00
|
|
|
struct voctrl_get_equalizer_args {
|
|
|
|
const char *name;
|
|
|
|
int *valueptr;
|
|
|
|
};
|
2002-12-14 18:12:40 +01:00
|
|
|
//#define VOCTRL_GUI_NOWINDOW 19
|
|
|
|
/* Frame duplication */
|
|
|
|
#define VOCTRL_DUPLICATE_FRAME 20
|
|
|
|
// ... 21
|
2003-03-10 01:03:46 +01:00
|
|
|
#define VOCTRL_START_SLICE 21
|
2002-08-15 01:02:45 +02:00
|
|
|
|
2003-11-30 17:36:10 +01:00
|
|
|
#define VOCTRL_ONTOP 25
|
2004-08-22 21:01:56 +02:00
|
|
|
#define VOCTRL_ROOTWIN 26
|
2005-11-10 23:25:54 +01:00
|
|
|
#define VOCTRL_BORDER 27
|
2006-08-28 21:10:11 +02:00
|
|
|
#define VOCTRL_DRAW_EOSD 28
|
|
|
|
#define VOCTRL_GET_EOSD_RES 29
|
|
|
|
typedef struct {
|
|
|
|
int w, h; // screen dimensions, including black borders
|
|
|
|
int mt, mb, ml, mr; // borders (top, bottom, left, right)
|
|
|
|
} mp_eosd_res_t;
|
2003-11-30 17:36:10 +01:00
|
|
|
|
2006-11-17 19:16:21 +01:00
|
|
|
#define VOCTRL_SET_DEINTERLACE 30
|
|
|
|
#define VOCTRL_GET_DEINTERLACE 31
|
|
|
|
|
2007-02-17 21:58:55 +01:00
|
|
|
#define VOCTRL_UPDATE_SCREENINFO 32
|
|
|
|
|
2003-03-12 16:04:05 +01:00
|
|
|
// Vo can be used by xover
|
|
|
|
#define VOCTRL_XOVERLAY_SUPPORT 22
|
|
|
|
|
|
|
|
#define VOCTRL_XOVERLAY_SET_COLORKEY 24
|
|
|
|
typedef struct {
|
|
|
|
uint32_t x11; // The raw x11 color
|
|
|
|
uint16_t r,g,b;
|
|
|
|
} mp_colorkey_t;
|
|
|
|
|
|
|
|
#define VOCTRL_XOVERLAY_SET_WIN 23
|
|
|
|
typedef struct {
|
|
|
|
int x,y;
|
|
|
|
int w,h;
|
|
|
|
} mp_win_t;
|
2002-06-05 21:35:54 +02:00
|
|
|
|
2002-02-09 01:47:26 +01:00
|
|
|
#define VO_TRUE 1
|
|
|
|
#define VO_FALSE 0
|
|
|
|
#define VO_ERROR -1
|
|
|
|
#define VO_NOTAVAIL -2
|
|
|
|
#define VO_NOTIMPL -3
|
|
|
|
|
2002-02-17 04:06:38 +01:00
|
|
|
#define VOFLAG_FULLSCREEN 0x01
|
|
|
|
#define VOFLAG_MODESWITCHING 0x02
|
|
|
|
#define VOFLAG_SWSCALE 0x04
|
|
|
|
#define VOFLAG_FLIPPING 0x08
|
2003-03-12 16:04:05 +01:00
|
|
|
#define VOFLAG_XOVERLAY_SUB_VO 0x10000
|
2002-02-17 04:06:38 +01:00
|
|
|
|
2001-02-24 21:28:24 +01:00
|
|
|
typedef struct vo_info_s
|
|
|
|
{
|
|
|
|
/* driver name ("Matrox Millennium G200/G400" */
|
|
|
|
const char *name;
|
|
|
|
/* short name (for config strings) ("mga") */
|
|
|
|
const char *short_name;
|
|
|
|
/* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
|
|
|
|
const char *author;
|
|
|
|
/* any additional comments */
|
|
|
|
const char *comment;
|
|
|
|
} vo_info_t;
|
|
|
|
|
2008-04-03 05:25:41 +02:00
|
|
|
struct vo;
|
|
|
|
|
|
|
|
struct vo_driver {
|
|
|
|
// Driver uses new API
|
|
|
|
int is_new;
|
|
|
|
|
|
|
|
// This is set if the driver is not new and contains pointers to
|
|
|
|
// old-API functions to be used instead of the ones below.
|
|
|
|
struct vo_old_functions *old_functions;
|
|
|
|
|
2007-12-02 15:06:03 +01:00
|
|
|
const vo_info_t *info;
|
2002-01-26 17:01:26 +01:00
|
|
|
/*
|
|
|
|
* Preinitializes driver (real INITIALIZATION)
|
|
|
|
* arg - currently it's vo_subdevice
|
|
|
|
* returns: zero on successful initialization, non-zero on error.
|
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
int (*preinit)(struct vo *vo, const char *arg);
|
2001-02-24 21:28:24 +01:00
|
|
|
/*
|
2002-01-26 17:01:26 +01:00
|
|
|
* Initialize (means CONFIGURE) the display driver.
|
2001-03-03 22:46:39 +01:00
|
|
|
* params:
|
|
|
|
* width,height: image source size
|
|
|
|
* d_width,d_height: size of the requested window size, just a hint
|
|
|
|
* fullscreen: flag, 0=windowd 1=fullscreen, just a hint
|
|
|
|
* title: window title, if available
|
|
|
|
* format: fourcc of pixel format
|
|
|
|
* returns : zero on successful initialization, non-zero on error.
|
2001-02-24 21:28:24 +01:00
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
int (*config)(struct vo *vo, uint32_t width, uint32_t height,
|
|
|
|
uint32_t d_width, uint32_t d_height, uint32_t fullscreen,
|
|
|
|
char *title, uint32_t format);
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2002-02-09 01:47:26 +01:00
|
|
|
/*
|
|
|
|
* Control interface
|
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
int (*control)(struct vo *vo, uint32_t request, void *data);
|
2001-02-24 21:28:24 +01:00
|
|
|
|
|
|
|
/*
|
2001-03-03 22:46:39 +01:00
|
|
|
* Display a new RGB/BGR frame of the video to the screen.
|
|
|
|
* params:
|
|
|
|
* src[0] - pointer to the image
|
2001-02-24 21:28:24 +01:00
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
int (*draw_frame)(struct vo *vo, uint8_t *src[]);
|
2001-02-24 21:28:24 +01:00
|
|
|
|
|
|
|
/*
|
2001-03-03 22:46:39 +01:00
|
|
|
* Draw a planar YUV slice to the buffer:
|
|
|
|
* params:
|
|
|
|
* src[3] = source image planes (Y,U,V)
|
|
|
|
* stride[3] = source image planes line widths (in bytes)
|
|
|
|
* w,h = width*height of area to be copied (in Y pixels)
|
|
|
|
* x,y = position at the destination image (in Y pixels)
|
2001-02-24 21:28:24 +01:00
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
int (*draw_slice)(struct vo *vo, uint8_t *src[], int stride[], int w,
|
|
|
|
int h, int x, int y);
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2001-08-13 13:08:18 +02:00
|
|
|
/*
|
|
|
|
* Draws OSD to the screen buffer
|
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
void (*draw_osd)(struct vo *vo);
|
2001-08-13 13:08:18 +02:00
|
|
|
|
2001-02-24 21:28:24 +01:00
|
|
|
/*
|
2001-03-03 22:46:39 +01:00
|
|
|
* Blit/Flip buffer to the screen. Must be called after each frame!
|
2001-02-24 21:28:24 +01:00
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
void (*flip_page)(struct vo *vo);
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2001-03-03 22:46:39 +01:00
|
|
|
/*
|
|
|
|
* This func is called after every frames to handle keyboard and
|
|
|
|
* other events. It's called in PAUSE mode too!
|
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
void (*check_events)(struct vo *vo);
|
2001-03-03 22:46:39 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Closes driver. Should restore the original state of the system.
|
|
|
|
*/
|
2008-04-03 05:25:41 +02:00
|
|
|
void (*uninit)(struct vo *vo);
|
|
|
|
};
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2008-04-03 05:25:41 +02:00
|
|
|
struct vo_old_functions {
|
|
|
|
int (*preinit)(const char *arg);
|
|
|
|
int (*config)(uint32_t width, uint32_t height, uint32_t d_width,
|
|
|
|
uint32_t d_height, uint32_t fullscreen, char *title,
|
|
|
|
uint32_t format);
|
|
|
|
int (*control)(uint32_t request, void *data);
|
|
|
|
int (*draw_frame)(uint8_t *src[]);
|
|
|
|
int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
|
|
|
|
void (*draw_osd)(void);
|
|
|
|
void (*flip_page)(void);
|
|
|
|
void (*check_events)(void);
|
|
|
|
void (*uninit)(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vo {
|
|
|
|
const struct vo_driver *driver;
|
|
|
|
void *priv;
|
|
|
|
};
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2008-04-03 05:25:41 +02:00
|
|
|
struct vo *init_best_video_out(char **vo_list);
|
|
|
|
int vo_config(struct vo *vo, uint32_t width, uint32_t height,
|
2007-02-17 21:58:55 +01:00
|
|
|
uint32_t d_width, uint32_t d_height, uint32_t flags,
|
|
|
|
char *title, uint32_t format);
|
2006-02-09 15:08:03 +01:00
|
|
|
void list_video_out(void);
|
2002-09-29 23:53:05 +02:00
|
|
|
|
2008-04-03 05:25:41 +02:00
|
|
|
int vo_control(struct vo *vo, uint32_t request, void *data);
|
|
|
|
int vo_draw_frame(struct vo *vo, uint8_t *src[]);
|
|
|
|
int vo_draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h, int x, int y);
|
|
|
|
void vo_draw_osd(struct vo *vo);
|
|
|
|
void vo_flip_page(struct vo *vo);
|
|
|
|
void vo_check_events(struct vo *vo);
|
|
|
|
void vo_destroy(struct vo *vo);
|
|
|
|
|
|
|
|
|
2001-02-24 21:28:24 +01:00
|
|
|
// NULL terminated array of all drivers
|
2008-04-03 05:25:41 +02:00
|
|
|
extern const struct vo_driver *video_out_drivers[];
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2002-02-22 19:00:38 +01:00
|
|
|
extern int vo_flags;
|
|
|
|
|
2002-04-07 04:12:15 +02:00
|
|
|
extern int vo_config_count;
|
|
|
|
|
2006-04-16 15:38:28 +02:00
|
|
|
extern int xinerama_screen;
|
|
|
|
extern int xinerama_x;
|
|
|
|
extern int xinerama_y;
|
|
|
|
|
2002-02-09 23:38:36 +01:00
|
|
|
// correct resolution/bpp on screen: (should be autodetected by vo_init())
|
2001-04-13 15:47:36 +02:00
|
|
|
extern int vo_depthonscreen;
|
|
|
|
extern int vo_screenwidth;
|
|
|
|
extern int vo_screenheight;
|
|
|
|
|
|
|
|
// requested resolution/bpp: (-x -y -bpp options)
|
2002-02-22 19:00:38 +01:00
|
|
|
extern int vo_dx;
|
|
|
|
extern int vo_dy;
|
2001-04-13 15:47:36 +02:00
|
|
|
extern int vo_dwidth;
|
|
|
|
extern int vo_dheight;
|
|
|
|
extern int vo_dbpp;
|
2001-03-25 06:28:40 +02:00
|
|
|
|
2002-09-28 22:09:14 +02:00
|
|
|
extern int vo_grabpointer;
|
2001-07-04 01:45:49 +02:00
|
|
|
extern int vo_doublebuffering;
|
2002-03-31 22:38:56 +02:00
|
|
|
extern int vo_directrendering;
|
2002-02-12 16:06:04 +01:00
|
|
|
extern int vo_vsync;
|
2002-03-07 18:50:25 +01:00
|
|
|
extern int vo_fs;
|
2001-07-04 01:45:49 +02:00
|
|
|
extern int vo_fsmode;
|
2002-06-04 22:17:07 +02:00
|
|
|
extern float vo_panscan;
|
2004-03-13 17:48:52 +01:00
|
|
|
extern int vo_adapter_num;
|
|
|
|
extern int vo_refresh_rate;
|
2004-05-01 16:52:15 +02:00
|
|
|
extern int vo_keepaspect;
|
2004-07-29 16:59:48 +02:00
|
|
|
extern int vo_rootwin;
|
2005-08-21 03:20:31 +02:00
|
|
|
extern int vo_ontop;
|
2005-11-10 23:25:54 +01:00
|
|
|
extern int vo_border;
|
2001-07-04 01:45:49 +02:00
|
|
|
|
2007-08-12 14:21:07 +02:00
|
|
|
extern int vo_gamma_gamma;
|
2002-07-19 22:51:48 +02:00
|
|
|
extern int vo_gamma_brightness;
|
|
|
|
extern int vo_gamma_saturation;
|
|
|
|
extern int vo_gamma_contrast;
|
|
|
|
extern int vo_gamma_hue;
|
|
|
|
extern int vo_gamma_red_intensity;
|
|
|
|
extern int vo_gamma_green_intensity;
|
|
|
|
extern int vo_gamma_blue_intensity;
|
|
|
|
|
2003-09-01 20:24:27 +02:00
|
|
|
extern int vo_nomouse_input;
|
2002-04-16 19:41:29 +02:00
|
|
|
|
2001-11-05 03:58:47 +01:00
|
|
|
extern int vo_pts;
|
2001-11-29 18:31:58 +01:00
|
|
|
extern float vo_fps;
|
2001-11-05 03:58:47 +01:00
|
|
|
|
2001-06-22 00:34:25 +02:00
|
|
|
extern char *vo_subdevice;
|
|
|
|
|
2003-10-03 20:13:45 +02:00
|
|
|
extern int vo_colorkey;
|
|
|
|
|
2005-08-21 03:20:31 +02:00
|
|
|
extern int WinID;
|
|
|
|
|
2008-01-06 13:57:26 +01:00
|
|
|
#if defined(HAVE_FBDEV) || defined(HAVE_VESA)
|
2002-08-23 01:03:51 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
float min;
|
|
|
|
float max;
|
|
|
|
} range_t;
|
|
|
|
|
|
|
|
extern float range_max(range_t *r);
|
|
|
|
extern int in_range(range_t *r, float f);
|
|
|
|
extern range_t *str2range(char *s);
|
|
|
|
extern char *monitor_hfreq_str;
|
|
|
|
extern char *monitor_vfreq_str;
|
|
|
|
extern char *monitor_dotclock_str;
|
|
|
|
|
2008-01-06 13:57:26 +01:00
|
|
|
#endif /* defined(HAVE_FBDEV) || defined(HAVE_VESA) */
|
2007-12-31 17:15:50 +01:00
|
|
|
|
2008-02-22 10:09:46 +01:00
|
|
|
#endif /* MPLAYER_VIDEO_OUT_H */
|