annotate libvo/vo_dfbmga.c @ 8985:8e28993c9f28

sync
author nicolas
date Sat, 18 Jan 2003 13:44:52 +0000
parents 554e6aa7da5f
children 070b91093606
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 /*
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
2 MPlayer video driver for DirectFB / Matrox G400
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
3
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
4 Copyright (C) 2002 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
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 #include <fcntl.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
33 #include <unistd.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
34 #include <errno.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
35 #include <assert.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
36
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
37 #include <sys/mman.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
38 #include <sys/ioctl.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
39 #include <sys/kd.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
40 #include <linux/fb.h>
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
41
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
42 #include "config.h"
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
43 #include "video_out.h"
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
44 #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
45 #include "fastmemcpy.h"
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
46 #include "sub.h"
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
47 #include "../postproc/rgb2rgb.h"
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
48
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
49 #include "aspect.h"
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
50
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
51 #ifndef min
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
52 #define min(x,y) (((x)<(y))?(x):(y))
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
53 #endif
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
54
8148
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 8138
diff changeset
55 static vo_info_t info = {
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
56 "DirectFB / Matrox G400",
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
57 "dfbmga",
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
58 "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
59 ""
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
8148
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 8138
diff changeset
62 LIBVO_EXTERN(dfbmga)
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 8138
diff changeset
63
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
64 extern int verbose;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
65
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
66 /******************************
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
67 * directfb *
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
68 ******************************/
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
69
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
70 /*
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
71 * (Globals)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
72 */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
73 static IDirectFB *dfb;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
74
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
75 static IDirectFBDisplayLayer *bes;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
76 static IDirectFBDisplayLayer *crtc2;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
77 static IDirectFBDisplayLayer *spic;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
78
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
79 static int num_bufs;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
80 static int current_buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
81 static int current_ip_buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
82 static IDirectFBSurface *bufs[3];
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
83
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
84 static IDirectFBSurface *frame;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
85 static IDirectFBSurface *c2frame;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
86 static IDirectFBSurface *subframe;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
87
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
88 static DFBSurfacePixelFormat frame_format;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
89 static DFBSurfacePixelFormat subframe_format;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
90
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
91 static DFBRectangle drect;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
92
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
93 static IDirectFBInputDevice *keyboard;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
94 static IDirectFBEventBuffer *buffer;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
95
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
96 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
97 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
98
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
99 static int inited = 0;
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 static int stretch = 0;
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 static int use_bes = 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
104 static int use_crtc2 = 1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
105 static int use_spic = 1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
106
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
107 static int osd_changed;
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
108 static int osd_dirty;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
109 static int osd_current;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
110
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
111 /******************************
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
112 * vo_directfb *
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
113 ******************************/
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
114
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
115 /* 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
116 #ifdef HAVE_FBDEV
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
117 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
118 #else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
119 char *fb_dev_name;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
120 #endif
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
121
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
122 static uint32_t in_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
123 static uint32_t in_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
124 static uint32_t screen_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
125 static uint32_t screen_height;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
126 static uint32_t sub_width;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
127 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
128
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
129 static char *
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
130 pixelformat_name( DFBSurfacePixelFormat format )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
131 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
132 switch(format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
133 case DSPF_ARGB:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
134 return "ARGB";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
135 case DSPF_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
136 return "RGB32";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
137 case DSPF_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
138 return "RGB24";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
139 case DSPF_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
140 return "RGB16";
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
141 #if DIRECTFBVERSION > 915
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
142 case DSPF_ARGB1555:
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
143 return "ARGB1555";
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
144 #else
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
145 case DSPF_RGB15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
146 return "RGB15";
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
147 #endif
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
148 case DSPF_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
149 return "YUY2";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
150 case DSPF_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
151 return "UYVY";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
152 case DSPF_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
153 return "YV12";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
154 case DSPF_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
155 return "I420";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
156 case DSPF_LUT8:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
157 return "LUT8";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
158 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
159 return "Unknown pixel format";
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
160 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
161 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
162
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
163 static DFBSurfacePixelFormat
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
164 imgfmt_to_pixelformat( uint32_t format )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
165 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
166 switch (format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
167 case IMGFMT_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
168 case IMGFMT_BGR32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
169 return DSPF_ARGB;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
170 case IMGFMT_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
171 case IMGFMT_BGR24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
172 return DSPF_RGB24;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
173 case IMGFMT_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
174 case IMGFMT_BGR16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
175 return DSPF_RGB16;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
176 case IMGFMT_RGB15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
177 case IMGFMT_BGR15:
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
178 #if DIRECTFBVERSION > 915
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
179 return DSPF_ARGB1555;
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
180 #else
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
181 return DSPF_RGB15;
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
182 #endif
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
183 case IMGFMT_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
184 return DSPF_YUY2;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
185 case IMGFMT_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
186 return DSPF_UYVY;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
187 case IMGFMT_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
188 return DSPF_YV12;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
189 case IMGFMT_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
190 case IMGFMT_IYUV:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
191 return DSPF_I420;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
192 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
193 return DSPF_UNKNOWN;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
194 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
195 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
196
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
197 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
198 preinit( const char *arg )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
199 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
200 if (vo_subdevice) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
201 while (*vo_subdevice != '\0') {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
202 if (!strncmp(vo_subdevice, "bes", 3)) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
203 use_bes = 1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
204 vo_subdevice += 3;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
205 } else if (!strncmp(vo_subdevice, "nocrtc2", 7)) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
206 use_crtc2 = 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
207 vo_subdevice += 7;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
208 } else if (!strncmp(vo_subdevice, "nospic", 6)) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
209 use_spic = 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
210 vo_subdevice += 6;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
211 } else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
212 vo_subdevice++;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
213 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
214 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
215 if (!use_bes && !use_crtc2) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
216 fprintf( stderr, "vo_dfbmga: No output selected\n" );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
217 return -1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
218 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
219
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
220 if (!inited) {
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
221 if (DirectFBInit( NULL, NULL ) != DFB_OK)
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
222 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
223
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
224 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
225 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
226 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
227 DirectFBSetOption( "no-cursor", "" );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
228 DirectFBSetOption( "bg-color", "00000000" );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
229
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
230 if (DirectFBCreate( &dfb ) != DFB_OK)
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
231 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
232
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
233 inited = 1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
234 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
235
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
236 if (use_bes) {
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
237 if (dfb->GetDisplayLayer( dfb, 1, &bes ) != DFB_OK)
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
238 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
239 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
240 bes->SetOpacity( bes, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
241 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
242
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
243 if (use_crtc2) {
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
244 if (dfb->GetDisplayLayer( dfb, 2, &crtc2 ) != DFB_OK)
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
245 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
246 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
247 crtc2->SetOpacity( crtc2, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
248 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
249
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
250 if (dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard ) != DFB_OK)
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
251 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
252 keyboard->CreateEventBuffer( keyboard, &buffer );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
253 buffer->Reset( buffer );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
254
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
255 return 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
256 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
257
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
258 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
259 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
260 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
261 uint32_t fullscreen,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
262 char *title,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
263 uint32_t format )
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 DFBDisplayLayerConfig dlc;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
266 DFBDisplayLayerConfigFlags failed;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
267
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
268 uint32_t out_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
269 uint32_t out_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
270
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
271 in_width = width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
272 in_height = height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
273
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
274 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
275 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
276
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
277 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
278
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
279 if (use_bes) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
280 /* Draw to BES surface */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
281 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
282 dlc.width = in_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
283 dlc.height = in_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
284 dlc.buffermode = DLBM_BACKVIDEO;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
285
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
286 if (bes->TestConfiguration( bes, &dlc, &failed ) != DFB_OK)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
287 return -1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
288 bes->SetConfiguration( bes, &dlc );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
289 bes->GetSurface( bes, &frame );
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 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
292 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
293 bes->SetScreenLocation( bes,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
294 (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
295 (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
296 (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
297 (float) out_height / 10000.0f );
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
298 bufs[0] = frame;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
299 num_bufs = 1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
300 } else {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
301 /* 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
302 DFBSurfaceDescription dsc;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
303
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
304 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
305 DSDESC_PIXELFORMAT;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
306 dsc.width = in_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
307 dsc.height = in_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
308 dsc.pixelformat = dlc.pixelformat;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
309
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
310 for (num_bufs = 0; num_bufs < 3; num_bufs++) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
311 if (dfb->CreateSurface( dfb, &dsc, &bufs[num_bufs] ) != DFB_OK) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
312 if (num_bufs == 0)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
313 return -1;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
314 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
315 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
316 frame = bufs[0];
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
317 current_buf = 0;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
318 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
319 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
320
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
321 if (use_crtc2) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
322 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
323 dlc.buffermode = DLBM_BACKVIDEO;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
324
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
325 switch (dlc.pixelformat) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
326 case DSPF_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
327 case DSPF_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
328 /* sub-picture supported */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
329 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
330
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
331 case DSPF_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
332 case DSPF_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
333 /* 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
334 dlc.pixelformat = DSPF_ARGB;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
335
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
336 /* fall through */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
337 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
338 /* sub-picture not supported */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
339 use_spic = 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 if (crtc2->TestConfiguration( crtc2, &dlc, &failed ) != DFB_OK)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
343 return -1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
344 crtc2->SetConfiguration( crtc2, &dlc );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
345 crtc2->GetSurface( crtc2, &c2frame );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
346
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
347 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
348
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
349 /* 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
350 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
351 (in_width < screen_width))
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
352 out_width = in_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
353 else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
354 out_width = screen_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
355 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
356 (in_height < screen_height))
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
357 out_height = in_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
358 else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
359 out_height = screen_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
360
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
361 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
362 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
363
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
364 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
365 in_height != out_height)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
366 stretch = 1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
367 else
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
368 stretch = 0;
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 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
371 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
372 drect.w = out_width;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
373 drect.h = out_height;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
374
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
375 c2frame->Clear( c2frame, 0, 0, 0, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
376 c2frame->Flip( c2frame, NULL, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
377 c2frame->Clear( c2frame, 0, 0, 0, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
378
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
379 printf( "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
380 } else {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
381 screen_width = in_width;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
382 screen_height = in_height;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
383 use_spic = 0;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
384 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
385
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
386 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
387 frame_pixel_size = DFB_BYTES_PER_PIXEL( frame_format );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
388 printf( "vo_dfbmga: Video surface %dx%d %s (%s)\n",
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
389 in_width, in_height,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
390 pixelformat_name( frame_format ),
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
391 use_bes ? "BES" : "offscreen" );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
392
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
393 if (use_spic) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
394 /* 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
395 IDirectFBPalette *palette;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
396 DFBColor color;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
397 int i;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
398
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
399 if (dfb->GetDisplayLayer( dfb, 3, &spic ) != DFB_OK)
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
400 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
401 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
402 spic->SetOpacity( spic, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
403
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
404 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
405 dlc.pixelformat = DSPF_LUT8;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
406 dlc.buffermode = DLBM_BACKVIDEO;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
407 if (spic->TestConfiguration( spic, &dlc, &failed ) != DFB_OK)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
408 return -1;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
409 spic->SetConfiguration( spic, &dlc );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
410
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
411 spic->GetSurface( spic, &subframe );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
412
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
413 subframe->GetPalette( subframe, &palette );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
414 color.a = 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
415 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
416 color.r = i * 17;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
417 color.g = i * 17;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
418 color.b = i * 17;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
419 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
420 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
421 palette->Release( palette );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
422
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
423 subframe->Clear( subframe, 0, 0, 0, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
424 subframe->Flip( subframe, NULL, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
425 subframe->Clear( subframe, 0, 0, 0, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
426 } else if (use_crtc2) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
427 /* 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
428 subframe = c2frame;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
429 } else {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
430 /* Draw OSD to BES surface */
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
431 subframe = frame;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
432 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
433
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
434 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
435 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
436 subframe_pixel_size = DFB_BYTES_PER_PIXEL( subframe_format );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
437 printf( "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
438 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
439 pixelformat_name( subframe_format ),
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
440 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
441
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
442 /* Display all needed layers */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
443 if (use_bes)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
444 bes->SetOpacity( bes, 0xFF );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
445 if (use_crtc2)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
446 crtc2->SetOpacity( crtc2, 0xFF );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
447 if (use_spic)
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
448 spic->SetOpacity( spic, 0xFF );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
449
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
450 osd_dirty = 0;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
451 osd_current = 1;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
452
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
453 return 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
454 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
455
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
456 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
457 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
458 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
459 switch (format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
460 case IMGFMT_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
461 case IMGFMT_BGR32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
462 case IMGFMT_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
463 case IMGFMT_BGR24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
464 case IMGFMT_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
465 case IMGFMT_BGR16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
466 case IMGFMT_RGB15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
467 case IMGFMT_BGR15:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
468 case IMGFMT_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
469 case IMGFMT_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
470 case IMGFMT_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
471 case IMGFMT_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
472 case IMGFMT_IYUV:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
473 return (VFCAP_HWSCALE_UP |
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
474 VFCAP_HWSCALE_DOWN |
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
475 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
476 VFCAP_CSP_SUPPORTED |
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
477 VFCAP_OSD);
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
478 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
479
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
480 return 0;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
481 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
482
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
483 static void
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
484 vo_draw_alpha_lut8( int w, int h,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
485 unsigned char* src,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
486 unsigned char *srca,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
487 int srcstride,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
488 unsigned char* dst,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
489 int dststride )
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
490 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
491 int x;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
492
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
493 while (h--) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
494 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
495 if (srca[x])
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
496 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
497 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
498 src += srcstride;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
499 srca += srcstride;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
500 dst += dststride;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
501 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
502 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
503
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
504 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
505 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
506 int w, int h,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
507 unsigned char *src,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
508 unsigned char *srca,
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
509 int stride )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
510 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
511 void *dst;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
512 int pitch;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
513
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
514 if (use_spic) {
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
515 if (!osd_changed)
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
516 return;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
517 osd_dirty |= osd_current;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
518 } else if (use_crtc2) {
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
519 if (x0 < drect.x ||
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
520 y0 < drect.y ||
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
521 x0 + w > drect.x + drect.w ||
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
522 y0 + h > drect.y + drect.h)
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
523 osd_dirty |= osd_current;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
524 }
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
525
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
526 if (subframe->Lock( subframe, DSLF_WRITE, &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
527 return;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
528
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
529 switch (subframe_format) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
530 case DSPF_LUT8:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
531 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
532 ((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
533 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
534 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
535 case DSPF_RGB32:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
536 case DSPF_ARGB:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
537 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
538 (( 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
539 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
540 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
541 case DSPF_RGB24:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
542 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
543 ((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
544 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
545 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
546 case DSPF_RGB16:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
547 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
548 ((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
549 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
550 break;
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
551 #if DIRECTFBVERSION > 915
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
552 case DSPF_ARGB1555:
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
553 #else
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
554 case DSPF_RGB15:
8640
554e6aa7da5f fix to compile with DirecFB 0.9.16
zdar
parents: 8202
diff changeset
555 #endif
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
556 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
557 ((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
558 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
559 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
560 case DSPF_YUY2:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
561 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
562 ((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
563 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
564 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
565 case DSPF_UYVY:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
566 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
567 ((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
568 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
569 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
570 case DSPF_I420:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
571 case DSPF_YV12:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
572 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
573 ((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
574 pitch );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
575 break;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
576 default:
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
577 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
578
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
579 subframe->Unlock( subframe );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
580 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
581
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
582 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
583 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
584 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
585 return -1;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
586 }
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 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
589 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
590 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
591 void *dst;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
592 int pitch;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
593
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
594 if (vo_directrendering)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
595 frame->Unlock( frame );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
596
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
597 if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
598 return VO_FALSE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
599
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
600 memcpy_pic( dst + pitch * y + x, src[0],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
601 w, h, pitch, stride[0] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
602
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
603 dst += pitch * in_height;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
604
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
605 x /= 2; y /= 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
606 w /= 2; h /= 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
607 pitch /= 2;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
608
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
609 if (frame_format == DSPF_I420 )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
610 memcpy_pic( dst + pitch * y + x, src[1],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
611 w, h, pitch, stride[1] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
612 else
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
613 memcpy_pic( dst + pitch * y + x, src[2],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
614 w, h, pitch, stride[2] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
615
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
616 dst += pitch * in_height / 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
617
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
618 if (frame_format == DSPF_I420 )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
619 memcpy_pic( dst + pitch * y + x, src[2],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
620 w, h, pitch, stride[2] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
621 else
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
622 memcpy_pic( dst + pitch * y + x, src[1],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
623 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
624
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
625 frame->Unlock( frame );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
626
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
627 return VO_TRUE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
628 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
629
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
630 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
631 draw_osd( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
632 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
633 if (vo_directrendering)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
634 frame->Unlock( frame );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
635
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
636 osd_changed = vo_osd_changed( 0 );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
637
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
638 if (osd_dirty & osd_current) {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
639 if (use_spic) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
640 subframe->Clear( subframe, 0, 0, 0, 0 );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
641 } else if (use_crtc2) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
642 /* Clear black bars around the picture */
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
643 subframe->SetColor( subframe, 0, 0, 0, 0 );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
644 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
645 0, 0,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
646 screen_width, drect.y );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
647 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
648 0, drect.y + drect.h,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
649 screen_width, drect.y );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
650 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
651 0, drect.y,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
652 drect.x, drect.h );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
653 subframe->FillRectangle( subframe,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
654 drect.x + drect.w, drect.y,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
655 drect.x, drect.h );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
656 }
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
657 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
658 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
659
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
660 if (use_crtc2) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
661 /* Flip BES */
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
662 if (use_bes)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
663 frame->Flip( frame, NULL, 0 );
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
664
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
665 /* Blit from BES/temp to CRTC2 */
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
666 c2frame->SetBlittingFlags( c2frame, DSBLIT_NOFX );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
667 if (stretch)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
668 c2frame->StretchBlit( c2frame, frame, NULL, &drect );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
669 else
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
670 c2frame->Blit( c2frame, frame, NULL, drect.x, drect.y );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
671 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
672
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
673 vo_draw_text( sub_width, sub_height, draw_alpha );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
674
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
675 if (use_spic && osd_changed) {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
676 subframe->Flip( subframe, NULL, 0 );
8202
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
677 osd_current ^= 3;
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
678 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
679 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
680
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
681 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
682 flip_page( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
683 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
684 if (!use_crtc2) {
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
685 /* Flip BES */
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
686 frame->Flip( frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : 0 );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
687 } else {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
688 /* Flip CRTC2 */
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
689 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
690 if (!use_spic)
a90ecaca3989 This patch fixes the OSD flickering problem with vo_dfbmga.
arpi
parents: 8148
diff changeset
691 osd_current ^= 3;
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
692 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
693
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
694 current_buf = 0;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
695 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
696
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
697 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
698 uninit( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
699 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
700 buffer->Release( buffer );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
701 keyboard->Release( keyboard );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
702
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
703 while (num_bufs--) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
704 frame = bufs[num_bufs];
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
705 frame->Release( frame );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
706 }
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
707 if (use_bes) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
708 bes->SetOpacity( bes, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
709 bes->Release( bes );
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 if (use_crtc2) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
712 c2frame->Release( c2frame );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
713 crtc2->SetOpacity( crtc2, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
714 crtc2->Release( crtc2 );
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 if (use_spic) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
717 subframe->Release( subframe );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
718 spic->SetOpacity( spic, 0 );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
719 spic->Release( spic );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
720 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
721
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
722 /*
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
723 * 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
724 * 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
725 *
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
726 * dfb->Release( dfb );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
727 */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
728 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
729
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
730 static uint32_t
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
731 get_image( mp_image_t *mpi )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
732 {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
733 void *dst;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
734 int pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
735
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
736 if (use_bes &&
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
737 (mpi->type == MP_IMGTYPE_STATIC ||
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
738 mpi->flags & MP_IMGFLAG_READABLE))
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
739 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
740
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
741 if (mpi->flags & MP_IMGFLAG_READABLE &&
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
742 (mpi->type == MP_IMGTYPE_IPB || mpi->type == MP_IMGTYPE_IP)) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
743 int buf = current_buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
744
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
745 if (num_bufs < 2)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
746 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
747
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
748 current_ip_buf ^= 1;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
749
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
750 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
751 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
752
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
753 buf = current_ip_buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
754
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
755 if (mpi->type == MP_IMGTYPE_IPB)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
756 buf++;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
757
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
758 current_buf = buf;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
759 frame = bufs[current_buf];
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
760 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
761
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
762 if (frame->Lock( frame, DSLF_WRITE | (mpi->flags & MP_IMGFLAG_READABLE ? DSLF_READ : 0),
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
763 &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
764 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
765
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
766 if ((mpi->width == pitch) ||
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
767 (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
768
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
769 mpi->planes[0] = dst;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
770 mpi->width = in_width;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
771 mpi->stride[0] = pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
772
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
773 if (mpi->flags & MP_IMGFLAG_PLANAR) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
774 mpi->stride[1] = mpi->stride[2] = pitch / 2;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
775
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
776 if (mpi->flags & MP_IMGFLAG_SWAPPED) {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
777 mpi->planes[1] = dst + in_height * pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
778 mpi->planes[2] = mpi->planes[1] + in_height * pitch / 4;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
779 } else {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
780 mpi->planes[2] = dst + in_height * pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
781 mpi->planes[1] = mpi->planes[2] + in_height * pitch / 4;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
782 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
783 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
784
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
785 mpi->flags |= MP_IMGFLAG_DIRECT;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
786
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
787 return VO_TRUE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
788 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
789
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
790 frame->Unlock( frame );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
791
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
792 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
793 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
794
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
795
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
796
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
797 static uint32_t
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
798 draw_image( mp_image_t *mpi )
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
799 {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
800 if (mpi->flags & (MP_IMGFLAG_DIRECT | MP_IMGFLAG_DRAW_CALLBACK))
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
801 return VO_TRUE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
802
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
803 if (mpi->flags & MP_IMGFLAG_PLANAR)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
804 return draw_slice( mpi->planes, mpi->stride,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
805 mpi->w, mpi->h, 0, 0 );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
806 else {
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
807 void *dst;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
808 int pitch;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
809
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
810 if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
811 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
812 memcpy_pic( dst, mpi->planes[0],
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
813 mpi->w * (mpi->bpp / 8), mpi->h,
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
814 pitch, mpi->stride[0] );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
815 frame->Unlock( frame );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
816
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
817 return VO_TRUE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
818 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
819 }
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
820
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
821 static int
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
822 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
823 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
824 DFBResult res;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
825 DFBColorAdjustment ca;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
826 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
827
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
828 ca.flags = DCAF_NONE;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
829
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
830 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
831 ca.flags |= DCAF_BRIGHTNESS;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
832 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
833 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
834 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
835 ca.flags |= DCAF_CONTRAST;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
836 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
837 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
838 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
839 ca.flags |= DCAF_HUE;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
840 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
841 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
842 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
843 ca.flags |= DCAF_SATURATION;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
844 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
845 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
846
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
847 /* Prefer CRTC2 over BES */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
848 if (use_crtc2)
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
849 res = crtc2->SetColorAdjustment( crtc2, &ca );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
850 else
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
851 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
852
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
853 if (res != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
854 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
855
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
856 return VO_TRUE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
857 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
858
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
859 static int
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
860 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
861 {
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
862 DFBResult res;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
863 DFBColorAdjustment ca;
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
864 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
865
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
866 /* Prefer CRTC2 over BES */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
867 if (use_crtc2)
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
868 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
869 else
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
870 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
871
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
872 if (res != DFB_OK)
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
873 return VO_FALSE;
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
874
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
875 if (!strcasecmp( data, "brightness" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
876 (ca.flags & DCAF_BRIGHTNESS))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
877 *value = (ca.brightness - 0x8000) * factor;
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
878 if (!strcasecmp( data, "contrast" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
879 (ca.flags & DCAF_CONTRAST))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
880 *value = (ca.contrast - 0x8000) * factor;
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
881 if (!strcasecmp( data, "hue" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
882 (ca.flags & DCAF_HUE))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
883 *value = (ca.hue - 0x8000) * factor;
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
884 if (!strcasecmp( data, "saturation" ) &&
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
885 (ca.flags & DCAF_SATURATION))
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
886 *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
887
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
888 return VO_TRUE;
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
889 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
890
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
891 static uint32_t
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
892 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
893 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
894 switch (request) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
895 case VOCTRL_QUERY_FORMAT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
896 return query_format( *((uint32_t *) data) );
8138
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 case VOCTRL_GET_IMAGE:
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
899 return get_image( data );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
900
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
901 case VOCTRL_DRAW_IMAGE:
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
902 return draw_image( data );
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
903
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
904 case VOCTRL_SET_EQUALIZER:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
905 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
906 va_list ap;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
907 int value;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
908
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
909 va_start( ap, data );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
910 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
911 va_end( ap );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
912
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
913 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
914 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
915 case VOCTRL_GET_EQUALIZER:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
916 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
917 va_list ap;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
918 int *value;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
919
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
920 va_start( ap, data );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
921 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
922 va_end( ap );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
923
8138
ca825957ed02 This patch adds direct rendering to vo_dfbmga.
arpi
parents: 8121
diff changeset
924 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
925 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
926 }
8121
89d0b7bbf043 - cleanup equalizer stuff (removed vidix dependency)
arpi
parents: 8080
diff changeset
927
8013
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
928 return VO_NOTIMPL;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
929 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
930
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
931 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
932
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
933 #include "../linux/keycodes.h"
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
934
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
935 static void
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
936 check_events( void )
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
937 {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
938 DFBInputEvent event;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
939
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
940 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
941 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
942 switch (event.key_symbol) {
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
943 case DIKS_ESCAPE:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
944 mplayer_put_key( 'q' );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
945 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
946 case DIKS_PAGE_UP:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
947 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
948 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
949 case DIKS_PAGE_DOWN:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
950 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
951 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
952 case DIKS_CURSOR_UP:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
953 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
954 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
955 case DIKS_CURSOR_DOWN:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
956 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
957 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
958 case DIKS_CURSOR_LEFT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
959 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
960 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
961 case DIKS_CURSOR_RIGHT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
962 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
963 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
964 case DIKS_INSERT:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
965 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
966 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
967 case DIKS_DELETE:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
968 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
969 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
970 case DIKS_HOME:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
971 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
972 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
973 case DIKS_END:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
974 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
975 break;
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
976 default:
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
977 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
978 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
979 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
980 }
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
981
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
982 /*
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
983 * 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
984 * 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
985 * 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
986 */
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
987 buffer->Reset( buffer );
bd100a3d486f Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff changeset
988 }