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