Mercurial > mplayer.hg
annotate libvo/vo_dfbmga.c @ 34374:09f2662d11cb
cdda: set position to an actual EOF position when we set EOF.
This avoids some inconsistency like the stream indicating EOF but
a read still returning more data.
author | reimar |
---|---|
date | Fri, 23 Dec 2011 21:52:04 +0000 |
parents | 169a40da4c53 |
children | 389d43c448b3 |
rev | line source |
---|---|
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
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 DirectFB / Matrox G200/G400/G450/G550 |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
3 * |
27594 | 4 * copyright (C) 2002-2008 Ville Syrjala <syrjala@sci.fi> |
27582
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
5 * Originally based on vo_directfb.c by 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
|
6 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
7 * 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
|
8 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
9 * 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
|
10 * 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
|
11 * 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
|
12 * 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
|
13 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
14 * 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
|
15 * 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
|
16 * 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
|
17 * 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
|
18 * |
34d3e0c8487a
Upgrade license of LGPL 2 or later files to LGPL 2.1 or later.
diego
parents:
26755
diff
changeset
|
19 * 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
|
20 * 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
|
21 * 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
|
22 */ |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
23 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
24 #include <directfb.h> |
32168 | 25 #include <directfb_version.h> |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
26 #include <stdio.h> |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
27 #include <stdlib.h> |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
28 #include <string.h> |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
29 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
30 #include "config.h" |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
31 #include "video_out.h" |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
32 #include "video_out_internal.h" |
33301
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
33 #include "libmpcodecs/vf.h" |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
34 #include "fastmemcpy.h" |
32467 | 35 #include "sub/sub.h" |
9021 | 36 #include "mp_msg.h" |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
37 #include "aspect.h" |
22823
98eaf29b5dee
Code cleanup: don't include a .c file in mplayer.c and fix a few
rathann
parents:
20279
diff
changeset
|
38 #include "mp_fifo.h" |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
39 |
25216 | 40 static const vo_info_t info = { |
11147 | 41 "DirectFB / Matrox G200/G400/G450/G550", |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
42 "dfbmga", |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
43 "Ville Syrjala <syrjala@sci.fi>", |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
44 "" |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
45 }; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
46 |
25220
c9e9ac2008c2
Mark the vo_functions_t definitions as const where possible.
reimar
parents:
25216
diff
changeset
|
47 const LIBVO_EXTERN(dfbmga) |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
8138
diff
changeset
|
48 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
49 static IDirectFB *dfb; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
50 |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
51 static IDirectFBDisplayLayer *crtc1; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
52 static IDirectFBDisplayLayer *bes; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
53 static IDirectFBDisplayLayer *crtc2; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
54 static IDirectFBDisplayLayer *spic; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
55 |
8138 | 56 static int num_bufs; |
57 static int current_buf; | |
58 static int current_ip_buf; | |
59 static IDirectFBSurface *bufs[3]; | |
60 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
61 static IDirectFBSurface *frame; |
13026 | 62 static IDirectFBSurface *subframe; |
63 | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
64 static IDirectFBSurface *besframe; |
27590 | 65 static IDirectFBSurface *c1frame; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
66 static IDirectFBSurface *c2frame; |
13026 | 67 static IDirectFBSurface *spicframe; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
68 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
69 static DFBSurfacePixelFormat frame_format; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
70 static DFBSurfacePixelFormat subframe_format; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
71 |
11147 | 72 static DFBRectangle besrect; |
27590 | 73 static DFBRectangle c1rect; |
11147 | 74 static DFBRectangle c2rect; |
75 static DFBRectangle *subrect; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
76 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
77 static IDirectFBInputDevice *keyboard; |
16864 | 78 static IDirectFBInputDevice *remote; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
79 static IDirectFBEventBuffer *buffer; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
80 |
9021 | 81 static int blit_done; |
27590 | 82 static int c1stretch; |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
83 static int c2stretch; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
84 |
9021 | 85 static int use_bes; |
27590 | 86 static int use_crtc1; |
9021 | 87 static int use_crtc2; |
88 static int use_spic; | |
89 static int use_input; | |
16864 | 90 static int use_remote; |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
91 static int field_parity; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
92 static int flipping; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
93 static DFBDisplayLayerBufferMode buffermode; |
11987 | 94 static int tvnorm; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
95 |
8138 | 96 static int osd_changed; |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
97 static int osd_dirty; |
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
98 static int osd_current; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
99 static int osd_max; |
8138 | 100 |
14716 | 101 static int is_g200; |
11147 | 102 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
103 static uint32_t in_width; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
104 static uint32_t in_height; |
20278 | 105 static uint32_t buf_height; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
106 static uint32_t screen_width; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
107 static uint32_t screen_height; |
8138 | 108 static uint32_t sub_width; |
109 static uint32_t sub_height; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
110 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
111 static char * |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
112 pixelformat_name( DFBSurfacePixelFormat format ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
113 { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
114 switch(format) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
115 case DSPF_ARGB: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
116 return "ARGB"; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
117 case DSPF_RGB32: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
118 return "RGB32"; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
119 case DSPF_RGB16: |
27593 | 120 return "RGB16"; |
8640 | 121 case DSPF_ARGB1555: |
27593 | 122 return "ARGB1555"; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
123 case DSPF_YUY2: |
27593 | 124 return "YUY2"; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
125 case DSPF_UYVY: |
27593 | 126 return "UYVY"; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
127 case DSPF_YV12: |
27593 | 128 return "YV12"; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
129 case DSPF_I420: |
27593 | 130 return "I420"; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
131 case DSPF_ALUT44: |
27593 | 132 return "ALUT44"; |
14716 | 133 case DSPF_NV12: |
134 return "NV12"; | |
135 case DSPF_NV21: | |
136 return "NV21"; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
137 default: |
27593 | 138 return "Unknown pixel format"; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
139 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
140 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
141 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
142 static DFBSurfacePixelFormat |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
143 imgfmt_to_pixelformat( uint32_t format ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
144 { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
145 switch (format) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
146 case IMGFMT_BGR32: |
27593 | 147 return DSPF_RGB32; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
148 case IMGFMT_BGR16: |
27593 | 149 return DSPF_RGB16; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
150 case IMGFMT_BGR15: |
27593 | 151 return DSPF_ARGB1555; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
152 case IMGFMT_YUY2: |
27593 | 153 return DSPF_YUY2; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
154 case IMGFMT_UYVY: |
27593 | 155 return DSPF_UYVY; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
156 case IMGFMT_YV12: |
27593 | 157 return DSPF_YV12; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
158 case IMGFMT_I420: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
159 case IMGFMT_IYUV: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
160 return DSPF_I420; |
14716 | 161 case IMGFMT_NV12: |
162 return DSPF_NV12; | |
163 case IMGFMT_NV21: | |
164 return DSPF_NV21; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
165 default: |
27593 | 166 return DSPF_UNKNOWN; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
167 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
168 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
169 |
9021 | 170 struct layer_enum |
171 { | |
172 const char *name; | |
173 IDirectFBDisplayLayer **layer; | |
174 DFBResult res; | |
175 }; | |
176 | |
177 static DFBEnumerationResult | |
178 get_layer_by_name( DFBDisplayLayerID id, | |
179 DFBDisplayLayerDescription desc, | |
180 void *data ) | |
181 { | |
182 struct layer_enum *l = (struct layer_enum *) data; | |
183 | |
184 if (!strcmp( l->name, desc.name )) | |
185 if ((l->res = dfb->GetDisplayLayer( dfb, id, l->layer )) == DFB_OK) | |
186 return DFENUM_CANCEL; | |
187 | |
188 return DFENUM_OK; | |
189 } | |
190 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
191 static int |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
192 preinit( const char *arg ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
193 { |
9021 | 194 DFBResult res; |
13459 | 195 int force_input = -1; |
9021 | 196 |
197 /* Some defaults */ | |
198 use_bes = 0; | |
27590 | 199 use_crtc1 = 0; |
9021 | 200 use_crtc2 = 1; |
201 use_spic = 1; | |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
202 field_parity = -1; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
203 buffermode = DLBM_TRIPLE; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
204 osd_max = 4; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
205 flipping = 1; |
11987 | 206 tvnorm = -1; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
207 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
208 use_input = !getenv( "DISPLAY" ); |
9021 | 209 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
210 if (vo_subdevice) { |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
211 int show_help = 0; |
9021 | 212 int opt_no = 0; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
213 while (*vo_subdevice != '\0') { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
214 if (!strncmp(vo_subdevice, "bes", 3)) { |
9021 | 215 use_bes = !opt_no; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
216 vo_subdevice += 3; |
9021 | 217 opt_no = 0; |
27590 | 218 } else if (!strncmp(vo_subdevice, "crtc1", 5)) { |
219 use_crtc1 = !opt_no; | |
220 vo_subdevice += 5; | |
221 opt_no = 0; | |
9021 | 222 } else if (!strncmp(vo_subdevice, "crtc2", 5)) { |
223 use_crtc2 = !opt_no; | |
224 vo_subdevice += 5; | |
225 opt_no = 0; | |
226 } else if (!strncmp(vo_subdevice, "spic", 4)) { | |
227 use_spic = !opt_no; | |
228 vo_subdevice += 4; | |
229 opt_no = 0; | |
230 } else if (!strncmp(vo_subdevice, "input", 5)) { | |
13459 | 231 force_input = !opt_no; |
9021 | 232 vo_subdevice += 5; |
233 opt_no = 0; | |
16864 | 234 } else if (!strncmp(vo_subdevice, "remote", 6)) { |
235 use_remote = !opt_no; | |
236 vo_subdevice += 6; | |
237 opt_no = 0; | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
238 } else if (!strncmp(vo_subdevice, "buffermode=", 11)) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
239 if (opt_no) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
240 show_help = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
241 break; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
242 } |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
243 vo_subdevice += 11; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
244 if (!strncmp(vo_subdevice, "single", 6)) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
245 buffermode = DLBM_FRONTONLY; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
246 osd_max = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
247 flipping = 0; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
248 vo_subdevice += 6; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
249 } else if (!strncmp(vo_subdevice, "double", 6)) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
250 buffermode = DLBM_BACKVIDEO; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
251 osd_max = 2; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
252 flipping = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
253 vo_subdevice += 6; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
254 } else if (!strncmp(vo_subdevice, "triple", 6)) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
255 buffermode = DLBM_TRIPLE; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
256 osd_max = 4; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
257 flipping = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
258 vo_subdevice += 6; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
259 } else { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
260 show_help = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
261 break; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
262 } |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
263 opt_no = 0; |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
264 } else if (!strncmp(vo_subdevice, "fieldparity=", 12)) { |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
265 if (opt_no) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
266 show_help = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
267 break; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
268 } |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
269 vo_subdevice += 12; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
270 if (!strncmp(vo_subdevice, "top", 3)) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
271 field_parity = 0; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
272 vo_subdevice += 3; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
273 } else if (!strncmp(vo_subdevice, "bottom", 6)) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
274 field_parity = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
275 vo_subdevice += 6; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
276 } else { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
277 show_help = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
278 break; |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
279 } |
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
280 opt_no = 0; |
11987 | 281 } else if (!strncmp(vo_subdevice, "tvnorm=", 7)) { |
282 if (opt_no) { | |
283 show_help = 1; | |
284 break; | |
285 } | |
286 vo_subdevice += 7; | |
287 if (!strncmp(vo_subdevice, "pal", 3)) { | |
288 tvnorm = 0; | |
289 vo_subdevice += 3; | |
290 } else if (!strncmp(vo_subdevice, "ntsc" , 4)) { | |
291 tvnorm = 1; | |
292 vo_subdevice += 4; | |
293 } else if (!strncmp(vo_subdevice, "auto" , 4)) { | |
294 tvnorm = 2; | |
295 vo_subdevice += 4; | |
296 } else { | |
297 show_help = 1; | |
298 break; | |
299 } | |
300 opt_no = 0; | |
9021 | 301 } else if (!strncmp(vo_subdevice, "no", 2)) { |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
302 if (opt_no) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
303 show_help = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
304 break; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
305 } |
9021 | 306 vo_subdevice += 2; |
307 opt_no = 1; | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
308 } else if (*vo_subdevice == ':') { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
309 if (opt_no) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
310 show_help = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
311 break; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
312 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
313 vo_subdevice++; |
9021 | 314 opt_no = 0; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
315 } else { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
316 show_help = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
317 break; |
9021 | 318 } |
27593 | 319 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
320 if (show_help) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
321 mp_msg( MSGT_VO, MSGL_ERR, |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
322 "\nvo_dfbmga command line help:\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
323 "Example: mplayer -vo dfbmga:nocrtc2:bes:buffermode=single\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
324 "\nOptions (use 'no' prefix to disable):\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
325 " bes Use Backend Scaler\n" |
27590 | 326 " crtc1 Use CRTC1\n" |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
327 " crtc2 Use CRTC2\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
328 " spic Use hardware sub-picture for OSD\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
329 " input Use DirectFB for keyboard input\n" |
16864 | 330 " remote Use DirectFB for remote control input\n" |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
331 "\nOther options:\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
332 " buffermode=(single|double|triple)\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
333 " single Use single buffering\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
334 " double Use double buffering\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
335 " triple Use triple buffering\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
336 " fieldparity=(top|bottom)\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
337 " top Top field first\n" |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
338 " bottom Bottom field first\n" |
11987 | 339 " tvnorm=(pal|ntsc|auto)\n" |
340 " pal Force PAL\n" | |
341 " ntsc Force NTSC\n" | |
342 " auto Select according to FPS\n" | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
343 "\n" ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
344 return -1; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
345 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
346 } |
27590 | 347 if (!use_bes && !use_crtc1 && !use_crtc2) { |
27593 | 348 mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: No output selected\n" ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
349 return -1; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
350 } |
27590 | 351 if (use_bes && use_crtc1) { |
27593 | 352 mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Both BES and CRTC1 outputs selected\n" ); |
353 return -1; | |
354 } | |
355 | |
356 if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) { | |
357 mp_msg( MSGT_VO, MSGL_ERR, | |
358 "vo_dfbmga: DirectFBInit() failed - %s\n", | |
359 DirectFBErrorString( res ) ); | |
27590 | 360 return -1; |
361 } | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
362 |
27593 | 363 switch (tvnorm) { |
364 case 0: | |
365 DirectFBSetOption( "matrox-tv-standard", "pal" ); | |
366 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to PAL\n" ); | |
367 break; | |
368 case 1: | |
369 DirectFBSetOption( "matrox-tv-standard", "ntsc" ); | |
370 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to NTSC\n" ); | |
371 break; | |
372 case 2: | |
373 if (vo_fps > 27) { | |
11987 | 374 DirectFBSetOption( "matrox-tv-standard", "ntsc" ); |
27593 | 375 mp_msg( MSGT_VO, MSGL_INFO, |
376 "vo_dfbmga: Selected TV standard based upon FPS: NTSC\n" ); | |
377 } else { | |
378 DirectFBSetOption( "matrox-tv-standard", "pal" ); | |
379 mp_msg( MSGT_VO, MSGL_INFO, | |
380 "vo_dfbmga: Selected TV standard based upon FPS: PAL\n" ); | |
11987 | 381 } |
27593 | 382 break; |
383 } | |
11987 | 384 |
27593 | 385 if ((res = DirectFBCreate( &dfb )) != DFB_OK) { |
386 mp_msg( MSGT_VO, MSGL_ERR, | |
387 "vo_dfbmga: DirectFBCreate() failed - %s\n", | |
388 DirectFBErrorString( res ) ); | |
389 return -1; | |
390 } | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
391 |
27590 | 392 if (use_crtc1 || use_bes) { |
13026 | 393 struct layer_enum l = { |
394 "FBDev Primary Layer", | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
395 &crtc1, |
13026 | 396 DFB_UNSUPPORTED |
397 }; | |
398 dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); | |
399 if (l.res != DFB_OK) { | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
400 mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get CRTC1 layer - %s\n", |
13026 | 401 DirectFBErrorString( l.res ) ); |
14929 | 402 uninit(); |
13026 | 403 return -1; |
404 } | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
405 if ((res = crtc1->SetCooperativeLevel( crtc1, DLSCL_EXCLUSIVE )) != DFB_OK) { |
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
406 mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to CRTC1 layer - %s\n", |
13026 | 407 DirectFBErrorString( res ) ); |
14929 | 408 uninit(); |
13026 | 409 return -1; |
410 } | |
411 use_input = 1; | |
412 } | |
413 | |
13459 | 414 if (force_input != -1) |
415 use_input = force_input; | |
416 | |
13026 | 417 if (use_bes) { |
11147 | 418 DFBDisplayLayerConfig dlc; |
419 DFBDisplayLayerConfigFlags failed; | |
9021 | 420 struct layer_enum l = { |
421 "Matrox Backend Scaler", | |
422 &bes, | |
423 DFB_UNSUPPORTED | |
424 }; | |
425 | |
426 dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); | |
427 if (l.res != DFB_OK) { | |
428 mp_msg( MSGT_VO, MSGL_ERR, "Can't get BES layer - %s\n", | |
429 DirectFBErrorString( l.res ) ); | |
14929 | 430 uninit(); |
8121 | 431 return -1; |
9021 | 432 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
433 if ((res = bes->SetCooperativeLevel( bes, DLSCL_EXCLUSIVE )) != DFB_OK) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
434 mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to BES - %s\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
435 DirectFBErrorString( res ) ); |
14929 | 436 uninit(); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
437 return -1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
438 } |
11147 | 439 dlc.flags = DLCONF_PIXELFORMAT; |
440 dlc.pixelformat = DSPF_RGB16; | |
441 if (bes->TestConfiguration( bes, &dlc, &failed ) != DFB_OK) { | |
442 is_g200 = 1; | |
443 use_crtc2 = 0; | |
444 } | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
445 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
446 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
447 if (use_crtc2) { |
9021 | 448 struct layer_enum l = { |
11866 | 449 "Matrox CRTC2 Layer", |
9021 | 450 &crtc2, |
451 DFB_UNSUPPORTED | |
452 }; | |
453 | |
454 dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); | |
455 if (l.res != DFB_OK) { | |
456 mp_msg( MSGT_VO, MSGL_ERR, "Can't get CRTC2 layer - %s\n", | |
457 DirectFBErrorString( l.res ) ); | |
14929 | 458 uninit(); |
8121 | 459 return -1; |
9021 | 460 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
461 if ((res = crtc2->SetCooperativeLevel( crtc2, DLSCL_EXCLUSIVE )) != DFB_OK) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
462 mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to CRTC2 - %s\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
463 DirectFBErrorString( res ) ); |
14929 | 464 uninit(); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
465 return -1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
466 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
467 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
468 |
16864 | 469 if (use_input || use_remote) { |
470 if ((res = dfb->CreateEventBuffer( dfb, &buffer )) != DFB_OK) { | |
471 mp_msg( MSGT_VO, MSGL_ERR, | |
472 "vo_dfbmga: Can't create event buffer - %s\n", | |
473 DirectFBErrorString( res ) ); | |
474 uninit(); | |
475 return -1; | |
476 } | |
477 } | |
478 | |
9021 | 479 if (use_input) { |
480 if ((res = dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard )) != DFB_OK) { | |
481 mp_msg( MSGT_VO, MSGL_ERR, | |
482 "vo_dfbmga: Can't get keyboard - %s\n", | |
483 DirectFBErrorString( res ) ); | |
14929 | 484 uninit(); |
9021 | 485 return -1; |
486 } | |
16864 | 487 if ((res = keyboard->AttachEventBuffer( keyboard, buffer )) != DFB_OK) { |
14929 | 488 mp_msg( MSGT_VO, MSGL_ERR, |
16864 | 489 "vo_dfbmga: Can't attach event buffer to keyboard - %s\n", |
14929 | 490 DirectFBErrorString( res ) ); |
491 uninit(); | |
492 return -1; | |
493 } | |
9021 | 494 } |
16864 | 495 if (use_remote) { |
496 if ((res = dfb->GetInputDevice( dfb, DIDID_REMOTE, &remote )) != DFB_OK) { | |
497 mp_msg( MSGT_VO, MSGL_ERR, | |
498 "vo_dfbmga: Can't get remote control - %s\n", | |
499 DirectFBErrorString( res ) ); | |
500 uninit(); | |
501 return -1; | |
502 } | |
503 if ((res = remote->AttachEventBuffer( remote, buffer )) != DFB_OK) { | |
504 mp_msg( MSGT_VO, MSGL_ERR, | |
505 "vo_dfbmga: Can't attach event buffer to remote control - %s\n", | |
506 DirectFBErrorString( res ) ); | |
507 uninit(); | |
508 return -1; | |
509 } | |
510 } | |
27593 | 511 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
512 return 0; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
513 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
514 |
13026 | 515 static void release_config( void ) |
516 { | |
517 if (spicframe) | |
518 spicframe->Release( spicframe ); | |
519 if (spic) | |
520 spic->Release( spic ); | |
521 if (c2frame) | |
522 c2frame->Release( c2frame ); | |
27590 | 523 if (c1frame) |
524 c1frame->Release( c1frame ); | |
13026 | 525 if (besframe) |
526 besframe->Release( besframe ); | |
527 if (bufs[0]) | |
528 bufs[0]->Release( bufs[0] ); | |
529 if (bufs[1]) | |
530 bufs[1]->Release( bufs[1] ); | |
531 if (bufs[2]) | |
532 bufs[2]->Release( bufs[2] ); | |
27593 | 533 |
13026 | 534 spicframe = NULL; |
535 spic = NULL; | |
536 c2frame = NULL; | |
27590 | 537 c1frame = NULL; |
13026 | 538 besframe = NULL; |
539 bufs[0] = NULL; | |
540 bufs[1] = NULL; | |
541 bufs[2] = NULL; | |
542 } | |
543 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
544 static int |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
545 config( uint32_t width, uint32_t height, |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
546 uint32_t d_width, uint32_t d_height, |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
14929
diff
changeset
|
547 uint32_t flags, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
548 char *title, |
27593 | 549 uint32_t format ) |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
550 { |
9021 | 551 DFBResult res; |
552 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
553 DFBDisplayLayerConfig dlc; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
554 DFBDisplayLayerConfigFlags failed; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
555 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
556 uint32_t out_width; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
557 uint32_t out_height; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
558 |
13026 | 559 release_config(); |
560 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
561 in_width = width; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
562 in_height = height; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
563 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
564 aspect_save_orig(width, height); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
565 aspect_save_prescale(d_width, d_height); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
566 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
567 dlc.pixelformat = imgfmt_to_pixelformat( format ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
568 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
569 { |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
570 /* Draw to a temporary surface */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
571 DFBSurfaceDescription dsc; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
572 |
8138 | 573 dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
574 DSDESC_PIXELFORMAT; |
20278 | 575 dsc.width = (in_width + 15) & ~15; |
576 dsc.height = (in_height + 15) & ~15; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
577 dsc.pixelformat = dlc.pixelformat; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
578 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
579 /* Don't waste video memory since we don't need direct stretchblit */ |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
580 if (use_bes) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
581 dsc.flags |= DSDESC_CAPS; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
582 dsc.caps = DSCAPS_SYSTEMONLY; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
583 } |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
584 |
8138 | 585 for (num_bufs = 0; num_bufs < 3; num_bufs++) { |
9021 | 586 if ((res = dfb->CreateSurface( dfb, &dsc, &bufs[num_bufs] )) != DFB_OK) { |
587 if (num_bufs == 0) { | |
588 mp_msg( MSGT_VO, MSGL_ERR, | |
589 "vo_dfbmga: Can't create surfaces - %s!\n", | |
590 DirectFBErrorString( res ) ); | |
8138 | 591 return -1; |
9021 | 592 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
593 break; |
8138 | 594 } |
595 } | |
596 frame = bufs[0]; | |
597 current_buf = 0; | |
598 current_ip_buf = 0; | |
20278 | 599 buf_height = dsc.height; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
600 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
601 frame->GetPixelFormat( frame, &frame_format ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
602 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Video surface %dx%d %s\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
603 in_width, in_height, |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
604 pixelformat_name( frame_format ) ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
605 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
606 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
607 /* |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
608 * BES |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
609 */ |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
610 if (use_bes) { |
13026 | 611 aspect_save_screenres( 0x10000, 0x10000 ); |
11147 | 612 aspect( &out_width, &out_height, A_ZOOM ); |
13027 | 613 besrect.x = (0x10000 - out_width) * in_width / out_width / 2; |
614 besrect.y = (0x10000 - out_height) * in_height / out_height / 2; | |
11147 | 615 besrect.w = in_width; |
616 besrect.h = in_height; | |
617 | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
618 dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE; |
11147 | 619 dlc.width = besrect.w + besrect.x * 2; |
620 dlc.height = besrect.h + besrect.y * 2; | |
27593 | 621 dlc.buffermode = buffermode; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
622 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
623 if ((res = bes->TestConfiguration( bes, &dlc, &failed )) != DFB_OK) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
624 mp_msg( MSGT_VO, MSGL_ERR, |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
625 "vo_dfbmga: Invalid BES configuration - %s!\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
626 DirectFBErrorString( res ) ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
627 return -1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
628 } |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
629 if ((res = bes->SetConfiguration( bes, &dlc )) != DFB_OK) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
630 mp_msg( MSGT_VO, MSGL_ERR, |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
631 "vo_dfbmga: BES configuration failed - %s!\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
632 DirectFBErrorString( res ) ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
633 return -1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
634 } |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
635 bes->GetSurface( bes, &besframe ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
636 besframe->SetBlittingFlags( besframe, DSBLIT_NOFX ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
637 |
11147 | 638 bes->SetScreenLocation( bes, 0.0, 0.0, 1.0, 1.0 ); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
639 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
640 besframe->Clear( besframe, 0, 0, 0, 0xff ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
641 besframe->Flip( besframe, NULL, 0 ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
642 besframe->Clear( besframe, 0, 0, 0, 0xff ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
643 besframe->Flip( besframe, NULL, 0 ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
644 besframe->Clear( besframe, 0, 0, 0, 0xff ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
645 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
646 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: BES using %s buffering\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
647 dlc.buffermode == DLBM_TRIPLE ? "triple" : |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
648 dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
649 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: BES surface %dx%d %s\n", dlc.width, dlc.height, pixelformat_name( dlc.pixelformat ) ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
650 } |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
651 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
652 /* |
27590 | 653 * CRTC1 |
654 */ | |
655 if (use_crtc1) { | |
656 dlc.flags = DLCONF_BUFFERMODE; | |
657 dlc.buffermode = buffermode; | |
658 | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
659 if ((res = crtc1->TestConfiguration( crtc1, &dlc, &failed )) != DFB_OK) { |
27590 | 660 mp_msg( MSGT_VO, MSGL_ERR, |
661 "vo_dfbmga: Invalid CRTC1 configuration - %s!\n", | |
662 DirectFBErrorString( res ) ); | |
663 return -1; | |
664 } | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
665 if ((res = crtc1->SetConfiguration( crtc1, &dlc )) != DFB_OK) { |
27590 | 666 mp_msg( MSGT_VO, MSGL_ERR, |
667 "vo_dfbmga: CRTC1 configuration failed - %s!\n", | |
668 DirectFBErrorString( res ) ); | |
669 return -1; | |
670 } | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
671 if ((res = crtc1->GetConfiguration( crtc1, &dlc )) != DFB_OK) { |
27590 | 672 mp_msg( MSGT_VO, MSGL_ERR, |
673 "vo_dfbmga: Getting CRTC1 configuration failed - %s!\n", | |
674 DirectFBErrorString( res ) ); | |
675 return -1; | |
676 } | |
677 | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
678 crtc1->GetSurface( crtc1, &c1frame ); |
27590 | 679 c1frame->SetBlittingFlags( c1frame, DSBLIT_NOFX ); |
680 c1frame->SetColor( c1frame, 0, 0, 0, 0xff ); | |
681 | |
682 c1frame->GetSize( c1frame, &screen_width, &screen_height ); | |
683 | |
684 aspect_save_screenres( screen_width, screen_height ); | |
685 aspect( &out_width, &out_height, (flags & VOFLAG_FULLSCREEN) ? A_ZOOM : A_NOZOOM ); | |
686 | |
687 if (in_width != out_width || in_height != out_height) | |
688 c1stretch = 1; | |
689 else | |
690 c1stretch = 0; | |
691 | |
692 c1rect.x = (screen_width - out_width) / 2; | |
693 c1rect.y = (screen_height - out_height) / 2; | |
694 c1rect.w = out_width; | |
695 c1rect.h = out_height; | |
696 | |
697 c1frame->Clear( c1frame, 0, 0, 0, 0xff ); | |
698 c1frame->Flip( c1frame, NULL, 0 ); | |
699 c1frame->Clear( c1frame, 0, 0, 0, 0xff ); | |
700 c1frame->Flip( c1frame, NULL, 0 ); | |
701 c1frame->Clear( c1frame, 0, 0, 0, 0xff ); | |
702 | |
703 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC1 using %s buffering\n", | |
704 dlc.buffermode == DLBM_TRIPLE ? "triple" : | |
705 dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); | |
706 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC1 surface %dx%d %s\n", screen_width, screen_height, pixelformat_name( dlc.pixelformat ) ); | |
707 } | |
708 | |
709 /* | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
710 * CRTC2 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
711 */ |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
712 if (use_crtc2) { |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
713 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
714 dlc.buffermode = buffermode; |
12980 | 715 dlc.options = DLOP_NONE; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
716 |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
717 if (field_parity != -1) { |
11147 | 718 dlc.options |= DLOP_FIELD_PARITY; |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
719 } |
11987 | 720 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Field parity set to: "); |
721 switch (field_parity) { | |
722 case -1: | |
723 mp_msg( MSGT_VO, MSGL_INFO, "Don't care\n"); | |
724 break; | |
725 case 0: | |
726 mp_msg( MSGT_VO, MSGL_INFO, "Top field first\n"); | |
727 break; | |
728 case 1: | |
729 mp_msg( MSGT_VO, MSGL_INFO, "Bottom field first\n"); | |
730 break; | |
731 } | |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
732 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
733 switch (dlc.pixelformat) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
734 case DSPF_I420: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
735 case DSPF_YV12: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
736 /* sub-picture supported */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
737 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
738 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
739 case DSPF_YUY2: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
740 case DSPF_UYVY: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
741 /* Blit to YUY2/UYVY not supported */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
742 dlc.pixelformat = DSPF_ARGB; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
743 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
744 /* fall through */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
745 default: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
746 /* sub-picture not supported */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
747 use_spic = 0; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
748 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
749 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
750 if ((res = crtc2->TestConfiguration( crtc2, &dlc, &failed )) != DFB_OK) { |
9021 | 751 mp_msg( MSGT_VO, MSGL_ERR, |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
752 "vo_dfbmga: Invalid CRTC2 configuration - %s!\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
753 DirectFBErrorString( res ) ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
754 return -1; |
9021 | 755 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
756 if ((res = crtc2->SetConfiguration( crtc2, &dlc )) != DFB_OK) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
757 mp_msg( MSGT_VO, MSGL_ERR, |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
758 "vo_dfbmga: CRTC2 configuration failed - %s!\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
759 DirectFBErrorString( res ) ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
760 return -1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
761 } |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
762 |
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
763 if (field_parity != -1) |
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
764 crtc2->SetFieldParity( crtc2, field_parity ); |
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
765 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
766 crtc2->GetSurface( crtc2, &c2frame ); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
767 c2frame->SetBlittingFlags( c2frame, DSBLIT_NOFX ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
768 c2frame->SetColor( c2frame, 0, 0, 0, 0xff ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
769 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
770 c2frame->GetSize( c2frame, &screen_width, &screen_height ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
771 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
772 /* Don't stretch only slightly smaller videos */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
773 if ((in_width > (0.95 * screen_width)) && |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
774 (in_width < screen_width)) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
775 out_width = in_width; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
776 else |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
777 out_width = screen_width; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
778 if ((in_height > (0.95 * screen_height)) && |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
779 (in_height < screen_height)) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
780 out_height = in_height; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
781 else |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
782 out_height = screen_height; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
783 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
784 aspect_save_screenres( out_width, out_height ); |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
14929
diff
changeset
|
785 aspect( &out_width, &out_height, (flags & VOFLAG_FULLSCREEN) ? A_ZOOM : A_NOZOOM ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
786 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
787 if (in_width != out_width || |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
788 in_height != out_height) |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
789 c2stretch = 1; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
790 else |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
791 c2stretch = 0; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
792 |
11147 | 793 c2rect.x = (screen_width - out_width) / 2; |
794 c2rect.y = (screen_height - out_height) / 2; | |
795 c2rect.w = out_width; | |
796 c2rect.h = out_height; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
797 |
9021 | 798 c2frame->Clear( c2frame, 0, 0, 0, 0xff ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
799 c2frame->Flip( c2frame, NULL, 0 ); |
9021 | 800 c2frame->Clear( c2frame, 0, 0, 0, 0xff ); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
801 c2frame->Flip( c2frame, NULL, 0 ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
802 c2frame->Clear( c2frame, 0, 0, 0, 0xff ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
803 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
804 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC2 using %s buffering\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
805 dlc.buffermode == DLBM_TRIPLE ? "triple" : |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
806 dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); |
12276 | 807 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC2 surface %dx%d %s\n", screen_width, screen_height, pixelformat_name( dlc.pixelformat ) ); |
8138 | 808 } else { |
809 use_spic = 0; | |
810 } | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
811 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
812 /* |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
813 * Sub-picture |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
814 */ |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
815 if (use_spic) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
816 /* Draw OSD to sub-picture surface */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
817 IDirectFBPalette *palette; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
818 DFBColor color; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
819 int i; |
9021 | 820 struct layer_enum l = { |
821 "Matrox CRTC2 Sub-Picture", | |
822 &spic, | |
823 DFB_UNSUPPORTED | |
824 }; | |
825 dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); | |
826 if (l.res != DFB_OK) { | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
827 mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get sub-picture layer - %s\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
828 DirectFBErrorString( l.res ) ); |
8121 | 829 return -1; |
9021 | 830 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
831 if ((res = spic->SetCooperativeLevel( spic, DLSCL_EXCLUSIVE )) != DFB_OK) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
832 mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to sub-picture - %s\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
833 DirectFBErrorString( res ) ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
834 return -1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
835 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
836 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
837 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
838 dlc.pixelformat = DSPF_ALUT44; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
839 dlc.buffermode = buffermode; |
9461
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
840 dlc.flags |= DLCONF_OPTIONS; |
17cf28e5846a
Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
alex
parents:
9380
diff
changeset
|
841 dlc.options = DLOP_ALPHACHANNEL; |
32169 | 842 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
843 if ((res = spic->TestConfiguration( spic, &dlc, &failed )) != DFB_OK) { |
9021 | 844 mp_msg( MSGT_VO, MSGL_ERR, |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
845 "vo_dfbmga: Invalid sub-picture configuration - %s!\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
846 DirectFBErrorString( res ) ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
847 return -1; |
9021 | 848 } |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
849 if ((res = spic->SetConfiguration( spic, &dlc )) != DFB_OK) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
850 mp_msg( MSGT_VO, MSGL_ERR, |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
851 "vo_dfbmga: Sub-picture configuration failed - %s!\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
852 DirectFBErrorString( res ) ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
853 return -1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
854 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
855 |
13026 | 856 spic->GetSurface( spic, &spicframe ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
857 |
13026 | 858 spicframe->GetPalette( spicframe, &palette ); |
9021 | 859 color.a = 0xff; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
860 for (i = 0; i < 16; i++) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
861 color.r = i * 17; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
862 color.g = i * 17; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
863 color.b = i * 17; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
864 palette->SetEntries( palette, &color, 1, i ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
865 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
866 palette->Release( palette ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
867 |
13026 | 868 spicframe->Clear( spicframe, 0, 0, 0, 0 ); |
869 spicframe->Flip( spicframe, NULL, 0 ); | |
870 spicframe->Clear( spicframe, 0, 0, 0, 0 ); | |
871 spicframe->Flip( spicframe, NULL, 0 ); | |
872 spicframe->Clear( spicframe, 0, 0, 0, 0 ); | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
873 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
874 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Sub-picture layer using %s buffering\n", |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
875 dlc.buffermode == DLBM_TRIPLE ? "triple" : |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
876 dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); |
13026 | 877 |
878 subframe = spicframe; | |
879 subrect = NULL; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
880 } else if (use_crtc2) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
881 /* Draw OSD to CRTC2 surface */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
882 subframe = c2frame; |
11147 | 883 subrect = &c2rect; |
27590 | 884 } else if (use_crtc1) { |
885 /* Draw OSD to CRTC1 surface */ | |
886 subframe = c1frame; | |
887 subrect = &c1rect; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
888 } else { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
889 /* Draw OSD to BES surface */ |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
890 subframe = besframe; |
11147 | 891 subrect = &besrect; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
892 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
893 |
8138 | 894 subframe->GetSize( subframe, &sub_width, &sub_height ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
895 subframe->GetPixelFormat( subframe, &subframe_format ); |
9021 | 896 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Sub-picture surface %dx%d %s (%s)\n", |
8138 | 897 sub_width, sub_height, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
898 pixelformat_name( subframe_format ), |
27590 | 899 use_crtc2 ? (use_spic ? "Sub-picture layer" : "CRTC2") : |
900 use_crtc1 ? "CRTC1" : "BES" ); | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
901 |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
902 osd_dirty = 0; |
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
903 osd_current = 1; |
9021 | 904 blit_done = 0; |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
905 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
906 return 0; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
907 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
908 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
909 static int |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
910 query_format( uint32_t format ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
911 { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
912 switch (format) { |
27593 | 913 case IMGFMT_YV12: |
914 case IMGFMT_I420: | |
915 case IMGFMT_IYUV: | |
916 if (is_g200 || use_crtc1) | |
917 return 0; | |
918 break; | |
919 case IMGFMT_BGR32: | |
920 case IMGFMT_BGR16: | |
921 case IMGFMT_BGR15: | |
922 if (is_g200 && use_bes) | |
923 return 0; | |
924 break; | |
925 case IMGFMT_UYVY: | |
926 if (is_g200) | |
927 return 0; | |
928 break; | |
929 case IMGFMT_YUY2: | |
930 break; | |
931 case IMGFMT_NV12: | |
932 case IMGFMT_NV21: | |
933 if (use_crtc1 || use_crtc2) | |
934 return 0; | |
935 break; | |
936 default: | |
937 return 0; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
938 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
939 |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25220
diff
changeset
|
940 return VFCAP_HWSCALE_UP | |
14716 | 941 VFCAP_HWSCALE_DOWN | |
942 VFCAP_CSP_SUPPORTED_BY_HW | | |
943 VFCAP_CSP_SUPPORTED | | |
26755
46f0b4d34fa1
cosmetics: Remove useless parentheses from from return statements.
diego
parents:
25220
diff
changeset
|
944 VFCAP_OSD; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
945 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
946 |
8138 | 947 static void |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
948 vo_draw_alpha_alut44( int w, int h, |
27593 | 949 unsigned char* src, |
950 unsigned char *srca, | |
951 int srcstride, | |
952 unsigned char* dst, | |
953 int dststride ) | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
954 { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
955 int x; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
956 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
957 while (h--) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
958 for (x = 0; x < w; x++) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
959 if (srca[x]) |
8138 | 960 dst[x] = ((255 - srca[x]) & 0xF0) | (src[x] >> 4); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
961 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
962 src += srcstride; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
963 srca += srcstride; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
964 dst += dststride; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
965 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
966 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
967 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
968 static void |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
969 clear_alpha( int x0, int y0, |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
970 int w, int h ) |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
971 { |
20279 | 972 if (use_spic && !flipping && vo_osd_changed_flag) |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
973 subframe->FillRectangle( subframe, x0, y0, w, h ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
974 } |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
975 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
976 static void |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
977 draw_alpha( int x0, int y0, |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
978 int w, int h, |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
979 unsigned char *src, |
27593 | 980 unsigned char *srca, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
981 int stride ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
982 { |
27583 | 983 uint8_t *dst; |
984 void *ptr; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
985 int pitch; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
986 |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
987 if (use_spic) { |
20279 | 988 if (!osd_changed || (!flipping && !vo_osd_changed_flag)) |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
989 return; |
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
990 osd_dirty |= osd_current; |
11147 | 991 } else { |
992 if (x0 < subrect->x || | |
993 y0 < subrect->y || | |
994 x0 + w > subrect->x + subrect->w || | |
995 y0 + h > subrect->y + subrect->h) | |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
996 osd_dirty |= osd_current; |
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
997 } |
8138 | 998 |
27583 | 999 if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &ptr, &pitch ) != DFB_OK) |
8138 | 1000 return; |
27583 | 1001 dst = ptr; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1002 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1003 switch (subframe_format) { |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1004 case DSPF_ALUT44: |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1005 vo_draw_alpha_alut44( w, h, src, srca, stride, |
27583 | 1006 dst + pitch * y0 + x0, |
27593 | 1007 pitch ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1008 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1009 case DSPF_RGB32: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1010 case DSPF_ARGB: |
27593 | 1011 vo_draw_alpha_rgb32( w, h, src, srca, stride, |
27583 | 1012 dst + pitch * y0 + 4 * x0, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1013 pitch ); |
27593 | 1014 break; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1015 case DSPF_RGB16: |
27593 | 1016 vo_draw_alpha_rgb16( w, h, src, srca, stride, |
27583 | 1017 dst + pitch * y0 + 2 * x0, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1018 pitch ); |
27593 | 1019 break; |
8640 | 1020 case DSPF_ARGB1555: |
27593 | 1021 vo_draw_alpha_rgb15( w, h, src, srca, stride, |
27583 | 1022 dst + pitch * y0 + 2 * x0, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1023 pitch ); |
27593 | 1024 break; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1025 case DSPF_YUY2: |
27593 | 1026 vo_draw_alpha_yuy2( w, h, src, srca, stride, |
27583 | 1027 dst + pitch * y0 + 2 * x0, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1028 pitch ); |
27593 | 1029 break; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1030 case DSPF_UYVY: |
27593 | 1031 vo_draw_alpha_yuy2( w, h, src, srca, stride, |
27583 | 1032 dst + pitch * y0 + 2 * x0 + 1, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1033 pitch ); |
27593 | 1034 break; |
14716 | 1035 case DSPF_NV12: |
1036 case DSPF_NV21: | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1037 case DSPF_I420: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1038 case DSPF_YV12: |
27593 | 1039 vo_draw_alpha_yv12( w, h, src, srca, stride, |
27583 | 1040 dst + pitch * y0 + x0, |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1041 pitch ); |
27593 | 1042 break; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1043 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1044 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1045 subframe->Unlock( subframe ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1046 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1047 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
1048 static int |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1049 draw_frame( uint8_t * src[] ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1050 { |
8138 | 1051 return -1; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1052 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1053 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
1054 static int |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1055 draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1056 { |
27583 | 1057 uint8_t *dst; |
1058 void *ptr; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1059 int pitch; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1060 |
27583 | 1061 if (frame->Lock( frame, DSLF_WRITE, &ptr, &pitch ) != DFB_OK) |
8138 | 1062 return VO_FALSE; |
27583 | 1063 dst = ptr; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1064 |
8138 | 1065 memcpy_pic( dst + pitch * y + x, src[0], |
1066 w, h, pitch, stride[0] ); | |
1067 | |
20278 | 1068 dst += pitch * buf_height; |
8138 | 1069 |
14716 | 1070 y /= 2; |
1071 h /= 2; | |
1072 | |
1073 if (frame_format == DSPF_NV12 || frame_format == DSPF_NV21) { | |
1074 memcpy_pic( dst + pitch * y + x, src[1], | |
1075 w, h, pitch, stride[1] ); | |
32169 | 1076 } else { |
27593 | 1077 x /= 2; |
1078 w /= 2; | |
1079 pitch /= 2; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1080 |
27593 | 1081 if (frame_format == DSPF_I420 ) |
1082 memcpy_pic( dst + pitch * y + x, src[1], | |
1083 w, h, pitch, stride[1] ); | |
1084 else | |
1085 memcpy_pic( dst + pitch * y + x, src[2], | |
1086 w, h, pitch, stride[2] ); | |
8138 | 1087 |
27593 | 1088 dst += pitch * buf_height / 2; |
8138 | 1089 |
27593 | 1090 if (frame_format == DSPF_I420 ) |
1091 memcpy_pic( dst + pitch * y + x, src[2], | |
1092 w, h, pitch, stride[2] ); | |
1093 else | |
1094 memcpy_pic( dst + pitch * y + x, src[1], | |
1095 w, h, pitch, stride[1] ); | |
14716 | 1096 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1097 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1098 frame->Unlock( frame ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1099 |
8138 | 1100 return VO_TRUE; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1101 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1102 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1103 static void |
9021 | 1104 blit_to_screen( void ) |
1105 { | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1106 IDirectFBSurface *blitsrc = frame; |
11147 | 1107 DFBRectangle *srect = NULL; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1108 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1109 if (use_bes) { |
27592
6398d845ae76
Don't limit BES to non-synced single buffering when CRTC2 is used.
syrjala
parents:
27591
diff
changeset
|
1110 if (vo_vsync && !flipping) |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1111 bes->WaitForSync( bes ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1112 |
11147 | 1113 besframe->Blit( besframe, blitsrc, NULL, besrect.x, besrect.y ); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1114 blitsrc = besframe; |
11147 | 1115 srect = &besrect; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1116 } |
9021 | 1117 |
27590 | 1118 if (use_crtc1) { |
1119 if (vo_vsync && !flipping) | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
1120 crtc1->WaitForSync( crtc1 ); |
27590 | 1121 |
1122 if (c1stretch) | |
1123 c1frame->StretchBlit( c1frame, blitsrc, srect, &c1rect ); | |
1124 else | |
1125 c1frame->Blit( c1frame, blitsrc, srect, c1rect.x, c1rect.y ); | |
1126 } | |
1127 | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1128 if (use_crtc2) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1129 if (vo_vsync && !flipping) |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1130 crtc2->WaitForSync( crtc2 ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1131 |
27593 | 1132 if (c2stretch) |
11147 | 1133 c2frame->StretchBlit( c2frame, blitsrc, srect, &c2rect ); |
27593 | 1134 else |
11147 | 1135 c2frame->Blit( c2frame, blitsrc, srect, c2rect.x, c2rect.y ); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1136 } |
9021 | 1137 } |
1138 | |
1139 static void | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1140 draw_osd( void ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1141 { |
9021 | 1142 frame = bufs[current_buf]; |
1143 frame->Unlock( frame ); | |
8138 | 1144 |
1145 osd_changed = vo_osd_changed( 0 ); | |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
1146 if (osd_dirty & osd_current) { |
8138 | 1147 if (use_spic) { |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1148 if (flipping) |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1149 subframe->Clear( subframe, 0, 0, 0, 0 ); |
11147 | 1150 } else { |
8138 | 1151 /* Clear black bars around the picture */ |
1152 subframe->FillRectangle( subframe, | |
1153 0, 0, | |
11147 | 1154 sub_width, subrect->y ); |
8138 | 1155 subframe->FillRectangle( subframe, |
11147 | 1156 0, subrect->y + subrect->h, |
1157 sub_width, subrect->y ); | |
8138 | 1158 subframe->FillRectangle( subframe, |
11147 | 1159 0, subrect->y, |
1160 subrect->x, subrect->h ); | |
8138 | 1161 subframe->FillRectangle( subframe, |
11147 | 1162 subrect->x + subrect->w, subrect->y, |
1163 subrect->x, subrect->h ); | |
8138 | 1164 } |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
1165 osd_dirty &= ~osd_current; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1166 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1167 |
27593 | 1168 blit_to_screen(); |
1169 blit_done = 1; | |
8138 | 1170 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1171 vo_remove_text( sub_width, sub_height, clear_alpha ); |
8138 | 1172 vo_draw_text( sub_width, sub_height, draw_alpha ); |
1173 | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1174 if (use_spic && flipping && osd_changed) { |
8138 | 1175 subframe->Flip( subframe, NULL, 0 ); |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1176 osd_current <<= 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1177 if (osd_current > osd_max) |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1178 osd_current = 1; |
8202
a90ecaca3989
This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents:
8148
diff
changeset
|
1179 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1180 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1181 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1182 static void |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1183 flip_page( void ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1184 { |
27593 | 1185 if (!blit_done) |
1186 blit_to_screen(); | |
9021 | 1187 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1188 if (flipping) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1189 if (use_crtc2) |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1190 c2frame->Flip( c2frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); |
27590 | 1191 if (use_crtc1) |
1192 c1frame->Flip( c1frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); | |
1193 if (use_bes) | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1194 besframe->Flip( besframe, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1195 |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1196 if (!use_spic) { |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1197 osd_current <<= 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1198 if (osd_current > osd_max) |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1199 osd_current = 1; |
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1200 } |
8138 | 1201 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1202 |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1203 blit_done = 0; |
11147 | 1204 current_buf = 0; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1205 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1206 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1207 static void |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1208 uninit( void ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1209 { |
13026 | 1210 release_config(); |
1211 | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1212 if (buffer) |
9021 | 1213 buffer->Release( buffer ); |
16864 | 1214 if (remote) |
1215 remote->Release( remote ); | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1216 if (keyboard) |
9021 | 1217 keyboard->Release( keyboard ); |
13026 | 1218 if (crtc2) |
1219 crtc2->Release( crtc2 ); | |
1220 if (bes) | |
1221 bes->Release( bes ); | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
1222 if (crtc1) |
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
1223 crtc1->Release( crtc1 ); |
13026 | 1224 if (dfb) |
1225 dfb->Release( dfb ); | |
1226 | |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1227 buffer = NULL; |
16864 | 1228 remote = NULL; |
9979
a4ea0311ade2
spring update patch by Ville Syrjala <syrjala@sci.fi>
alex
parents:
9461
diff
changeset
|
1229 keyboard = NULL; |
13026 | 1230 crtc2 = NULL; |
1231 bes = NULL; | |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
1232 crtc1 = NULL; |
13026 | 1233 dfb = NULL; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1234 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1235 |
8138 | 1236 static uint32_t |
1237 get_image( mp_image_t *mpi ) | |
1238 { | |
9021 | 1239 int buf = current_buf; |
27583 | 1240 uint8_t *dst; |
1241 void *ptr; | |
8138 | 1242 int pitch; |
1243 | |
1244 if (mpi->flags & MP_IMGFLAG_READABLE && | |
1245 (mpi->type == MP_IMGTYPE_IPB || mpi->type == MP_IMGTYPE_IP)) { | |
1246 if (num_bufs < 2) | |
1247 return VO_FALSE; | |
1248 | |
1249 current_ip_buf ^= 1; | |
1250 | |
1251 if (mpi->type == MP_IMGTYPE_IPB && num_bufs < 3 && current_ip_buf) | |
1252 return VO_FALSE; | |
1253 | |
1254 buf = current_ip_buf; | |
1255 | |
1256 if (mpi->type == MP_IMGTYPE_IPB) | |
1257 buf++; | |
9021 | 1258 } |
1259 frame = bufs[buf]; | |
1260 frame->Unlock( frame ); | |
8138 | 1261 |
9021 | 1262 /* Always use DSLF_READ to preserve system memory copy */ |
1263 if (frame->Lock( frame, DSLF_WRITE | DSLF_READ, | |
27583 | 1264 &ptr, &pitch ) != DFB_OK) |
8138 | 1265 return VO_FALSE; |
27583 | 1266 dst = ptr; |
8138 | 1267 |
1268 if ((mpi->width == pitch) || | |
1269 (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) { | |
1270 | |
1271 mpi->planes[0] = dst; | |
1272 mpi->width = in_width; | |
1273 mpi->stride[0] = pitch; | |
1274 | |
1275 if (mpi->flags & MP_IMGFLAG_PLANAR) { | |
14716 | 1276 if (mpi->num_planes > 2) { |
27593 | 1277 mpi->stride[1] = mpi->stride[2] = pitch / 2; |
8138 | 1278 |
27593 | 1279 if (mpi->flags & MP_IMGFLAG_SWAPPED) { |
1280 /* I420 */ | |
1281 mpi->planes[1] = dst + buf_height * pitch; | |
1282 mpi->planes[2] = mpi->planes[1] + buf_height * pitch / 4; | |
1283 } else { | |
1284 /* YV12 */ | |
1285 mpi->planes[2] = dst + buf_height * pitch; | |
1286 mpi->planes[1] = mpi->planes[2] + buf_height * pitch / 4; | |
1287 } | |
14716 | 1288 } else { |
1289 /* NV12/NV21 */ | |
1290 mpi->stride[1] = pitch; | |
20278 | 1291 mpi->planes[1] = dst + buf_height * pitch; |
14716 | 1292 } |
8138 | 1293 } |
1294 | |
1295 mpi->flags |= MP_IMGFLAG_DIRECT; | |
9021 | 1296 mpi->priv = (void *) buf; |
1297 current_buf = buf; | |
8138 | 1298 |
1299 return VO_TRUE; | |
1300 } | |
1301 | |
1302 frame->Unlock( frame ); | |
1303 | |
1304 return VO_FALSE; | |
1305 } | |
1306 | |
1307 | |
1308 | |
1309 static uint32_t | |
1310 draw_image( mp_image_t *mpi ) | |
1311 { | |
9021 | 1312 if (mpi->flags & MP_IMGFLAG_DIRECT) { |
1313 current_buf = (int) mpi->priv; | |
1314 return VO_TRUE; | |
1315 } | |
1316 if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK) | |
8138 | 1317 return VO_TRUE; |
1318 | |
1319 if (mpi->flags & MP_IMGFLAG_PLANAR) | |
1320 return draw_slice( mpi->planes, mpi->stride, | |
1321 mpi->w, mpi->h, 0, 0 ); | |
1322 else { | |
1323 void *dst; | |
1324 int pitch; | |
1325 | |
1326 if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK) | |
1327 return VO_FALSE; | |
1328 memcpy_pic( dst, mpi->planes[0], | |
1329 mpi->w * (mpi->bpp / 8), mpi->h, | |
1330 pitch, mpi->stride[0] ); | |
1331 frame->Unlock( frame ); | |
1332 | |
1333 return VO_TRUE; | |
1334 } | |
1335 } | |
1336 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1337 static int |
33313
169a40da4c53
Add "const" to equalizer name argument to avoid compiler warnings.
reimar
parents:
33305
diff
changeset
|
1338 set_equalizer( const char *data, int value ) |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1339 { |
8138 | 1340 DFBResult res; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1341 DFBColorAdjustment ca; |
8121 | 1342 float factor = (float) 0xffff / 200.0; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1343 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1344 ca.flags = DCAF_NONE; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1345 |
8121 | 1346 if (!strcasecmp( data, "brightness" )) { |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1347 ca.flags |= DCAF_BRIGHTNESS; |
8121 | 1348 ca.brightness = value * factor + 0x8000; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1349 } |
8121 | 1350 if (!strcasecmp( data, "contrast" )) { |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1351 ca.flags |= DCAF_CONTRAST; |
8121 | 1352 ca.contrast = value * factor + 0x8000; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1353 } |
8121 | 1354 if (!strcasecmp( data, "hue" )) { |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1355 ca.flags |= DCAF_HUE; |
8121 | 1356 ca.hue = value * factor + 0x8000; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1357 } |
8121 | 1358 if (!strcasecmp( data, "saturation" )) { |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1359 ca.flags |= DCAF_SATURATION; |
8121 | 1360 ca.saturation = value * factor + 0x8000; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1361 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1362 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1363 /* Prefer CRTC2 over BES */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1364 if (use_crtc2) |
8138 | 1365 res = crtc2->SetColorAdjustment( crtc2, &ca ); |
27590 | 1366 else if (use_crtc1) |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
1367 res = crtc1->SetColorAdjustment( crtc1, &ca ); |
8138 | 1368 else |
1369 res = bes->SetColorAdjustment( bes, &ca ); | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1370 |
8138 | 1371 if (res != DFB_OK) |
1372 return VO_FALSE; | |
1373 | |
1374 return VO_TRUE; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1375 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1376 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1377 static int |
33313
169a40da4c53
Add "const" to equalizer name argument to avoid compiler warnings.
reimar
parents:
33305
diff
changeset
|
1378 get_equalizer( const char *data, int *value ) |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1379 { |
8138 | 1380 DFBResult res; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1381 DFBColorAdjustment ca; |
8121 | 1382 float factor = 200.0 / (float) 0xffff; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1383 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1384 /* Prefer CRTC2 over BES */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1385 if (use_crtc2) |
8138 | 1386 res = crtc2->GetColorAdjustment( crtc2, &ca ); |
27590 | 1387 else if (use_crtc1) |
27591
5ab1614e3f0a
Rename some variables and change some strings to make the CRTC1 code clearer.
syrjala
parents:
27590
diff
changeset
|
1388 res = crtc1->GetColorAdjustment( crtc1, &ca ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1389 else |
8138 | 1390 res = bes->GetColorAdjustment( bes, &ca ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1391 |
8138 | 1392 if (res != DFB_OK) |
1393 return VO_FALSE; | |
27593 | 1394 |
8121 | 1395 if (!strcasecmp( data, "brightness" ) && |
1396 (ca.flags & DCAF_BRIGHTNESS)) | |
1397 *value = (ca.brightness - 0x8000) * factor; | |
1398 if (!strcasecmp( data, "contrast" ) && | |
1399 (ca.flags & DCAF_CONTRAST)) | |
1400 *value = (ca.contrast - 0x8000) * factor; | |
1401 if (!strcasecmp( data, "hue" ) && | |
1402 (ca.flags & DCAF_HUE)) | |
1403 *value = (ca.hue - 0x8000) * factor; | |
1404 if (!strcasecmp( data, "saturation" ) && | |
1405 (ca.flags & DCAF_SATURATION)) | |
1406 *value = (ca.saturation - 0x8000) * factor; | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1407 |
8138 | 1408 return VO_TRUE; |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1409 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1410 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
1411 static int |
33305
ddb45e9443ec
Remove the variable arguments from the libvo control() functions.
iive
parents:
33301
diff
changeset
|
1412 control( uint32_t request, void *data ) |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1413 { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1414 switch (request) { |
9021 | 1415 case VOCTRL_GUISUPPORT: |
1416 case VOCTRL_GUI_NOWINDOW: | |
1417 return VO_TRUE; | |
1418 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1419 case VOCTRL_QUERY_FORMAT: |
27593 | 1420 return query_format( *((uint32_t *) data) ); |
8138 | 1421 |
1422 case VOCTRL_GET_IMAGE: | |
1423 return get_image( data ); | |
1424 | |
1425 case VOCTRL_DRAW_IMAGE: | |
1426 return draw_image( data ); | |
1427 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1428 case VOCTRL_SET_EQUALIZER: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1429 { |
33301
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1430 vf_equalizer_t *eq=data; |
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1431 return set_equalizer( eq->item, eq->value ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1432 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1433 case VOCTRL_GET_EQUALIZER: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1434 { |
33301
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1435 vf_equalizer_t *eq=data; |
899d817e56fc
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
iive
parents:
32467
diff
changeset
|
1436 return get_equalizer( eq->item, &eq->value ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1437 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1438 } |
8121 | 1439 |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1440 return VO_NOTIMPL; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1441 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1442 |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
13459
diff
changeset
|
1443 #include "osdep/keycodes.h" |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1444 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1445 static void |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1446 check_events( void ) |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1447 { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1448 DFBInputEvent event; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1449 |
16864 | 1450 if (!buffer) |
9021 | 1451 return; |
1452 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1453 if (buffer->GetEvent( buffer, DFB_EVENT( &event )) == DFB_OK) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1454 if (event.type == DIET_KEYPRESS) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1455 switch (event.key_symbol) { |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1456 case DIKS_ESCAPE: |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1457 mplayer_put_key( KEY_ESC ); |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1458 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1459 case DIKS_PAGE_UP: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1460 mplayer_put_key( KEY_PAGE_UP ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1461 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1462 case DIKS_PAGE_DOWN: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1463 mplayer_put_key( KEY_PAGE_DOWN ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1464 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1465 case DIKS_CURSOR_UP: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1466 mplayer_put_key( KEY_UP ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1467 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1468 case DIKS_CURSOR_DOWN: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1469 mplayer_put_key( KEY_DOWN ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1470 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1471 case DIKS_CURSOR_LEFT: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1472 mplayer_put_key( KEY_LEFT ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1473 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1474 case DIKS_CURSOR_RIGHT: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1475 mplayer_put_key( KEY_RIGHT ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1476 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1477 case DIKS_INSERT: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1478 mplayer_put_key( KEY_INSERT ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1479 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1480 case DIKS_DELETE: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1481 mplayer_put_key( KEY_DELETE ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1482 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1483 case DIKS_HOME: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1484 mplayer_put_key( KEY_HOME ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1485 break; |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1486 case DIKS_END: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1487 mplayer_put_key( KEY_END ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1488 break; |
16864 | 1489 |
1490 case DIKS_POWER: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1491 mplayer_put_key( KEY_POWER ); |
16864 | 1492 break; |
1493 case DIKS_MENU: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1494 mplayer_put_key( KEY_MENU ); |
16864 | 1495 break; |
1496 case DIKS_PLAY: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1497 mplayer_put_key( KEY_PLAY ); |
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1498 break; |
16864 | 1499 case DIKS_STOP: |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1500 mplayer_put_key( KEY_STOP ); |
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1501 break; |
16864 | 1502 case DIKS_PAUSE: |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1503 mplayer_put_key( KEY_PAUSE ); |
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1504 break; |
16864 | 1505 case DIKS_PLAYPAUSE: |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1506 mplayer_put_key( KEY_PLAYPAUSE ); |
16864 | 1507 break; |
1508 case DIKS_FORWARD: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1509 mplayer_put_key( KEY_FORWARD ); |
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1510 break; |
16864 | 1511 case DIKS_NEXT: |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1512 mplayer_put_key( KEY_NEXT ); |
16864 | 1513 break; |
1514 case DIKS_REWIND: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1515 mplayer_put_key( KEY_REWIND ); |
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1516 break; |
16864 | 1517 case DIKS_PREVIOUS: |
16896
5a9251e955df
changed KEY_PREVIOUS to KEY_PREV, cause the first undefined
ptt
parents:
16892
diff
changeset
|
1518 mplayer_put_key( KEY_PREV ); |
16864 | 1519 break; |
1520 case DIKS_VOLUME_UP: | |
27593 | 1521 mplayer_put_key( KEY_VOLUME_UP ); |
16864 | 1522 break; |
1523 case DIKS_VOLUME_DOWN: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1524 mplayer_put_key( KEY_VOLUME_DOWN ); |
16864 | 1525 break; |
1526 case DIKS_MUTE: | |
16892
3470c810527b
libvo input cleanup: remove the dependency on libinput,
albeu
parents:
16864
diff
changeset
|
1527 mplayer_put_key( KEY_MUTE ); |
16864 | 1528 break; |
1529 | |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1530 default: |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1531 mplayer_put_key( event.key_symbol ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1532 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1533 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1534 } |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1535 |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1536 /* |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1537 * empty buffer, because of repeating |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1538 * keyboard repeat is faster than key handling and this causes problems during seek |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1539 * temporary workabout. should be solved in the future |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1540 */ |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1541 buffer->Reset( buffer ); |
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
1542 } |