2001-02-24 20:28:24 +00:00
|
|
|
/*
|
|
|
|
* video_out.h
|
|
|
|
*
|
|
|
|
* Copyright (C) Aaron Holtzman - Aug 1999
|
2001-03-03 21:46:39 +00:00
|
|
|
* Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
|
2001-02-24 20:28:24 +00:00
|
|
|
*
|
|
|
|
*/
|
2002-03-03 18:47:29 +00:00
|
|
|
|
|
|
|
#ifndef __VIDEO_OUT_H
|
|
|
|
#define __VIDEO_OUT_H 1
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
2002-02-09 00:47:26 +00:00
|
|
|
#include <stdarg.h>
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2002-03-24 00:32:13 +00:00
|
|
|
//#include "font_load.h"
|
2001-04-14 17:55:20 +00:00
|
|
|
#include "img_format.h"
|
2002-01-26 16:01:26 +00:00
|
|
|
#include "../vidix/vidix.h"
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2001-03-03 21:46:39 +00:00
|
|
|
#define VO_EVENT_EXPOSE 1
|
|
|
|
#define VO_EVENT_RESIZE 2
|
|
|
|
#define VO_EVENT_KEYPRESS 4
|
|
|
|
|
2002-02-09 00:47:26 +00:00
|
|
|
/* takes a pointer to a vo_vaa_s struct */
|
|
|
|
#define VOCTRL_QUERY_VAA 1
|
|
|
|
/* takes a pointer to uint32_t fourcc */
|
|
|
|
#define VOCTRL_QUERY_FORMAT 2
|
2002-02-18 17:34:20 +00:00
|
|
|
/* signal a device reset seek */
|
2002-02-09 00:47:26 +00:00
|
|
|
#define VOCTRL_RESET 3
|
2002-02-09 22:38:36 +00:00
|
|
|
/* true if vo driver can use GUI created windows */
|
|
|
|
#define VOCTRL_GUISUPPORT 4
|
2002-02-17 00:33:50 +00:00
|
|
|
/* used to switch to fullscreen */
|
|
|
|
#define VOCTRL_FULLSCREEN 5
|
2002-02-17 09:25:09 +00:00
|
|
|
/* user wants to have screen shot. (currently without args)*/
|
|
|
|
#define VOCTRL_SCREENSHOT 6
|
2002-02-18 17:34:20 +00:00
|
|
|
/* signal a device pause */
|
|
|
|
#define VOCTRL_PAUSE 7
|
|
|
|
/* start/resume playback */
|
|
|
|
#define VOCTRL_RESUME 8
|
2002-03-07 02:44:16 +00:00
|
|
|
/* libmpcodecs direct rendering: */
|
|
|
|
#define VOCTRL_GET_IMAGE 9
|
2002-04-06 19:08:52 +00:00
|
|
|
#define VOCTRL_DRAW_IMAGE 13
|
2002-05-17 23:47:27 +00:00
|
|
|
#define VOCTRL_SET_SPU_PALETTE 14
|
2002-03-09 17:27:37 +00:00
|
|
|
/* decoding ahead: */
|
|
|
|
#define VOCTRL_GET_NUM_FRAMES 10
|
|
|
|
#define VOCTRL_GET_FRAME_NUM 11
|
|
|
|
#define VOCTRL_SET_FRAME_NUM 12
|
2002-06-05 22:47:15 +00:00
|
|
|
#define VOCTRL_GET_PANSCAN 15
|
|
|
|
#define VOCTRL_SET_PANSCAN 16
|
2002-06-05 19:35:54 +00:00
|
|
|
|
2002-02-09 00:47:26 +00:00
|
|
|
#define VO_TRUE 1
|
|
|
|
#define VO_FALSE 0
|
|
|
|
#define VO_ERROR -1
|
|
|
|
#define VO_NOTAVAIL -2
|
|
|
|
#define VO_NOTIMPL -3
|
|
|
|
|
2002-02-17 03:06:38 +00:00
|
|
|
#define VOFLAG_FULLSCREEN 0x01
|
|
|
|
#define VOFLAG_MODESWITCHING 0x02
|
|
|
|
#define VOFLAG_SWSCALE 0x04
|
|
|
|
#define VOFLAG_FLIPPING 0x08
|
|
|
|
|
2001-02-24 20:28:24 +00: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;
|
|
|
|
|
2002-01-26 16:01:26 +00:00
|
|
|
/* Direct access to BES */
|
|
|
|
typedef struct bes_da_s
|
|
|
|
{
|
|
|
|
vidix_rect_t dest; /* This field should be filled by x,y,w,h
|
|
|
|
from vidix:src but pitches from
|
|
|
|
vidix:dest */
|
|
|
|
int flags; /* Probably will work only when flag == 0 */
|
|
|
|
/* memory model */
|
2002-02-09 22:38:36 +00:00
|
|
|
unsigned frame_size; /* destination frame size */
|
|
|
|
unsigned num_frames; /* number of available frames */
|
2002-01-26 16:01:26 +00:00
|
|
|
unsigned offsets[VID_PLAY_MAXFRAMES]; /* relative offset of each frame from begin of video memory */
|
|
|
|
vidix_yuv_t offset; /* relative offsets within frame for yuv planes */
|
|
|
|
void* dga_addr; /* linear address of BES */
|
|
|
|
}bes_da_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Video Accelearted Architecture.
|
|
|
|
Every field of this structure can be set to NULL that means that
|
|
|
|
features is not supported
|
|
|
|
*/
|
|
|
|
typedef struct vo_vaa_s
|
|
|
|
{
|
|
|
|
uint32_t flags; /* currently undefined */
|
|
|
|
/*
|
|
|
|
* Query Direct Access to BES
|
|
|
|
* info - information to be filled
|
|
|
|
* returns: 0 on success errno on error.
|
|
|
|
*/
|
|
|
|
int (*query_bes_da)(bes_da_t *info);
|
|
|
|
int (*get_video_eq)(vidix_video_eq_t *info);
|
|
|
|
int (*set_video_eq)(const vidix_video_eq_t *info);
|
|
|
|
int (*get_num_fx)(unsigned *info);
|
|
|
|
int (*get_oem_fx)(vidix_oem_fx_t *info);
|
|
|
|
int (*set_oem_fx)(const vidix_oem_fx_t *info);
|
|
|
|
int (*set_deint)(const vidix_deinterlace_t *info);
|
|
|
|
}vo_vaa_t;
|
|
|
|
|
2002-01-31 09:57:13 +00:00
|
|
|
/* Misc info to tuneup vo driver */
|
|
|
|
typedef struct vo_tune_info_s
|
|
|
|
{
|
|
|
|
int pitch[3]; /* Should be 0 if unknown else power of 2 */
|
|
|
|
}vo_tune_info_t;
|
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
typedef struct vo_functions_s
|
|
|
|
{
|
2002-01-26 16:01:26 +00: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 20:28:24 +00:00
|
|
|
/*
|
2002-01-26 16:01:26 +00:00
|
|
|
* Initialize (means CONFIGURE) the display driver.
|
2001-03-03 21:46:39 +00: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 20:28:24 +00:00
|
|
|
*/
|
2002-01-31 09:57:13 +00:00
|
|
|
uint32_t (*config)(uint32_t width, uint32_t height, uint32_t d_width,
|
|
|
|
uint32_t d_height, uint32_t fullscreen, char *title,
|
|
|
|
uint32_t format,const vo_tune_info_t *);
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2002-02-09 00:47:26 +00:00
|
|
|
/*
|
|
|
|
* Control interface
|
|
|
|
*/
|
|
|
|
uint32_t (*control)(uint32_t request, void *data, ...);
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Return driver information.
|
|
|
|
* returns : read-only pointer to a vo_info_t structure.
|
|
|
|
*/
|
|
|
|
const vo_info_t* (*get_info)(void);
|
|
|
|
|
|
|
|
/*
|
2001-03-03 21:46:39 +00:00
|
|
|
* Display a new RGB/BGR frame of the video to the screen.
|
|
|
|
* params:
|
|
|
|
* src[0] - pointer to the image
|
2001-02-24 20:28:24 +00:00
|
|
|
*/
|
|
|
|
uint32_t (*draw_frame)(uint8_t *src[]);
|
|
|
|
|
|
|
|
/*
|
2001-03-03 21:46:39 +00: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 20:28:24 +00:00
|
|
|
*/
|
|
|
|
uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
|
|
|
|
|
2001-08-13 11:08:18 +00:00
|
|
|
/*
|
|
|
|
* Draws OSD to the screen buffer
|
|
|
|
*/
|
|
|
|
void (*draw_osd)(void);
|
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
/*
|
2001-03-03 21:46:39 +00:00
|
|
|
* Blit/Flip buffer to the screen. Must be called after each frame!
|
2001-02-24 20:28:24 +00:00
|
|
|
*/
|
|
|
|
void (*flip_page)(void);
|
|
|
|
|
2001-03-03 21:46:39 +00: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 20:28:24 +00:00
|
|
|
void (*uninit)(void);
|
|
|
|
|
|
|
|
} vo_functions_t;
|
|
|
|
|
2001-06-17 12:25:12 +00:00
|
|
|
char *vo_format_name(int format);
|
2001-07-16 12:11:49 +00:00
|
|
|
int vo_init(void);
|
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
// NULL terminated array of all drivers
|
|
|
|
extern vo_functions_t* video_out_drivers[];
|
|
|
|
|
2002-02-22 18:00:38 +00:00
|
|
|
extern int vo_flags;
|
|
|
|
|
2002-04-07 02:12:15 +00:00
|
|
|
extern int vo_config_count;
|
|
|
|
|
2002-02-09 22:38:36 +00:00
|
|
|
// correct resolution/bpp on screen: (should be autodetected by vo_init())
|
2001-04-13 13:47:36 +00:00
|
|
|
extern int vo_depthonscreen;
|
|
|
|
extern int vo_screenwidth;
|
|
|
|
extern int vo_screenheight;
|
|
|
|
|
|
|
|
// requested resolution/bpp: (-x -y -bpp options)
|
2002-02-22 18:00:38 +00:00
|
|
|
extern int vo_dx;
|
|
|
|
extern int vo_dy;
|
2001-04-13 13:47:36 +00:00
|
|
|
extern int vo_dwidth;
|
|
|
|
extern int vo_dheight;
|
|
|
|
extern int vo_dbpp;
|
2001-03-25 04:28:40 +00:00
|
|
|
|
2002-03-07 17:50:25 +00:00
|
|
|
extern int vo_old_x;
|
|
|
|
extern int vo_old_y;
|
|
|
|
extern int vo_old_width;
|
|
|
|
extern int vo_old_height;
|
|
|
|
|
2001-07-03 23:45:49 +00:00
|
|
|
extern int vo_doublebuffering;
|
2002-03-31 20:38:56 +00:00
|
|
|
extern int vo_directrendering;
|
2002-02-12 15:06:04 +00:00
|
|
|
extern int vo_vsync;
|
2002-03-07 17:50:25 +00:00
|
|
|
extern int vo_fs;
|
2001-07-03 23:45:49 +00:00
|
|
|
extern int vo_fsmode;
|
2002-06-04 20:17:07 +00:00
|
|
|
extern float vo_panscan;
|
2001-07-03 23:45:49 +00:00
|
|
|
|
2002-07-19 20:51:48 +00: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 17:41:29 +00:00
|
|
|
extern int vo_mouse_timer_const;
|
|
|
|
|
2001-11-05 02:58:47 +00:00
|
|
|
extern int vo_pts;
|
2001-11-29 17:31:58 +00:00
|
|
|
extern float vo_fps;
|
2001-11-05 02:58:47 +00:00
|
|
|
|
2001-06-21 22:34:25 +00:00
|
|
|
extern char *vo_subdevice;
|
|
|
|
|
2002-03-03 18:47:29 +00:00
|
|
|
#endif
|