annotate libvo/vo_directfb2.c @ 7835:d489890c59d3

add an option to force audio recording when a tv card reports no audio sources
author henry
date Tue, 22 Oct 2002 07:56:13 +0000
parents fcbe94c83ff6
children 530d1c5f0c78
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
2 MPlayer video driver for DirectFramebuffer device
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
3
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
4 (C) 2002
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
5
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
6 Written by Jiri Svoboda <Jiri.Svoboda@seznam.cz>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
7
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
8 This library is free software; you can redistribute it and/or
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
9 modify it under the terms of the GNU Lesser General Public
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
10 License as published by the Free Software Foundation; either
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
11 version 2 of the License, or (at your option) any later version.
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
12
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
13 This library is distributed in the hope that it will be useful,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
16 Lesser General Public License for more details.
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
17
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
18 You should have received a copy of the GNU Lesser General Public
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
19 License along with this library; if not, write to the
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
20 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
21 Boston, MA 02111-1307, USA.
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
22 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
23
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
24 // directfb includes
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
25
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
26 #include <directfb.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
27
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
28 // other things
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
29
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
30 #include <stdio.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
31 #include <stdlib.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
32 #include <string.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
33 #include <fcntl.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
34 #include <unistd.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
35 #include <errno.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
36 #include <ctype.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
37 #include <assert.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
38
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
39 #include <sys/mman.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
40 #include <sys/ioctl.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
41 #include <sys/kd.h>
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
42
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
43 #include "config.h"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
44 #include "video_out.h"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
45 #include "video_out_internal.h"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
46 #include "fastmemcpy.h"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
47 #include "sub.h"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
48
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
49 #include "aspect.h"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
50
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
51 #ifndef min
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
52 #define min(x,y) (((x)<(y))?(x):(y))
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
53 #endif
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
54
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
55
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
56 LIBVO_EXTERN(directfb)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
57
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
58 static vo_info_t vo_info = {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
59 "Direct Framebuffer Device",
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
60 "directfb",
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
61 "Jiri Svoboda Jiri.Svoboda@seznam.cz",
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
62 "version 2.0beta"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
63 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
64
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
65 extern int verbose;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
66
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
67 /******************************
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
68 * vo_directfb globals *
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
69 ******************************/
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
70
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
71 #define DFBCHECK(x...) \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
72 { \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
73 DFBResult err = x; \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
74 \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
75 if (err != DFB_OK) \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
76 { \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
77 fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
78 DirectFBErrorFatal( #x, err ); \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
79 } \
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
80 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
81
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
82 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
83 * filled by preinit
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
84 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
85
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
86 // main DirectFB handle
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
87 static IDirectFB *dfb = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
88 // keyboard handle
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
89 static IDirectFBInputDevice *keyboard = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
90 // A buffer for input events.
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
91 static IDirectFBEventBuffer *buffer = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
92
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
93 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
94 * filled during config
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
95 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
96
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
97 // handle of used layer
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
98 static IDirectFBDisplayLayer *layer = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
99 // surface of used layer
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
100 static IDirectFBSurface *primary = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
101 static int primarylocked = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
102 // handle of temporary surface (if used)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
103 static IDirectFBSurface *frame = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
104 static int framelocked = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
105 // flipping mode flag (layer/surface)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
106 static int flipping = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
107 // scaling flag
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
108 static int stretch = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
109 // pictrure position
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
110 static int xoffset=0,yoffset=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
111 // picture size
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
112 static int out_width=0,out_height=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
113 // frame/primary size
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
114 static int width=0,height=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
115 // frame primary format
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
116 DFBSurfacePixelFormat pixel_format;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
117 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
118 static void (*draw_alpha_p)(int w, int h, unsigned char *src,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
119 unsigned char *srca, int stride, unsigned char *dst,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
120 int dstride);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
121 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
122
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
123 /******************************
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
124 * cmd line parameteres *
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
125 ******************************/
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
126
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
127 /* command line/config file options */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
128 #ifdef HAVE_FBDEV
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
129 extern char *fb_dev_name;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
130 #else
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
131 char *fb_dev_name;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
132 #endif
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
133
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
134 /******************************
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
135 * implementation *
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
136 ******************************/
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
137
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
138 void unlock() {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
139 if (frame && framelocked) frame->Unlock(frame);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
140 if (primary && primarylocked) primary->Unlock(primary);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
141 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
142
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
143
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
144 static uint32_t preinit(const char *arg)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
145 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
146
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
147 DFBResult ret;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
148
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
149 if (verbose) printf("DirectFB: Preinit entered\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
150
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
151 DFBCHECK (DirectFBInit (NULL,NULL));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
152
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
153 if (((directfb_major_version <= 0) &&
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
154 (directfb_minor_version <= 9) &&
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
155 (directfb_micro_version < 13)))
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
156 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
157 printf("DirectFB: Unsupported DirectFB version\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
158 return 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
159 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
160
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
161 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
162 * (set options)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
163 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
164
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
165 if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER"))) fb_dev_name = "/dev/fb0";
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
166 DFBCHECK (DirectFBSetOption ("fbdev",fb_dev_name));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
167
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
168 // uncomment this if you do not wish to create a new vt for DirectFB
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
169 // DFBCHECK (DirectFBSetOption ("no-vt-switch",""));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
170
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
171 // uncomment this if you want to allow vt switching
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
172 // DFBCHECK (DirectFBSetOption ("vt-switching",""));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
173
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
174 // uncomment this if you want to hide gfx cursor (req dfb >=0.9.9)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
175 DFBCHECK (DirectFBSetOption ("no-cursor",""));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
176
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
177 // bg color fix
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
178 DFBCHECK (DirectFBSetOption ("bg-color","00000000"));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
179
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
180 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
181 * (Initialize)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
182 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
183
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
184 DFBCHECK (DirectFBCreate (&dfb));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
185 DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
186
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
187 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
188 * (Get keyboard)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
189 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
190
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
191 ret = dfb->GetInputDevice (dfb, DIDID_KEYBOARD, &keyboard);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
192
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
193 if (ret==DFB_OK) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
194 if (verbose) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
195 printf("DirectFB: Keyboard init OK\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
196 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
197 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
198 keyboard = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
199 printf("DirectFB: Keyboard init FAILED\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
200 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
201
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
202 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
203 * Create an input buffer for the keyboard.
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
204 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
205 if (keyboard) DFBCHECK (keyboard->CreateEventBuffer (keyboard, &buffer));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
206
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
207 // just to start with clean ...
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
208 if (buffer) buffer->Reset(buffer);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
209
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
210 if (verbose) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
211 printf("DirectFB: Preinit OK\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
212 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
213
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
214 return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
215
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
216 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
217
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
218 DFBSurfacePixelFormat convformat(uint32_t format)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
219 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
220 // add more formats !!!
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
221 switch (format) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
222 case IMGFMT_RGB32: return DSPF_RGB32; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
223 case IMGFMT_BGR32: return DSPF_RGB32; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
224 case IMGFMT_RGB24: return DSPF_RGB24; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
225 case IMGFMT_BGR24: return DSPF_RGB24; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
226 case IMGFMT_RGB16: return DSPF_RGB16; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
227 case IMGFMT_BGR16: return DSPF_RGB16; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
228 case IMGFMT_RGB15: return DSPF_RGB15; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
229 case IMGFMT_BGR15: return DSPF_RGB15; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
230 case IMGFMT_YUY2: return DSPF_YUY2; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
231 case IMGFMT_UYVY: return DSPF_UYVY; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
232 case IMGFMT_YV12: return DSPF_YV12; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
233 case IMGFMT_I420: return DSPF_I420; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
234 // case IMGFMT_IYUV: return DSPF_IYUV; break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
235 default: return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
236 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
237 return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
238 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
239
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
240 typedef struct enum1_s {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
241 uint32_t format;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
242 int scale;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
243 int result;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
244 unsigned int id;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
245 unsigned int width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
246 unsigned int height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
247 int setsize;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
248 } enum1_t;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
249
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
250 DFBEnumerationResult test_format_callback( unsigned int id,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
251 DFBDisplayLayerDescription desc,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
252 void *data)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
253 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
254 enum1_t *params =(enum1_t *)data;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
255 IDirectFBDisplayLayer *layer;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
256 DFBResult ret;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
257
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
258 ret = dfb->GetDisplayLayer( dfb, id, &layer);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
259 if (ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
260 DirectFBError( "dfb->GetDisplayLayer failed", ret );
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
261 return DFENUM_OK;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
262 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
263 DFBDisplayLayerConfig dlc;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
264
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
265 if (params->setsize) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
266 dlc.flags = DLCONF_WIDTH |DLCONF_HEIGHT;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
267 dlc.width = params->width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
268 dlc.height = params->height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
269 layer->SetConfiguration(layer,&dlc);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
270 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
271
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
272
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
273 dlc.flags = DLCONF_PIXELFORMAT;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
274 dlc.pixelformat = convformat(params->format);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
275
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
276 layer->SetOpacity(layer,0);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
277 ret = layer->TestConfiguration(layer,&dlc,NULL);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
278
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
279 layer->Release(layer);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
280
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
281 if (verbose) printf("DirectFB: Test format - layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
282
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
283 if (!ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
284 // printf("Test OK\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
285 if (params->result) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
286 if ((!params->scale) && (desc.caps & DLCAPS_SCREEN_LOCATION)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
287 params->scale=1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
288 params->id=id;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
289 if (verbose) printf("DirectFB: Test format - added layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
290
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
291 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
292 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
293 params->result=1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
294 params->id=id;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
295 if (desc.caps & DLCAPS_SCREEN_LOCATION) params->scale=1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
296 if (verbose) printf("DirectFB: Test format - added layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
297 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
298 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
299 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
300
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
301 return DFENUM_OK;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
302 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
303
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
304 static uint32_t query_format(uint32_t format)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
305 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
306 int ret = VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD; // osd should be removed in future -> will be handled outside...
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
307 enum1_t params;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
308
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
309
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
310 if (!convformat(format)) return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
311 // temporary disable YV12
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
312 // if (format == IMGFMT_YV12) return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
313 // if (format == IMGFMT_I420) return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
314 if (format == IMGFMT_IYUV) return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
315
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
316 if (verbose) printf("DirectFB: Format query: %s\n",vo_format_name(format));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
317
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
318 params.format=format;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
319 params.scale=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
320 params.result=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
321 params.setsize=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
322
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
323 DFBCHECK (dfb->EnumDisplayLayers(dfb,test_format_callback,&params));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
324
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
325 if (params.result) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
326 if (params.scale) ret |=VFCAP_HWSCALE_UP|VFCAP_HWSCALE_DOWN;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
327 return ret;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
328 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
329
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
330 return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
331 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
332
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
333 typedef struct videomode_s {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
334 int width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
335 int height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
336 int out_width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
337 int out_height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
338 int overx;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
339 int overy;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
340 int bpp;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
341 } videomode_t;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
342
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
343
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
344 DFBEnumerationResult video_modes_callback( unsigned int width,unsigned int height,unsigned int bpp, void *data)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
345 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
346 videomode_t *params =(videomode_t *)data;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
347
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
348 int overx=0,overy=0,closer=0,over=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
349 int we_are_under=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
350
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
351 if (verbose) printf("DirectFB: Validator entered %i %i %i\n",width,height,bpp);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
352
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
353 overx=width-params->out_width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
354 overy=height-params->out_height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
355
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
356 if (!params->width) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
357 params->width=width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
358 params->height=height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
359 params->overx=overx;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
360 params->overy=overy;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
361 if (verbose) printf("DirectFB: Mode added %i %i %i\n",width,height,bpp);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
362 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
363
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
364 if ((params->overy<0)||(params->overx<0)) we_are_under=1; // stored mode is smaller than req mode
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
365 if (abs(overx*overy)<abs(params->overx * params->overy)) closer=1; // current mode is closer to desired res
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
366 if ((overx>=0)&&(overy>=0)) over=1; // current mode is bigger or equaul to desired res
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
367 if ((closer && (over || we_are_under)) || (we_are_under && over)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
368 params->width=width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
369 params->height=height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
370 params->overx=overx;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
371 params->overy=overy;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
372 if (verbose) printf("DirectFB: Better mode added %i %i %i\n",width,height,bpp);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
373 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
374
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
375 return DFENUM_OK;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
376 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
377
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
378 #define CONFIG_ERROR -1
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
379
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
380 static uint32_t config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
381 uint32_t d_height, uint32_t fullscreen, char *title,
7272
fcbe94c83ff6 config() parameters change
zdar
parents: 6985
diff changeset
382 uint32_t format)
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
383 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
384 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
385 * (Locals)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
386 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
387
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
388 // decode flags
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
389
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
390 int fs = fullscreen & 0x01;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
391 int vm = fullscreen & 0x02;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
392 int zoom = fullscreen & 0x04;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
393 int flip = fullscreen & 0x08;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
394
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
395 DFBSurfaceDescription dsc;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
396 DFBResult ret;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
397 DFBDisplayLayerConfig dlc;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
398 DFBSurfaceCapabilities caps;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
399
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
400 enum1_t params;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
401
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
402 if (verbose) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
403 printf("DirectFB: Config entered [%ix%i]\n",s_width,s_height);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
404 printf("DirectFB: With requested format: %s\n",vo_format_name(format));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
405 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
406 // initial clean-up
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
407 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
408 frame->Release(frame);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
409 frame=NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
410 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
411
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
412 if (primary) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
413 primary->Release(primary);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
414 primary=NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
415 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
416
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
417 if (layer) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
418 layer->Release(layer);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
419 layer=NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
420 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
421
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
422
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
423 // vm things
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
424
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
425 if (vm) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
426 videomode_t params;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
427 params.out_width=d_width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
428 params.out_height=d_height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
429 params.width=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
430 params.height=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
431 switch (format) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
432 case IMGFMT_RGB32:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
433 case IMGFMT_BGR32:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
434 params.bpp=32;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
435 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
436 case IMGFMT_RGB24:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
437 case IMGFMT_BGR24:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
438 params.bpp=24;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
439 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
440 case IMGFMT_RGB16:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
441 case IMGFMT_BGR16:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
442 case IMGFMT_RGB15:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
443 case IMGFMT_BGR15:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
444 params.bpp=16;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
445 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
446 default: params.bpp=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
447
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
448 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
449 if (verbose) printf("DirectFB: Config - videomode change\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
450 DFBCHECK (dfb->EnumVideoModes(dfb,video_modes_callback,&params));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
451 ret=dfb->SetVideoMode(dfb,params.width,params.height,params.bpp);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
452 if (ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
453 ret=dfb->SetVideoMode(dfb,params.width,params.height,24);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
454 if (ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
455 ret=dfb->SetVideoMode(dfb,params.width,params.height,32);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
456 if (ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
457 ret=dfb->SetVideoMode(dfb,params.width,params.height,16);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
458 if (ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
459 ret=dfb->SetVideoMode(dfb,params.width,params.height,8);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
460 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
461 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
462 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
463 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
464 } // vm end
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
465
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
466 // find best layer
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
467
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
468 if (verbose) printf("DirectFB: Config - find suitable layer\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
469 params.format=format;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
470 params.scale=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
471 params.result=0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
472 params.width=s_width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
473 params.height=s_height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
474 params.setsize=1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
475
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
476 DFBCHECK (dfb->EnumDisplayLayers(dfb,test_format_callback,&params));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
477
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
478 if (!params.result) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
479 printf("DirectFB: ConfigError - no suitable layer found\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
480 params.id = DLID_PRIMARY;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
481 }
6985
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
482 /* Uncomment following if you want to use tvout on CRTC2 (requieres patch for DirectFB from Ville Syrjala)
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
483 params.id=2;
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
484 params.scale=0;
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
485 params.result=1;
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
486 */
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
487 if (verbose) printf("DirectFB: Config - layer %i\n",params.id);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
488
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
489
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
490 // try to setp-up proper configuration
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
491
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
492
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
493 DFBCHECK (dfb->GetDisplayLayer( dfb, params.id, &layer));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
494
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
495 if (params.scale) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
496 if (verbose) printf("DirectFB: Config - set layer config (size)\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
497 dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
498 dlc.width = s_width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
499 dlc.height = s_height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
500
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
501 ret = layer->SetConfiguration(layer,&dlc);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
502
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
503 if (ret && (params.scale || verbose)) printf("DirectFB: ConfigError in layer configuration (size)\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
504
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
505 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
506
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
507 dlc.flags = DLCONF_PIXELFORMAT;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
508 dlc.pixelformat = convformat(params.format);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
509
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
510 // printf("DirectFB: Format [%x]\n",dlc.pixelformat);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
511
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
512 if (verbose) printf("DirectFB: Config - set layer config (format)\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
513 ret = layer->SetConfiguration(layer,&dlc);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
514
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
515 if (ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
516 printf("DirectFB: ConfigError in layer configuration (format)\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
517 return CONFIG_ERROR;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
518 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
519
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
520
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
521 // flipping of layer
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
522
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
523 dlc.flags = DLCONF_BUFFERMODE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
524 dlc.buffermode = DLBM_BACKVIDEO;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
525 ret = layer->SetConfiguration( layer, &dlc );
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
526 if (ret!=DFB_OK) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
527 dlc.buffermode = DLBM_BACKSYSTEM;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
528 ret = layer->SetConfiguration( layer, &dlc );
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
529 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
530
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
531 // get layer surface
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
532
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
533 ret = layer->GetSurface(layer,&primary);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
534
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
535 if (ret) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
536 printf("DirectFB: ConfigError in obtaining surface\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
537 return CONFIG_ERROR; // what shall we report on fail?
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
538 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
539
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
540 // test surface for flipping
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
541 DFBCHECK(primary->GetCapabilities(primary,&caps));
7272
fcbe94c83ff6 config() parameters change
zdar
parents: 6985
diff changeset
542 // primary->Clear(primary,0,0,0,0);
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
543 flipping = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
544 if (caps & DSCAPS_FLIPPING) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
545 ret = primary->Flip(primary,NULL,0);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
546 if (ret==DFB_OK) {
7272
fcbe94c83ff6 config() parameters change
zdar
parents: 6985
diff changeset
547 // primary->Clear(primary,0,0,0,0);
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
548 flipping = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
549 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
550 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
551
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
552 if (verbose) printf("DirectFB: Config - flipping = %i\n",flipping);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
553
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
554 // is scale needed ? Aspect ratio and layer pos/size
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
555
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
556
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
557 // get surface size
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
558 DFBCHECK(primary->GetSize(primary,&width,&height));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
559
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
560 if (verbose) printf("DirectFB: Config - surface size = %ix%i\n",width,height);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
561
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
562 aspect_save_orig(s_width,s_height);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
563 aspect_save_prescale(d_width,d_height);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
564 if (params.scale) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
565 aspect_save_screenres(10000,10000);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
566 aspect(&out_width,&out_height,A_ZOOM);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
567
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
568 ret = layer->SetScreenLocation(layer,(1-(float)out_width/10000)/2,(1-(float)out_height/10000)/2,((float)out_width/10000),((float)out_height/10000));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
569
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
570 if (ret) printf("DirectFB: ConfigError in layer configuration (position)\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
571
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
572 xoffset = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
573 yoffset = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
574
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
575 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
576
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
577 aspect_save_screenres(width,height);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
578
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
579 if(fs) /* -fs */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
580 aspect(&out_width,&out_height,A_ZOOM);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
581 else
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
582 aspect(&out_width,&out_height,A_NOZOOM);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
583
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
584
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
585 xoffset = (width - out_width) / 2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
586 yoffset = (height - out_height) / 2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
587 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
588
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
589 if (((s_width==out_width)&&(s_height==out_height)) || (params.scale)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
590 stretch = 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
591 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
592 stretch = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
593 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
594
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
595
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
596 // temporary buffer in case of not flipping or scaling
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
597 if ((!flipping) || stretch) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
598
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
599 DFBCHECK (primary->GetPixelFormat (primary, &dsc.pixelformat));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
600
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
601 dsc.flags = DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_WIDTH;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
602
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
603 dsc.width = s_width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
604 dsc.height = s_height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
605
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
606 DFBCHECK (dfb->CreateSurface( dfb, &dsc, &frame));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
607 DFBCHECK(frame->GetSize(frame,&width,&height));
6985
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
608 if (verbose) printf("DirectFB: Frame is active.\n");
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
609 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
610
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
611 // get format for draw_alpha - should be removed soon - osd will be rendered outside vo driver
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
612 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
613 DFBCHECK (frame->GetPixelFormat(frame,&pixel_format));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
614 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
615 DFBCHECK (primary->GetPixelFormat(primary,&pixel_format));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
616 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
617
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
618 // finally turn on layer
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
619 layer->SetOpacity(layer,255);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
620
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
621 if (verbose) printf("DirectFB: Config finished [%ix%i] - [%ix%i]\n",out_width,out_height,width,height);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
622
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
623 return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
624 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
625
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
626 static const vo_info_t *get_info(void)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
627 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
628 return &vo_info;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
629 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
630
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
631 extern void mplayer_put_key(int code);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
632
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
633 #include "../linux/keycodes.h"
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
634
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
635 static void check_events(void)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
636 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
637
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
638 if (buffer) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
639
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
640 DFBInputEvent event;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
641
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
642 //if (verbose) printf ("DirectFB: Check events entered\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
643 if (buffer->GetEvent(buffer, DFB_EVENT (&event)) == DFB_OK) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
644
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
645 if (event.type == DIET_KEYPRESS) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
646 switch (event.key_symbol) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
647 case DIKS_ESCAPE:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
648 mplayer_put_key('q');
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
649 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
650 case DIKS_PAGE_UP: mplayer_put_key(KEY_PAGE_UP);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
651 case DIKS_PAGE_DOWN: mplayer_put_key(KEY_PAGE_DOWN);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
652 case DIKS_CURSOR_UP: mplayer_put_key(KEY_UP);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
653 case DIKS_CURSOR_DOWN: mplayer_put_key(KEY_DOWN);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
654 case DIKS_CURSOR_LEFT: mplayer_put_key(KEY_LEFT);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
655 case DIKS_CURSOR_RIGHT: mplayer_put_key(KEY_RIGHT);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
656 case DIKS_INSERT: mplayer_put_key(KEY_INSERT);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
657 case DIKS_DELETE: mplayer_put_key(KEY_DELETE);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
658 case DIKS_HOME: mplayer_put_key(KEY_HOME);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
659 case DIKS_END: mplayer_put_key(KEY_END);break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
660
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
661 default:mplayer_put_key(event.key_symbol);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
662 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
663 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
664 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
665 // empty buffer, because of repeating (keyboard repeat is faster than key handling
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
666 // and this causes problems during seek)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
667 // temporary workabout should be solved in the future
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
668 buffer->Reset(buffer);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
669
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
670 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
671 //if (verbose) printf ("DirectFB: Check events finished\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
672 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
673
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
674 static void flip_page(void)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
675 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
676 DFBSurfaceBlittingFlags flags=DSBLIT_NOFX;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
677
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
678 unlock(); // unlock frame & primary
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
679
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
680 // if (verbose) printf("DirectFB: Flip page entered");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
681
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
682 DFBCHECK (primary->SetBlittingFlags(primary,flags));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
683
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
684 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
685 if (stretch) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
686 DFBRectangle rect;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
687 rect.x=xoffset;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
688 rect.y=yoffset;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
689 rect.w=out_width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
690 rect.h=out_height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
691
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
692 DFBCHECK (primary->StretchBlit(primary,frame,NULL,&rect));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
693
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
694 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
695
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
696 DFBCHECK (primary->Blit(primary,frame,NULL,xoffset,yoffset));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
697
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
698 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
699 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
700
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
701
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
702 if (flipping) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
703 DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
704 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
705
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
706 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
707
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
708
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
709
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
710 static void uninit(void)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
711 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
712
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
713 if (verbose ) printf("DirectFB: Uninit entered\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
714
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
715 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
716
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
717 /*
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
718 * (Release)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
719 */
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
720 if (verbose ) printf("DirectFB: Release buffer\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
721 if (buffer) buffer->Release (buffer);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
722 if (verbose ) printf("DirectFB: Release keyboard\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
723 if (keyboard) keyboard->Release (keyboard);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
724 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
725 if (verbose ) printf("DirectFB: Release frame\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
726 frame->Release (frame);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
727 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
728
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
729 if (verbose ) printf("DirectFB: Release primary\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
730 if (primary) primary->Release (primary);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
731
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
732 // switch off BES
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
733 // if (layer) layer->SetOpacity(layer,0);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
734
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
735 if (layer) layer->Release(layer);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
736
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
737 if (verbose ) printf("DirectFB: Release DirectFB library\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
738
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
739 dfb->Release (dfb);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
740
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
741 if (verbose ) printf("DirectFB: Uninit done.\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
742 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
743
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
744
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
745 static uint32_t directfb_set_video_eq(char *data, int value) //data==name
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
746 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
747
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
748 DFBColorAdjustment ca;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
749 float factor = (float)0xffff / 200.0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
750
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
751 DFBDisplayLayerDescription desc;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
752
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
753 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
754
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
755 if (layer) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
756
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
757 layer->GetDescription(layer,&desc);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
758
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
759 ca.flags=DCAF_NONE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
760
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
761 if (! strcmp( data,"brightness" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
762 if (desc.caps & DLCAPS_BRIGHTNESS) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
763 ca.brightness = value * factor +0x8000;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
764 ca.flags |= DCAF_BRIGHTNESS;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
765 if (verbose) printf("DirectFB: SetVEq Brightness 0x%X %i\n",ca.brightness,value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
766 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
767 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
768
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
769 if (! strcmp( data,"contrast" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
770 if ((desc.caps & DLCAPS_CONTRAST)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
771 ca.contrast = value * factor + 0x8000;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
772 ca.flags |= DCAF_CONTRAST;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
773 if (verbose) printf("DirectFB: SetVEq Contrast 0x%X %i\n",ca.contrast,value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
774 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
775 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
776
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
777 if (! strcmp( data,"hue" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
778 if ((desc.caps & DLCAPS_HUE)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
779 ca.hue = value * factor + 0x8000;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
780 ca.flags |= DCAF_HUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
781 if (verbose) printf("DirectFB: SetVEq Hue 0x%X %i\n",ca.hue,value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
782 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
783 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
784
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
785 if (! strcmp( data,"saturation" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
786 if ((desc.caps & DLCAPS_SATURATION)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
787 ca.saturation = value * factor + 0x8000;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
788 ca.flags |= DCAF_SATURATION;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
789 if (verbose) printf("DirectFB: SetVEq Saturation 0x%X %i\n",ca.saturation,value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
790 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
791 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
792
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
793 if (ca.flags != DCAF_NONE) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
794 layer->SetColorAdjustment(layer,&ca);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
795 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
796 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
797 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
798
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
799 return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
800
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
801 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
802
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
803 static uint32_t directfb_get_video_eq(char *data, int *value) // data==name
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
804 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
805
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
806 DFBColorAdjustment ca;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
807 float factor = 200.0 / (float)0xffff;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
808
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
809 DFBDisplayLayerDescription desc;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
810
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
811 if (layer) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
812
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
813 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
814
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
815 layer->GetDescription(layer,&desc);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
816
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
817 layer->GetColorAdjustment(layer,&ca);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
818
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
819 if (! strcmp( data,"brightness" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
820 if (desc.caps & DLCAPS_BRIGHTNESS) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
821 *value = (int) ((ca.brightness-0x8000) * factor);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
822 if (verbose) printf("DirectFB: GetVEq Brightness 0x%X %i\n",ca.brightness,*value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
823 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
824 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
825 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
826
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
827 if (! strcmp( data,"contrast" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
828 if ((desc.caps & DLCAPS_CONTRAST)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
829 *value = (int) ((ca.contrast-0x8000) * factor);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
830 if (verbose) printf("DirectFB: GetVEq Contrast 0x%X %i\n",ca.contrast,*value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
831 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
832 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
833 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
834
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
835 if (! strcmp( data,"hue" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
836 if ((desc.caps & DLCAPS_HUE)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
837 *value = (int) ((ca.hue-0x8000) * factor);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
838 if (verbose) printf("DirectFB: GetVEq Hue 0x%X %i\n",ca.hue,*value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
839 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
840 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
841 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
842
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
843 if (! strcmp( data,"saturation" )) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
844 if ((desc.caps & DLCAPS_SATURATION)) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
845 *value = (int) ((ca.saturation-0x8000) * factor);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
846 if (verbose) printf("DirectFB: GetVEq Saturation 0x%X %i\n",ca.saturation,*value);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
847 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
848 } else return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
849 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
850 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
851 return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
852 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
853
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
854 static uint32_t get_image(mp_image_t *mpi)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
855 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
856
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
857 int err;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
858 void *dst;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
859 int pitch;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
860
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
861 // if (verbose) printf("DirectFB: get_image() called\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
862 if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // slow video ram
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
863 if(mpi->type==MP_IMGTYPE_STATIC) return VO_FALSE; // it is not static
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
864
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
865 // printf("width=%d vs. pitch=%d, flags=0x%X \n",mpi->width,pitch,mpi->flags);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
866
6985
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
867 if((mpi->width==pitch) ||
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
868 (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH))){
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
869 // we're lucky or codec accepts stride => ok, let's go!
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
870
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
871 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
872 err = frame->Lock(frame,DSLF_WRITE,&dst,&pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
873 framelocked=1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
874 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
875 err = primary->Lock(primary,DSLF_WRITE,&dst,&pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
876 primarylocked=1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
877 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
878
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
879 if (err) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
880 if (verbose) printf("DirectFB: DR lock failed!");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
881 return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
882 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
883
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
884 if(mpi->flags&MP_IMGFLAG_PLANAR){
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
885 //YV12 format
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
886 mpi->planes[0]=dst;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
887 if(mpi->flags&MP_IMGFLAG_SWAPPED){
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
888 mpi->planes[1]=dst + pitch*height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
889 mpi->planes[2]=mpi->planes[1] + pitch*height/4;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
890 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
891 mpi->planes[2]=dst + pitch*height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
892 mpi->planes[1]=mpi->planes[2] + pitch*height/4;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
893 }
6985
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
894 mpi->width=width;
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
895 mpi->stride[0]=pitch;
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
896 mpi->stride[1]=mpi->stride[2]=pitch/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
897 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
898 //YUY2 and RGB formats
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
899 mpi->planes[0]=dst;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
900 mpi->width=width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
901 mpi->stride[0]=pitch;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
902 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
903 mpi->flags|=MP_IMGFLAG_DIRECT;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
904 // if (verbose) printf("DirectFB: get_image() SUCCESS -> Direct Rendering ENABLED\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
905 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
906
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
907 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
908 return VO_FALSE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
909 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
910
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
911 static uint32_t draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
912 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
913 int i;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
914 unsigned int pitch;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
915 void *dst;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
916 void *dst2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
917 void *srcp;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
918 unsigned int p;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
919
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
920 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
921
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
922 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
923 DFBCHECK (frame->Lock(frame,DSLF_WRITE,&dst,&pitch));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
924 framelocked = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
925 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
926 DFBCHECK (primary->Lock(primary,DSLF_WRITE,&dst,&pitch));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
927 primarylocked = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
928 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
929
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
930 p=min(w,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
931
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
932 dst += y*pitch + x;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
933 dst2 = dst + pitch*height - y*pitch + y*pitch/4 - x/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
934 srcp = src[0];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
935
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
936 for (i=0;i<h;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
937 memcpy(dst,srcp,p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
938 dst += pitch;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
939 srcp += stride[0];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
940 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
941
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
942 if (pixel_format == DSPF_YV12) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
943
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
944 dst = dst2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
945 srcp = src[2];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
946 p = p/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
947
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
948 for (i=0;i<h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
949 memcpy(dst,srcp,p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
950 dst += pitch/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
951 srcp += stride[2];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
952 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
953
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
954 dst = dst2 + pitch*height/4;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
955 srcp = src[1];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
956
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
957 for (i=0;i<h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
958 memcpy(dst,srcp,p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
959 dst += pitch/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
960 srcp += stride[1];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
961 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
962
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
963 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
964
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
965 dst = dst2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
966 srcp = src[1];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
967 p = p/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
968
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
969 for (i=0;i<h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
970 memcpy(dst,srcp,p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
971 dst += pitch/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
972 srcp += stride[1];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
973 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
974
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
975 dst = dst2 + pitch*height/4;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
976 srcp = src[2];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
977
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
978 for (i=0;i<h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
979 memcpy(dst,srcp,p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
980 dst += pitch/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
981 srcp += stride[2];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
982 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
983
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
984 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
985
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
986 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
987
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
988 return 0;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
989 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
990
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
991
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
992 static uint32_t put_image(mp_image_t *mpi){
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
993
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
994
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
995 static IDirectFBSurface *tmp = NULL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
996 DFBSurfaceDescription dsc;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
997 DFBRectangle rect;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
998
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
999 // if (verbose) printf("DirectFB: Put_image entered %i %i %i %i %i %i\n",mpi->x,mpi->y,mpi->w,mpi->h,mpi->width,mpi->height);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1000
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1001 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1002
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1003 // already out?
6985
6074119e09a0 Put/get_image fixed. Deleted forgotten development comments
zdar
parents: 6952
diff changeset
1004 if((mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK))) {
6952
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1005 // if (verbose) printf("DirectFB: Put_image - nothing todo\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1006 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1007 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1008
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1009 if (mpi->flags&MP_IMGFLAG_PLANAR) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1010 // memcpy all planes - sad but necessary
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1011 int i;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1012 unsigned int pitch;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1013 void *dst;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1014 void *src;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1015 unsigned int p;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1016
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1017 // if (verbose) printf("DirectFB: Put_image - planar branch\n");
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1018 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1019 DFBCHECK (frame->Lock(frame,DSLF_WRITE,&dst,&pitch));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1020 framelocked = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1021 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1022 DFBCHECK (primary->Lock(primary,DSLF_WRITE,&dst,&pitch));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1023 primarylocked = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1024 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1025
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1026 p=min(mpi->w,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1027
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1028 src = mpi->planes[0]+mpi->y*mpi->stride[0]+mpi->x;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1029
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1030 for (i=0;i<mpi->h;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1031 memcpy(dst+i*pitch,src+i*mpi->stride[0],p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1032 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1033
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1034 if (pixel_format == DSPF_YV12) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1035
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1036 dst += pitch*height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1037 p = p/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1038 src = mpi->planes[2]+mpi->y*mpi->stride[2]+mpi->x/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1039
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1040 for (i=0;i<mpi->h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1041 memcpy(dst+i*pitch/2,src+i*mpi->stride[2],p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1042 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1043
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1044 dst += pitch*height/4;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1045 src = mpi->planes[1]+mpi->y*mpi->stride[1]+mpi->x/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1046
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1047 for (i=0;i<mpi->h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1048 memcpy(dst+i*pitch/2,src+i*mpi->stride[1],p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1049 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1050
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1051 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1052
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1053 dst += pitch*height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1054 p = p/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1055 src = mpi->planes[1]+mpi->y*mpi->stride[1]+mpi->x/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1056
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1057 for (i=0;i<mpi->h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1058 memcpy(dst+i*pitch/2,src+i*mpi->stride[1],p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1059 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1060
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1061 dst += pitch*height/4;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1062 src = mpi->planes[2]+mpi->y*mpi->stride[2]+mpi->x/2;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1063
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1064 for (i=0;i<mpi->h/2;i++) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1065 memcpy(dst+i*pitch/2,src+i*mpi->stride[2],p);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1066 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1067
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1068 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1069 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1070
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1071 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1072
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1073 dsc.flags = DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_WIDTH | DSDESC_PREALLOCATED;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1074 dsc.preallocated[0].data = mpi->planes[0];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1075 dsc.preallocated[0].pitch = mpi->stride[0];
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1076 dsc.width = mpi->width;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1077 dsc.height = mpi->height;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1078 dsc.pixelformat = convformat(mpi->imgfmt);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1079
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1080 DFBCHECK (dfb->CreateSurface( dfb, &dsc, &tmp));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1081
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1082 rect.x=mpi->x;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1083 rect.y=mpi->y;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1084 rect.w=mpi->w;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1085 rect.h=mpi->h;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1086
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1087 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1088 DFBCHECK (tmp->Blit(tmp,frame,&rect,0,0));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1089 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1090 DFBCHECK (tmp->Blit(tmp,primary,&rect,xoffset,yoffset));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1091 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1092 tmp->Release(tmp);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1093 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1094 return VO_TRUE;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1095 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1096
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1097
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1098
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1099 static uint32_t control(uint32_t request, void *data, ...)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1100 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1101 switch (request) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1102 case VOCTRL_QUERY_FORMAT:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1103 return query_format(*((uint32_t*)data));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1104 case VOCTRL_GET_IMAGE:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1105 return get_image(data);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1106 case VOCTRL_DRAW_IMAGE:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1107 return put_image(data);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1108 case VOCTRL_SET_EQUALIZER:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1109 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1110 va_list ap;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1111 int value;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1112
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1113 va_start(ap, data);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1114 value = va_arg(ap, int);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1115 va_end(ap);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1116
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1117 return(directfb_set_video_eq(data, value));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1118 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1119 case VOCTRL_GET_EQUALIZER:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1120 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1121 va_list ap;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1122 int *value;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1123
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1124 va_start(ap, data);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1125 value = va_arg(ap, int*);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1126 va_end(ap);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1127
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1128 return(directfb_get_video_eq(data, value));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1129 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1130 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1131 return VO_NOTIMPL;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1132 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1133
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1134 // unused function
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1135
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1136 static uint32_t draw_frame(uint8_t *src[])
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1137 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1138 return -1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1139 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1140
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1141 // hopefully will be removed soon
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1142
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1143 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1144 unsigned char *srca, int stride)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1145 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1146 void *dst;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1147 int pitch;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1148
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1149 unlock(); // isnt it silly I have to unlock surface and than lock again :-)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1150
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1151 if (frame) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1152 DFBCHECK (frame->Lock(frame,DSLF_WRITE,&dst,&pitch));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1153 framelocked = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1154 } else {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1155 DFBCHECK (primary->Lock(primary,DSLF_WRITE,&dst,&pitch));
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1156 primarylocked = 1;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1157 };
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1158
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1159 switch(pixel_format) {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1160 case DSPF_RGB32:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1161 case DSPF_ARGB:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1162 vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 4*x0,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1163 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1164
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1165 case DSPF_RGB24:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1166 vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 3*x0,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1167 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1168
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1169 case DSPF_RGB16:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1170 vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1171 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1172
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1173 case DSPF_RGB15:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1174 vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1175 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1176
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1177 case DSPF_YUY2:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1178 vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1179 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1180
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1181 case DSPF_UYVY:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1182 vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0 + 1,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1183 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1184
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1185 case DSPF_I420:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1186 case DSPF_YV12:
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1187 vo_draw_alpha_yv12(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 1*x0,pitch);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1188 break;
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1189 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1190
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1191 unlock();
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1192 }
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1193
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1194 static void draw_osd(void)
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1195 {
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1196 vo_draw_text(width,height,draw_alpha);
fc505cbab7ce new directfb driver for 0.9.13+ by jiri.svoboda@seznam.cz
arpi
parents:
diff changeset
1197 }