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