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
|
|
|
|
|
|
|
#ifndef __VIDEO_OUT_H
|
|
|
|
#define __VIDEO_OUT_H 1
|
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"
|
2001-04-14 19:55:20 +02:00
|
|
|
#include "img_format.h"
|
2002-11-03 15:30:00 +01: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-17 10:25:09 +01:00
|
|
|
#define VOCTRL_SCREENSHOT 6
|
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
|
|
|
|
#define VOCTRL_GET_EQUALIZER 18
|
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-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;
|
|
|
|
|
|
|
|
typedef struct vo_functions_s
|
|
|
|
{
|
2002-11-11 16:22:10 +01:00
|
|
|
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.
|
|
|
|
*/
|
|
|
|
uint32_t (*preinit)(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
|
|
|
*/
|
2002-01-31 10:57:13 +01:00
|
|
|
uint32_t (*config)(uint32_t width, uint32_t height, uint32_t d_width,
|
|
|
|
uint32_t d_height, uint32_t fullscreen, char *title,
|
2002-08-28 23:32:32 +02:00
|
|
|
uint32_t format);
|
2001-02-24 21:28:24 +01:00
|
|
|
|
2002-02-09 01:47:26 +01:00
|
|
|
/*
|
|
|
|
* Control interface
|
|
|
|
*/
|
|
|
|
uint32_t (*control)(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
|
|
|
*/
|
|
|
|
uint32_t (*draw_frame)(uint8_t *src[]);
|
|
|
|
|
|
|
|
/*
|
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
|
|
|
*/
|
|
|
|
uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
|
|
|
|
|
2001-08-13 13:08:18 +02:00
|
|
|
/*
|
|
|
|
* Draws OSD to the screen buffer
|
|
|
|
*/
|
|
|
|
void (*draw_osd)(void);
|
|
|
|
|
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
|
|
|
*/
|
|
|
|
void (*flip_page)(void);
|
|
|
|
|
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!
|
|
|
|
*/
|
|
|
|
void (*check_events)(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Closes driver. Should restore the original state of the system.
|
|
|
|
*/
|
2001-02-24 21:28:24 +01:00
|
|
|
void (*uninit)(void);
|
|
|
|
|
|
|
|
} vo_functions_t;
|
|
|
|
|
2001-06-17 14:25:12 +02:00
|
|
|
char *vo_format_name(int format);
|
2001-07-16 14:11:49 +02:00
|
|
|
int vo_init(void);
|
|
|
|
|
2002-09-29 23:53:05 +02:00
|
|
|
vo_functions_t* init_best_video_out(char** vo_list);
|
|
|
|
void list_video_out();
|
|
|
|
|
2001-02-24 21:28:24 +01:00
|
|
|
// NULL terminated array of all drivers
|
|
|
|
extern vo_functions_t* video_out_drivers[];
|
|
|
|
|
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;
|
|
|
|
|
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;
|
2001-07-04 01:45:49 +02:00
|
|
|
|
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;
|
|
|
|
|
2002-04-16 19:41:29 +02:00
|
|
|
extern int vo_mouse_timer_const;
|
|
|
|
|
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;
|
|
|
|
|
2002-08-23 01:03:51 +02:00
|
|
|
#if defined(HAVE_FBDEV)||defined(HAVE_VESA)
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2002-03-03 19:47:29 +01:00
|
|
|
#endif
|