annotate libvo/vo_dfbmga.c @ 9649:0650fe13f36c

ome fixes, like css styles - now ../default.css
author mpt
date Sat, 22 Mar 2003 17:29:45 +0000
parents 17cf28e5846a
children a4ea0311ade2
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 /*
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
2 MPlayer video driver for DirectFB / Matrox 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
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
4 Copyright (C) 2002,2003 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 = {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
42 "DirectFB / Matrox 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
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
61 static IDirectFBDisplayLayer *bes;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
62 static IDirectFBDisplayLayer *crtc2;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
63 static IDirectFBDisplayLayer *spic;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
64
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
65 static int num_bufs;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
66 static int current_buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
67 static int current_ip_buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
68 static IDirectFBSurface *bufs[3];
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
69
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
70 static IDirectFBSurface *frame;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
71 static IDirectFBSurface *c2frame;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
72 static IDirectFBSurface *subframe;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
73
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
74 static DFBSurfacePixelFormat frame_format;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
75 static DFBSurfacePixelFormat subframe_format;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
76
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
77 static DFBRectangle drect;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
78
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
79 static IDirectFBInputDevice *keyboard;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
80 static IDirectFBEventBuffer *buffer;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
81
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
82 static unsigned int frame_pixel_size;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
83 static unsigned int subframe_pixel_size;
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 int inited = 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
86
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
87 static int blit_done;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
88 static int stretch;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
89
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
90 static int use_bes;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
91 static int use_crtc2;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
92 static int use_spic;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
93 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
94 static int field_parity;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
95
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
96 static int osd_changed;
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
97 static int osd_dirty;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
98 static int osd_current;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
99
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
100 /******************************
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
101 * vo_directfb *
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
102 ******************************/
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
103
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
104 /* command line/config file options */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
105 #ifdef HAVE_FBDEV
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
106 extern char *fb_dev_name;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
107 #else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
108 char *fb_dev_name;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
109 #endif
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
110
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
111 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
112 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
113 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
114 static uint32_t screen_height;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
115 static uint32_t sub_width;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
116 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
117
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
118 static char *
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
119 pixelformat_name( DFBSurfacePixelFormat format )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
120 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
121 switch(format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
122 case DSPF_ARGB:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
123 return "ARGB";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
124 case DSPF_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
125 return "RGB32";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
126 case DSPF_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
127 return "RGB24";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
128 case DSPF_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
129 return "RGB16";
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
130 #if DIRECTFBVERSION > 915
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
131 case DSPF_ARGB1555:
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
132 return "ARGB1555";
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
133 #else
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
134 case DSPF_RGB15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
135 return "RGB15";
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
136 #endif
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
137 case DSPF_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
138 return "YUY2";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
139 case DSPF_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
140 return "UYVY";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
141 case DSPF_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
142 return "YV12";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
143 case DSPF_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
144 return "I420";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
145 case DSPF_LUT8:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
146 return "LUT8";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
147 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
148 return "Unknown pixel format";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
149 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
150 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
151
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
152 static DFBSurfacePixelFormat
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
153 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
154 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
155 switch (format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
156 case IMGFMT_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
157 case IMGFMT_BGR32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
158 return DSPF_ARGB;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
159 case IMGFMT_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
160 case IMGFMT_BGR24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
161 return DSPF_RGB24;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
162 case IMGFMT_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
163 case IMGFMT_BGR16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
164 return DSPF_RGB16;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
165 case IMGFMT_RGB15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
166 case IMGFMT_BGR15:
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
167 #if DIRECTFBVERSION > 915
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
168 return DSPF_ARGB1555;
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
169 #else
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
170 return DSPF_RGB15;
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
171 #endif
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
172 case IMGFMT_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
173 return DSPF_YUY2;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
174 case IMGFMT_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
175 return DSPF_UYVY;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
176 case IMGFMT_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
177 return DSPF_YV12;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
178 case IMGFMT_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
179 case IMGFMT_IYUV:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
180 return DSPF_I420;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
181 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
182 return DSPF_UNKNOWN;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
183 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
184 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
185
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
186 struct layer_enum
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
187 {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
188 const char *name;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
189 IDirectFBDisplayLayer **layer;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
190 DFBResult res;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
191 };
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
192
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
193 static DFBEnumerationResult
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
194 get_layer_by_name( DFBDisplayLayerID id,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
195 DFBDisplayLayerDescription desc,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
196 void *data )
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
197 {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
198 struct layer_enum *l = (struct layer_enum *) data;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
199
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
200 #if DIRECTFBVERSION > 915
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
201 /* We have desc.name so use it */
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
202 if (!strcmp( l->name, desc.name ))
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
203 if ((l->res = dfb->GetDisplayLayer( dfb, id, l->layer )) == DFB_OK)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
204 return DFENUM_CANCEL;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
205 #else
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
206 /* Fake it according to id */
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
207 if ((id == 1 && !strcmp( l->name, "Matrox Backend Scaler" )) ||
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
208 (id == 2 && !strcmp( l->name, "Matrox CRTC2" )) ||
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
209 (id == 3 && !strcmp( l->name, "Matrox CRTC2 Sub-Picture" )))
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
210 if ((l->res = dfb->GetDisplayLayer( dfb, id, l->layer )) == DFB_OK)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
211 return DFENUM_CANCEL;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
212 #endif
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
213
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
214 return DFENUM_OK;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
215 }
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
216
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
217 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
218 preinit( const char *arg )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
219 {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
220 DFBResult res;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
221
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
222 /* Some defaults */
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
223 use_bes = 0;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
224 use_crtc2 = 1;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
225 use_spic = 1;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
226 use_input = 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
227 field_parity = -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
228
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
229 if (vo_subdevice) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
230 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
231 while (*vo_subdevice != '\0') {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
232 if (!strncmp(vo_subdevice, "bes", 3)) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
233 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
234 vo_subdevice += 3;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
235 opt_no = 0;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
236 } else if (!strncmp(vo_subdevice, "crtc2", 5)) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
237 use_crtc2 = !opt_no;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
238 vo_subdevice += 5;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
239 opt_no = 0;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
240 } else if (!strncmp(vo_subdevice, "spic", 4)) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
241 use_spic = !opt_no;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
242 vo_subdevice += 4;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
243 opt_no = 0;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
244 } else if (!strncmp(vo_subdevice, "input", 5)) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
245 use_spic = !opt_no;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
246 vo_subdevice += 5;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
247 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
248 } else if (!strncmp(vo_subdevice, "fieldparity=", 12)) {
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
249 vo_subdevice += 12;
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
250 if (*vo_subdevice == '0' ||
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
251 *vo_subdevice == '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
252 field_parity = *vo_subdevice - '0';
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
253 vo_subdevice++;
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
254 }
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
255 opt_no = 0;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
256 } else if (!strncmp(vo_subdevice, "no", 2)) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
257 vo_subdevice += 2;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
258 opt_no = 1;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
259 } else {
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
260 vo_subdevice++;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
261 opt_no = 0;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
262 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
263 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
264 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
265 if (!use_bes && !use_crtc2) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
266 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
267 return -1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
268 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
269
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
270 if (!inited) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
271 if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
272 mp_msg( MSGT_VO, MSGL_ERR,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
273 "vo_dfbmga: DirectFBInit() failed - %s\n",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
274 DirectFBErrorString( res ) );
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
275 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
276 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
277
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
278 if (!fb_dev_name && !(fb_dev_name = getenv( "FRAMEBUFFER" )))
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
279 fb_dev_name = "/dev/fb0";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
280 DirectFBSetOption( "fbdev", fb_dev_name );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
281 DirectFBSetOption( "no-cursor", "" );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
282 DirectFBSetOption( "bg-color", "00000000" );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
283
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
284 if ((res = DirectFBCreate( &dfb )) != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
285 mp_msg( MSGT_VO, MSGL_ERR,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
286 "vo_dfbmga: DirectFBCreate() failed - %s\n",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
287 DirectFBErrorString( res ) );
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
288 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
289 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
290
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
291 inited = 1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
292 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
293
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
294 if (use_bes) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
295 struct layer_enum l = {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
296 "Matrox Backend Scaler",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
297 &bes,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
298 DFB_UNSUPPORTED
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
299 };
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
300
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
301 dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
302 if (l.res != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
303 mp_msg( MSGT_VO, MSGL_ERR, "Can't get BES layer - %s\n",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
304 DirectFBErrorString( l.res ) );
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
305 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
306 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
307 bes->SetCooperativeLevel( bes, DLSCL_EXCLUSIVE );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
308 bes->SetOpacity( bes, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
309 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
310
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
311 if (use_crtc2) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
312 struct layer_enum l = {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
313 "Matrox CRTC2",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
314 &crtc2,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
315 DFB_UNSUPPORTED
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
316 };
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
317
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
318 dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
319 if (l.res != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
320 mp_msg( MSGT_VO, MSGL_ERR, "Can't get CRTC2 layer - %s\n",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
321 DirectFBErrorString( l.res ) );
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
322 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
323 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
324 crtc2->SetCooperativeLevel( crtc2, DLSCL_EXCLUSIVE );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
325 crtc2->SetOpacity( crtc2, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
326 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
327
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
328 if (use_input) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
329 if ((res = dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard )) != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
330 mp_msg( MSGT_VO, MSGL_ERR,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
331 "vo_dfbmga: Can't get keyboard - %s\n",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
332 DirectFBErrorString( res ) );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
333 return -1;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
334 }
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
335 keyboard->CreateEventBuffer( keyboard, &buffer );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
336 buffer->Reset( buffer );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
337 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
338
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
339 return 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
340 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
341
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
342 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
343 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
344 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
345 uint32_t fullscreen,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
346 char *title,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
347 uint32_t format )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
348 {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
349 DFBResult res;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
350
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
351 DFBDisplayLayerConfig dlc;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
352 DFBDisplayLayerConfigFlags failed;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
353
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
354 uint32_t out_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
355 uint32_t out_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
356
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
357 c2frame = NULL;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
358 spic = NULL;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
359 subframe = NULL;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
360 bufs[0] = bufs[1] = bufs[2] = NULL;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
361
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
362 in_width = width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
363 in_height = height;
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 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
366 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
367
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
368 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
369
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
370 if (use_bes) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
371 /* Draw to BES surface */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
372 dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
373 dlc.width = in_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
374 dlc.height = in_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
375 dlc.buffermode = DLBM_BACKVIDEO;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
376
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
377 if (bes->TestConfiguration( bes, &dlc, &failed ) != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
378 mp_msg( MSGT_VO, MSGL_ERR,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
379 "vo_dfbmga: Invalid BES configuration!\n" );
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
380 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
381 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
382 bes->SetConfiguration( bes, &dlc );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
383 bes->GetSurface( bes, &frame );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
384
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
385 aspect_save_screenres( 10000, 10000 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
386 aspect( &out_width, &out_height, A_ZOOM );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
387 bes->SetScreenLocation( bes,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
388 (1.0f - (float) out_width / 10000.0f) / 2.0f,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
389 (1.0f - (float) out_height / 10000.0f) / 2.0f,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
390 (float) out_width / 10000.0f,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
391 (float) out_height / 10000.0f );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
392 bufs[0] = frame;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
393 num_bufs = 1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
394 } else {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
395 /* 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
396 DFBSurfaceDescription dsc;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
397
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
398 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
399 DSDESC_PIXELFORMAT;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
400 dsc.width = in_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
401 dsc.height = in_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
402 dsc.pixelformat = dlc.pixelformat;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
403
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
404 for (num_bufs = 0; num_bufs < 3; num_bufs++) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
405 if ((res = dfb->CreateSurface( dfb, &dsc, &bufs[num_bufs] )) != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
406 if (num_bufs == 0) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
407 mp_msg( MSGT_VO, MSGL_ERR,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
408 "vo_dfbmga: Can't create surfaces - %s!\n",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
409 DirectFBErrorString( res ) );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
410 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
411 }
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
412 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
413 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
414 frame = bufs[0];
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
415 current_buf = 0;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
416 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
417 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
418
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
419 if (use_crtc2) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
420 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
421 dlc.buffermode = DLBM_BACKVIDEO;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
422
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
423 #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
424 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
425 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
426 dlc.options = DLOP_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
427 }
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
428 #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
429
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
430 switch (dlc.pixelformat) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
431 case DSPF_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
432 case DSPF_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
433 /* sub-picture supported */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
434 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
435
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
436 case DSPF_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
437 case DSPF_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
438 /* 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
439 dlc.pixelformat = DSPF_ARGB;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
440
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
441 /* fall through */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
442 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
443 /* sub-picture not supported */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
444 use_spic = 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
445 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
446
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
447 if (crtc2->TestConfiguration( crtc2, &dlc, &failed ) != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
448 mp_msg( MSGT_VO, MSGL_ERR,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
449 "vo_dfbmga: Invalid CRTC2 configuration!\n" );
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
450 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
451 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
452 crtc2->SetConfiguration( crtc2, &dlc );
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
453
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
454 #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
455 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
456 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
457 #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
458
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
459 crtc2->GetSurface( crtc2, &c2frame );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
460
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
461 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
462
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
463 /* 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
464 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
465 (in_width < screen_width))
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
466 out_width = in_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
467 else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
468 out_width = screen_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
469 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
470 (in_height < screen_height))
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
471 out_height = in_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
472 else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
473 out_height = screen_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
474
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
475 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
476 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
477
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
478 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
479 in_height != out_height)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
480 stretch = 1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
481 else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
482 stretch = 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
483
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
484 drect.x = (screen_width - out_width) / 2;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
485 drect.y = (screen_height - out_height) / 2;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
486 drect.w = out_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
487 drect.h = out_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
488
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
489 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
490 c2frame->Flip( c2frame, NULL, 0 );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
491 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
492
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
493 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC2 surface %dx%d %s\n", dlc.width, dlc.height, pixelformat_name( dlc.pixelformat ) );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
494 } else {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
495 screen_width = in_width;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
496 screen_height = in_height;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
497 use_spic = 0;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
498 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
499
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
500 frame->GetPixelFormat( frame, &frame_format );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
501 frame_pixel_size = DFB_BYTES_PER_PIXEL( frame_format );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
502 mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Video surface %dx%d %s (%s)\n",
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
503 in_width, in_height,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
504 pixelformat_name( frame_format ),
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
505 use_bes ? "BES" : "offscreen" );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
506
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
507 if (use_spic) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
508 /* 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
509 IDirectFBPalette *palette;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
510 DFBColor color;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
511 int i;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
512 struct layer_enum l = {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
513 "Matrox CRTC2 Sub-Picture",
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
514 &spic,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
515 DFB_UNSUPPORTED
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
516 };
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
517 dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
518 if (l.res != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
519 mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get sub-picture layer - %s\n", DirectFBErrorString( l.res ) );
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
520 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
521 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
522 spic->SetCooperativeLevel( spic, DLSCL_EXCLUSIVE );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
523 spic->SetOpacity( spic, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
524
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
525 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
526 dlc.pixelformat = DSPF_LUT8;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
527 dlc.buffermode = DLBM_BACKVIDEO;
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
528 #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
529 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
530 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
531 #endif
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
532 if (spic->TestConfiguration( spic, &dlc, &failed ) != DFB_OK) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
533 mp_msg( MSGT_VO, MSGL_ERR,
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
534 "vo_dfbmga: Invalid sub-picture configuration!\n" );
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
535 return -1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
536 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
537 spic->SetConfiguration( spic, &dlc );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
538
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
539 spic->GetSurface( spic, &subframe );
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 subframe->GetPalette( subframe, &palette );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
542 color.a = 0xff;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
543 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
544 color.r = i * 17;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
545 color.g = i * 17;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
546 color.b = i * 17;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
547 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
548 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
549 palette->Release( palette );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
550
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
551 subframe->Clear( subframe, 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
552 subframe->Flip( subframe, NULL, 0 );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
553 subframe->Clear( subframe, 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
554 } else if (use_crtc2) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
555 /* 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
556 subframe = c2frame;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
557 } else {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
558 /* Draw OSD to BES surface */
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
559 subframe = frame;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
560 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
561
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
562 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
563 subframe->GetPixelFormat( subframe, &subframe_format );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
564 subframe_pixel_size = DFB_BYTES_PER_PIXEL( subframe_format );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
565 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
566 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
567 pixelformat_name( subframe_format ),
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
568 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
569
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
570 /* Display all needed layers */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
571 if (use_bes)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
572 bes->SetOpacity( bes, 0xFF );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
573 if (use_crtc2)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
574 crtc2->SetOpacity( crtc2, 0xFF );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
575 if (use_spic)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
576 spic->SetOpacity( spic, 0xFF );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
577
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
578 osd_dirty = 0;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
579 osd_current = 1;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
580 blit_done = 0;
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
581
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
582 return 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
583 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
584
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
585 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
586 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
587 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
588 switch (format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
589 case IMGFMT_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
590 case IMGFMT_BGR32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
591 case IMGFMT_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
592 case IMGFMT_BGR24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
593 case IMGFMT_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
594 case IMGFMT_BGR16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
595 case IMGFMT_RGB15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
596 case IMGFMT_BGR15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
597 case IMGFMT_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
598 case IMGFMT_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
599 case IMGFMT_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
600 case IMGFMT_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
601 case IMGFMT_IYUV:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
602 return (VFCAP_HWSCALE_UP |
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
603 VFCAP_HWSCALE_DOWN |
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
604 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
605 VFCAP_CSP_SUPPORTED |
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
606 VFCAP_OSD);
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
607 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
608
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
609 return 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
610 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
611
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
612 static void
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
613 vo_draw_alpha_lut8( int w, int h,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
614 unsigned char* src,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
615 unsigned char *srca,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
616 int srcstride,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
617 unsigned char* dst,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
618 int dststride )
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
619 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
620 int x;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
621
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
622 while (h--) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
623 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
624 if (srca[x])
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
625 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
626 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
627 src += srcstride;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
628 srca += srcstride;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
629 dst += dststride;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
630 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
631 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
632
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
633 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
634 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
635 int w, int h,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
636 unsigned char *src,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
637 unsigned char *srca,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
638 int stride )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
639 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
640 void *dst;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
641 int pitch;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
642
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
643 if (use_spic) {
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
644 if (!osd_changed)
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
645 return;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
646 osd_dirty |= osd_current;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
647 } else if (use_crtc2) {
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
648 if (x0 < drect.x ||
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
649 y0 < drect.y ||
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
650 x0 + w > drect.x + drect.w ||
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
651 y0 + h > drect.y + drect.h)
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
652 osd_dirty |= osd_current;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
653 }
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
654
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
655 if (subframe->Lock( subframe, DSLF_WRITE, &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
656 return;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
657
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
658 switch (subframe_format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
659 case DSPF_LUT8:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
660 vo_draw_alpha_lut8( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
661 ((uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
662 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
663 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
664 case DSPF_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
665 case DSPF_ARGB:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
666 vo_draw_alpha_rgb32( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
667 (( uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
668 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
669 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
670 case DSPF_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
671 vo_draw_alpha_rgb24( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
672 ((uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
673 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
674 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
675 case DSPF_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
676 vo_draw_alpha_rgb16( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
677 ((uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
678 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
679 break;
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
680 #if DIRECTFBVERSION > 915
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
681 case DSPF_ARGB1555:
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
682 #else
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
683 case DSPF_RGB15:
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
684 #endif
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
685 vo_draw_alpha_rgb15( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
686 ((uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
687 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
688 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
689 case DSPF_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
690 vo_draw_alpha_yuy2( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
691 ((uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
692 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
693 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
694 case DSPF_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
695 vo_draw_alpha_yuy2( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
696 ((uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0 + 1,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
697 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
698 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
699 case DSPF_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
700 case DSPF_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
701 vo_draw_alpha_yv12( w, h, src, srca, stride,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
702 ((uint8_t *) dst) + pitch * y0 + subframe_pixel_size * x0,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
703 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
704 break;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
705 default:
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
706 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
707
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
708 subframe->Unlock( subframe );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
709 }
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 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
712 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
713 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
714 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
715 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
716
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
717 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
718 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
719 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
720 void *dst;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
721 int pitch;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
722
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
723 if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
724 return VO_FALSE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
725
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
726 memcpy_pic( dst + pitch * y + x, src[0],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
727 w, h, pitch, stride[0] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
728
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
729 dst += pitch * in_height;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
730
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
731 x /= 2; y /= 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
732 w /= 2; h /= 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
733 pitch /= 2;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
734
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
735 if (frame_format == DSPF_I420 )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
736 memcpy_pic( dst + pitch * y + x, src[1],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
737 w, h, pitch, stride[1] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
738 else
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
739 memcpy_pic( dst + pitch * y + x, src[2],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
740 w, h, pitch, stride[2] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
741
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
742 dst += pitch * in_height / 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
743
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
744 if (frame_format == DSPF_I420 )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
745 memcpy_pic( dst + pitch * y + x, src[2],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
746 w, h, pitch, stride[2] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
747 else
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
748 memcpy_pic( dst + pitch * y + x, src[1],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
749 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
750
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
751 frame->Unlock( frame );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
752
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
753 return VO_TRUE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
754 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
755
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
756 static void
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
757 blit_to_screen( void )
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
758 {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
759 /* Flip BES */
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
760 if (use_bes)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
761 frame->Flip( frame, NULL, 0 );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
762
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
763 /* Blit from BES/temp to CRTC2 */
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
764 c2frame->SetBlittingFlags( c2frame, DSBLIT_NOFX );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
765 if (stretch)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
766 c2frame->StretchBlit( c2frame, frame, NULL, &drect );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
767 else
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
768 c2frame->Blit( c2frame, frame, NULL, drect.x, drect.y );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
769 }
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
770
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
771 static void
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
772 draw_osd( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
773 {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
774 frame = bufs[current_buf];
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
775 frame->Unlock( frame );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
776
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
777 osd_changed = vo_osd_changed( 0 );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
778
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
779 if (osd_dirty & osd_current) {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
780 if (use_spic) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
781 subframe->Clear( subframe, 0, 0, 0, 0xff );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
782 } else if (use_crtc2) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
783 /* Clear black bars around the picture */
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
784 subframe->SetColor( subframe, 0, 0, 0, 0xff );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
785 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
786 0, 0,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
787 screen_width, drect.y );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
788 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
789 0, drect.y + drect.h,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
790 screen_width, drect.y );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
791 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
792 0, drect.y,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
793 drect.x, drect.h );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
794 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
795 drect.x + drect.w, drect.y,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
796 drect.x, drect.h );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
797 }
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
798 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
799 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
800
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
801 if (use_crtc2) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
802 blit_to_screen();
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
803 blit_done = 1;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
804 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
805
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
806 vo_draw_text( sub_width, sub_height, draw_alpha );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
807
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
808 if (use_spic && osd_changed) {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
809 subframe->Flip( subframe, NULL, 0 );
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
810 osd_current ^= 3;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
811 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
812 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
813
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
814 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
815 flip_page( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
816 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
817 if (!use_crtc2) {
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
818 /* Flip BES */
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
819 frame->Flip( frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : 0 );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
820 } else {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
821 if (!blit_done)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
822 blit_to_screen();
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
823
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
824 /* Flip CRTC2 */
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
825 c2frame->Flip( c2frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : 0 );
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
826 if (!use_spic)
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
827 osd_current ^= 3;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
828 blit_done = 0;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
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
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
831 current_buf = vo_directrendering ? 0 : (current_buf + 1) % num_bufs;
8013
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
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
834 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
835 uninit( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
836 {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
837 if (use_input) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
838 buffer->Release( buffer );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
839 keyboard->Release( keyboard );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
840 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
841
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
842 while (num_bufs--) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
843 frame = bufs[num_bufs];
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
844 if (frame)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
845 frame->Release( frame );
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
846 bufs[num_bufs] = NULL;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
847 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
848 if (use_bes) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
849 bes->SetOpacity( bes, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
850 bes->Release( bes );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
851 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
852 if (use_crtc2) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
853 if (c2frame)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
854 c2frame->Release( c2frame );
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
855 crtc2->SetOpacity( crtc2, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
856 crtc2->Release( crtc2 );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
857 c2frame = NULL;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
858 }
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
859 if (use_spic && spic) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
860 if (subframe)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
861 subframe->Release( subframe );
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
862 spic->SetOpacity( spic, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
863 spic->Release( spic );
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
864 subframe = NULL;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
865 spic = NULL;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
866 }
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 /*
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
869 * Don't release. Segfault in preinit() if
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
870 * DirectFBCreate() called more than once.
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
871 *
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
872 * dfb->Release( dfb );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
873 */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
874 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
875
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
876 static uint32_t
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
877 get_image( mp_image_t *mpi )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
878 {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
879 int buf = current_buf;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
880 void *dst;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
881 int pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
882
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
883 if (use_bes &&
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
884 (mpi->type == MP_IMGTYPE_STATIC ||
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
885 mpi->flags & MP_IMGFLAG_READABLE))
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
886 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
887
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
888 if (mpi->flags & MP_IMGFLAG_READABLE &&
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
889 (mpi->type == MP_IMGTYPE_IPB || mpi->type == MP_IMGTYPE_IP)) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
890 if (num_bufs < 2)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
891 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
892
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
893 current_ip_buf ^= 1;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
894
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
895 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
896 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
897
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
898 buf = current_ip_buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
899
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
900 if (mpi->type == MP_IMGTYPE_IPB)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
901 buf++;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
902 }
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
903 frame = bufs[buf];
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
904 frame->Unlock( frame );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
905
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
906 /* Always use DSLF_READ to preserve system memory copy */
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
907 if (frame->Lock( frame, DSLF_WRITE | DSLF_READ,
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
908 &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
909 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
910
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
911 if ((mpi->width == pitch) ||
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
912 (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
913
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
914 mpi->planes[0] = dst;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
915 mpi->width = in_width;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
916 mpi->stride[0] = pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
917
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
918 if (mpi->flags & MP_IMGFLAG_PLANAR) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
919 mpi->stride[1] = mpi->stride[2] = pitch / 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
920
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
921 if (mpi->flags & MP_IMGFLAG_SWAPPED) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
922 mpi->planes[1] = dst + in_height * pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
923 mpi->planes[2] = mpi->planes[1] + in_height * pitch / 4;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
924 } else {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
925 mpi->planes[2] = dst + in_height * pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
926 mpi->planes[1] = mpi->planes[2] + in_height * pitch / 4;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
927 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
928 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
929
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
930 mpi->flags |= MP_IMGFLAG_DIRECT;
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
931 mpi->priv = (void *) buf;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
932 current_buf = buf;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
933
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
934 return VO_TRUE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
935 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
936
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
937 frame->Unlock( frame );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
938
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
939 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
940 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
941
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
942
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
943
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
944 static uint32_t
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
945 draw_image( mp_image_t *mpi )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
946 {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
947 if (mpi->flags & MP_IMGFLAG_DIRECT) {
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
948 current_buf = (int) mpi->priv;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
949 return VO_TRUE;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
950 }
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
951 if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
952 return VO_TRUE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
953
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
954 if (mpi->flags & MP_IMGFLAG_PLANAR)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
955 return draw_slice( mpi->planes, mpi->stride,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
956 mpi->w, mpi->h, 0, 0 );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
957 else {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
958 void *dst;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
959 int pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
960
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
961 if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
962 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
963 memcpy_pic( dst, mpi->planes[0],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
964 mpi->w * (mpi->bpp / 8), mpi->h,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
965 pitch, mpi->stride[0] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
966 frame->Unlock( frame );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
967
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
968 return VO_TRUE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
969 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
970 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
971
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
972 static int
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
973 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
974 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
975 DFBResult res;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
976 DFBColorAdjustment ca;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
977 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
978
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
979 ca.flags = DCAF_NONE;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
980
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
981 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
982 ca.flags |= DCAF_BRIGHTNESS;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
983 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
984 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
985 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
986 ca.flags |= DCAF_CONTRAST;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
987 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
988 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
989 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
990 ca.flags |= DCAF_HUE;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
991 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
992 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
993 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
994 ca.flags |= DCAF_SATURATION;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
995 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
996 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
997
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
998 /* Prefer CRTC2 over BES */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
999 if (use_crtc2)
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1000 res = crtc2->SetColorAdjustment( crtc2, &ca );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1001 else
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1002 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
1003
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1004 if (res != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1005 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1006
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1007 return VO_TRUE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1008 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1009
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1010 static int
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1011 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
1012 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1013 DFBResult res;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1014 DFBColorAdjustment ca;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1015 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
1016
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1017 /* Prefer CRTC2 over BES */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1018 if (use_crtc2)
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1019 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
1020 else
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1021 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
1022
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1023 if (res != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1024 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1025
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1026 if (!strcasecmp( data, "brightness" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1027 (ca.flags & DCAF_BRIGHTNESS))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1028 *value = (ca.brightness - 0x8000) * factor;
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1029 if (!strcasecmp( data, "contrast" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1030 (ca.flags & DCAF_CONTRAST))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1031 *value = (ca.contrast - 0x8000) * factor;
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1032 if (!strcasecmp( data, "hue" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1033 (ca.flags & DCAF_HUE))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1034 *value = (ca.hue - 0x8000) * factor;
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1035 if (!strcasecmp( data, "saturation" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1036 (ca.flags & DCAF_SATURATION))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1037 *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
1038
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1039 return VO_TRUE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1040 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1041
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1042 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1043 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
1044 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1045 switch (request) {
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
1046 case VOCTRL_GUISUPPORT:
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
1047 case VOCTRL_GUI_NOWINDOW:
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
1048 return VO_TRUE;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
1049
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1050 case VOCTRL_QUERY_FORMAT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1051 return query_format( *((uint32_t *) data) );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1052
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1053 case VOCTRL_GET_IMAGE:
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1054 return get_image( data );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1055
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1056 case VOCTRL_DRAW_IMAGE:
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1057 return draw_image( data );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1058
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1059 case VOCTRL_SET_EQUALIZER:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1060 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1061 va_list ap;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1062 int value;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1063
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1064 va_start( ap, data );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1065 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
1066 va_end( ap );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1067
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1068 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
1069 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1070 case VOCTRL_GET_EQUALIZER:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1071 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1072 va_list ap;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1073 int *value;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1074
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1075 va_start( ap, data );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1076 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
1077 va_end( ap );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1078
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
1079 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
1080 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1081 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
1082
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1083 return VO_NOTIMPL;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1084 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1085
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1086 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
1087
9380
edfe34c5405d linux->osdep
arpi
parents: 9021
diff changeset
1088 #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
1089
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1090 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1091 check_events( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1092 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1093 DFBInputEvent event;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1094
9021
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
1095 if (!use_input)
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
1096 return;
070b91093606 * Remove unneeded includes & macros
arpi
parents: 8640
diff changeset
1097
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1098 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
1099 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
1100 switch (event.key_symbol) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1101 case DIKS_ESCAPE:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1102 mplayer_put_key( 'q' );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1103 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1104 case DIKS_PAGE_UP:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1105 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
1106 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1107 case DIKS_PAGE_DOWN:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1108 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
1109 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1110 case DIKS_CURSOR_UP:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1111 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
1112 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1113 case DIKS_CURSOR_DOWN:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1114 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
1115 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1116 case DIKS_CURSOR_LEFT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1117 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
1118 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1119 case DIKS_CURSOR_RIGHT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1120 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
1121 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1122 case DIKS_INSERT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1123 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
1124 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1125 case DIKS_DELETE:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1126 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
1127 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1128 case DIKS_HOME:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1129 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
1130 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1131 case DIKS_END:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1132 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
1133 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1134 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1135 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
1136 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1137 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1138 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1139
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1140 /*
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1141 * 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
1142 * 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
1143 * 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
1144 */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1145 buffer->Reset( buffer );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
1146 }