Mercurial > mplayer.hg
annotate libvo/vo_directfb2.c @ 36886:590e9305f12c
configure: Fix unnecessary rebuilds.
author | reimar |
---|---|
date | Fri, 07 Mar 2014 18:29:27 +0000 |
parents | 5d3f93051de9 |
children |
rev | line source |
---|---|
6952 | 1 /* |
27582
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
2 * MPlayer video driver for DirectFramebuffer device |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
3 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
4 * copyright (C) 2002 Jiri Svoboda <Jiri.Svoboda@seznam.cz> |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
5 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
6 * based on vo_directfb2.c |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
7 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
8 * This file is part of MPlayer. |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
9 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
10 * MPlayer is free software; you can redistribute it and/or |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
11 * modify it under the terms of the GNU Lesser General Public |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
12 * License as published by the Free Software Foundation; either |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
13 * version 2.1 of the License, or (at your option) any later version. |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
14 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
15 * MPlayer is distributed in the hope that it will be useful, |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
18 * Lesser General Public License for more details. |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
19 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
20 * You should have received a copy of the GNU Lesser General Public License |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
21 * along with MPlayer; if not, write to the Free Software Foundation, Inc., |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
23 */ |
6952 | 24 |
25 #include <directfb.h> | |
32168 | 26 #include <directfb_version.h> |
6952 | 27 #include <stdio.h> |
28 #include <stdlib.h> | |
29 #include <string.h> | |
32198 | 30 #include <libavutil/common.h> |
6952 | 31 |
32 #include "config.h" | |
33 #include "video_out.h" | |
36517 | 34 #define NO_DRAW_FRAME |
6952 | 35 #include "video_out_internal.h" |
33301
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
36 #include "libmpcodecs/vf.h" |
6952 | 37 #include "fastmemcpy.h" |
32467 | 38 #include "sub/sub.h" |
9937 | 39 #include "mp_msg.h" |
6952 | 40 #include "aspect.h" |
15750 | 41 #include "subopt-helper.h" |
22823
98eaf29b5dee
Code cleanup: don't include a .c file in mplayer.c and fix a few
rathann
parents:
20112
diff
changeset
|
42 #include "mp_fifo.h" |
6952 | 43 |
9937 | 44 // triple buffering |
45 #define TRIPLE 1 | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
46 |
25216 | 47 static const vo_info_t info = { |
6952 | 48 "Direct Framebuffer Device", |
49 "directfb", | |
50 "Jiri Svoboda Jiri.Svoboda@seznam.cz", | |
32169 | 51 "v 2.0 (for DirectFB version >=0.9.22)" |
6952 | 52 }; |
53 | |
25220
c9e9ac2008c2
Mark the vo_functions_t definitions as const where possible.
reimar
parents:
25216
diff
changeset
|
54 const LIBVO_EXTERN(directfb) |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
8137
diff
changeset
|
55 |
6952 | 56 /****************************** |
57 * vo_directfb globals * | |
58 ******************************/ | |
59 | |
60 #define DFBCHECK(x...) \ | |
61 { \ | |
62 DFBResult err = x; \ | |
63 \ | |
64 if (err != DFB_OK) \ | |
65 { \ | |
66 fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ | |
67 DirectFBErrorFatal( #x, err ); \ | |
68 } \ | |
69 } | |
70 | |
71 /* | |
72 * filled by preinit | |
73 */ | |
74 | |
75 // main DirectFB handle | |
76 static IDirectFB *dfb = NULL; | |
77 // keyboard handle | |
78 static IDirectFBInputDevice *keyboard = NULL; | |
79 // A buffer for input events. | |
80 static IDirectFBEventBuffer *buffer = NULL; | |
81 | |
82 /* | |
83 * filled during config | |
84 */ | |
85 | |
86 // handle of used layer | |
87 static IDirectFBDisplayLayer *layer = NULL; | |
88 // surface of used layer | |
89 static IDirectFBSurface *primary = NULL; | |
90 static int primarylocked = 0; | |
91 // handle of temporary surface (if used) | |
92 static IDirectFBSurface *frame = NULL; | |
93 static int framelocked = 0; | |
94 // flipping mode flag (layer/surface) | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
95 static int flipping = 0; |
6952 | 96 // scaling flag |
97 static int stretch = 0; | |
24950 | 98 // picture position |
6952 | 99 static int xoffset=0,yoffset=0; |
100 // picture size | |
101 static int out_width=0,out_height=0; | |
102 // frame/primary size | |
103 static int width=0,height=0; | |
104 // frame primary format | |
105 DFBSurfacePixelFormat pixel_format; | |
106 /* | |
107 static void (*draw_alpha_p)(int w, int h, unsigned char *src, | |
108 unsigned char *srca, int stride, unsigned char *dst, | |
109 int dstride); | |
110 */ | |
111 | |
112 /****************************** | |
113 * cmd line parameteres * | |
114 ******************************/ | |
115 | |
116 /* command line/config file options */ | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
117 static int layer_id = -1; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
118 static int buffer_mode = 1; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
119 static int use_input = 1; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
120 static int field_parity = -1; |
6952 | 121 |
122 /****************************** | |
123 * implementation * | |
124 ******************************/ | |
125 | |
30556
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
126 static void unlock(void) |
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
127 { |
6952 | 128 if (frame && framelocked) frame->Unlock(frame); |
129 if (primary && primarylocked) primary->Unlock(primary); | |
130 } | |
131 | |
15750 | 132 static int get_parity(strarg_t *arg) { |
133 if (strargcmp(arg, "top") == 0) | |
134 return 0; | |
135 if (strargcmp(arg, "bottom") == 0) | |
136 return 1; | |
137 return -1; | |
138 } | |
139 | |
140 static int check_parity(void *arg) { | |
141 return get_parity(arg) != -1; | |
142 } | |
143 | |
144 static int get_mode(strarg_t *arg) { | |
145 if (strargcmp(arg, "single") == 0) | |
146 return 1; | |
147 if (strargcmp(arg, "double") == 0) | |
148 return 2; | |
149 if (strargcmp(arg, "triple") == 0) | |
150 return 3; | |
151 return 0; | |
152 } | |
153 | |
154 static int check_mode(void *arg) { | |
155 return get_mode(arg) != 0; | |
156 } | |
6952 | 157 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15750
diff
changeset
|
158 static int preinit(const char *arg) |
6952 | 159 { |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
160 DFBResult ret; |
15750 | 161 strarg_t mode_str = {0, NULL}; |
162 strarg_t par_str = {0, NULL}; | |
163 strarg_t dfb_params = {0, NULL}; | |
28828
56eee6ffba9b
Make data related to suboption parsing const in libvo
reimar
parents:
27582
diff
changeset
|
164 const opt_t subopts[] = { |
15750 | 165 {"input", OPT_ARG_BOOL, &use_input, NULL}, |
166 {"buffermode", OPT_ARG_STR, &mode_str, check_mode}, | |
167 {"fieldparity", OPT_ARG_STR, &par_str, check_parity}, | |
168 {"layer", OPT_ARG_INT, &layer_id, NULL}, | |
169 {"dfbopts", OPT_ARG_STR, &dfb_params, NULL}, | |
170 {NULL} | |
171 }; | |
6952 | 172 |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
173 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Preinit entered\n"); |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
174 |
24950 | 175 if (dfb) return 0; // we are already initialized! |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
176 |
15750 | 177 // set defaults |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
178 buffer_mode = 1 + vo_doublebuffering; // honor -double switch |
15750 | 179 layer_id = -1; |
180 use_input = 1; | |
181 field_parity = -1; | |
182 if (subopt_parse(arg, subopts) != 0) { | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
183 mp_msg( MSGT_VO, MSGL_ERR, |
11982 | 184 "\n-vo directfb command line help:\n" |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
185 "Example: mplayer -vo directfb:layer=1:buffermode=single\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
186 "\nOptions (use 'no' prefix to disable):\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
187 " input Use DirectFB for keyboard input\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
188 "\nOther options:\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
189 " layer=n\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
190 " n=0..xx Use layer with id n for output (0=primary)\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
191 " buffermode=(single|double|triple)\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
192 " single Use single buffering\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
193 " double Use double buffering\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
194 " triple Use triple buffering\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
195 " fieldparity=(top|bottom)\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
196 " top Top field first\n" |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
197 " bottom Bottom field first\n" |
15750 | 198 " dfbopts=<str>\n" |
199 " Specify a parameter list for DirectFB\n" | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
200 "\n" ); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
201 return -1; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
202 } |
15750 | 203 if (mode_str.len) |
204 buffer_mode = get_mode(&mode_str); | |
205 if (par_str.len) | |
206 field_parity = get_parity(&par_str); | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
207 |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
208 |
15750 | 209 if (dfb_params.len > 0) |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
210 { |
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
211 int argc = 2; |
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
212 char arg0[10] = "mplayer"; |
18878 | 213 char *arg1 = malloc(dfb_params.len + 7); |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
214 char* argv[3]; |
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
215 char ** a; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
216 |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
217 a = &argv[0]; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
218 |
15750 | 219 strcpy(arg1, "--dfb:"); |
220 strncat(arg1, dfb_params.str, dfb_params.len); | |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
221 |
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
222 argv[0]=arg0; |
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
223 argv[1]=arg1; |
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
224 argv[2]=NULL; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
225 |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
226 DFBCHECK (DirectFBInit (&argc,&a)); |
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
227 |
15750 | 228 free(arg1); |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
229 } else { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
230 |
6952 | 231 DFBCHECK (DirectFBInit (NULL,NULL)); |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
232 } |
6952 | 233 |
234 if (((directfb_major_version <= 0) && | |
235 (directfb_minor_version <= 9) && | |
32167 | 236 (directfb_micro_version < 15))) |
6952 | 237 { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
238 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: Unsupported DirectFB version\n"); |
6952 | 239 return 1; |
240 } | |
241 | |
242 /* | |
243 * (set options) | |
244 */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
245 |
24950 | 246 // uncomment this if you do not wish to create a new VT for DirectFB |
6952 | 247 // DFBCHECK (DirectFBSetOption ("no-vt-switch","")); |
248 | |
24950 | 249 // uncomment this if you want to allow VT switching |
6952 | 250 // DFBCHECK (DirectFBSetOption ("vt-switching","")); |
251 | |
252 // uncomment this if you want to hide gfx cursor (req dfb >=0.9.9) | |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
253 DFBCHECK (DirectFBSetOption ("no-cursor","")); |
6952 | 254 |
255 // bg color fix | |
256 DFBCHECK (DirectFBSetOption ("bg-color","00000000")); | |
257 | |
258 /* | |
259 * (Initialize) | |
260 */ | |
261 | |
262 DFBCHECK (DirectFBCreate (&dfb)); | |
263 | |
264 /* | |
265 * (Get keyboard) | |
266 */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
267 |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
268 if (use_input) { |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
269 ret = dfb->GetInputDevice (dfb, DIDID_KEYBOARD, &keyboard); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
270 if (ret==DFB_OK) { |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
271 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Keyboard init OK\n"); |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
272 } else { |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
273 keyboard = NULL; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
274 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: Keyboard init FAILED\n"); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
275 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
276 } |
6952 | 277 |
278 | |
279 /* | |
280 * Create an input buffer for the keyboard. | |
281 */ | |
282 if (keyboard) DFBCHECK (keyboard->CreateEventBuffer (keyboard, &buffer)); | |
283 | |
24950 | 284 // just to start clean ... |
6952 | 285 if (buffer) buffer->Reset(buffer); |
286 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
287 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Preinit OK\n"); |
6952 | 288 |
289 return 0; | |
290 | |
291 } | |
292 | |
30556
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
293 static DFBSurfacePixelFormat convformat(uint32_t format) |
6952 | 294 { |
295 // add more formats !!! | |
296 switch (format) { | |
297 case IMGFMT_RGB32: return DSPF_RGB32; break; | |
298 case IMGFMT_BGR32: return DSPF_RGB32; break; | |
299 case IMGFMT_RGB24: return DSPF_RGB24; break; | |
300 case IMGFMT_BGR24: return DSPF_RGB24; break; | |
301 case IMGFMT_RGB16: return DSPF_RGB16; break; | |
302 case IMGFMT_BGR16: return DSPF_RGB16; break; | |
8640 | 303 case IMGFMT_RGB15: return DSPF_ARGB1555; break; |
304 case IMGFMT_BGR15: return DSPF_ARGB1555; break; | |
31082
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
305 case IMGFMT_RGB12: return DSPF_ARGB4444; break; |
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
306 case IMGFMT_BGR12: return DSPF_ARGB4444; break; |
6952 | 307 case IMGFMT_YUY2: return DSPF_YUY2; break; |
308 case IMGFMT_UYVY: return DSPF_UYVY; break; | |
309 case IMGFMT_YV12: return DSPF_YV12; break; | |
310 case IMGFMT_I420: return DSPF_I420; break; | |
311 // case IMGFMT_IYUV: return DSPF_IYUV; break; | |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
312 case IMGFMT_RGB8: return DSPF_RGB332; break; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
313 case IMGFMT_BGR8: return DSPF_RGB332; break; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
314 |
6952 | 315 default: return 0; |
316 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
317 return 0; |
6952 | 318 } |
319 | |
320 typedef struct enum1_s { | |
321 uint32_t format; | |
322 int scale; | |
323 int result; | |
324 unsigned int id; | |
325 unsigned int width; | |
326 unsigned int height; | |
327 int setsize; | |
328 } enum1_t; | |
329 | |
30556
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
330 static DFBEnumerationResult test_format_callback(unsigned int id, |
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
331 DFBDisplayLayerDescription desc, |
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
332 void *data) |
6952 | 333 { |
334 enum1_t *params =(enum1_t *)data; | |
335 IDirectFBDisplayLayer *layer; | |
336 DFBResult ret; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
337 |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
338 if ((layer_id == -1 )||(layer_id == id)) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
339 |
6952 | 340 ret = dfb->GetDisplayLayer( dfb, id, &layer); |
341 if (ret) { | |
342 DirectFBError( "dfb->GetDisplayLayer failed", ret ); | |
343 return DFENUM_OK; | |
344 } else { | |
345 DFBDisplayLayerConfig dlc; | |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
346 |
6952 | 347 if (params->setsize) { |
348 dlc.flags = DLCONF_WIDTH |DLCONF_HEIGHT; | |
349 dlc.width = params->width; | |
350 dlc.height = params->height; | |
351 layer->SetConfiguration(layer,&dlc); | |
352 } | |
353 | |
354 | |
355 dlc.flags = DLCONF_PIXELFORMAT; | |
356 dlc.pixelformat = convformat(params->format); | |
9515 | 357 |
358 layer->SetOpacity(layer,0); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
359 |
6952 | 360 ret = layer->TestConfiguration(layer,&dlc,NULL); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
361 |
6952 | 362 layer->Release(layer); |
363 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
364 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Test format - layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION)); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
365 |
9515 | 366 if (ret==DFB_OK) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
367 // printf("Test OK\n"); |
6952 | 368 if (params->result) { |
369 if ((!params->scale) && (desc.caps & DLCAPS_SCREEN_LOCATION)) { | |
370 params->scale=1; | |
371 params->id=id; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
372 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Test format - added layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION)); |
6952 | 373 } |
374 } else { | |
375 params->result=1; | |
376 params->id=id; | |
377 if (desc.caps & DLCAPS_SCREEN_LOCATION) params->scale=1; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
378 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Test format - added layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION)); |
6952 | 379 }; |
380 }; | |
381 }; | |
382 | |
8137
530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
arpi
parents:
7272
diff
changeset
|
383 }; |
9515 | 384 |
6952 | 385 return DFENUM_OK; |
386 } | |
387 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15750
diff
changeset
|
388 static int query_format(uint32_t format) |
6952 | 389 { |
24950 | 390 int ret = VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD; // osd should be removed the in future -> will be handled outside... |
6952 | 391 enum1_t params; |
392 | |
393 | |
394 if (!convformat(format)) return 0; | |
24950 | 395 // temporarily disable YV12 |
6952 | 396 // if (format == IMGFMT_YV12) return 0; |
397 // if (format == IMGFMT_I420) return 0; | |
398 if (format == IMGFMT_IYUV) return 0; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
399 |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
400 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Format query: %s\n",vo_format_name(format)); |
6952 | 401 |
402 params.format=format; | |
403 params.scale=0; | |
404 params.result=0; | |
405 params.setsize=0; | |
406 | |
407 DFBCHECK (dfb->EnumDisplayLayers(dfb,test_format_callback,¶ms)); | |
408 | |
409 if (params.result) { | |
410 if (params.scale) ret |=VFCAP_HWSCALE_UP|VFCAP_HWSCALE_DOWN; | |
411 return ret; | |
412 } | |
413 | |
414 return 0; | |
415 } | |
416 | |
417 typedef struct videomode_s { | |
418 int width; | |
419 int height; | |
420 int out_width; | |
421 int out_height; | |
422 int overx; | |
423 int overy; | |
424 int bpp; | |
425 } videomode_t; | |
426 | |
427 | |
30556
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
428 static DFBEnumerationResult video_modes_callback(int width, int height, |
358ac046eccc
libvo: Mark functions not used outside of their files as static.
diego
parents:
30250
diff
changeset
|
429 int bpp, void *data) |
6952 | 430 { |
431 videomode_t *params =(videomode_t *)data; | |
432 | |
433 int overx=0,overy=0,closer=0,over=0; | |
434 int we_are_under=0; | |
435 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
436 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Validator entered %i %i %i\n",width,height,bpp); |
6952 | 437 |
438 overx=width-params->out_width; | |
439 overy=height-params->out_height; | |
440 | |
441 if (!params->width) { | |
442 params->width=width; | |
443 params->height=height; | |
444 params->overx=overx; | |
445 params->overy=overy; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
446 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Mode added %i %i %i\n",width,height,bpp); |
6952 | 447 } |
448 | |
449 if ((params->overy<0)||(params->overx<0)) we_are_under=1; // stored mode is smaller than req mode | |
450 if (abs(overx*overy)<abs(params->overx * params->overy)) closer=1; // current mode is closer to desired res | |
451 if ((overx>=0)&&(overy>=0)) over=1; // current mode is bigger or equaul to desired res | |
452 if ((closer && (over || we_are_under)) || (we_are_under && over)) { | |
453 params->width=width; | |
454 params->height=height; | |
455 params->overx=overx; | |
456 params->overy=overy; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
457 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Better mode added %i %i %i\n",width,height,bpp); |
6952 | 458 }; |
459 | |
460 return DFENUM_OK; | |
461 } | |
462 | |
463 #define CONFIG_ERROR -1 | |
464 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15750
diff
changeset
|
465 static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
13787
diff
changeset
|
466 uint32_t d_height, uint32_t flags, char *title, |
7272 | 467 uint32_t format) |
6952 | 468 { |
469 /* | |
470 * (Locals) | |
471 */ | |
472 | |
473 // decode flags | |
474 | |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
13787
diff
changeset
|
475 int fs = flags & VOFLAG_FULLSCREEN; |
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
13787
diff
changeset
|
476 int vm = flags & VOFLAG_MODESWITCHING; |
6952 | 477 |
478 DFBSurfaceDescription dsc; | |
479 DFBResult ret; | |
480 DFBDisplayLayerConfig dlc; | |
481 DFBSurfaceCapabilities caps; | |
482 | |
483 enum1_t params; | |
484 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
485 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config entered [%ix%i]\n",s_width,s_height); |
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
486 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: With requested format: %s\n",vo_format_name(format)); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
487 |
24950 | 488 // initial cleanup |
6952 | 489 if (frame) { |
490 frame->Release(frame); | |
491 frame=NULL; | |
492 } | |
493 | |
494 if (primary) { | |
495 primary->Release(primary); | |
496 primary=NULL; | |
497 } | |
498 | |
499 if (layer) { | |
500 layer->Release(layer); | |
501 layer=NULL; | |
502 } | |
503 | |
504 | |
505 // vm things | |
506 | |
507 if (vm) { | |
508 videomode_t params; | |
509 params.out_width=d_width; | |
510 params.out_height=d_height; | |
511 params.width=0; | |
512 params.height=0; | |
513 switch (format) { | |
9515 | 514 case IMGFMT_RGB32: |
515 case IMGFMT_BGR32: | |
6952 | 516 params.bpp=32; |
517 break; | |
9515 | 518 case IMGFMT_RGB24: |
519 case IMGFMT_BGR24: | |
6952 | 520 params.bpp=24; |
521 break; | |
522 case IMGFMT_RGB16: | |
523 case IMGFMT_BGR16: | |
524 case IMGFMT_RGB15: | |
525 case IMGFMT_BGR15: | |
31082
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
526 case IMGFMT_RGB12: |
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
527 case IMGFMT_BGR12: |
6952 | 528 params.bpp=16; |
529 break; | |
9515 | 530 default: params.bpp=0; |
531 | |
532 } | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
533 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - trying to change videomode\n"); |
6952 | 534 DFBCHECK (dfb->EnumVideoModes(dfb,video_modes_callback,¶ms)); |
535 ret=dfb->SetVideoMode(dfb,params.width,params.height,params.bpp); | |
536 if (ret) { | |
537 ret=dfb->SetVideoMode(dfb,params.width,params.height,24); | |
538 if (ret) { | |
539 ret=dfb->SetVideoMode(dfb,params.width,params.height,32); | |
540 if (ret) { | |
541 ret=dfb->SetVideoMode(dfb,params.width,params.height,16); | |
542 if (ret) { | |
543 ret=dfb->SetVideoMode(dfb,params.width,params.height,8); | |
544 } | |
545 } | |
546 } | |
547 } | |
548 } // vm end | |
549 | |
24950 | 550 // just to be sure clear primary layer |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
551 ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
552 if (ret==DFB_OK) { |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
553 ret = layer->GetSurface(layer,&primary); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
554 if (ret==DFB_OK) { |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
555 primary->Clear(primary,0,0,0,0xff); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
556 ret = primary->Flip(primary,NULL,0); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
557 if (ret==DFB_OK) { |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
558 primary->Clear(primary,0,0,0,0xff); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
559 } |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
560 primary->Release(primary); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
561 } |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
562 primary=NULL; |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
563 layer->Release(layer); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
564 } |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
565 layer=NULL; |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
566 |
6952 | 567 // find best layer |
568 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
569 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - looking for suitable layer\n"); |
6952 | 570 params.format=format; |
571 params.scale=0; | |
572 params.result=0; | |
573 params.width=s_width; | |
574 params.height=s_height; | |
575 params.setsize=1; | |
576 | |
577 DFBCHECK (dfb->EnumDisplayLayers(dfb,test_format_callback,¶ms)); | |
578 | |
579 if (!params.result) { | |
9937 | 580 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError - no suitable layer found\n"); |
6952 | 581 params.id = DLID_PRIMARY; |
9515 | 582 } |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
583 |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
584 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - layer %i\n",params.id); |
6952 | 585 |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
586 // setup layer |
6952 | 587 |
588 DFBCHECK (dfb->GetDisplayLayer( dfb, params.id, &layer)); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
589 |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
590 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - switching layer to exclusive mode\n"); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
591 ret = layer->SetCooperativeLevel (layer, DLSCL_EXCLUSIVE); |
6952 | 592 |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
593 if (DFB_OK != ret) { |
24951 | 594 mp_msg(MSGT_VO, MSGL_WARN,"DirectFB: Warning - cannot switch layer to exclusive mode. This could cause\nproblems. You may need to select correct pixel format manually!\n"); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
595 DirectFBError("MPlayer - Switch layer to exlusive mode.",ret); |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
596 }; |
6952 | 597 if (params.scale) { |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
598 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - changing layer configuration (size)\n"); |
6952 | 599 dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT; |
600 dlc.width = s_width; | |
601 dlc.height = s_height; | |
9515 | 602 |
6952 | 603 ret = layer->SetConfiguration(layer,&dlc); |
9515 | 604 |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
605 if (ret) { |
9937 | 606 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError in layer configuration (size)\n"); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
607 DirectFBError("MPlayer - Layer size change.",ret); |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
608 }; |
6952 | 609 } |
610 | |
24950 | 611 // look if we need to change the pixel format of the layer |
612 // and just to be sure also fetch all layer properties | |
9515 | 613 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_OPTIONS | DLCONF_BUFFERMODE; |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
614 |
9515 | 615 ret = layer->GetConfiguration(layer,&dlc); |
616 | |
617 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_WIDTH | DLCONF_HEIGHT; | |
618 | |
619 if (ret) { | |
9937 | 620 mp_msg(MSGT_VO, MSGL_WARN,"DirectFB: Warning - could not get layer properties!\n"); |
621 } else { | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
622 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Layer reports format:%x\n",dlc.pixelformat); |
9515 | 623 } |
6952 | 624 |
9515 | 625 if ((dlc.pixelformat != convformat(params.format)) || (ret != DFB_OK)) { |
626 | |
627 dlc.flags = DLCONF_PIXELFORMAT; | |
628 dlc.pixelformat = convformat(params.format); | |
629 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
630 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Desired pixelformat: %x\n",dlc.pixelformat); |
9515 | 631 |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
632 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - changing layer configuration (format)\n"); |
9515 | 633 ret = layer->SetConfiguration(layer,&dlc); |
634 | |
635 if (ret) { | |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
636 unsigned int bpp; |
9937 | 637 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError in layer configuration (format, flags=%x)\n",dlc.flags); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
638 DirectFBError("MPlayer - layer pixelformat change",ret); |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
639 |
24950 | 640 // ugly fbdev workaround - try to switch pixelformat via videomode change |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
641 switch (dlc.pixelformat) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
642 case DSPF_ARGB: |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
643 case DSPF_RGB32: bpp=32;break; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
644 case DSPF_RGB24: bpp=24;break; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
645 case DSPF_RGB16: bpp=16;break; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
646 case DSPF_ARGB1555: bpp=15;break; |
31082
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
647 case DSPF_ARGB4444: bpp=12; break; |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
648 case DSPF_RGB332 : bpp=8;break; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
649 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
650 |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
651 switch (dlc.pixelformat) { |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
652 case DSPF_ARGB: |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
653 case DSPF_RGB32: |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
654 case DSPF_RGB24: |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
655 case DSPF_RGB16: |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
656 case DSPF_ARGB1555: |
31082
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
657 case DSPF_ARGB4444: |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
658 case DSPF_RGB332: |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
659 mp_msg(MSGT_VO, MSGL_V,"DirectFB: Trying to recover via videomode change (VM).\n"); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
660 // get size |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
661 dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
662 if (DFB_OK==layer->GetConfiguration(layer,&dlc)) { |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
663 // try to set videomode |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
664 mp_msg(MSGT_VO, MSGL_V,"DirectFB: Videomode %ix%i BPP %i\n",dlc.width,dlc.height,bpp); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
665 ret = dfb->SetVideoMode(dfb,dlc.width,dlc.height,bpp); |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
666 if (ret) DirectFBError("MPlayer - VM - pixelformat change",ret); |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
667 |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
668 }; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
669 |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
670 //get current pixel format |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
671 dlc.flags = DLCONF_PIXELFORMAT; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
672 ret = layer->GetConfiguration(layer,&dlc); |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
673 if (ret) { |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
674 DirectFBError("MPlayer - VM - Layer->GetConfiguration",ret); |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
675 } else { |
24951 | 676 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Layer now has pixelformat [%x]\n",dlc.pixelformat); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
677 }; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
678 |
24950 | 679 // check if we were succesful |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
680 if ((dlc.pixelformat != convformat(params.format)) || (ret != DFB_OK)) { |
9937 | 681 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Recovery failed!.\n"); |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
682 return CONFIG_ERROR; |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
683 } |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
684 |
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
685 break; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
686 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
687 default: return CONFIG_ERROR; |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
688 |
9538
7b1907aa1422
Some 10l and better layer handling (to comply with DFB 0.9.17)
zdar
parents:
9515
diff
changeset
|
689 }; |
9515 | 690 }; |
6952 | 691 }; |
692 | |
693 // flipping of layer | |
24950 | 694 // try triple, double... buffering |
6952 | 695 |
696 dlc.flags = DLCONF_BUFFERMODE; | |
9937 | 697 #ifdef TRIPLE |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
698 if (buffer_mode > 2) { |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
699 dlc.buffermode = DLBM_TRIPLE; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
700 ret = layer->SetConfiguration( layer, &dlc ); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
701 } else { |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
702 ret=!DFB_OK; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
703 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
704 |
9937 | 705 if (ret!=DFB_OK) { |
706 #endif | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
707 if (buffer_mode > 1) { |
9937 | 708 dlc.buffermode = DLBM_BACKVIDEO; |
709 ret = layer->SetConfiguration( layer, &dlc ); | |
710 if (ret!=DFB_OK) { | |
711 dlc.buffermode = DLBM_BACKSYSTEM; | |
712 ret = layer->SetConfiguration( layer, &dlc ); | |
6952 | 713 } |
9937 | 714 } |
715 if (ret == DFB_OK) { | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
716 mp_msg(MSGT_VO, MSGL_V,"DirectFB: Double buffering is active\n"); |
9937 | 717 } |
718 #ifdef TRIPLE | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
719 } else { |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
720 mp_msg(MSGT_VO, MSGL_V,"DirectFB: Triple buffering is active\n"); |
9937 | 721 } |
722 #endif | |
6952 | 723 |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
724 if (field_parity != -1) { |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
725 dlc.flags = DLCONF_OPTIONS; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
726 ret = layer->GetConfiguration( layer, &dlc ); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
727 if (ret==DFB_OK) { |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
728 dlc.options |= DLOP_FIELD_PARITY; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
729 ret = layer->SetConfiguration( layer, &dlc ); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
730 if (ret==DFB_OK) { |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
731 layer->SetFieldParity( layer, field_parity ); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
732 } |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
733 } |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
734 } |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
735 mp_msg( MSGT_VO, MSGL_DBG2, "DirectFB: Requested field parity: "); |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
736 switch (field_parity) { |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
737 case -1: |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
738 mp_msg( MSGT_VO, MSGL_DBG2, "Don't care\n"); |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
739 break; |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
740 case 0: |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
741 mp_msg( MSGT_VO, MSGL_DBG2, "Top field first\n"); |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
742 break; |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
743 case 1: |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
744 mp_msg( MSGT_VO, MSGL_DBG2, "Bottom field first\n"); |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
745 break; |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
746 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
747 |
6952 | 748 // get layer surface |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
749 |
6952 | 750 ret = layer->GetSurface(layer,&primary); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
751 |
6952 | 752 if (ret) { |
9937 | 753 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError - could not get surface\n"); |
24950 | 754 return CONFIG_ERROR; // what shall we report on failure? |
6952 | 755 } |
756 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
757 // test surface for flipping |
6952 | 758 DFBCHECK(primary->GetCapabilities(primary,&caps)); |
9937 | 759 primary->Clear(primary,0,0,0,0xff); |
6952 | 760 flipping = 0; |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
761 if (caps & (DSCAPS_FLIPPING |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
762 #ifdef TRIPLE |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
763 | DSCAPS_TRIPLE |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
764 #endif |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
765 )) { |
6952 | 766 ret = primary->Flip(primary,NULL,0); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
767 if (ret==DFB_OK) { |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
768 flipping = 1; |
9937 | 769 primary->Clear(primary,0,0,0,0xff); |
770 #ifdef TRIPLE | |
771 // if we have 3 buffers clean once more | |
772 if (caps & DSCAPS_TRIPLE) { | |
773 primary->Flip(primary,NULL,0); | |
774 primary->Clear(primary,0,0,0,0xff); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
775 flipping = 2; |
9937 | 776 } |
777 #endif | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
778 } |
6952 | 779 }; |
780 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
781 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - flipping = %i\n",flipping); |
6952 | 782 |
783 // is scale needed ? Aspect ratio and layer pos/size | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
784 |
6952 | 785 |
786 // get surface size | |
787 DFBCHECK(primary->GetSize(primary,&width,&height)); | |
788 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
789 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - surface size = %ix%i\n",width,height); |
6952 | 790 |
791 aspect_save_orig(s_width,s_height); | |
792 aspect_save_prescale(d_width,d_height); | |
793 if (params.scale) { | |
794 aspect_save_screenres(10000,10000); | |
795 aspect(&out_width,&out_height,A_ZOOM); | |
796 | |
797 ret = layer->SetScreenLocation(layer,(1-(float)out_width/10000)/2,(1-(float)out_height/10000)/2,((float)out_width/10000),((float)out_height/10000)); | |
798 | |
9937 | 799 if (ret) mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError in layer configuration (position)\n"); |
6952 | 800 |
801 xoffset = 0; | |
802 yoffset = 0; | |
803 | |
804 } else { | |
805 | |
806 aspect_save_screenres(width,height); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
807 |
6952 | 808 if(fs) /* -fs */ |
809 aspect(&out_width,&out_height,A_ZOOM); | |
810 else | |
811 aspect(&out_width,&out_height,A_NOZOOM); | |
812 | |
813 | |
814 xoffset = (width - out_width) / 2; | |
815 yoffset = (height - out_height) / 2; | |
816 } | |
817 | |
818 if (((s_width==out_width)&&(s_height==out_height)) || (params.scale)) { | |
819 stretch = 0; | |
820 } else { | |
821 stretch = 1; | |
822 } | |
823 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
824 |
6952 | 825 // temporary buffer in case of not flipping or scaling |
826 if ((!flipping) || stretch) { | |
827 | |
828 DFBCHECK (primary->GetPixelFormat (primary, &dsc.pixelformat)); | |
829 | |
830 dsc.flags = DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_WIDTH; | |
831 | |
832 dsc.width = s_width; | |
833 dsc.height = s_height; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
834 |
6952 | 835 DFBCHECK (dfb->CreateSurface( dfb, &dsc, &frame)); |
836 DFBCHECK(frame->GetSize(frame,&width,&height)); | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
837 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Frame is active.\n"); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
838 } |
6952 | 839 |
840 // get format for draw_alpha - should be removed soon - osd will be rendered outside vo driver | |
841 if (frame) { | |
842 DFBCHECK (frame->GetPixelFormat(frame,&pixel_format)); | |
843 } else { | |
844 DFBCHECK (primary->GetPixelFormat(primary,&pixel_format)); | |
845 }; | |
846 | |
847 // finally turn on layer | |
848 layer->SetOpacity(layer,255); | |
849 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
850 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Config finished [%ix%i] - [%ix%i]\n",out_width,out_height,width,height); |
6952 | 851 |
852 return 0; | |
853 } | |
854 | |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
11982
diff
changeset
|
855 #include "osdep/keycodes.h" |
6952 | 856 |
857 static void check_events(void) | |
858 { | |
859 | |
860 if (buffer) { | |
861 | |
862 DFBInputEvent event; | |
863 | |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
864 //if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf ("DirectFB: Check events entered\n"); |
6952 | 865 if (buffer->GetEvent(buffer, DFB_EVENT (&event)) == DFB_OK) { |
866 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
867 if (event.type == DIET_KEYPRESS) { |
6952 | 868 switch (event.key_symbol) { |
869 case DIKS_ESCAPE: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16171
diff
changeset
|
870 mplayer_put_key(KEY_ESC); |
6952 | 871 break; |
872 case DIKS_PAGE_UP: mplayer_put_key(KEY_PAGE_UP);break; | |
873 case DIKS_PAGE_DOWN: mplayer_put_key(KEY_PAGE_DOWN);break; | |
874 case DIKS_CURSOR_UP: mplayer_put_key(KEY_UP);break; | |
875 case DIKS_CURSOR_DOWN: mplayer_put_key(KEY_DOWN);break; | |
876 case DIKS_CURSOR_LEFT: mplayer_put_key(KEY_LEFT);break; | |
877 case DIKS_CURSOR_RIGHT: mplayer_put_key(KEY_RIGHT);break; | |
878 case DIKS_INSERT: mplayer_put_key(KEY_INSERT);break; | |
879 case DIKS_DELETE: mplayer_put_key(KEY_DELETE);break; | |
880 case DIKS_HOME: mplayer_put_key(KEY_HOME);break; | |
881 case DIKS_END: mplayer_put_key(KEY_END);break; | |
882 | |
883 default:mplayer_put_key(event.key_symbol); | |
884 }; | |
885 }; | |
886 }; | |
887 // empty buffer, because of repeating (keyboard repeat is faster than key handling | |
888 // and this causes problems during seek) | |
24950 | 889 // temporary workaround should be solved in the future |
6952 | 890 buffer->Reset(buffer); |
891 | |
892 } | |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
893 //if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf ("DirectFB: Check events finished\n"); |
6952 | 894 } |
895 | |
896 static void flip_page(void) | |
897 { | |
898 DFBSurfaceBlittingFlags flags=DSBLIT_NOFX; | |
899 | |
900 unlock(); // unlock frame & primary | |
901 | |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
902 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: Flip page entered"); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
903 |
6952 | 904 DFBCHECK (primary->SetBlittingFlags(primary,flags)); |
905 | |
906 if (frame) { | |
907 if (stretch) { | |
908 DFBRectangle rect; | |
909 rect.x=xoffset; | |
910 rect.y=yoffset; | |
911 rect.w=out_width; | |
912 rect.h=out_height; | |
913 | |
914 DFBCHECK (primary->StretchBlit(primary,frame,NULL,&rect)); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
915 |
6952 | 916 } else { |
917 | |
918 DFBCHECK (primary->Blit(primary,frame,NULL,xoffset,yoffset)); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
919 |
6952 | 920 }; |
921 }; | |
922 | |
923 | |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
924 #ifdef TRIPLE |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
925 switch (flipping) { |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
926 case 1: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAIT)); |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
927 break; |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
928 case 2: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_ONSYNC)); |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
929 break; |
24950 | 930 default:; // should never be reached |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
931 } |
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
932 #else |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
933 if (flipping) { |
6952 | 934 DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC)); |
935 } | |
11972
cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
zdar
parents:
11000
diff
changeset
|
936 #endif |
6952 | 937 |
938 } | |
939 | |
940 | |
941 | |
942 static void uninit(void) | |
943 { | |
944 | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
945 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Uninit entered\n"); |
6952 | 946 |
947 unlock(); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
948 |
6952 | 949 /* |
950 * (Release) | |
951 */ | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
952 /* |
9937 | 953 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Releasing buffer\n"); |
6952 | 954 if (buffer) buffer->Release (buffer); |
9937 | 955 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Releasing keyboard\n"); |
6952 | 956 if (keyboard) keyboard->Release (keyboard); |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
957 */ |
6952 | 958 if (frame) { |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
959 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Releasing frame\n"); |
6952 | 960 frame->Release (frame); |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
961 frame = NULL; |
6952 | 962 }; |
963 | |
964 // switch off BES | |
965 // if (layer) layer->SetOpacity(layer,0); | |
966 | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
967 if (layer) { |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
968 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Releasing layer\n"); |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
969 layer->Release(layer); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
970 layer = NULL; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
971 } |
6952 | 972 |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
973 if (primary) { |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
974 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Releasing primary\n"); |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
975 primary->Release (primary); |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
976 primary = NULL; |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
977 } |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
978 |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
979 |
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
980 /* mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Releasing DirectFB library\n"); |
6952 | 981 |
982 dfb->Release (dfb); | |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
983 */ |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
984 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Uninit done.\n"); |
6952 | 985 } |
986 | |
987 | |
33312 | 988 static uint32_t directfb_set_video_eq(const char *data, int value) //data==name |
6952 | 989 { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
990 |
6952 | 991 DFBColorAdjustment ca; |
992 float factor = (float)0xffff / 200.0; | |
993 | |
994 DFBDisplayLayerDescription desc; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
995 |
6952 | 996 unlock(); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
997 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
998 if (layer) { |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
999 |
6952 | 1000 layer->GetDescription(layer,&desc); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1001 |
6952 | 1002 ca.flags=DCAF_NONE; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1003 |
6952 | 1004 if (! strcmp( data,"brightness" )) { |
1005 if (desc.caps & DLCAPS_BRIGHTNESS) { | |
1006 ca.brightness = value * factor +0x8000; | |
1007 ca.flags |= DCAF_BRIGHTNESS; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1008 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: SetVEq Brightness 0x%X %i\n",ca.brightness,value); |
6952 | 1009 } else return VO_FALSE; |
1010 } | |
1011 | |
1012 if (! strcmp( data,"contrast" )) { | |
1013 if ((desc.caps & DLCAPS_CONTRAST)) { | |
1014 ca.contrast = value * factor + 0x8000; | |
1015 ca.flags |= DCAF_CONTRAST; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1016 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: SetVEq Contrast 0x%X %i\n",ca.contrast,value); |
6952 | 1017 } else return VO_FALSE; |
1018 } | |
1019 | |
1020 if (! strcmp( data,"hue" )) { | |
1021 if ((desc.caps & DLCAPS_HUE)) { | |
1022 ca.hue = value * factor + 0x8000; | |
1023 ca.flags |= DCAF_HUE; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1024 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: SetVEq Hue 0x%X %i\n",ca.hue,value); |
6952 | 1025 } else return VO_FALSE; |
1026 } | |
1027 | |
1028 if (! strcmp( data,"saturation" )) { | |
1029 if ((desc.caps & DLCAPS_SATURATION)) { | |
1030 ca.saturation = value * factor + 0x8000; | |
1031 ca.flags |= DCAF_SATURATION; | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1032 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: SetVEq Saturation 0x%X %i\n",ca.saturation,value); |
6952 | 1033 } else return VO_FALSE; |
1034 } | |
1035 | |
1036 if (ca.flags != DCAF_NONE) { | |
1037 layer->SetColorAdjustment(layer,&ca); | |
1038 return VO_TRUE; | |
1039 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1040 } |
6952 | 1041 |
1042 return VO_FALSE; | |
1043 | |
1044 } | |
1045 | |
33312 | 1046 static uint32_t directfb_get_video_eq(const char *data, int *value) // data==name |
6952 | 1047 { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1048 |
6952 | 1049 DFBColorAdjustment ca; |
1050 float factor = 200.0 / (float)0xffff; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1051 |
6952 | 1052 DFBDisplayLayerDescription desc; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1053 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1054 if (layer) { |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1055 |
6952 | 1056 unlock(); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1057 |
6952 | 1058 layer->GetDescription(layer,&desc); |
1059 | |
1060 layer->GetColorAdjustment(layer,&ca); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1061 |
6952 | 1062 if (! strcmp( data,"brightness" )) { |
1063 if (desc.caps & DLCAPS_BRIGHTNESS) { | |
1064 *value = (int) ((ca.brightness-0x8000) * factor); | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1065 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: GetVEq Brightness 0x%X %i\n",ca.brightness,*value); |
6952 | 1066 return VO_TRUE; |
1067 } else return VO_FALSE; | |
1068 } | |
1069 | |
1070 if (! strcmp( data,"contrast" )) { | |
1071 if ((desc.caps & DLCAPS_CONTRAST)) { | |
1072 *value = (int) ((ca.contrast-0x8000) * factor); | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1073 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: GetVEq Contrast 0x%X %i\n",ca.contrast,*value); |
6952 | 1074 return VO_TRUE; |
1075 } else return VO_FALSE; | |
1076 } | |
1077 | |
1078 if (! strcmp( data,"hue" )) { | |
1079 if ((desc.caps & DLCAPS_HUE)) { | |
1080 *value = (int) ((ca.hue-0x8000) * factor); | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1081 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: GetVEq Hue 0x%X %i\n",ca.hue,*value); |
6952 | 1082 return VO_TRUE; |
1083 } else return VO_FALSE; | |
1084 } | |
1085 | |
1086 if (! strcmp( data,"saturation" )) { | |
1087 if ((desc.caps & DLCAPS_SATURATION)) { | |
1088 *value = (int) ((ca.saturation-0x8000) * factor); | |
24949
11d4bcd96bc3
Reduce excessive verbosity: Move debug messages to the appropriate MSGL
diego
parents:
24939
diff
changeset
|
1089 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: GetVEq Saturation 0x%X %i\n",ca.saturation,*value); |
6952 | 1090 return VO_TRUE; |
1091 } else return VO_FALSE; | |
1092 } | |
1093 } | |
1094 return VO_FALSE; | |
1095 } | |
1096 | |
1097 static uint32_t get_image(mp_image_t *mpi) | |
1098 { | |
1099 | |
1100 int err; | |
25763 | 1101 uint8_t *dst; |
6952 | 1102 int pitch; |
1103 | |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
1104 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: get_image() called\n"); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1105 if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // slow video ram |
6952 | 1106 if(mpi->type==MP_IMGTYPE_STATIC) return VO_FALSE; // it is not static |
1107 | |
1108 // printf("width=%d vs. pitch=%d, flags=0x%X \n",mpi->width,pitch,mpi->flags); | |
1109 | |
30250
8ddf6f92553a
Remove a check that simply can not have worked since it relied on a completely
reimar
parents:
29263
diff
changeset
|
1110 if(mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH)){ |
6952 | 1111 // we're lucky or codec accepts stride => ok, let's go! |
1112 | |
1113 if (frame) { | |
25763 | 1114 err = frame->Lock(frame,DSLF_WRITE|DSLF_READ,(void *)&dst,&pitch); |
6952 | 1115 framelocked=1; |
1116 } else { | |
25763 | 1117 err = primary->Lock(primary,DSLF_WRITE,(void *)&dst,&pitch); |
6952 | 1118 primarylocked=1; |
1119 } | |
1120 | |
1121 if (err) { | |
9937 | 1122 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: DR lock failed!"); |
6952 | 1123 return VO_FALSE; |
1124 }; | |
1125 | |
1126 if(mpi->flags&MP_IMGFLAG_PLANAR){ | |
1127 //YV12 format | |
1128 mpi->planes[0]=dst; | |
1129 if(mpi->flags&MP_IMGFLAG_SWAPPED){ | |
1130 mpi->planes[1]=dst + pitch*height; | |
1131 mpi->planes[2]=mpi->planes[1] + pitch*height/4; | |
1132 } else { | |
1133 mpi->planes[2]=dst + pitch*height; | |
1134 mpi->planes[1]=mpi->planes[2] + pitch*height/4; | |
1135 } | |
6985
6074119e09a0
Put/get_image fixed. Deleted forgotten development comments
zdar
parents:
6952
diff
changeset
|
1136 mpi->width=width; |
6074119e09a0
Put/get_image fixed. Deleted forgotten development comments
zdar
parents:
6952
diff
changeset
|
1137 mpi->stride[0]=pitch; |
6952 | 1138 mpi->stride[1]=mpi->stride[2]=pitch/2; |
1139 } else { | |
1140 //YUY2 and RGB formats | |
1141 mpi->planes[0]=dst; | |
1142 mpi->width=width; | |
1143 mpi->stride[0]=pitch; | |
1144 } | |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1145 |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1146 // center image |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1147 |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1148 if (!frame) { |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1149 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1150 mpi->planes[0]= dst + yoffset * pitch + xoffset; |
24939 | 1151 mpi->planes[1]+= ((yoffset * pitch) >> 2) + (xoffset >> 1); |
1152 mpi->planes[2]+= ((yoffset * pitch) >> 2) + (xoffset >> 1); | |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1153 } else { |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1154 mpi->planes[0]=dst + yoffset * pitch + xoffset * (mpi->bpp >> 3); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1155 } |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1156 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1157 |
6952 | 1158 mpi->flags|=MP_IMGFLAG_DIRECT; |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
1159 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: get_image() SUCCESS -> Direct Rendering ENABLED\n"); |
6952 | 1160 return VO_TRUE; |
1161 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1162 } |
6952 | 1163 return VO_FALSE; |
1164 } | |
1165 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15750
diff
changeset
|
1166 static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) |
6952 | 1167 { |
1168 int i; | |
1169 unsigned int pitch; | |
25763 | 1170 uint8_t *dst; |
1171 uint8_t *dst2; | |
1172 uint8_t *srcp; | |
6952 | 1173 unsigned int p; |
1174 | |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
1175 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: draw_slice entered\n"); |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1176 |
6952 | 1177 unlock(); |
1178 | |
1179 if (frame) { | |
25763 | 1180 DFBCHECK (frame->Lock(frame,DSLF_WRITE|DSLF_READ,(void *)&dst,&pitch)); |
6952 | 1181 framelocked = 1; |
1182 } else { | |
25763 | 1183 DFBCHECK (primary->Lock(primary,DSLF_WRITE,(void *)&dst,&pitch)); |
6952 | 1184 primarylocked = 1; |
1185 }; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1186 |
32198 | 1187 p = FFMIN(w, pitch); |
6952 | 1188 |
1189 dst += y*pitch + x; | |
1190 dst2 = dst + pitch*height - y*pitch + y*pitch/4 - x/2; | |
1191 srcp = src[0]; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1192 |
6952 | 1193 for (i=0;i<h;i++) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1194 fast_memcpy(dst,srcp,p); |
6952 | 1195 dst += pitch; |
1196 srcp += stride[0]; | |
1197 } | |
1198 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1199 if (pixel_format == DSPF_YV12) { |
6952 | 1200 |
1201 dst = dst2; | |
1202 srcp = src[2]; | |
1203 p = p/2; | |
1204 | |
1205 for (i=0;i<h/2;i++) { | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1206 fast_memcpy(dst,srcp,p); |
6952 | 1207 dst += pitch/2; |
1208 srcp += stride[2]; | |
1209 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1210 |
6952 | 1211 dst = dst2 + pitch*height/4; |
1212 srcp = src[1]; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1213 |
6952 | 1214 for (i=0;i<h/2;i++) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1215 fast_memcpy(dst,srcp,p); |
6952 | 1216 dst += pitch/2; |
1217 srcp += stride[1]; | |
1218 } | |
1219 | |
1220 } else { | |
1221 | |
1222 dst = dst2; | |
1223 srcp = src[1]; | |
1224 p = p/2; | |
1225 | |
1226 for (i=0;i<h/2;i++) { | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1227 fast_memcpy(dst,srcp,p); |
6952 | 1228 dst += pitch/2; |
1229 srcp += stride[1]; | |
1230 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1231 |
6952 | 1232 dst = dst2 + pitch*height/4; |
1233 srcp = src[2]; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1234 |
6952 | 1235 for (i=0;i<h/2;i++) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1236 fast_memcpy(dst,srcp,p); |
6952 | 1237 dst += pitch/2; |
1238 srcp += stride[2]; | |
1239 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1240 |
6952 | 1241 } |
1242 | |
1243 unlock(); | |
1244 | |
1245 return 0; | |
1246 } | |
1247 | |
1248 | |
1249 static uint32_t put_image(mp_image_t *mpi){ | |
1250 | |
1251 | |
24166 | 1252 // static IDirectFBSurface *tmp = NULL; |
1253 // DFBSurfaceDescription dsc; | |
1254 // DFBRectangle rect; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1255 |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
1256 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: Put_image entered %i %i %i %i %i %i\n",mpi->x,mpi->y,mpi->w,mpi->h,mpi->width,mpi->height); |
6952 | 1257 |
1258 unlock(); | |
1259 | |
1260 // already out? | |
6985
6074119e09a0
Put/get_image fixed. Deleted forgotten development comments
zdar
parents:
6952
diff
changeset
|
1261 if((mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK))) { |
24951 | 1262 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: Put_image - nothing to do\n"); |
6952 | 1263 return VO_TRUE; |
1264 } | |
1265 | |
1266 if (mpi->flags&MP_IMGFLAG_PLANAR) { | |
1267 // memcpy all planes - sad but necessary | |
1268 int i; | |
1269 unsigned int pitch; | |
25763 | 1270 uint8_t *dst; |
1271 uint8_t *src; | |
6952 | 1272 unsigned int p; |
1273 | |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
16892
diff
changeset
|
1274 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: Put_image - planar branch\n"); |
6952 | 1275 if (frame) { |
25763 | 1276 DFBCHECK (frame->Lock(frame,DSLF_WRITE|DSLF_READ,(void *)&dst,&pitch)); |
6952 | 1277 framelocked = 1; |
1278 } else { | |
25763 | 1279 DFBCHECK (primary->Lock(primary,DSLF_WRITE,(void *)&dst,&pitch)); |
6952 | 1280 primarylocked = 1; |
1281 }; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1282 |
32198 | 1283 p = FFMIN(mpi->w, pitch); |
6952 | 1284 |
1285 src = mpi->planes[0]+mpi->y*mpi->stride[0]+mpi->x; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1286 |
6952 | 1287 for (i=0;i<mpi->h;i++) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1288 fast_memcpy(dst+i*pitch,src+i*mpi->stride[0],p); |
6952 | 1289 } |
1290 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1291 |
6952 | 1292 if (pixel_format == DSPF_YV12) { |
1293 | |
1294 dst += pitch*height; | |
1295 p = p/2; | |
1296 src = mpi->planes[2]+mpi->y*mpi->stride[2]+mpi->x/2; | |
1297 | |
1298 for (i=0;i<mpi->h/2;i++) { | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1299 fast_memcpy(dst+i*pitch/2,src+i*mpi->stride[2],p); |
6952 | 1300 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1301 |
6952 | 1302 dst += pitch*height/4; |
1303 src = mpi->planes[1]+mpi->y*mpi->stride[1]+mpi->x/2; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1304 |
6952 | 1305 for (i=0;i<mpi->h/2;i++) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1306 fast_memcpy(dst+i*pitch/2,src+i*mpi->stride[1],p); |
6952 | 1307 } |
1308 | |
1309 } else { | |
1310 | |
1311 dst += pitch*height; | |
1312 p = p/2; | |
1313 src = mpi->planes[1]+mpi->y*mpi->stride[1]+mpi->x/2; | |
1314 | |
1315 for (i=0;i<mpi->h/2;i++) { | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1316 fast_memcpy(dst+i*pitch/2,src+i*mpi->stride[1],p); |
6952 | 1317 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1318 |
6952 | 1319 dst += pitch*height/4; |
1320 src = mpi->planes[2]+mpi->y*mpi->stride[2]+mpi->x/2; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1321 |
6952 | 1322 for (i=0;i<mpi->h/2;i++) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22886
diff
changeset
|
1323 fast_memcpy(dst+i*pitch/2,src+i*mpi->stride[2],p); |
6952 | 1324 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1325 |
6952 | 1326 } |
1327 unlock(); | |
1328 | |
1329 } else { | |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1330 // I had to disable native directfb blit because it wasn't working under some conditions :-( |
6952 | 1331 |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1332 /* |
6952 | 1333 dsc.flags = DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_WIDTH | DSDESC_PREALLOCATED; |
1334 dsc.preallocated[0].data = mpi->planes[0]; | |
1335 dsc.preallocated[0].pitch = mpi->stride[0]; | |
1336 dsc.width = mpi->width; | |
1337 dsc.height = mpi->height; | |
1338 dsc.pixelformat = convformat(mpi->imgfmt); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1339 |
6952 | 1340 DFBCHECK (dfb->CreateSurface( dfb, &dsc, &tmp)); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1341 |
6952 | 1342 rect.x=mpi->x; |
1343 rect.y=mpi->y; | |
1344 rect.w=mpi->w; | |
1345 rect.h=mpi->h; | |
1346 | |
1347 if (frame) { | |
1348 DFBCHECK (tmp->Blit(tmp,frame,&rect,0,0)); | |
1349 } else { | |
1350 DFBCHECK (tmp->Blit(tmp,primary,&rect,xoffset,yoffset)); | |
1351 }; | |
1352 tmp->Release(tmp); | |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1353 */ |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1354 |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1355 unsigned int pitch; |
25763 | 1356 uint8_t *dst; |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1357 |
24951 | 1358 // if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf("DirectFB: Put_image - non-planar branch\n"); |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1359 if (frame) { |
25763 | 1360 DFBCHECK (frame->Lock(frame,DSLF_WRITE,(void *)&dst,&pitch)); |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1361 framelocked = 1; |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1362 mem2agpcpy_pic(dst,mpi->planes[0] + mpi->y * mpi->stride[0] + mpi->x * (mpi->bpp >> 3) ,mpi->w * (mpi->bpp >> 3),mpi->h,pitch,mpi->stride[0]); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1363 } else { |
25763 | 1364 DFBCHECK (primary->Lock(primary,DSLF_WRITE,(void *)&dst,&pitch)); |
10840
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1365 primarylocked = 1; |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1366 mem2agpcpy_pic(dst + yoffset * pitch + xoffset * (mpi->bpp >> 3),mpi->planes[0] + mpi->y * mpi->stride[0] + mpi->x * (mpi->bpp >> 3) ,mpi->w * (mpi->bpp >> 3),mpi->h,pitch,mpi->stride[0]); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1367 }; |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1368 unlock(); |
10f45897d653
Config fixed, changed put_image to use memcpy instead of native blits (for compatibility reasons), always clear primary layer (to have always black background) and try to center image.
zdar
parents:
10618
diff
changeset
|
1369 |
6952 | 1370 } |
1371 return VO_TRUE; | |
1372 } | |
1373 | |
1374 | |
1375 | |
33305
ddb45e9443ec
Remove the variable arguments from the libvo control() functions.
iive
parents:
33301
diff
changeset
|
1376 static int control(uint32_t request, void *data) |
6952 | 1377 { |
1378 switch (request) { | |
1379 case VOCTRL_QUERY_FORMAT: | |
1380 return query_format(*((uint32_t*)data)); | |
1381 case VOCTRL_GET_IMAGE: | |
1382 return get_image(data); | |
1383 case VOCTRL_DRAW_IMAGE: | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1384 return put_image(data); |
6952 | 1385 case VOCTRL_SET_EQUALIZER: |
1386 { | |
33301
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1387 vf_equalizer_t *eq=data; |
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1388 return directfb_set_video_eq(eq->item, eq->value); |
6952 | 1389 } |
1390 case VOCTRL_GET_EQUALIZER: | |
1391 { | |
33301
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1392 vf_equalizer_t *eq=data; |
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1393 return directfb_get_video_eq(eq->item, &eq->value); |
6952 | 1394 } |
1395 }; | |
1396 return VO_NOTIMPL; | |
1397 } | |
1398 | |
1399 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, | |
1400 unsigned char *srca, int stride) | |
1401 { | |
1402 void *dst; | |
1403 int pitch; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1404 |
11000 | 1405 unlock(); // isn't it silly I have to unlock surface and then lock it again :-) |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1406 |
6952 | 1407 if (frame) { |
10004
c889e7f9391a
triple buffering support, configuration/option system changed,some minor bugs fixed
zdar
parents:
9937
diff
changeset
|
1408 DFBCHECK (frame->Lock(frame,DSLF_WRITE|DSLF_READ,&dst,&pitch)); |
6952 | 1409 framelocked = 1; |
1410 } else { | |
1411 DFBCHECK (primary->Lock(primary,DSLF_WRITE,&dst,&pitch)); | |
1412 primarylocked = 1; | |
1413 }; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28828
diff
changeset
|
1414 |
6952 | 1415 switch(pixel_format) { |
1416 case DSPF_RGB32: | |
1417 case DSPF_ARGB: | |
1418 vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 4*x0,pitch); | |
1419 break; | |
1420 | |
1421 case DSPF_RGB24: | |
1422 vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 3*x0,pitch); | |
1423 break; | |
1424 | |
1425 case DSPF_RGB16: | |
1426 vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch); | |
1427 break; | |
8640 | 1428 case DSPF_ARGB1555: |
6952 | 1429 vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch); |
1430 break; | |
31082
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
1431 case DSPF_ARGB4444: |
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
1432 vo_draw_alpha_rgb12(w, h, src, srca, stride, |
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
1433 ((uint8_t *) dst) + pitch * y0 + 2 * x0, |
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
1434 pitch); |
92f88bb315c5
Add support for 12-bit color mode on framebuffer devices.
cehoyos
parents:
31019
diff
changeset
|
1435 break; |
6952 | 1436 |
1437 case DSPF_YUY2: | |
1438 vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0,pitch); | |
1439 break; | |
1440 | |
1441 case DSPF_UYVY: | |
1442 vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0 + 1,pitch); | |
1443 break; | |
1444 | |
1445 case DSPF_I420: | |
1446 case DSPF_YV12: | |
1447 vo_draw_alpha_yv12(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 1*x0,pitch); | |
1448 break; | |
1449 } | |
1450 | |
1451 unlock(); | |
1452 } | |
1453 | |
1454 static void draw_osd(void) | |
1455 { | |
1456 vo_draw_text(width,height,draw_alpha); | |
1457 } |