~stefanlsd/mplayer/gutsy

1 by Reinhard Tartler
imported mplayer_0.99+1.0pre7try2+cvs20060117
1
/*
2
 *  video_out.h
3
 *
4
 *      Copyright (C) Aaron Holtzman - Aug 1999
5
 *	Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
6
 *	(C) MPlayer Developers
7
 *
8
 */
9
 
10
#ifndef __VIDEO_OUT_H
11
#define __VIDEO_OUT_H 1
12
13
#include <inttypes.h>
14
#include <stdarg.h>
15
16
//#include "font_load.h"
2.6.1 by William Grant
Update to 1.0rc1.
17
#include "libmpcodecs/img_format.h"
1 by Reinhard Tartler
imported mplayer_0.99+1.0pre7try2+cvs20060117
18
//#include "vidix/vidix.h"
19
20
#define VO_EVENT_EXPOSE 1
21
#define VO_EVENT_RESIZE 2
22
#define VO_EVENT_KEYPRESS 4
23
24
/* Obsolete: VOCTRL_QUERY_VAA 1 */
25
/* does the device support the required format */
26
#define VOCTRL_QUERY_FORMAT 2
27
/* signal a device reset seek */
28
#define VOCTRL_RESET 3
29
/* true if vo driver can use GUI created windows */
30
#define VOCTRL_GUISUPPORT 4
31
#define VOCTRL_GUI_NOWINDOW 19
32
/* used to switch to fullscreen */
33
#define VOCTRL_FULLSCREEN 5
34
#define VOCTRL_SCREENSHOT 6
35
/* signal a device pause */
36
#define VOCTRL_PAUSE 7
37
/* start/resume playback */
38
#define VOCTRL_RESUME 8
39
/* libmpcodecs direct rendering: */
40
#define VOCTRL_GET_IMAGE 9
41
#define VOCTRL_DRAW_IMAGE 13
42
#define VOCTRL_SET_SPU_PALETTE 14
43
/* decoding ahead: */
44
#define VOCTRL_GET_NUM_FRAMES 10
45
#define VOCTRL_GET_FRAME_NUM  11
46
#define VOCTRL_SET_FRAME_NUM  12
47
#define VOCTRL_GET_PANSCAN 15
48
#define VOCTRL_SET_PANSCAN 16
49
/* equalizer controls */
50
#define VOCTRL_SET_EQUALIZER 17
51
#define VOCTRL_GET_EQUALIZER 18
52
//#define VOCTRL_GUI_NOWINDOW 19
53
/* Frame duplication */
54
#define VOCTRL_DUPLICATE_FRAME 20
55
// ... 21
56
#define VOCTRL_START_SLICE 21
57
58
#define VOCTRL_ONTOP 25
59
#define VOCTRL_ROOTWIN 26
60
#define VOCTRL_BORDER 27
2.6.1 by William Grant
Update to 1.0rc1.
61
#define VOCTRL_DRAW_EOSD 28
62
#define VOCTRL_GET_EOSD_RES 29
63
typedef struct {
64
  int w, h; // screen dimensions, including black borders
65
  int mt, mb, ml, mr; // borders (top, bottom, left, right)
66
} mp_eosd_res_t;
1 by Reinhard Tartler
imported mplayer_0.99+1.0pre7try2+cvs20060117
67
68
// Vo can be used by xover
69
#define VOCTRL_XOVERLAY_SUPPORT 22
70
71
#define VOCTRL_XOVERLAY_SET_COLORKEY 24
72
typedef struct {
73
  uint32_t x11; // The raw x11 color
74
  uint16_t r,g,b;
75
} mp_colorkey_t;
76
77
#define VOCTRL_XOVERLAY_SET_WIN 23
78
typedef struct {
79
  int x,y;
80
  int w,h;
81
} mp_win_t;
82
83
#define VO_TRUE		1
84
#define VO_FALSE	0
85
#define VO_ERROR	-1
86
#define VO_NOTAVAIL	-2
87
#define VO_NOTIMPL	-3
88
89
#define VOFLAG_FULLSCREEN	0x01
90
#define VOFLAG_MODESWITCHING	0x02
91
#define VOFLAG_SWSCALE		0x04
92
#define VOFLAG_FLIPPING		0x08
93
#define VOFLAG_XOVERLAY_SUB_VO  0x10000
94
95
typedef struct vo_info_s
96
{
97
        /* driver name ("Matrox Millennium G200/G400" */
98
        const char *name;
99
        /* short name (for config strings) ("mga") */
100
        const char *short_name;
101
        /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
102
        const char *author;
103
        /* any additional comments */
104
        const char *comment;
105
} vo_info_t;
106
107
typedef struct vo_functions_s
108
{
109
	vo_info_t *info;
110
	/*
111
	 * Preinitializes driver (real INITIALIZATION)
112
	 *   arg - currently it's vo_subdevice
113
	 *   returns: zero on successful initialization, non-zero on error.
114
	 */
115
	int (*preinit)(const char *arg);
116
        /*
117
         * Initialize (means CONFIGURE) the display driver.
118
	 * params:
119
         *   width,height: image source size
120
	 *   d_width,d_height: size of the requested window size, just a hint
121
	 *   fullscreen: flag, 0=windowd 1=fullscreen, just a hint
122
	 *   title: window title, if available
123
	 *   format: fourcc of pixel format
124
         * returns : zero on successful initialization, non-zero on error.
125
         */
126
        int (*config)(uint32_t width, uint32_t height, uint32_t d_width,
127
			 uint32_t d_height, uint32_t fullscreen, char *title,
128
			 uint32_t format);
129
130
	/*
131
	 * Control interface
132
	 */
133
	int (*control)(uint32_t request, void *data, ...);
134
135
        /*
136
         * Display a new RGB/BGR frame of the video to the screen.
137
         * params:
138
	 *   src[0] - pointer to the image
139
         */
140
        int (*draw_frame)(uint8_t *src[]);
141
142
        /*
143
         * Draw a planar YUV slice to the buffer:
144
	 * params:
145
	 *   src[3] = source image planes (Y,U,V)
146
         *   stride[3] = source image planes line widths (in bytes)
147
	 *   w,h = width*height of area to be copied (in Y pixels)
148
         *   x,y = position at the destination image (in Y pixels)
149
         */
150
        int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
151
152
   	/*
153
         * Draws OSD to the screen buffer
154
         */
155
        void (*draw_osd)(void);
156
157
        /*
158
         * Blit/Flip buffer to the screen. Must be called after each frame!
159
         */
160
        void (*flip_page)(void);
161
162
        /*
163
         * This func is called after every frames to handle keyboard and
164
	 * other events. It's called in PAUSE mode too!
165
         */
166
        void (*check_events)(void);
167
168
        /*
169
         * Closes driver. Should restore the original state of the system.
170
         */
171
        void (*uninit)(void);
172
173
} vo_functions_t;
174
2.6.1 by William Grant
Update to 1.0rc1.
175
const char *vo_format_name(int format);
1 by Reinhard Tartler
imported mplayer_0.99+1.0pre7try2+cvs20060117
176
int vo_init(void);
177
178
vo_functions_t* init_best_video_out(char** vo_list);
2 by Reinhard Tartler
upgrade to pre8
179
void list_video_out(void);
1 by Reinhard Tartler
imported mplayer_0.99+1.0pre7try2+cvs20060117
180
181
// NULL terminated array of all drivers
182
extern vo_functions_t* video_out_drivers[];
183
184
extern int vo_flags;
185
186
extern int vo_config_count;
187
2 by Reinhard Tartler
upgrade to pre8
188
extern int xinerama_screen;
189
extern int xinerama_x;
190
extern int xinerama_y;
191
1 by Reinhard Tartler
imported mplayer_0.99+1.0pre7try2+cvs20060117
192
// correct resolution/bpp on screen:  (should be autodetected by vo_init())
193
extern int vo_depthonscreen;
194
extern int vo_screenwidth;
195
extern int vo_screenheight;
196
197
// requested resolution/bpp:  (-x -y -bpp options)
198
extern int vo_dx;
199
extern int vo_dy;
200
extern int vo_dwidth;
201
extern int vo_dheight;
202
extern int vo_dbpp;
203
204
extern int vo_grabpointer;
205
extern int vo_doublebuffering;
206
extern int vo_directrendering;
207
extern int vo_vsync;
208
extern int vo_fs;
209
extern int vo_fsmode;
210
extern float vo_panscan;
211
extern int vo_adapter_num;
212
extern int vo_refresh_rate;
213
extern int vo_keepaspect;
214
extern int vo_rootwin;
215
extern int vo_ontop;
216
extern int vo_border;
217
218
extern int vo_gamma_brightness;
219
extern int vo_gamma_saturation;
220
extern int vo_gamma_contrast;
221
extern int vo_gamma_hue;
222
extern int vo_gamma_red_intensity;
223
extern int vo_gamma_green_intensity;
224
extern int vo_gamma_blue_intensity;
225
226
extern int vo_nomouse_input;
227
228
extern int vo_pts;
229
extern float vo_fps;
230
231
extern char *vo_subdevice;
232
233
extern int vo_colorkey;
234
235
extern int WinID;
236
237
#if defined(HAVE_FBDEV)||defined(HAVE_VESA) 
238
239
typedef struct {
240
        float min;
241
	float max;
242
	} range_t;
243
244
extern float range_max(range_t *r);
245
extern int in_range(range_t *r, float f);
246
extern range_t *str2range(char *s);
247
extern char *monitor_hfreq_str;
248
extern char *monitor_vfreq_str;
249
extern char *monitor_dotclock_str;
250
251
#endif 
252
		
253
#endif