comparison libvo/vo_xv.c @ 9161:cedace61d1ad

-fixed-vo vs. panscan vs. 'f' vs. -fs fix patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
author arpi
date Wed, 29 Jan 2003 20:25:01 +0000
parents e59cda3414b6
children 8e91f0734b96
comparison
equal deleted inserted replaced
9160:2a67f587c792 9161:cedace61d1ad
383 XMapWindow(mDisplay, vo_window); 383 XMapWindow(mDisplay, vo_window);
384 if ( flags&1 ) vo_x11_fullscreen(); 384 if ( flags&1 ) vo_x11_fullscreen();
385 #ifdef HAVE_XINERAMA 385 #ifdef HAVE_XINERAMA
386 vo_x11_xinerama_move(mDisplay,vo_window); 386 vo_x11_xinerama_move(mDisplay,vo_window);
387 #endif 387 #endif
388 } else 388 vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
389 if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height ); 389 } else {
390 390 // vo_fs set means we were already at fullscreen
391 vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 ); 391 vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
392 if ( !vo_fs ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
393 if ( flags&1 && !vo_fs ) vo_x11_fullscreen(); // handle -fs on non-first file
394 }
395
396 // vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
397
398 printf("\n!!!!!! %d;%d %dx%d \n",hint.x,hint.y,hint.width,hint.height);
392 399
393 if ( vo_gc != None ) XFreeGC( mDisplay,vo_gc ); 400 if ( vo_gc != None ) XFreeGC( mDisplay,vo_gc );
394 vo_gc = XCreateGC(mDisplay, vo_window, 0L, &xgcv); 401 vo_gc = XCreateGC(mDisplay, vo_window, 0L, &xgcv);
395 XFlush(mDisplay); 402 XFlush(mDisplay);
396 XSync(mDisplay, False); 403 XSync(mDisplay, False);
432 #if 0 439 #if 0
433 set_gamma_correction(); 440 set_gamma_correction();
434 #endif 441 #endif
435 442
436 aspect(&vo_dwidth,&vo_dheight,A_NOZOOM); 443 aspect(&vo_dwidth,&vo_dheight,A_NOZOOM);
437 if ( ( flags&1 )&&( WinID <= 0 ) ) 444 if ( (( flags&1 )&&( WinID <= 0 )) || vo_fs )
438 { 445 {
439 aspect(&vo_dwidth,&vo_dheight,A_ZOOM); 446 aspect(&vo_dwidth,&vo_dheight,A_ZOOM);
440 drwX=( vo_screenwidth - (vo_dwidth > vo_screenwidth?vo_screenwidth:vo_dwidth) ) / 2; 447 drwX=( vo_screenwidth - (vo_dwidth > vo_screenwidth?vo_screenwidth:vo_dwidth) ) / 2;
441 drwY=( vo_screenheight - (vo_dheight > vo_screenheight?vo_screenheight:vo_dheight) ) / 2; 448 drwY=( vo_screenheight - (vo_dheight > vo_screenheight?vo_screenheight:vo_dheight) ) / 2;
442 vo_dwidth=(vo_dwidth > vo_screenwidth?vo_screenwidth:vo_dwidth); 449 vo_dwidth=(vo_dwidth > vo_screenwidth?vo_screenwidth:vo_dwidth);
443 vo_dheight=(vo_dheight > vo_screenheight?vo_screenheight:vo_dheight); 450 vo_dheight=(vo_dheight > vo_screenheight?vo_screenheight:vo_dheight);
444 mp_msg(MSGT_VO,MSGL_V, "[xv-fs] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight ); 451 mp_msg(MSGT_VO,MSGL_V, "[xv-fs] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
445 } 452 }
446 453
447 panscan_calc(); 454 panscan_calc();
455 XClearWindow(mDisplay, vo_window);
456 #ifdef HAVE_SHM
457 if ( Shmem_Flag )
458 {
459 XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX, drwY, 1, 1, False);
460 XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX,drwY,vo_dwidth,(vo_fs?vo_dheight - 1:vo_dheight), False);
461 }
462 else
463 #endif
464 {
465 XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX, drwY, 1, 1);
466 XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], 0, 0, image_width, image_height, drwX,drwY,vo_dwidth,(vo_fs?vo_dheight - 1:vo_dheight));
467 }
448 468
449 mp_msg(MSGT_VO,MSGL_V, "[xv] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight ); 469 mp_msg(MSGT_VO,MSGL_V, "[xv] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
450 470
451 saver_off(mDisplay); // turning off screen saver 471 saver_off(mDisplay); // turning off screen saver
452 return 0; 472 return 0;