Mercurial > mplayer.hg
comparison libvo/vo_directfb2.c @ 8137:530d1c5f0c78
Switch containing options for DirectFB library was renamed to dfbopts.
Layer selection is done as "subdevice" - integer nuber after -vo
directfb: where -1 is autodetection and 0,1,2... are for layers
example: mplayer -vo directfb:2 -dfbopts matrox-crtc2,matrox-tv-standard=pal *.avi
author | arpi |
---|---|
date | Sun, 10 Nov 2002 13:57:42 +0000 |
parents | fcbe94c83ff6 |
children | 5b39e79af5fe |
comparison
equal
deleted
inserted
replaced
8136:1831ce784783 | 8137:530d1c5f0c78 |
---|---|
36 #include <ctype.h> | 36 #include <ctype.h> |
37 #include <assert.h> | 37 #include <assert.h> |
38 | 38 |
39 #include <sys/mman.h> | 39 #include <sys/mman.h> |
40 #include <sys/ioctl.h> | 40 #include <sys/ioctl.h> |
41 #ifdef __linux__ | |
41 #include <sys/kd.h> | 42 #include <sys/kd.h> |
43 #else | |
44 #include <linux/kd.h> | |
45 #endif | |
42 | 46 |
43 #include "config.h" | 47 #include "config.h" |
44 #include "video_out.h" | 48 #include "video_out.h" |
45 #include "video_out_internal.h" | 49 #include "video_out_internal.h" |
46 #include "fastmemcpy.h" | 50 #include "fastmemcpy.h" |
57 | 61 |
58 static vo_info_t vo_info = { | 62 static vo_info_t vo_info = { |
59 "Direct Framebuffer Device", | 63 "Direct Framebuffer Device", |
60 "directfb", | 64 "directfb", |
61 "Jiri Svoboda Jiri.Svoboda@seznam.cz", | 65 "Jiri Svoboda Jiri.Svoboda@seznam.cz", |
62 "version 2.0beta" | 66 "v 2.0 (for DirectFB version >=0.9.13)" |
63 }; | 67 }; |
64 | 68 |
65 extern int verbose; | 69 extern int verbose; |
66 | 70 |
67 /****************************** | 71 /****************************** |
128 #ifdef HAVE_FBDEV | 132 #ifdef HAVE_FBDEV |
129 extern char *fb_dev_name; | 133 extern char *fb_dev_name; |
130 #else | 134 #else |
131 char *fb_dev_name; | 135 char *fb_dev_name; |
132 #endif | 136 #endif |
137 char *dfb_params; | |
138 int layer_id = -1; | |
133 | 139 |
134 /****************************** | 140 /****************************** |
135 * implementation * | 141 * implementation * |
136 ******************************/ | 142 ******************************/ |
137 | 143 |
146 | 152 |
147 DFBResult ret; | 153 DFBResult ret; |
148 | 154 |
149 if (verbose) printf("DirectFB: Preinit entered\n"); | 155 if (verbose) printf("DirectFB: Preinit entered\n"); |
150 | 156 |
157 if (arg) { | |
158 int tmp=-1; | |
159 if (sscanf(arg,"%i",&tmp)) { | |
160 layer_id=tmp; | |
161 if (verbose) printf("DirectFB: Layer id forced to %i\n",layer_id); | |
162 }; | |
163 } | |
164 | |
165 if (dfb_params) | |
166 { | |
167 int argc = 2; | |
168 char arg0[10] = "mplayer"; | |
169 char arg1[256] = "--dfb:"; | |
170 char* argv[3]; | |
171 char ** a; | |
172 | |
173 a = &argv[0]; | |
174 | |
175 strncat(arg1,dfb_params,249); | |
176 | |
177 argv[0]=arg0; | |
178 argv[1]=arg1; | |
179 argv[2]=NULL; | |
180 | |
181 DFBCHECK (DirectFBInit (&argc,&a)); | |
182 | |
183 } else { | |
184 | |
151 DFBCHECK (DirectFBInit (NULL,NULL)); | 185 DFBCHECK (DirectFBInit (NULL,NULL)); |
186 } | |
152 | 187 |
153 if (((directfb_major_version <= 0) && | 188 if (((directfb_major_version <= 0) && |
154 (directfb_minor_version <= 9) && | 189 (directfb_minor_version <= 9) && |
155 (directfb_micro_version < 13))) | 190 (directfb_micro_version < 13))) |
156 { | 191 { |
180 /* | 215 /* |
181 * (Initialize) | 216 * (Initialize) |
182 */ | 217 */ |
183 | 218 |
184 DFBCHECK (DirectFBCreate (&dfb)); | 219 DFBCHECK (DirectFBCreate (&dfb)); |
185 DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)); | 220 if (DFB_OK != dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)) { |
221 printf("DirectFB: Warning - cannot swith to fullscreen mode"); | |
222 }; | |
186 | 223 |
187 /* | 224 /* |
188 * (Get keyboard) | 225 * (Get keyboard) |
189 */ | 226 */ |
190 | 227 |
252 void *data) | 289 void *data) |
253 { | 290 { |
254 enum1_t *params =(enum1_t *)data; | 291 enum1_t *params =(enum1_t *)data; |
255 IDirectFBDisplayLayer *layer; | 292 IDirectFBDisplayLayer *layer; |
256 DFBResult ret; | 293 DFBResult ret; |
294 | |
295 if ((layer_id == -1 )||(layer_id == id)) { | |
257 | 296 |
258 ret = dfb->GetDisplayLayer( dfb, id, &layer); | 297 ret = dfb->GetDisplayLayer( dfb, id, &layer); |
259 if (ret) { | 298 if (ret) { |
260 DirectFBError( "dfb->GetDisplayLayer failed", ret ); | 299 DirectFBError( "dfb->GetDisplayLayer failed", ret ); |
261 return DFENUM_OK; | 300 return DFENUM_OK; |
296 if (verbose) printf("DirectFB: Test format - added layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION)); | 335 if (verbose) printf("DirectFB: Test format - added layer %i scale/pos %i\n",id,(desc.caps & DLCAPS_SCREEN_LOCATION)); |
297 }; | 336 }; |
298 }; | 337 }; |
299 }; | 338 }; |
300 | 339 |
340 }; | |
341 | |
301 return DFENUM_OK; | 342 return DFENUM_OK; |
302 } | 343 } |
303 | 344 |
304 static uint32_t query_format(uint32_t format) | 345 static uint32_t query_format(uint32_t format) |
305 { | 346 { |
537 return CONFIG_ERROR; // what shall we report on fail? | 578 return CONFIG_ERROR; // what shall we report on fail? |
538 } | 579 } |
539 | 580 |
540 // test surface for flipping | 581 // test surface for flipping |
541 DFBCHECK(primary->GetCapabilities(primary,&caps)); | 582 DFBCHECK(primary->GetCapabilities(primary,&caps)); |
542 // primary->Clear(primary,0,0,0,0); | 583 #if DIRECTFBVERSION > 913 |
584 primary->Clear(primary,0,0,0,0); | |
585 #endif | |
543 flipping = 0; | 586 flipping = 0; |
544 if (caps & DSCAPS_FLIPPING) { | 587 if (caps & DSCAPS_FLIPPING) { |
545 ret = primary->Flip(primary,NULL,0); | 588 ret = primary->Flip(primary,NULL,0); |
546 if (ret==DFB_OK) { | 589 if (ret==DFB_OK) { |
547 // primary->Clear(primary,0,0,0,0); | 590 #if DIRECTFBVERSION > 913 |
591 primary->Clear(primary,0,0,0,0); | |
592 #endif | |
548 flipping = 1; | 593 flipping = 1; |
549 } | 594 } |
550 }; | 595 }; |
551 | 596 |
552 if (verbose) printf("DirectFB: Config - flipping = %i\n",flipping); | 597 if (verbose) printf("DirectFB: Config - flipping = %i\n",flipping); |