comparison libvo/vo_xvmc.c @ 17932:3fe3b2b3a6ce

Convert all if(verbose>X) to mp_msg_test calls.
author diego
date Fri, 24 Mar 2006 08:12:03 +0000
parents 717430668496
children d75953576ae4
comparison
equal deleted inserted replaced
17931:ed9950b8200d 17932:3fe3b2b3a6ce
43 #include <assert.h> 43 #include <assert.h>
44 44
45 45
46 #define UNUSED(x) ((void)(x)) 46 #define UNUSED(x) ((void)(x))
47 47
48
49 extern int vo_verbose;
50 48
51 static int benchmark; 49 static int benchmark;
52 static int use_sleep; 50 static int use_sleep;
53 static int first_frame;//draw colorkey on first frame 51 static int first_frame;//draw colorkey on first frame
54 static int use_queue; 52 static int use_queue;
268 int s,mc_surf_num; 266 int s,mc_surf_num;
269 XvMCSurfaceInfo * mc_surf_list; 267 XvMCSurfaceInfo * mc_surf_list;
270 268
271 rez = XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay),&num_adaptors,&ai); 269 rez = XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay),&num_adaptors,&ai);
272 if( rez != Success ) return -1; 270 if( rez != Success ) return -1;
273 if( verbose > 2 ) printf("vo_xvmc: Querying %d adaptors\n",num_adaptors); 271 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
272 printf("vo_xvmc: Querying %d adaptors\n",num_adaptors); }
274 for(i=0; i<num_adaptors; i++) 273 for(i=0; i<num_adaptors; i++)
275 { 274 {
276 if( verbose > 2) printf("vo_xvmc: Quering adaptor #%d\n",i); 275 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
276 printf("vo_xvmc: Quering adaptor #%d\n",i); }
277 if( ai[i].type == 0 ) continue;// we need at least dummy type! 277 if( ai[i].type == 0 ) continue;// we need at least dummy type!
278 //probing ports 278 //probing ports
279 for(p=ai[i].base_id; p<ai[i].base_id+ai[i].num_ports; p++) 279 for(p=ai[i].base_id; p<ai[i].base_id+ai[i].num_ports; p++)
280 { 280 {
281 if( verbose > 2) printf("vo_xvmc: probing port #%ld\n",p); 281 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
282 printf("vo_xvmc: probing port #%ld\n",p); }
282 mc_surf_list = XvMCListSurfaceTypes(mDisplay,p,&mc_surf_num); 283 mc_surf_list = XvMCListSurfaceTypes(mDisplay,p,&mc_surf_num);
283 if( mc_surf_list == NULL || mc_surf_num == 0){ 284 if( mc_surf_list == NULL || mc_surf_num == 0){
284 if( verbose > 2) printf("vo_xvmc: No XvMC supported. \n"); 285 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
286 printf("vo_xvmc: No XvMC supported. \n"); }
285 continue; 287 continue;
286 } 288 }
287 if( verbose > 2) printf("vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num); 289 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
290 printf("vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num); }
288 //we have XvMC list! 291 //we have XvMC list!
289 for(s=0; s<mc_surf_num; s++) 292 for(s=0; s<mc_surf_num; s++)
290 { 293 {
291 if( width > mc_surf_list[s].max_width ) continue; 294 if( width > mc_surf_list[s].max_width ) continue;
292 if( height > mc_surf_list[s].max_height ) continue; 295 if( height > mc_surf_list[s].max_height ) continue;
299 } 302 }
300 303
301 if(!query){ 304 if(!query){
302 rez = XvGrabPort(mDisplay,p,CurrentTime); 305 rez = XvGrabPort(mDisplay,p,CurrentTime);
303 if(rez != Success){ 306 if(rez != Success){
304 if (verbose > 2) printf("vo_xvmc: Fail to grab port %ld\n",p); 307 if ( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
308 printf("vo_xvmc: Fail to grab port %ld\n",p); }
305 continue; 309 continue;
306 } 310 }
307 printf("vo_xvmc: Port %ld grabed\n",p); 311 printf("vo_xvmc: Port %ld grabed\n",p);
308 xv_port = p; 312 xv_port = p;
309 } 313 }
318 322
319 // somebody know cleaner way to escape from 3 internal loops? 323 // somebody know cleaner way to escape from 3 internal loops?
320 surface_found: 324 surface_found:
321 325
322 memcpy(surf_info,&mc_surf_list[s],sizeof(XvMCSurfaceInfo)); 326 memcpy(surf_info,&mc_surf_list[s],sizeof(XvMCSurfaceInfo));
323 if( verbose > 2 || !query) 327 if( mp_msg_test(MSGT_VO,MSGL_DBG3) || !query)
324 printf("vo_xvmc: Found matching surface with id=%X on %ld port at %d adapter\n", 328 printf("vo_xvmc: Found matching surface with id=%X on %ld port at %d adapter\n",
325 mc_surf_list[s].surface_type_id,p,i); 329 mc_surf_list[s].surface_type_id,p,i);
326 return mc_surf_list[s].surface_type_id; 330 return mc_surf_list[s].surface_type_id;
327 } 331 }
328 332
334 // assert(mpi->flags &MP_IMGFLAGS_DRAWBACK); 338 // assert(mpi->flags &MP_IMGFLAGS_DRAWBACK);
335 339
336 rndr = (xvmc_render_state_t*)mpi->priv;//there is copy in plane[2] 340 rndr = (xvmc_render_state_t*)mpi->priv;//there is copy in plane[2]
337 assert( rndr != NULL ); 341 assert( rndr != NULL );
338 assert( rndr->magic == MP_XVMC_RENDER_MAGIC ); 342 assert( rndr->magic == MP_XVMC_RENDER_MAGIC );
339 if( verbose > 3 ) 343 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
340 printf("vo_xvmc: draw_image(show rndr=%p)\n",rndr); 344 printf("vo_xvmc: draw_image(show rndr=%p)\n",rndr);
341 // the surface have passed vf system without been skiped, it will be displayed 345 // the surface have passed vf system without been skiped, it will be displayed
342 rndr->state |= MP_XVMC_STATE_DISPLAY_PENDING; 346 rndr->state |= MP_XVMC_STATE_DISPLAY_PENDING;
343 p_render_surface_to_show = rndr; 347 p_render_surface_to_show = rndr;
344 return VO_TRUE; 348 return VO_TRUE;
498 surface_render[i].mc_type = surface_info.mc_type & (~XVMC_IDCT); 502 surface_render[i].mc_type = surface_info.mc_type & (~XVMC_IDCT);
499 surface_render[i].idct = (surface_info.mc_type & XVMC_IDCT) == XVMC_IDCT; 503 surface_render[i].idct = (surface_info.mc_type & XVMC_IDCT) == XVMC_IDCT;
500 surface_render[i].chroma_format = surface_info.chroma_format; 504 surface_render[i].chroma_format = surface_info.chroma_format;
501 surface_render[i].unsigned_intra = (surface_info.flags & XVMC_INTRA_UNSIGNED) == XVMC_INTRA_UNSIGNED; 505 surface_render[i].unsigned_intra = (surface_info.flags & XVMC_INTRA_UNSIGNED) == XVMC_INTRA_UNSIGNED;
502 surface_render[i].p_surface = &surface_array[i]; 506 surface_render[i].p_surface = &surface_array[i];
503 if( verbose > 3 ) 507 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
504 printf("vo_xvmc: surface[%d] = %p .rndr=%p\n",i,&surface_array[i], &surface_render[i]); 508 printf("vo_xvmc: surface[%d] = %p .rndr=%p\n",i,&surface_array[i], &surface_render[i]);
505 } 509 }
506 number_of_surfaces = i; 510 number_of_surfaces = i;
507 if( number_of_surfaces < 4 ){// +2 I or P and +2 for B (to avoid visible motion drawing) 511 if( number_of_surfaces < 4 ){// +2 I or P and +2 for B (to avoid visible motion drawing)
508 printf("vo_xvmc: Unable to allocate at least 4 Surfaces\n"); 512 printf("vo_xvmc: Unable to allocate at least 4 Surfaces\n");
530 XvImageFormatValues * xvfmv; 534 XvImageFormatValues * xvfmv;
531 xvfmv = XvMCListSubpictureTypes(mDisplay, xv_port, 535 xvfmv = XvMCListSubpictureTypes(mDisplay, xv_port,
532 surface_info.surface_type_id, &num_subpic); 536 surface_info.surface_type_id, &num_subpic);
533 537
534 if(num_subpic != 0 && xvfmv != NULL){ 538 if(num_subpic != 0 && xvfmv != NULL){
535 if(verbose > 3){//Print All subpicture types for debug 539 if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){//Print all subpicture types for debug
536 for(s=0;s<num_subpic;s++) 540 for(s=0;s<num_subpic;s++)
537 print_xvimage_format_values(&xvfmv[s]); 541 print_xvimage_format_values(&xvfmv[s]);
538 } 542 }
539 543
540 for(s=0;s<num_subpic;s++){ 544 for(s=0;s<num_subpic;s++){
811 static void OSD_init(){ 815 static void OSD_init(){
812 unsigned short osd_height, osd_width; 816 unsigned short osd_height, osd_width;
813 int rez; 817 int rez;
814 818
815 if(subpicture_alloc){ 819 if(subpicture_alloc){
816 if(verbose>3) 820 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
817 printf("vo_xvmc: destroying subpicture\n"); 821 printf("vo_xvmc: destroying subpicture\n");
818 XvMCDestroySubpicture(mDisplay,&subpicture); 822 XvMCDestroySubpicture(mDisplay,&subpicture);
819 deallocate_xvimage(); 823 deallocate_xvimage();
820 subpicture_alloc = 0; 824 subpicture_alloc = 0;
821 } 825 }
834 if(osd_height > surface_info.subpicture_max_height) 838 if(osd_height > surface_info.subpicture_max_height)
835 osd_height = surface_info.subpicture_max_height; 839 osd_height = surface_info.subpicture_max_height;
836 if(osd_width == 0 || osd_height == 0) 840 if(osd_width == 0 || osd_height == 0)
837 return;//if called before window size is known 841 return;//if called before window size is known
838 842
839 if(verbose > 3) 843 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
840 printf("vo_xvmc: creating subpicture (%d,%d) format %X\n", 844 printf("vo_xvmc: creating subpicture (%d,%d) format %X\n",
841 osd_width,osd_height,subpicture_info.id); 845 osd_width,osd_height,subpicture_info.id);
842 846
843 rez = XvMCCreateSubpicture(mDisplay,&ctx,&subpicture, 847 rez = XvMCCreateSubpicture(mDisplay,&ctx,&subpicture,
844 osd_width,osd_height,subpicture_info.id); 848 osd_width,osd_height,subpicture_info.id);
845 if(rez != Success){ 849 if(rez != Success){
846 subpicture_mode = NO_SUBPICTURE; 850 subpicture_mode = NO_SUBPICTURE;
847 printf("vo_xvmc: Create Subpicture failed, OSD disabled\n"); 851 printf("vo_xvmc: Create Subpicture failed, OSD disabled\n");
848 return; 852 return;
849 } 853 }
850 if(verbose > 3){ 854 if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){
851 int i; 855 int i;
852 printf("vo_xvmc: Created Subpicture:\n"); 856 printf("vo_xvmc: Created Subpicture:\n");
853 printf(" xvimage_id=0x%X\n",subpicture.xvimage_id); 857 printf(" xvimage_id=0x%X\n",subpicture.xvimage_id);
854 printf(" width=%d\n",subpicture.width); 858 printf(" width=%d\n",subpicture.width);
855 printf(" height=%d\n",subpicture.height); 859 printf(" height=%d\n",subpicture.height);
863 printf("\"\n"); 867 printf("\"\n");
864 } 868 }
865 869
866 //call init for the surface type 870 //call init for the surface type
867 init_osd_fnc();//init palete,clear color etc ... 871 init_osd_fnc();//init palete,clear color etc ...
868 if(verbose > 3) 872 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
869 printf("vo_xvmc: clearing subpicture\n"); 873 printf("vo_xvmc: clearing subpicture\n");
870 clear_osd_fnc(0, 0, subpicture.width, subpicture.height); 874 clear_osd_fnc(0, 0, subpicture.width, subpicture.height);
871 875
872 allocate_xvimage(subpicture.width, subpicture.height, subpicture_info.id); 876 allocate_xvimage(subpicture.width, subpicture.height, subpicture_info.id);
873 subpicture_alloc = 1; 877 subpicture_alloc = 1;
875 879
876 static void draw_osd_IA44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ 880 static void draw_osd_IA44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
877 int ox,oy; 881 int ox,oy;
878 int rez; 882 int rez;
879 883
880 if(verbose > 3) 884 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
881 printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h); 885 printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
882 886
883 for(ox=0; ox<w; ox++){ 887 for(ox=0; ox<w; ox++){
884 for(oy=0; oy<h; oy++){ 888 for(oy=0; oy<h; oy++){
885 xvimage->data[oy*xvimage->width+ox] = (src[oy*stride+ox]>>4) | ((0-srca[oy*stride+ox])&0xf0); 889 xvimage->data[oy*xvimage->width+ox] = (src[oy*stride+ox]>>4) | ((0-srca[oy*stride+ox])&0xf0);
894 } 898 }
895 899
896 static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ 900 static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
897 int ox,oy; 901 int ox,oy;
898 int rez; 902 int rez;
899 if( verbose > 3) 903 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
900 printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h); 904 printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
901 905
902 for(ox=0; ox<w; ox++){ 906 for(ox=0; ox<w; ox++){
903 for(oy=0; oy<h; oy++){ 907 for(oy=0; oy<h; oy++){
904 xvimage->data[oy*xvimage->width+ox] = (src[oy*stride+ox]&0xf0) | (((0-srca[oy*stride+ox])>>4)&0xf); 908 xvimage->data[oy*xvimage->width+ox] = (src[oy*stride+ox]&0xf0) | (((0-srca[oy*stride+ox])>>4)&0xf);
916 xvmc_render_state_t * osd_rndr; 920 xvmc_render_state_t * osd_rndr;
917 int osd_has_changed; 921 int osd_has_changed;
918 int have_osd_to_draw; 922 int have_osd_to_draw;
919 int rez; 923 int rez;
920 924
921 if(verbose > 3) 925 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
922 printf("vo_xvmc: draw_osd ,OSD_mode=%d, surface_to_show=%p\n", 926 printf("vo_xvmc: draw_osd ,OSD_mode=%d, surface_to_show=%p\n",
923 subpicture_mode,p_render_surface_to_show); 927 subpicture_mode,p_render_surface_to_show);
924 928
925 if(subpicture_mode == BLEND_SUBPICTURE || 929 if(subpicture_mode == BLEND_SUBPICTURE ||
926 subpicture_mode == BACKEND_SUBPICTURE ){ 930 subpicture_mode == BACKEND_SUBPICTURE ){
971 p_render_surface_to_show->p_osd_target_surface_render = osd_rndr; 975 p_render_surface_to_show->p_osd_target_surface_render = osd_rndr;
972 976
973 p_render_surface_to_show = osd_rndr; 977 p_render_surface_to_show = osd_rndr;
974 p_render_surface_to_show->state = MP_XVMC_STATE_DISPLAY_PENDING; 978 p_render_surface_to_show->state = MP_XVMC_STATE_DISPLAY_PENDING;
975 979
976 if(verbose > 3) 980 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
977 printf("vo_xvmc:draw_osd: surface_to_show changed to %p\n",osd_rndr); 981 printf("vo_xvmc:draw_osd: surface_to_show changed to %p\n",osd_rndr);
978 }//endof if(BLEND) 982 }//endof if(BLEND)
979 if(subpicture_mode == BACKEND_SUBPICTURE){ 983 if(subpicture_mode == BACKEND_SUBPICTURE){
980 rez = XvMCBlendSubpicture(mDisplay, 984 rez = XvMCBlendSubpicture(mDisplay,
981 p_render_surface_to_show->p_surface, 985 p_render_surface_to_show->p_surface,
1040 1044
1041 static void flip_page(void){ 1045 static void flip_page(void){
1042 int i,cfs; 1046 int i,cfs;
1043 1047
1044 1048
1045 if( verbose > 3 ) 1049 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
1046 printf("vo_xvmc: flip_page show(rndr=%p)\n\n",p_render_surface_to_show); 1050 printf("vo_xvmc: flip_page show(rndr=%p)\n\n",p_render_surface_to_show);
1047 1051
1048 if(p_render_surface_to_show == NULL) return; 1052 if(p_render_surface_to_show == NULL) return;
1049 assert( p_render_surface_to_show->magic == MP_XVMC_RENDER_MAGIC ); 1053 assert( p_render_surface_to_show->magic == MP_XVMC_RENDER_MAGIC );
1050 //fixme assert( p_render_surface_to_show != p_render_surface_visible); 1054 //fixme assert( p_render_surface_to_show != p_render_surface_visible);
1058 if(free_element > 1)//a little voodoo magic 1062 if(free_element > 1)//a little voodoo magic
1059 xvmc_sync_surface(show_queue[0]->p_surface); 1063 xvmc_sync_surface(show_queue[0]->p_surface);
1060 return; 1064 return;
1061 } 1065 }
1062 p_render_surface_to_show=show_queue[0]; 1066 p_render_surface_to_show=show_queue[0];
1063 if(verbose > 4) 1067 if( mp_msg_test(MSGT_VO,MSGL_DBG5) )
1064 printf("vo_xvmc: flip_queue free_element=%d\n",free_element); 1068 printf("vo_xvmc: flip_queue free_element=%d\n",free_element);
1065 free_element--; 1069 free_element--;
1066 for(i=0; i<free_element; i++){ 1070 for(i=0; i<free_element; i++){
1067 show_queue[i] = show_queue[i+1]; 1071 show_queue[i] = show_queue[i+1];
1068 } 1072 }
1126 XvMCDestroySubpicture(mDisplay,&subpicture); 1130 XvMCDestroySubpicture(mDisplay,&subpicture);
1127 deallocate_xvimage(); 1131 deallocate_xvimage();
1128 1132
1129 subpicture_alloc = 0; 1133 subpicture_alloc = 0;
1130 1134
1131 if(verbose > 3) 1135 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
1132 printf("vo_xvmc: subpicture destroyed\n"); 1136 printf("vo_xvmc: subpicture destroyed\n");
1133 } 1137 }
1134 1138
1135 if( number_of_surfaces ){ 1139 if( number_of_surfaces ){
1136 1140
1152 free(surface_render);surface_render=NULL; 1156 free(surface_render);surface_render=NULL;
1153 1157
1154 XvMCDestroyContext(mDisplay,&ctx); 1158 XvMCDestroyContext(mDisplay,&ctx);
1155 number_of_surfaces = 0; 1159 number_of_surfaces = 0;
1156 1160
1157 if(verbose > 3) printf("vo_xvmc: Context sucessfuly freed\n"); 1161 if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
1162 printf("vo_xvmc: Context sucessfuly freed\n"); }
1158 } 1163 }
1159 1164
1160 1165
1161 if( xv_port !=0 ){ 1166 if( xv_port !=0 ){
1162 XvUngrabPort(mDisplay,xv_port,CurrentTime); 1167 XvUngrabPort(mDisplay,xv_port,CurrentTime);
1163 xv_port = 0; 1168 xv_port = 0;
1164 if(verbose > 3) printf("vo_xvmc: xv_port sucessfuly ungrabed\n"); 1169 if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
1170 printf("vo_xvmc: xv_port sucessfuly ungrabed\n"); }
1165 } 1171 }
1166 } 1172 }
1167 1173
1168 static void uninit(void){ 1174 static void uninit(void){
1169 if( verbose > 3 ) printf("vo_xvmc: uninit called\n"); 1175 if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
1176 printf("vo_xvmc: uninit called\n"); }
1170 xvmc_free(); 1177 xvmc_free();
1171 //from vo_xv 1178 //from vo_xv
1172 #ifdef HAVE_XF86VM 1179 #ifdef HAVE_XF86VM
1173 vo_vm_close(mDisplay); 1180 vo_vm_close(mDisplay);
1174 #endif 1181 #endif
1178 static int query_format(uint32_t format){ 1185 static int query_format(uint32_t format){
1179 uint32_t flags; 1186 uint32_t flags;
1180 XvMCSurfaceInfo qsurface_info; 1187 XvMCSurfaceInfo qsurface_info;
1181 int mode_id; 1188 int mode_id;
1182 1189
1183 if(verbose > 3) 1190 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
1184 printf("vo_xvmc: query_format=%X\n",format); 1191 printf("vo_xvmc: query_format=%X\n",format);
1185 1192
1186 if(!IMGFMT_IS_XVMC(format)) return 0;// no caps supported 1193 if(!IMGFMT_IS_XVMC(format)) return 0;// no caps supported
1187 mode_id = xvmc_find_surface_by_format(format, 16, 16, &qsurface_info, 1);//true=1 - quering 1194 mode_id = xvmc_find_surface_by_format(format, 16, 16, &qsurface_info, 1);//true=1 - quering
1188 1195
1202 static int draw_slice(uint8_t *image[], int stride[], 1209 static int draw_slice(uint8_t *image[], int stride[],
1203 int w, int h, int x, int y){ 1210 int w, int h, int x, int y){
1204 xvmc_render_state_t * rndr; 1211 xvmc_render_state_t * rndr;
1205 int rez; 1212 int rez;
1206 1213
1207 if(verbose > 3) 1214 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
1208 printf("vo_xvmc: draw_slice y=%d\n",y); 1215 printf("vo_xvmc: draw_slice y=%d\n",y);
1209 1216
1210 rndr = (xvmc_render_state_t*)image[2];//this is copy of priv-ate 1217 rndr = (xvmc_render_state_t*)image[2];//this is copy of priv-ate
1211 assert( rndr != NULL ); 1218 assert( rndr != NULL );
1212 assert( rndr->magic == MP_XVMC_RENDER_MAGIC ); 1219 assert( rndr->magic == MP_XVMC_RENDER_MAGIC );
1244 testblock->PMV[0][0][0],testblock->PMV[0][0][1]); 1251 testblock->PMV[0][0][0],testblock->PMV[0][0][1]);
1245 } 1252 }
1246 } 1253 }
1247 #endif 1254 #endif
1248 assert(rez==Success); 1255 assert(rez==Success);
1249 if(verbose > 3 ) printf("vo_xvmc: flush surface\n"); 1256 if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) printf("vo_xvmc: flush surface\n");
1250 rez = XvMCFlushSurface(mDisplay, rndr->p_surface); 1257 rez = XvMCFlushSurface(mDisplay, rndr->p_surface);
1251 assert(rez==Success); 1258 assert(rez==Success);
1252 1259
1253 // rndr->start_mv_blocks_num += rndr->filled_mv_blocks_num; 1260 // rndr->start_mv_blocks_num += rndr->filled_mv_blocks_num;
1254 rndr->start_mv_blocks_num = 0; 1261 rndr->start_mv_blocks_num = 0;
1264 static void check_osd_source(xvmc_render_state_t * src_rndr){ 1271 static void check_osd_source(xvmc_render_state_t * src_rndr){
1265 xvmc_render_state_t * osd_rndr; 1272 xvmc_render_state_t * osd_rndr;
1266 int stat; 1273 int stat;
1267 //If this is source surface, check does the OSD rendering is compleate 1274 //If this is source surface, check does the OSD rendering is compleate
1268 if(src_rndr->state & MP_XVMC_STATE_OSD_SOURCE){ 1275 if(src_rndr->state & MP_XVMC_STATE_OSD_SOURCE){
1269 if(verbose > 3) 1276 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
1270 printf("vo_xvmc: OSD surface=%p quering\n",src_rndr); 1277 printf("vo_xvmc: OSD surface=%p quering\n",src_rndr);
1271 osd_rndr = src_rndr->p_osd_target_surface_render; 1278 osd_rndr = src_rndr->p_osd_target_surface_render;
1272 XvMCGetSurfaceStatus(mDisplay, osd_rndr->p_surface, &stat); 1279 XvMCGetSurfaceStatus(mDisplay, osd_rndr->p_surface, &stat);
1273 if(!(stat & XVMC_RENDERING)) 1280 if(!(stat & XVMC_RENDERING))
1274 src_rndr->state &= ~MP_XVMC_STATE_OSD_SOURCE; 1281 src_rndr->state &= ~MP_XVMC_STATE_OSD_SOURCE;
1352 rndr->state = 0; 1359 rndr->state = 0;
1353 rndr->start_mv_blocks_num = 0; 1360 rndr->start_mv_blocks_num = 0;
1354 rndr->filled_mv_blocks_num = 0; 1361 rndr->filled_mv_blocks_num = 0;
1355 rndr->next_free_data_block_num = 0; 1362 rndr->next_free_data_block_num = 0;
1356 1363
1357 if( verbose > 3 ) 1364 if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
1358 printf("vo_xvmc: get_image: rndr=%p (surface=%p) \n", 1365 printf("vo_xvmc: get_image: rndr=%p (surface=%p) \n",
1359 rndr,rndr->p_surface); 1366 rndr,rndr->p_surface);
1360 return VO_TRUE; 1367 return VO_TRUE;
1361 } 1368 }
1362 1369