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