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