comparison libvo/vo_xvmc.c @ 15060:30289c5f3cc6

fix blackscreen when changing panscan.
author iive
date Thu, 07 Apr 2005 16:59:34 +0000
parents 76d461a061df
children 1d3ba9fb75cd
comparison
equal deleted inserted replaced
15059:0453cea5be15 15060:30289c5f3cc6
994 } 994 }
995 995
996 XvMCSyncSurface(mDisplay, srf); 996 XvMCSyncSurface(mDisplay, srf);
997 } 997 }
998 998
999 static void flip_page(void){ 999 static void put_xvmc_image(xvmc_render_state_t * p_render_surface){
1000 int rez; 1000 int rez;
1001 int clipX,clipY,clipW,clipH; 1001 int clipX,clipY,clipW,clipH;
1002 int i,cfs; 1002
1003 if(p_render_surface == NULL)
1004 return;
1003 1005
1004 clipX = drwX-(vo_panscan_x>>1); 1006 clipX = drwX-(vo_panscan_x>>1);
1005 clipY = drwY-(vo_panscan_y>>1); 1007 clipY = drwY-(vo_panscan_y>>1);
1006 clipW = vo_dwidth+vo_panscan_x; 1008 clipW = vo_dwidth+vo_panscan_x;
1007 clipH = vo_dheight+vo_panscan_y; 1009 clipH = vo_dheight+vo_panscan_y;
1010
1011 rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
1012 vo_window,
1013 0, 0, image_width, image_height,
1014 clipX, clipY, clipW, clipH,
1015 3);//p_render_surface_to_show->display_flags);
1016 if(rez != Success){
1017 printf("vo_xvmc: PutSurface failer, critical error!\n");
1018 assert(0);
1019 }
1020 }
1021
1022 static void flip_page(void){
1023 int i,cfs;
1024
1008 1025
1009 if( verbose > 3 ) 1026 if( verbose > 3 )
1010 printf("vo_xvmc: flip_page show(rndr=%p)\n\n",p_render_surface_to_show); 1027 printf("vo_xvmc: flip_page show(rndr=%p)\n\n",p_render_surface_to_show);
1011 1028
1012 if(p_render_surface_to_show == NULL) return; 1029 if(p_render_surface_to_show == NULL) return;
1042 1059
1043 //!!fixme assert(p_render_surface_to_show->state & MP_XVMC_STATE_DISPLAY_PENDING); 1060 //!!fixme assert(p_render_surface_to_show->state & MP_XVMC_STATE_DISPLAY_PENDING);
1044 1061
1045 //show it, displaying is always vsynced, so skip it for benchmark 1062 //show it, displaying is always vsynced, so skip it for benchmark
1046 if(!benchmark){ 1063 if(!benchmark){
1047 rez = XvMCPutSurface(mDisplay, p_render_surface_to_show->p_surface, 1064 put_xvmc_image(p_render_surface_to_show);
1048 vo_window,
1049 0, 0, image_width, image_height,
1050 clipX, clipY, clipW, clipH,
1051 3);//p_render_surface_to_show->display_flags);
1052 if(rez != Success){
1053 printf("vo_xvmc: PutSurface failer, critical error!\n");
1054 assert(0);
1055 }
1056 } 1065 }
1057 1066
1058 p_render_surface_visible = p_render_surface_to_show; 1067 p_render_surface_visible = p_render_surface_to_show;
1059 p_render_surface_to_show = NULL; 1068 p_render_surface_to_show = NULL;
1060 } 1069 }
1087 } 1096 }
1088 } 1097 }
1089 if ( e & VO_EVENT_EXPOSE ) 1098 if ( e & VO_EVENT_EXPOSE )
1090 { 1099 {
1091 vo_xv_draw_colorkey(drwX,drwY,vo_dwidth,vo_dheight); 1100 vo_xv_draw_colorkey(drwX,drwY,vo_dwidth,vo_dheight);
1092 if(p_render_surface_visible != NULL) 1101 put_xvmc_image(p_render_surface_visible);
1093 XvMCPutSurface(mDisplay, p_render_surface_visible->p_surface,vo_window,
1094 0, 0, image_width, image_height,
1095 drwX,drwY,vo_dwidth,vo_dheight,
1096 3);//,p_render_surface_visible->display_flags);!!
1097 } 1102 }
1098 } 1103 }
1099 1104
1100 static void xvmc_free(void){ 1105 static void xvmc_free(void){
1101 int i; 1106 int i;
1363 int old_y = vo_panscan_y; 1368 int old_y = vo_panscan_y;
1364 panscan_calc(); 1369 panscan_calc();
1365 1370
1366 if(old_y != vo_panscan_y) 1371 if(old_y != vo_panscan_y)
1367 { 1372 {
1368 XClearWindow(mDisplay, vo_window); 1373 vo_x11_clearwindow_part(mDisplay, vo_window,
1369 XFlush(mDisplay); 1374 vo_dwidth + vo_panscan_x - 1,
1375 vo_dheight + vo_panscan_y - 1,
1376 1);
1377 put_xvmc_image(p_render_surface_visible);
1370 } 1378 }
1371 } 1379 }
1372 return VO_TRUE; 1380 return VO_TRUE;
1373 1381
1374 case VOCTRL_SET_EQUALIZER: 1382 case VOCTRL_SET_EQUALIZER: