Mercurial > mplayer.hg
comparison libvo/vo_directfb2.c @ 11972:cda09732375e
removed usage of fb_dev_name, imported field parity reporting from dfbmga, fixed vsync handling in triple buffering mode
author | zdar |
---|---|
date | Tue, 17 Feb 2004 16:34:40 +0000 |
parents | 6e35326c742f |
children | d949d76c9484 |
comparison
equal
deleted
inserted
replaced
11971:93d7290b0be9 | 11972:cda09732375e |
---|---|
103 // handle of temporary surface (if used) | 103 // handle of temporary surface (if used) |
104 static IDirectFBSurface *frame = NULL; | 104 static IDirectFBSurface *frame = NULL; |
105 static int framelocked = 0; | 105 static int framelocked = 0; |
106 // flipping mode flag (layer/surface) | 106 // flipping mode flag (layer/surface) |
107 static int flipping = 0; | 107 static int flipping = 0; |
108 // tvnorm | |
109 static int tvnorm = -1; | |
108 // scaling flag | 110 // scaling flag |
109 static int stretch = 0; | 111 static int stretch = 0; |
110 // pictrure position | 112 // pictrure position |
111 static int xoffset=0,yoffset=0; | 113 static int xoffset=0,yoffset=0; |
112 // picture size | 114 // picture size |
124 /****************************** | 126 /****************************** |
125 * cmd line parameteres * | 127 * cmd line parameteres * |
126 ******************************/ | 128 ******************************/ |
127 | 129 |
128 /* command line/config file options */ | 130 /* command line/config file options */ |
129 #ifdef HAVE_FBDEV | |
130 extern char *fb_dev_name; | |
131 #else | |
132 char *fb_dev_name; | |
133 #endif | |
134 char *dfb_params; | 131 char *dfb_params; |
135 static int layer_id = -1; | 132 static int layer_id = -1; |
136 static int buffer_mode = 1; | 133 static int buffer_mode = 1; |
137 static int use_input = 1; | 134 static int use_input = 1; |
138 static int field_parity = -1; | 135 static int field_parity = -1; |
297 | 294 |
298 /* | 295 /* |
299 * (set options) | 296 * (set options) |
300 */ | 297 */ |
301 | 298 |
302 if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER"))) fb_dev_name = strdup("/dev/fb0"); | |
303 DFBCHECK (DirectFBSetOption ("fbdev",fb_dev_name)); | |
304 | |
305 // uncomment this if you do not wish to create a new vt for DirectFB | 299 // uncomment this if you do not wish to create a new vt for DirectFB |
306 // DFBCHECK (DirectFBSetOption ("no-vt-switch","")); | 300 // DFBCHECK (DirectFBSetOption ("no-vt-switch","")); |
307 | 301 |
308 // uncomment this if you want to allow vt switching | 302 // uncomment this if you want to allow vt switching |
309 // DFBCHECK (DirectFBSetOption ("vt-switching","")); | 303 // DFBCHECK (DirectFBSetOption ("vt-switching","")); |
310 | 304 |
311 // uncomment this if you want to hide gfx cursor (req dfb >=0.9.9) | 305 // uncomment this if you want to hide gfx cursor (req dfb >=0.9.9) |
312 DFBCHECK (DirectFBSetOption ("no-cursor","")); | 306 DFBCHECK (DirectFBSetOption ("no-cursor","")); |
313 | 307 |
314 // bg color fix | 308 // bg color fix |
315 DFBCHECK (DirectFBSetOption ("bg-color","00000000")); | 309 DFBCHECK (DirectFBSetOption ("bg-color","00000000")); |
316 | 310 |
317 /* | 311 /* |
655 // setup layer | 649 // setup layer |
656 | 650 |
657 DFBCHECK (dfb->GetDisplayLayer( dfb, params.id, &layer)); | 651 DFBCHECK (dfb->GetDisplayLayer( dfb, params.id, &layer)); |
658 | 652 |
659 #if DIRECTFBVERSION > 916 | 653 #if DIRECTFBVERSION > 916 |
654 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Config - switching layer to exclusive mode\n"); | |
660 ret = layer->SetCooperativeLevel (layer, DLSCL_EXCLUSIVE); | 655 ret = layer->SetCooperativeLevel (layer, DLSCL_EXCLUSIVE); |
661 | 656 |
662 if (DFB_OK != ret) { | 657 if (DFB_OK != ret) { |
663 mp_msg(MSGT_VO, MSGL_WARN,"DirectFB: Warning - cannot swith layer to exclusive mode. This could cause\nproblems. You may need to select correct pixel format manually!\n"); | 658 mp_msg(MSGT_VO, MSGL_WARN,"DirectFB: Warning - cannot swith layer to exclusive mode. This could cause\nproblems. You may need to select correct pixel format manually!\n"); |
664 DirectFBError("MPlayer - Switch layer to exlusive mode.",ret); | 659 DirectFBError("MPlayer - Switch layer to exlusive mode.",ret); |
807 if (ret==DFB_OK) { | 802 if (ret==DFB_OK) { |
808 layer->SetFieldParity( layer, field_parity ); | 803 layer->SetFieldParity( layer, field_parity ); |
809 } | 804 } |
810 } | 805 } |
811 } | 806 } |
807 mp_msg( MSGT_VO, MSGL_INFO, "DirectFB: Requested field parity: "); | |
808 switch (field_parity) { | |
809 case -1: | |
810 mp_msg( MSGT_VO, MSGL_INFO, "Don't care\n"); | |
811 break; | |
812 case 0: | |
813 mp_msg( MSGT_VO, MSGL_INFO, "Top field first\n"); | |
814 break; | |
815 case 1: | |
816 mp_msg( MSGT_VO, MSGL_INFO, "Bottom field first\n"); | |
817 break; | |
818 } | |
819 | |
812 #endif | 820 #endif |
813 | 821 |
814 | 822 |
815 // get layer surface | 823 // get layer surface |
816 | 824 |
832 | DSCAPS_TRIPLE | 840 | DSCAPS_TRIPLE |
833 #endif | 841 #endif |
834 )) { | 842 )) { |
835 ret = primary->Flip(primary,NULL,0); | 843 ret = primary->Flip(primary,NULL,0); |
836 if (ret==DFB_OK) { | 844 if (ret==DFB_OK) { |
845 flipping = 1; | |
837 #if DIRECTFBVERSION > 913 | 846 #if DIRECTFBVERSION > 913 |
838 primary->Clear(primary,0,0,0,0xff); | 847 primary->Clear(primary,0,0,0,0xff); |
839 #ifdef TRIPLE | 848 #ifdef TRIPLE |
840 // if we have 3 buffers clean once more | 849 // if we have 3 buffers clean once more |
841 if (caps & DSCAPS_TRIPLE) { | 850 if (caps & DSCAPS_TRIPLE) { |
842 primary->Flip(primary,NULL,0); | 851 primary->Flip(primary,NULL,0); |
843 primary->Clear(primary,0,0,0,0xff); | 852 primary->Clear(primary,0,0,0,0xff); |
853 flipping = 2; | |
844 } | 854 } |
845 #endif | 855 #endif |
846 #endif | 856 #endif |
847 flipping = 1; | |
848 } | 857 } |
849 }; | 858 }; |
850 | 859 |
851 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Config - flipping = %i\n",flipping); | 860 mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Config - flipping = %i\n",flipping); |
852 | 861 |
991 | 1000 |
992 }; | 1001 }; |
993 }; | 1002 }; |
994 | 1003 |
995 | 1004 |
1005 #ifdef TRIPLE | |
1006 switch (flipping) { | |
1007 case 1: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAIT)); | |
1008 break; | |
1009 case 2: DFBCHECK (primary->Flip (primary, NULL, DSFLIP_ONSYNC)); | |
1010 break; | |
1011 default:; // should never reach here | |
1012 } | |
1013 #else | |
996 if (flipping) { | 1014 if (flipping) { |
997 DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC)); | 1015 DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC)); |
998 } | 1016 } |
1017 #endif | |
999 | 1018 |
1000 } | 1019 } |
1001 | 1020 |
1002 | 1021 |
1003 | 1022 |