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