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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2001-03-25 04:28:40 +00:00
|
|
|
#include "font_load.h"
|
2001-04-14 17:55:20 +00:00
|
|
|
#include "img_format.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
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
typedef struct vo_functions_s
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Initialize 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
|
|
|
*/
|
|
|
|
uint32_t (*init)(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format);
|
|
|
|
|
2001-03-03 21:46:39 +00:00
|
|
|
/*
|
|
|
|
* Query that given pixel format is supported or not.
|
|
|
|
* params:
|
|
|
|
* format: fourcc of pixel format
|
|
|
|
* returns : 1 if supported, 0 if unsupported
|
|
|
|
*/
|
2001-02-24 20:28:24 +00:00
|
|
|
uint32_t (*query_format)(uint32_t format);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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[];
|
|
|
|
|
2001-04-13 13:47:36 +00:00
|
|
|
// currect resolution/bpp on screen: (should be autodetected by vo_init())
|
|
|
|
extern int vo_depthonscreen;
|
|
|
|
extern int vo_screenwidth;
|
|
|
|
extern int vo_screenheight;
|
|
|
|
|
|
|
|
// requested resolution/bpp: (-x -y -bpp options)
|
|
|
|
extern int vo_dwidth;
|
|
|
|
extern int vo_dheight;
|
|
|
|
extern int vo_dbpp;
|
2001-03-25 04:28:40 +00:00
|
|
|
|
2001-07-03 23:45:49 +00:00
|
|
|
extern int vo_doublebuffering;
|
|
|
|
extern int vo_fsmode;
|
|
|
|
|
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;
|
|
|
|
|