annotate libvo/vo_directfb2.c @ 29103:06c79db43cd8

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