Mercurial > mplayer.hg
annotate libvo/vo_dfbmga.c @ 8743:68a0f5e77257
10l, geometry always returns 1. i think this is the correct fix.
author | rfelker |
---|---|
date | Fri, 03 Jan 2003 18:01:49 +0000 |
parents | 554e6aa7da5f |
children | 070b91093606 |
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 | 79 static int num_bufs; |
80 static int current_buf; | |
81 static int current_ip_buf; | |
82 static IDirectFBSurface *bufs[3]; | |
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 | 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 | 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 | 126 static uint32_t sub_width; |
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 | 141 #if DIRECTFBVERSION > 915 |
142 case DSPF_ARGB1555: | |
143 return "ARGB1555"; | |
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 | 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 | 178 #if DIRECTFBVERSION > 915 |
179 return DSPF_ARGB1555; | |
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 | 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 | 221 if (DirectFBInit( NULL, NULL ) != DFB_OK) |
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 | 230 if (DirectFBCreate( &dfb ) != DFB_OK) |
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 | 237 if (dfb->GetDisplayLayer( dfb, 1, &bes ) != DFB_OK) |
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 | 244 if (dfb->GetDisplayLayer( dfb, 2, &crtc2 ) != DFB_OK) |
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 | 250 if (dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard ) != DFB_OK) |
8138 | 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 | 298 bufs[0] = frame; |
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 | 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 | 310 for (num_bufs = 0; num_bufs < 3; num_bufs++) { |
311 if (dfb->CreateSurface( dfb, &dsc, &bufs[num_bufs] ) != DFB_OK) { | |
312 if (num_bufs == 0) | |
313 return -1; | |
314 } | |
315 } | |
316 frame = bufs[0]; | |
317 current_buf = 0; | |
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 | 380 } else { |
381 screen_width = in_width; | |
382 screen_height = in_height; | |
383 use_spic = 0; | |
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 | 399 if (dfb->GetDisplayLayer( dfb, 3, &spic ) != DFB_OK) |
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 | 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 | 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 | 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 | 483 static void |
484 vo_draw_alpha_lut8( int w, int h, | |
485 unsigned char* src, | |
486 unsigned char *srca, | |
487 int srcstride, | |
488 unsigned char* dst, | |
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 | 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 | 525 |
526 if (subframe->Lock( subframe, DSLF_WRITE, &dst, &pitch ) != DFB_OK) | |
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 | 551 #if DIRECTFBVERSION > 915 |
552 case DSPF_ARGB1555: | |
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 | 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 | 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 | 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 | 594 if (vo_directrendering) |
595 frame->Unlock( frame ); | |
596 | |
597 if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK) | |
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 | 600 memcpy_pic( dst + pitch * y + x, src[0], |
601 w, h, pitch, stride[0] ); | |
602 | |
603 dst += pitch * in_height; | |
604 | |
605 x /= 2; y /= 2; | |
606 w /= 2; h /= 2; | |
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 | 609 if (frame_format == DSPF_I420 ) |
610 memcpy_pic( dst + pitch * y + x, src[1], | |
611 w, h, pitch, stride[1] ); | |
612 else | |
613 memcpy_pic( dst + pitch * y + x, src[2], | |
614 w, h, pitch, stride[2] ); | |
615 | |
616 dst += pitch * in_height / 2; | |
617 | |
618 if (frame_format == DSPF_I420 ) | |
619 memcpy_pic( dst + pitch * y + x, src[2], | |
620 w, h, pitch, stride[2] ); | |
621 else | |
622 memcpy_pic( dst + pitch * y + x, src[1], | |
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 | 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 | 633 if (vo_directrendering) |
634 frame->Unlock( frame ); | |
635 | |
636 osd_changed = vo_osd_changed( 0 ); | |
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 | 639 if (use_spic) { |
640 subframe->Clear( subframe, 0, 0, 0, 0 ); | |
641 } else if (use_crtc2) { | |
642 /* Clear black bars around the picture */ | |
643 subframe->SetColor( subframe, 0, 0, 0, 0 ); | |
644 subframe->FillRectangle( subframe, | |
645 0, 0, | |
646 screen_width, drect.y ); | |
647 subframe->FillRectangle( subframe, | |
648 0, drect.y + drect.h, | |
649 screen_width, drect.y ); | |
650 subframe->FillRectangle( subframe, | |
651 0, drect.y, | |
652 drect.x, drect.h ); | |
653 subframe->FillRectangle( subframe, | |
654 drect.x + drect.w, drect.y, | |
655 drect.x, drect.h ); | |
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 | 660 if (use_crtc2) { |
661 /* Flip BES */ | |
662 if (use_bes) | |
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 | 665 /* Blit from BES/temp to CRTC2 */ |
666 c2frame->SetBlittingFlags( c2frame, DSBLIT_NOFX ); | |
667 if (stretch) | |
668 c2frame->StretchBlit( c2frame, frame, NULL, &drect ); | |
669 else | |
670 c2frame->Blit( c2frame, frame, NULL, drect.x, drect.y ); | |
671 } | |
672 | |
673 vo_draw_text( sub_width, sub_height, draw_alpha ); | |
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 | 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 | 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 | 686 frame->Flip( frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : 0 ); |
687 } else { | |
688 /* Flip CRTC2 */ | |
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 | 692 } |
8013
bd100a3d486f
Here's a new vo plugin that uses DirectFB. It's meant for Matrox G400
arpi
parents:
diff
changeset
|
693 |
8138 | 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 | 703 while (num_bufs--) { |
704 frame = bufs[num_bufs]; | |
705 frame->Release( frame ); | |
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 | 730 static uint32_t |
731 get_image( mp_image_t *mpi ) | |
732 { | |
733 void *dst; | |
734 int pitch; | |
735 | |
736 if (use_bes && | |
737 (mpi->type == MP_IMGTYPE_STATIC || | |
738 mpi->flags & MP_IMGFLAG_READABLE)) | |
739 return VO_FALSE; | |
740 | |
741 if (mpi->flags & MP_IMGFLAG_READABLE && | |
742 (mpi->type == MP_IMGTYPE_IPB || mpi->type == MP_IMGTYPE_IP)) { | |
743 int buf = current_buf; | |
744 | |
745 if (num_bufs < 2) | |
746 return VO_FALSE; | |
747 | |
748 current_ip_buf ^= 1; | |
749 | |
750 if (mpi->type == MP_IMGTYPE_IPB && num_bufs < 3 && current_ip_buf) | |
751 return VO_FALSE; | |
752 | |
753 buf = current_ip_buf; | |
754 | |
755 if (mpi->type == MP_IMGTYPE_IPB) | |
756 buf++; | |
757 | |
758 current_buf = buf; | |
759 frame = bufs[current_buf]; | |
760 } | |
761 | |
762 if (frame->Lock( frame, DSLF_WRITE | (mpi->flags & MP_IMGFLAG_READABLE ? DSLF_READ : 0), | |
763 &dst, &pitch ) != DFB_OK) | |
764 return VO_FALSE; | |
765 | |
766 if ((mpi->width == pitch) || | |
767 (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) { | |
768 | |
769 mpi->planes[0] = dst; | |
770 mpi->width = in_width; | |
771 mpi->stride[0] = pitch; | |
772 | |
773 if (mpi->flags & MP_IMGFLAG_PLANAR) { | |
774 mpi->stride[1] = mpi->stride[2] = pitch / 2; | |
775 | |
776 if (mpi->flags & MP_IMGFLAG_SWAPPED) { | |
777 mpi->planes[1] = dst + in_height * pitch; | |
778 mpi->planes[2] = mpi->planes[1] + in_height * pitch / 4; | |
779 } else { | |
780 mpi->planes[2] = dst + in_height * pitch; | |
781 mpi->planes[1] = mpi->planes[2] + in_height * pitch / 4; | |
782 } | |
783 } | |
784 | |
785 mpi->flags |= MP_IMGFLAG_DIRECT; | |
786 | |
787 return VO_TRUE; | |
788 } | |
789 | |
790 frame->Unlock( frame ); | |
791 | |
792 return VO_FALSE; | |
793 } | |
794 | |
795 | |
796 | |
797 static uint32_t | |
798 draw_image( mp_image_t *mpi ) | |
799 { | |
800 if (mpi->flags & (MP_IMGFLAG_DIRECT | MP_IMGFLAG_DRAW_CALLBACK)) | |
801 return VO_TRUE; | |
802 | |
803 if (mpi->flags & MP_IMGFLAG_PLANAR) | |
804 return draw_slice( mpi->planes, mpi->stride, | |
805 mpi->w, mpi->h, 0, 0 ); | |
806 else { | |
807 void *dst; | |
808 int pitch; | |
809 | |
810 if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK) | |
811 return VO_FALSE; | |
812 memcpy_pic( dst, mpi->planes[0], | |
813 mpi->w * (mpi->bpp / 8), mpi->h, | |
814 pitch, mpi->stride[0] ); | |
815 frame->Unlock( frame ); | |
816 | |
817 return VO_TRUE; | |
818 } | |
819 } | |
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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 849 res = crtc2->SetColorAdjustment( crtc2, &ca ); |
850 else | |
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 | 853 if (res != DFB_OK) |
854 return VO_FALSE; | |
855 | |
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 | 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 | 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 | 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 | 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 | 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 | 872 if (res != DFB_OK) |
873 return VO_FALSE; | |
874 | |
8121 | 875 if (!strcasecmp( data, "brightness" ) && |
876 (ca.flags & DCAF_BRIGHTNESS)) | |
877 *value = (ca.brightness - 0x8000) * factor; | |
878 if (!strcasecmp( data, "contrast" ) && | |
879 (ca.flags & DCAF_CONTRAST)) | |
880 *value = (ca.contrast - 0x8000) * factor; | |
881 if (!strcasecmp( data, "hue" ) && | |
882 (ca.flags & DCAF_HUE)) | |
883 *value = (ca.hue - 0x8000) * factor; | |
884 if (!strcasecmp( data, "saturation" ) && | |
885 (ca.flags & DCAF_SATURATION)) | |
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 | 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 | 897 |
898 case VOCTRL_GET_IMAGE: | |
899 return get_image( data ); | |
900 | |
901 case VOCTRL_DRAW_IMAGE: | |
902 return draw_image( data ); | |
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 | 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 | 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 | 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 } |