annotate libvo/video_out.h @ 36188:34116de1aa96

Apply forgotten move of apply_border_pos function. Fixes compilation.
author reimar
date Sat, 25 May 2013 08:42:25 +0000
parents 3b15983f5e48
children 673719da1a92
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
28446
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
2 * Copyright (C) Aaron Holtzman - Aug 1999
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
3 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
4 * (C) MPlayer developers
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
5 *
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
6 * This file is part of MPlayer.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 *
28446
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
9 * it under the terms of the GNU General Public License as published by
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
11 * (at your option) any later version.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 *
28446
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
16 * GNU General Public License for more details.
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
17 *
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
18 * You should have received a copy of the GNU General Public License along
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 */
28446
7681eab10aea Add standard license headers, unify header formatting.
diego
parents: 28137
diff changeset
22
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25595
diff changeset
23 #ifndef MPLAYER_VIDEO_OUT_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25595
diff changeset
24 #define MPLAYER_VIDEO_OUT_H
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 #include <inttypes.h>
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
27 #include <stdarg.h>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28
32466
9e627a1793b1 Move font_load.[ch], font_load_ft.c and osd_font.h from libvo to sub.
cigaes
parents: 32391
diff changeset
29 //#include "sub/font_load.h"
19431
ac69ba536915 Explicitly include libmpcodecs/img_format.h and libvo/fastmemcpy.h.
diego
parents: 19108
diff changeset
30 #include "libmpcodecs/img_format.h"
13787
e047e70a9767 Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents: 13091
diff changeset
31 //#include "vidix/vidix.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32
36171
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
33
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
34 #define ROTATE(t, x, y) do { \
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
35 t rot_tmp = x; \
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
36 x = y; \
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
37 y = -rot_tmp; \
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
38 } while(0)
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
39
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
40 #define VO_EVENT_EXPOSE 1
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
41 #define VO_EVENT_RESIZE 2
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
42 #define VO_EVENT_KEYPRESS 4
31043
80036ef586ff Add reinitialization support. Necessary for fullscreen on OSX.
reimar
parents: 31017
diff changeset
43 #define VO_EVENT_REINIT 8
32368
ff2204a57cd3 Add VO_EVENT_MOVE which is required for VOs that interact directly
reimar
parents: 31201
diff changeset
44 #define VO_EVENT_MOVE 16
36167
29fb09ef97b9 Avoid duplicating the mouse autohide code.
reimar
parents: 35126
diff changeset
45 #define VO_EVENT_MOUSE 32
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
46
7124
eca7dbad0166 finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents: 7069
diff changeset
47 /* Obsolete: VOCTRL_QUERY_VAA 1 */
6781
924263b4df10 eq reworked
alex
parents: 6755
diff changeset
48 /* does the device support the required format */
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
49 #define VOCTRL_QUERY_FORMAT 2
4754
ad892563d9c4 Added VOCTRL_PAUSE and VOCTRL_RESUME
mswitch
parents: 4738
diff changeset
50 /* signal a device reset seek */
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
51 #define VOCTRL_RESET 3
4618
09198a119e39 added voctrl_guisupport and fixed some typos
alex
parents: 4592
diff changeset
52 /* true if vo driver can use GUI created windows */
09198a119e39 added voctrl_guisupport and fixed some typos
alex
parents: 4592
diff changeset
53 #define VOCTRL_GUISUPPORT 4
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6781
diff changeset
54 #define VOCTRL_GUI_NOWINDOW 19
4731
c8125c117807 added VOCTRL_FULLSCREEN
alex
parents: 4667
diff changeset
55 /* used to switch to fullscreen */
c8125c117807 added VOCTRL_FULLSCREEN
alex
parents: 4667
diff changeset
56 #define VOCTRL_FULLSCREEN 5
4754
ad892563d9c4 Added VOCTRL_PAUSE and VOCTRL_RESUME
mswitch
parents: 4738
diff changeset
57 /* signal a device pause */
ad892563d9c4 Added VOCTRL_PAUSE and VOCTRL_RESUME
mswitch
parents: 4738
diff changeset
58 #define VOCTRL_PAUSE 7
ad892563d9c4 Added VOCTRL_PAUSE and VOCTRL_RESUME
mswitch
parents: 4738
diff changeset
59 /* start/resume playback */
ad892563d9c4 Added VOCTRL_PAUSE and VOCTRL_RESUME
mswitch
parents: 4738
diff changeset
60 #define VOCTRL_RESUME 8
4971
fa002f25631e direct rendering support
arpi
parents: 4933
diff changeset
61 /* libmpcodecs direct rendering: */
fa002f25631e direct rendering support
arpi
parents: 4933
diff changeset
62 #define VOCTRL_GET_IMAGE 9
5502
9cecf4b10a4b VOCTRL_DRAW_IMAGE added
arpi
parents: 5431
diff changeset
63 #define VOCTRL_DRAW_IMAGE 13
6110
7bea806b9c5f Improvment for spu subtitles.
albeu
parents: 5651
diff changeset
64 #define VOCTRL_SET_SPU_PALETTE 14
5002
70751bbd6404 voctls for decoding ahead
nick
parents: 4981
diff changeset
65 /* decoding ahead: */
70751bbd6404 voctls for decoding ahead
nick
parents: 4981
diff changeset
66 #define VOCTRL_GET_NUM_FRAMES 10
70751bbd6404 voctls for decoding ahead
nick
parents: 4981
diff changeset
67 #define VOCTRL_GET_FRAME_NUM 11
70751bbd6404 voctls for decoding ahead
nick
parents: 4981
diff changeset
68 #define VOCTRL_SET_FRAME_NUM 12
6308
4764574062a0 100l to .so
arpi
parents: 6307
diff changeset
69 #define VOCTRL_GET_PANSCAN 15
4764574062a0 100l to .so
arpi
parents: 6307
diff changeset
70 #define VOCTRL_SET_PANSCAN 16
6781
924263b4df10 eq reworked
alex
parents: 6755
diff changeset
71 /* equalizer controls */
924263b4df10 eq reworked
alex
parents: 6755
diff changeset
72 #define VOCTRL_SET_EQUALIZER 17
924263b4df10 eq reworked
alex
parents: 6755
diff changeset
73 #define VOCTRL_GET_EQUALIZER 18
8450
8cfc9309f0cc notice vo driver about skipped/dropped frames
arpi
parents: 8148
diff changeset
74 //#define VOCTRL_GUI_NOWINDOW 19
8cfc9309f0cc notice vo driver about skipped/dropped frames
arpi
parents: 8148
diff changeset
75 /* Frame duplication */
8cfc9309f0cc notice vo driver about skipped/dropped frames
arpi
parents: 8148
diff changeset
76 #define VOCTRL_DUPLICATE_FRAME 20
8cfc9309f0cc notice vo driver about skipped/dropped frames
arpi
parents: 8148
diff changeset
77 // ... 21
9560
ae2ce6ebc1fa Pass start slice to the vo it make dr + slice implemantation easier
albeu
parents: 8450
diff changeset
78 #define VOCTRL_START_SLICE 21
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6781
diff changeset
79
11542
85e503ddf65f runtime 'stay-on-top' functionality
joey
parents: 10988
diff changeset
80 #define VOCTRL_ONTOP 25
13091
25f51c72eb06 added runtime toggle of root window playback
joey
parents: 12912
diff changeset
81 #define VOCTRL_ROOTWIN 26
16968
e9d849bf8050 add a switch, slave command, and vo control to toggle borderless window.
joey
parents: 16280
diff changeset
82 #define VOCTRL_BORDER 27
19576
3e7ce339d74b Add EOSD support to vf_vo.
eugeni
parents: 19431
diff changeset
83 #define VOCTRL_DRAW_EOSD 28
3e7ce339d74b Add EOSD support to vf_vo.
eugeni
parents: 19431
diff changeset
84 #define VOCTRL_GET_EOSD_RES 29
11542
85e503ddf65f runtime 'stay-on-top' functionality
joey
parents: 10988
diff changeset
85
20973
c0bcec5150a3 Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents: 19576
diff changeset
86 #define VOCTRL_SET_DEINTERLACE 30
c0bcec5150a3 Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents: 19576
diff changeset
87 #define VOCTRL_GET_DEINTERLACE 31
c0bcec5150a3 Add deinterlace property, patch by Carl Eugen Hoyos
reimar
parents: 19576
diff changeset
88
22232
d0b60d14d8d7 Move common vo initialization code to video_out.c
reimar
parents: 20973
diff changeset
89 #define VOCTRL_UPDATE_SCREENINFO 32
d0b60d14d8d7 Move common vo initialization code to video_out.c
reimar
parents: 20973
diff changeset
90
9569
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
91 // Vo can be used by xover
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
92 #define VOCTRL_XOVERLAY_SUPPORT 22
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
93
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
94 #define VOCTRL_XOVERLAY_SET_COLORKEY 24
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
95 typedef struct {
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
96 uint32_t x11; // The raw x11 color
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
97 uint16_t r,g,b;
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
98 } mp_colorkey_t;
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
99
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
100 #define VOCTRL_XOVERLAY_SET_WIN 23
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
101 typedef struct {
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
102 int x,y;
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
103 int w,h;
894d02a6469e vo_xover is a new vo that should make easy to have x11 support for
albeu
parents: 9560
diff changeset
104 } mp_win_t;
6307
72c87b2ec779 added panscan support for xmga/xvidix
pontscho
parents: 6304
diff changeset
105
32702
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
106 #define VO_TRUE 1
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
107 #define VO_FALSE 0
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
108 #define VO_ERROR -1
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
109 #define VO_NOTAVAIL -2
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
110 #define VO_NOTIMPL -3
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
111
32702
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
112 #define VOFLAG_FULLSCREEN 0x01
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
113 #define VOFLAG_MODESWITCHING 0x02
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
114 #define VOFLAG_SWSCALE 0x04
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
115 #define VOFLAG_FLIPPING 0x08
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
116 #define VOFLAG_HIDDEN 0x10 //< Use to create a hidden window
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
117 #define VOFLAG_STEREO 0x20 //< Use to create a stereo-capable window
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
118 #define VOFLAG_XOVERLAY_SUB_VO 0x10000
4736
57f053d75893 added VOFLAG_* definitions and int vo_flags
alex
parents: 4731
diff changeset
119
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 typedef struct vo_info_s
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 {
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
122 /* driver name ("Matrox Millennium G200/G400" */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
123 const char *name;
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
124 /* short name (for config strings) ("mga") */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
125 const char *short_name;
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
126 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
127 const char *author;
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
128 /* any additional comments */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
129 const char *comment;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 } vo_info_t;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 typedef struct vo_functions_s
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 {
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
134 const vo_info_t *info;
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
135 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
136 * Preinitializes driver (real INITIALIZATION)
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
137 * arg - currently it's vo_subdevice
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
138 * returns: zero on successful initialization, non-zero on error.
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
139 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
140 int (*preinit)(const char *arg);
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
141 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
142 * Initialize (means CONFIGURE) the display driver.
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
143 * params:
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
144 * width,height: image source size
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
145 * d_width,d_height: size of the requested window size, just a hint
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
146 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
147 * title: window title, if available
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
148 * format: fourcc of pixel format
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
149 * returns : zero on successful initialization, non-zero on error.
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
150 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
151 int (*config)(uint32_t width, uint32_t height, uint32_t d_width,
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
152 uint32_t d_height, uint32_t fullscreen, char *title,
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
153 uint32_t format);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
155 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
156 * Control interface
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
157 */
33305
ddb45e9443ec Remove the variable arguments from the libvo control() functions.
iive
parents: 32702
diff changeset
158 int (*control)(uint32_t request, void *data);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
160 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
161 * Display a new RGB/BGR frame of the video to the screen.
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
162 * params:
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
163 * src[0] - pointer to the image
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
164 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
165 int (*draw_frame)(uint8_t *src[]);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
167 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
168 * Draw a planar YUV slice to the buffer:
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
169 * params:
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
170 * src[3] = source image planes (Y,U,V)
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
171 * stride[3] = source image planes line widths (in bytes)
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
172 * w,h = width*height of area to be copied (in Y pixels)
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
173 * x,y = position at the destination image (in Y pixels)
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
174 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
175 int (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
177 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
178 * Draws OSD to the screen buffer
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
179 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
180 void (*draw_osd)(void);
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1326
diff changeset
181
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
182 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
183 * Blit/Flip buffer to the screen. Must be called after each frame!
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
184 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
185 void (*flip_page)(void);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
187 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
188 * This func is called after every frames to handle keyboard and
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
189 * other events. It's called in PAUSE mode too!
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
190 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
191 void (*check_events)(void);
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
192
31201
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
193 /*
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
194 * Closes driver. Should restore the original state of the system.
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
195 */
203789464176 misc cosmetics: K&R style nits, #include placement, indentation
diego
parents: 31049
diff changeset
196 void (*uninit)(void);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 } vo_functions_t;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198
25219
e82ecde2cbd4 Mark several uses of vo_functions_t as const to stop some of the current
reimar
parents: 25216
diff changeset
199 const vo_functions_t* init_best_video_out(char** vo_list);
e82ecde2cbd4 Mark several uses of vo_functions_t as const to stop some of the current
reimar
parents: 25216
diff changeset
200 int config_video_out(const vo_functions_t *vo, uint32_t width, uint32_t height,
22232
d0b60d14d8d7 Move common vo initialization code to video_out.c
reimar
parents: 20973
diff changeset
201 uint32_t d_width, uint32_t d_height, uint32_t flags,
d0b60d14d8d7 Move common vo initialization code to video_out.c
reimar
parents: 20973
diff changeset
202 char *title, uint32_t format);
17566
f580a7755ac5 Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents: 16968
diff changeset
203 void list_video_out(void);
7562
92188b57a062 video out driver list support (like -vc, example: -vo xmga,xv,x11,)
arpi
parents: 7539
diff changeset
204
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 // NULL terminated array of all drivers
25219
e82ecde2cbd4 Mark several uses of vo_functions_t as const to stop some of the current
reimar
parents: 25216
diff changeset
206 extern const vo_functions_t* const video_out_drivers[];
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207
4811
38a9cddd9e4d added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents: 4754
diff changeset
208 extern int vo_flags;
38a9cddd9e4d added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents: 4754
diff changeset
209
5511
7a24a067f0af vo_config_count now counts calls to vo->config()
arpi
parents: 5502
diff changeset
210 extern int vo_config_count;
7a24a067f0af vo_config_count now counts calls to vo->config()
arpi
parents: 5502
diff changeset
211
18116
d75953576ae4 Fix and improve xinerama support
reimar
parents: 17566
diff changeset
212 extern int xinerama_screen;
d75953576ae4 Fix and improve xinerama support
reimar
parents: 17566
diff changeset
213 extern int xinerama_x;
d75953576ae4 Fix and improve xinerama support
reimar
parents: 17566
diff changeset
214 extern int xinerama_y;
d75953576ae4 Fix and improve xinerama support
reimar
parents: 17566
diff changeset
215
4618
09198a119e39 added voctrl_guisupport and fixed some typos
alex
parents: 4592
diff changeset
216 // correct resolution/bpp on screen: (should be autodetected by vo_init())
388
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
217 extern int vo_depthonscreen;
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
218 extern int vo_screenwidth;
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
219 extern int vo_screenheight;
213
6ec8f6ab6cb1 subtitle+OSD font support
arpi_esp
parents: 31
diff changeset
220
388
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
221 // requested resolution/bpp: (-x -y -bpp options)
4811
38a9cddd9e4d added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents: 4754
diff changeset
222 extern int vo_dx;
38a9cddd9e4d added vo_dx,vo_dy (used currently only by X based outputs)
alex
parents: 4754
diff changeset
223 extern int vo_dy;
388
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
224 extern int vo_dwidth;
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
225 extern int vo_dheight;
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
226 extern int vo_dbpp;
ccb5ebfaaeac -bpp changes
arpi_esp
parents: 218
diff changeset
227
7539
56ea9db91251 -nograbpointer, based on old patch by Christian Ohm <chr.ohm@gmx.net>
arpi
parents: 7435
diff changeset
228 extern int vo_grabpointer;
1268
9877eaacff9e extern vo_doublebuffering cleanup
arpi
parents: 1184
diff changeset
229 extern int vo_doublebuffering;
5431
013458752947 disabling direct rendering by default (too buggy and conflicts with osd/sub)
arpi
parents: 5294
diff changeset
230 extern int vo_directrendering;
4667
95fa3901cafc add vsync support for doublebuffering to vo_vesa
atmos4
parents: 4618
diff changeset
231 extern int vo_vsync;
4981
bfc652fc7f43 rewrite fullscreen support in some libvo driver
pontscho
parents: 4971
diff changeset
232 extern int vo_fs;
1268
9877eaacff9e extern vo_doublebuffering cleanup
arpi
parents: 1184
diff changeset
233 extern int vo_fsmode;
6304
ee65527096c2 pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
arpi
parents: 6110
diff changeset
234 extern float vo_panscan;
36186
3b15983f5e48 Add options to determine where borders will be added when adjusting for aspect.
reimar
parents: 36171
diff changeset
235 extern float vo_border_pos_x;
3b15983f5e48 Add options to determine where borders will be added when adjusting for aspect.
reimar
parents: 36171
diff changeset
236 extern float vo_border_pos_y;
36171
94979f661d38 Add support for rotating the video via OpenGL.
reimar
parents: 36167
diff changeset
237 extern int vo_rotate;
12021
cd33d1e3b709 move refreshrate and adapter_num variables to video_out because they might be usefull for other drivers, too
faust3
parents: 11542
diff changeset
238 extern int vo_adapter_num;
cd33d1e3b709 move refreshrate and adapter_num variables to video_out because they might be usefull for other drivers, too
faust3
parents: 11542
diff changeset
239 extern int vo_refresh_rate;
12371
c000f4c23efd keepaspect and nokeepaspect are now useable by all vos
faust3
parents: 12021
diff changeset
240 extern int vo_keepaspect;
12912
1f6bb2356d18 add var vo_rootwin and -rootwin switch for mac osx
nplourde
parents: 12371
diff changeset
241 extern int vo_rootwin;
16280
7f34acc96aa4 remove extern for variables that are already in headers.
reimar
parents: 16171
diff changeset
242 extern int vo_ontop;
16968
e9d849bf8050 add a switch, slave command, and vo control to toggle borderless window.
joey
parents: 16280
diff changeset
243 extern int vo_border;
1268
9877eaacff9e extern vo_doublebuffering cleanup
arpi
parents: 1184
diff changeset
244
24027
0530865bb02a Declare all vo_gamma variables in libvo/video_out.h and remove them from
diego
parents: 23689
diff changeset
245 extern int vo_gamma_gamma;
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
246 extern int vo_gamma_brightness;
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
247 extern int vo_gamma_saturation;
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
248 extern int vo_gamma_contrast;
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
249 extern int vo_gamma_hue;
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
250 extern int vo_gamma_red_intensity;
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
251 extern int vo_gamma_green_intensity;
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
252 extern int vo_gamma_blue_intensity;
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6308
diff changeset
253
10785
e2dcade78bc6 -nomouseinput support for vo_sdl
alex
parents: 9569
diff changeset
254 extern int vo_nomouse_input;
31047
745f9833930b Deduplicate enable_mouse_movements declaration.
reimar
parents: 31043
diff changeset
255 extern int enable_mouse_movements;
5651
b8d8d72776f2 fix playlist bug with gui and rewrite mousecursor show/hide code
pontscho
parents: 5511
diff changeset
256
2707
97efb75dceb8 vo_pts added
arpi
parents: 1501
diff changeset
257 extern int vo_pts;
3201
039a973b3dda Newest DXR3 patch (improved 1.0rc2) by David Holm.
atmos4
parents: 2707
diff changeset
258 extern float vo_fps;
2707
97efb75dceb8 vo_pts added
arpi
parents: 1501
diff changeset
259
1184
e8c3f89ecd96 vo_subdevice implemented
al3x
parents: 1142
diff changeset
260 extern char *vo_subdevice;
e8c3f89ecd96 vo_subdevice implemented
al3x
parents: 1142
diff changeset
261
10988
c2bff70784d5 user settable colorkey
alex
parents: 10785
diff changeset
262 extern int vo_colorkey;
c2bff70784d5 user settable colorkey
alex
parents: 10785
diff changeset
263
29862
fbb1f57a313e Added -name, -title and -use-filename-title options and implementation in X11 vos
ptt
parents: 29524
diff changeset
264 extern char *vo_winname;
fbb1f57a313e Added -name, -title and -use-filename-title options and implementation in X11 vos
ptt
parents: 29524
diff changeset
265 extern char *vo_wintitle;
fbb1f57a313e Added -name, -title and -use-filename-title options and implementation in X11 vos
ptt
parents: 29524
diff changeset
266
28760
dec2bc0855e8 Make WinID a 64 bit integer, this should avoid issues with valid Window
reimar
parents: 28598
diff changeset
267 extern int64_t WinID;
16280
7f34acc96aa4 remove extern for variables that are already in headers.
reimar
parents: 16171
diff changeset
268
7069
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 7009
diff changeset
269 typedef struct {
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 7009
diff changeset
270 float min;
32702
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
271 float max;
7af3e6f901fd Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents: 32533
diff changeset
272 } range_t;
7069
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 7009
diff changeset
273
28051
9e739bdb049c Get rid of pointless 'extern' keywords.
diego
parents: 27997
diff changeset
274 float range_max(range_t *r);
9e739bdb049c Get rid of pointless 'extern' keywords.
diego
parents: 27997
diff changeset
275 int in_range(range_t *r, float f);
9e739bdb049c Get rid of pointless 'extern' keywords.
diego
parents: 27997
diff changeset
276 range_t *str2range(char *s);
7069
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 7009
diff changeset
277 extern char *monitor_hfreq_str;
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 7009
diff changeset
278 extern char *monitor_vfreq_str;
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 7009
diff changeset
279 extern char *monitor_dotclock_str;
21e1ab99cb21 General Timing Formula algorithm from a scratch.
arpi
parents: 7009
diff changeset
280
31017
fca6cfc4d5ca rename 'struct keymap' -> 'struct mp_keymap'
siretart
parents: 30465
diff changeset
281 struct mp_keymap {
28137
28bf0d126da2 Add and use a special lookup function to do table-based translation to MPlayer keycodes.
reimar
parents: 28051
diff changeset
282 int from;
28bf0d126da2 Add and use a special lookup function to do table-based translation to MPlayer keycodes.
reimar
parents: 28051
diff changeset
283 int to;
28bf0d126da2 Add and use a special lookup function to do table-based translation to MPlayer keycodes.
reimar
parents: 28051
diff changeset
284 };
31017
fca6cfc4d5ca rename 'struct keymap' -> 'struct mp_keymap'
siretart
parents: 30465
diff changeset
285 int lookup_keymap_table(const struct mp_keymap *map, int key);
28511
db19e31a2c7c Add a calc_src_dst_rects that calculates from window size, panscan etc.
reimar
parents: 28446
diff changeset
286 struct vo_rect {
db19e31a2c7c Add a calc_src_dst_rects that calculates from window size, panscan etc.
reimar
parents: 28446
diff changeset
287 int left, right, top, bottom, width, height;
db19e31a2c7c Add a calc_src_dst_rects that calculates from window size, panscan etc.
reimar
parents: 28446
diff changeset
288 };
28598
4172d83194f2 Extend calc_src_dst_rects to also calculate the border values needed for
reimar
parents: 28592
diff changeset
289 void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, struct vo_rect *dst,
4172d83194f2 Extend calc_src_dst_rects to also calculate the border values needed for
reimar
parents: 28592
diff changeset
290 struct vo_rect *borders, const struct vo_rect *crop);
31049
b40e41324173 Avoid duplicating mouse-movement command-generation code.
reimar
parents: 31047
diff changeset
291 void vo_mouse_movement(int posx, int posy);
28137
28bf0d126da2 Add and use a special lookup function to do table-based translation to MPlayer keycodes.
reimar
parents: 28051
diff changeset
292
35050
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
293 static inline int pixel_stride(unsigned fmt) {
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
294 if (IMGFMT_IS_RGB(fmt))
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
295 return (IMGFMT_RGB_DEPTH(fmt) + 7) / 8;
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
296 if (IMGFMT_IS_BGR(fmt))
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
297 return (IMGFMT_BGR_DEPTH(fmt) + 7) / 8;
35053
dda2444f4825 Fix OSD position again for interleaved YUV formats.
reimar
parents: 35050
diff changeset
298 if (fmt == IMGFMT_YUY2 || fmt == IMGFMT_UYVY)
dda2444f4825 Fix OSD position again for interleaved YUV formats.
reimar
parents: 35050
diff changeset
299 return 2;
35050
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
300 return IMGFMT_IS_YUVP16(fmt) ? 2 : 1;
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
301 }
b291f44d864a Avoid some code duplication related to drawing the OSD.
reimar
parents: 33305
diff changeset
302
29524
b1a437cdc60d Add infrastructure and test code to enable aspect scaling and panscan in windowed mode.
reimar
parents: 28760
diff changeset
303 static inline int aspect_scaling(void)
b1a437cdc60d Add infrastructure and test code to enable aspect scaling and panscan in windowed mode.
reimar
parents: 28760
diff changeset
304 {
35126
1278ec134f6b Enable aspect scaling even in windowed mode when
reimar
parents: 35053
diff changeset
305 return vo_fs || vo_keepaspect;
29524
b1a437cdc60d Add infrastructure and test code to enable aspect scaling and panscan in windowed mode.
reimar
parents: 28760
diff changeset
306 }
b1a437cdc60d Add infrastructure and test code to enable aspect scaling and panscan in windowed mode.
reimar
parents: 28760
diff changeset
307
36188
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
308 static inline int apply_border_pos(int full, int part, float pos) {
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
309 if (pos >= 0.0 && pos <= 1.0) {
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
310 return pos*(full - part);
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
311 }
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
312 if (pos < 0)
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
313 return pos * part;
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
314 return full - part + (pos - 1) * part;
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
315 }
34116de1aa96 Apply forgotten move of apply_border_pos function.
reimar
parents: 36186
diff changeset
316
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25595
diff changeset
317 #endif /* MPLAYER_VIDEO_OUT_H */