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