1
|
1 /*
|
|
2 * video_out.h
|
|
3 *
|
|
4 * Copyright (C) Aaron Holtzman - Aug 1999
|
31
|
5 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
|
1
|
6 *
|
|
7 */
|
|
8
|
|
9 #include <inttypes.h>
|
|
10
|
213
|
11 #include "font_load.h"
|
408
|
12 #include "img_format.h"
|
1
|
13
|
31
|
14 #define VO_EVENT_EXPOSE 1
|
|
15 #define VO_EVENT_RESIZE 2
|
|
16 #define VO_EVENT_KEYPRESS 4
|
|
17
|
1
|
18 typedef struct vo_info_s
|
|
19 {
|
|
20 /* driver name ("Matrox Millennium G200/G400" */
|
|
21 const char *name;
|
|
22 /* short name (for config strings) ("mga") */
|
|
23 const char *short_name;
|
|
24 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
|
|
25 const char *author;
|
|
26 /* any additional comments */
|
|
27 const char *comment;
|
|
28 } vo_info_t;
|
|
29
|
|
30 typedef struct vo_functions_s
|
|
31 {
|
|
32 /*
|
|
33 * Initialize the display driver.
|
31
|
34 * params:
|
|
35 * width,height: image source size
|
|
36 * d_width,d_height: size of the requested window size, just a hint
|
|
37 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
|
|
38 * title: window title, if available
|
|
39 * format: fourcc of pixel format
|
|
40 * returns : zero on successful initialization, non-zero on error.
|
1
|
41 */
|
|
42 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);
|
|
43
|
31
|
44 /*
|
|
45 * Query that given pixel format is supported or not.
|
|
46 * params:
|
|
47 * format: fourcc of pixel format
|
|
48 * returns : 1 if supported, 0 if unsupported
|
|
49 */
|
1
|
50 uint32_t (*query_format)(uint32_t format);
|
|
51
|
|
52 /*
|
|
53 * Return driver information.
|
|
54 * returns : read-only pointer to a vo_info_t structure.
|
|
55 */
|
|
56 const vo_info_t* (*get_info)(void);
|
|
57
|
|
58 /*
|
31
|
59 * Display a new RGB/BGR frame of the video to the screen.
|
|
60 * params:
|
|
61 * src[0] - pointer to the image
|
1
|
62 */
|
|
63 uint32_t (*draw_frame)(uint8_t *src[]);
|
|
64
|
|
65 /*
|
31
|
66 * Draw a planar YUV slice to the buffer:
|
|
67 * params:
|
|
68 * src[3] = source image planes (Y,U,V)
|
|
69 * stride[3] = source image planes line widths (in bytes)
|
|
70 * w,h = width*height of area to be copied (in Y pixels)
|
|
71 * x,y = position at the destination image (in Y pixels)
|
1
|
72 */
|
|
73 uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
|
|
74
|
|
75 /*
|
31
|
76 * Blit/Flip buffer to the screen. Must be called after each frame!
|
1
|
77 */
|
|
78 void (*flip_page)(void);
|
|
79
|
31
|
80 /*
|
|
81 * This func is called after every frames to handle keyboard and
|
|
82 * other events. It's called in PAUSE mode too!
|
|
83 */
|
|
84 void (*check_events)(void);
|
|
85
|
|
86 /*
|
|
87 * Closes driver. Should restore the original state of the system.
|
|
88 */
|
1
|
89 void (*uninit)(void);
|
|
90
|
|
91 } vo_functions_t;
|
|
92
|
1142
|
93 char *vo_format_name(int format);
|
1326
|
94 int vo_init(void);
|
|
95
|
1
|
96 // NULL terminated array of all drivers
|
|
97 extern vo_functions_t* video_out_drivers[];
|
|
98
|
388
|
99 // currect resolution/bpp on screen: (should be autodetected by vo_init())
|
|
100 extern int vo_depthonscreen;
|
|
101 extern int vo_screenwidth;
|
|
102 extern int vo_screenheight;
|
213
|
103
|
388
|
104 // requested resolution/bpp: (-x -y -bpp options)
|
|
105 extern int vo_dwidth;
|
|
106 extern int vo_dheight;
|
|
107 extern int vo_dbpp;
|
|
108
|
1268
|
109 extern int vo_doublebuffering;
|
|
110 extern int vo_fsmode;
|
|
111
|
1184
|
112 extern char *vo_subdevice;
|
|
113
|