annotate libvo/video_out.h @ 320:5427ff3e2e9d

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