annotate libvo/vo_dfbmga.c @ 14627:cd16b26cf6e0

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