comparison libvo/vo_directfb2.c @ 24950:ae7c626f949d

cosmetics: Comment grammar and spelling fixes.
author diego
date Tue, 06 Nov 2007 09:49:55 +0000
parents 11d4bcd96bc3
children 050bb6b58baa
comparison
equal deleted inserted replaced
24949:11d4bcd96bc3 24950:ae7c626f949d
107 static int framelocked = 0; 107 static int framelocked = 0;
108 // flipping mode flag (layer/surface) 108 // flipping mode flag (layer/surface)
109 static int flipping = 0; 109 static int flipping = 0;
110 // scaling flag 110 // scaling flag
111 static int stretch = 0; 111 static int stretch = 0;
112 // pictrure position 112 // picture position
113 static int xoffset=0,yoffset=0; 113 static int xoffset=0,yoffset=0;
114 // picture size 114 // picture size
115 static int out_width=0,out_height=0; 115 static int out_width=0,out_height=0;
116 // frame/primary size 116 // frame/primary size
117 static int width=0,height=0; 117 static int width=0,height=0;
183 {NULL} 183 {NULL}
184 }; 184 };
185 185
186 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Preinit entered\n"); 186 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Preinit entered\n");
187 187
188 if (dfb) return 0; // we are already inited! 188 if (dfb) return 0; // we are already initialized!
189 189
190 // set defaults 190 // set defaults
191 buffer_mode = 1 + vo_doublebuffering; // honor -double switch 191 buffer_mode = 1 + vo_doublebuffering; // honor -double switch
192 layer_id = -1; 192 layer_id = -1;
193 use_input = 1; 193 use_input = 1;
254 254
255 /* 255 /*
256 * (set options) 256 * (set options)
257 */ 257 */
258 258
259 // uncomment this if you do not wish to create a new vt for DirectFB 259 // uncomment this if you do not wish to create a new VT for DirectFB
260 // DFBCHECK (DirectFBSetOption ("no-vt-switch","")); 260 // DFBCHECK (DirectFBSetOption ("no-vt-switch",""));
261 261
262 // uncomment this if you want to allow vt switching 262 // uncomment this if you want to allow VT switching
263 // DFBCHECK (DirectFBSetOption ("vt-switching","")); 263 // DFBCHECK (DirectFBSetOption ("vt-switching",""));
264 264
265 // uncomment this if you want to hide gfx cursor (req dfb >=0.9.9) 265 // uncomment this if you want to hide gfx cursor (req dfb >=0.9.9)
266 DFBCHECK (DirectFBSetOption ("no-cursor","")); 266 DFBCHECK (DirectFBSetOption ("no-cursor",""));
267 267
298 /* 298 /*
299 * Create an input buffer for the keyboard. 299 * Create an input buffer for the keyboard.
300 */ 300 */
301 if (keyboard) DFBCHECK (keyboard->CreateEventBuffer (keyboard, &buffer)); 301 if (keyboard) DFBCHECK (keyboard->CreateEventBuffer (keyboard, &buffer));
302 302
303 // just to start with clean ... 303 // just to start clean ...
304 if (buffer) buffer->Reset(buffer); 304 if (buffer) buffer->Reset(buffer);
305 305
306 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Preinit OK\n"); 306 //mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Preinit OK\n");
307 307
308 return 0; 308 return 0;
407 return DFENUM_OK; 407 return DFENUM_OK;
408 } 408 }
409 409
410 static int query_format(uint32_t format) 410 static int query_format(uint32_t format)
411 { 411 {
412 int ret = VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD; // osd should be removed in future -> will be handled outside... 412 int ret = VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD; // osd should be removed the in future -> will be handled outside...
413 enum1_t params; 413 enum1_t params;
414 414
415 415
416 if (!convformat(format)) return 0; 416 if (!convformat(format)) return 0;
417 // temporary disable YV12 417 // temporarily disable YV12
418 // if (format == IMGFMT_YV12) return 0; 418 // if (format == IMGFMT_YV12) return 0;
419 // if (format == IMGFMT_I420) return 0; 419 // if (format == IMGFMT_I420) return 0;
420 if (format == IMGFMT_IYUV) return 0; 420 if (format == IMGFMT_IYUV) return 0;
421 421
422 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Format query: %s\n",vo_format_name(format)); 422 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Format query: %s\n",vo_format_name(format));
504 enum1_t params; 504 enum1_t params;
505 505
506 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config entered [%ix%i]\n",s_width,s_height); 506 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config entered [%ix%i]\n",s_width,s_height);
507 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: With requested format: %s\n",vo_format_name(format)); 507 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: With requested format: %s\n",vo_format_name(format));
508 508
509 // initial clean-up 509 // initial cleanup
510 if (frame) { 510 if (frame) {
511 frame->Release(frame); 511 frame->Release(frame);
512 frame=NULL; 512 frame=NULL;
513 } 513 }
514 514
564 } 564 }
565 } 565 }
566 } 566 }
567 } // vm end 567 } // vm end
568 568
569 // just for sure clear primary layer 569 // just to be sure clear primary layer
570 #if DIRECTFBVERSION > DFB_VERSION(0,9,13) 570 #if DIRECTFBVERSION > DFB_VERSION(0,9,13)
571 ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer); 571 ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer);
572 if (ret==DFB_OK) { 572 if (ret==DFB_OK) {
573 ret = layer->GetSurface(layer,&primary); 573 ret = layer->GetSurface(layer,&primary);
574 if (ret==DFB_OK) { 574 if (ret==DFB_OK) {
629 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError in layer configuration (size)\n"); 629 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError in layer configuration (size)\n");
630 DirectFBError("MPlayer - Layer size change.",ret); 630 DirectFBError("MPlayer - Layer size change.",ret);
631 }; 631 };
632 } 632 }
633 633
634 // look if we need to change pixel fromat of layer 634 // look if we need to change the pixel format of the layer
635 // and just for sure fetch also all layer propreties 635 // and just to be sure also fetch all layer properties
636 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_OPTIONS | DLCONF_BUFFERMODE; 636 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_OPTIONS | DLCONF_BUFFERMODE;
637 637
638 ret = layer->GetConfiguration(layer,&dlc); 638 ret = layer->GetConfiguration(layer,&dlc);
639 639
640 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_WIDTH | DLCONF_HEIGHT; 640 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_WIDTH | DLCONF_HEIGHT;
658 if (ret) { 658 if (ret) {
659 unsigned int bpp; 659 unsigned int bpp;
660 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError in layer configuration (format, flags=%x)\n",dlc.flags); 660 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError in layer configuration (format, flags=%x)\n",dlc.flags);
661 DirectFBError("MPlayer - layer pixelformat change",ret); 661 DirectFBError("MPlayer - layer pixelformat change",ret);
662 662
663 // ugly fbdev workabout - try to switch pixelformat via videomode change 663 // ugly fbdev workaround - try to switch pixelformat via videomode change
664 switch (dlc.pixelformat) { 664 switch (dlc.pixelformat) {
665 case DSPF_ARGB: 665 case DSPF_ARGB:
666 case DSPF_RGB32: bpp=32;break; 666 case DSPF_RGB32: bpp=32;break;
667 case DSPF_RGB24: bpp=24;break; 667 case DSPF_RGB24: bpp=24;break;
668 case DSPF_RGB16: bpp=16;break; 668 case DSPF_RGB16: bpp=16;break;
703 DirectFBError("MPlayer - VM - Layer->GetConfiguration",ret); 703 DirectFBError("MPlayer - VM - Layer->GetConfiguration",ret);
704 } else { 704 } else {
705 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Layer has now pixelformat [%x]\n",dlc.pixelformat); 705 mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Layer has now pixelformat [%x]\n",dlc.pixelformat);
706 }; 706 };
707 707
708 // check if we were succesfull 708 // check if we were succesful
709 if ((dlc.pixelformat != convformat(params.format)) || (ret != DFB_OK)) { 709 if ((dlc.pixelformat != convformat(params.format)) || (ret != DFB_OK)) {
710 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Recovery failed!.\n"); 710 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Recovery failed!.\n");
711 return CONFIG_ERROR; 711 return CONFIG_ERROR;
712 } 712 }
713 713
718 }; 718 };
719 }; 719 };
720 }; 720 };
721 721
722 // flipping of layer 722 // flipping of layer
723 // try triple, \double... buffering 723 // try triple, double... buffering
724 724
725 dlc.flags = DLCONF_BUFFERMODE; 725 dlc.flags = DLCONF_BUFFERMODE;
726 #ifdef TRIPLE 726 #ifdef TRIPLE
727 if (buffer_mode > 2) { 727 if (buffer_mode > 2) {
728 dlc.buffermode = DLBM_TRIPLE; 728 dlc.buffermode = DLBM_TRIPLE;
782 782
783 ret = layer->GetSurface(layer,&primary); 783 ret = layer->GetSurface(layer,&primary);
784 784
785 if (ret) { 785 if (ret) {
786 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError - could not get surface\n"); 786 mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: ConfigError - could not get surface\n");
787 return CONFIG_ERROR; // what shall we report on fail? 787 return CONFIG_ERROR; // what shall we report on failure?
788 } 788 }
789 789
790 // test surface for flipping 790 // test surface for flipping
791 DFBCHECK(primary->GetCapabilities(primary,&caps)); 791 DFBCHECK(primary->GetCapabilities(primary,&caps));
792 #if DIRECTFBVERSION > DFB_VERSION(0,9,13) 792 #if DIRECTFBVERSION > DFB_VERSION(0,9,13)
921 }; 921 };
922 }; 922 };
923 }; 923 };
924 // empty buffer, because of repeating (keyboard repeat is faster than key handling 924 // empty buffer, because of repeating (keyboard repeat is faster than key handling
925 // and this causes problems during seek) 925 // and this causes problems during seek)
926 // temporary workabout should be solved in the future 926 // temporary workaround should be solved in the future
927 buffer->Reset(buffer); 927 buffer->Reset(buffer);
928 928
929 } 929 }
930 //if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf ("DirectFB: Check events finished\n"); 930 //if ( mp_msg_test(MSGT_VO,MSGL_V) ) printf ("DirectFB: Check events finished\n");
931 } 931 }
962 switch (flipping) { 962 switch (flipping) {
963 case 1: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAIT)); 963 case 1: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAIT));
964 break; 964 break;
965 case 2: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_ONSYNC)); 965 case 2: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_ONSYNC));
966 break; 966 break;
967 default:; // should never reach here 967 default:; // should never be reached
968 } 968 }
969 #else 969 #else
970 if (flipping) { 970 if (flipping) {
971 DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC)); 971 DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC));
972 } 972 }