comparison libvo/vo_x11.c @ 5945:f9fe22a52e80

fix aspect ratio handling
author pontscho
date Fri, 03 May 2002 13:12:46 +0000
parents 5074aa8fae5a
children caac20b1ca79
comparison
equal deleted inserted replaced
5944:1faf2566907b 5945:f9fe22a52e80
248 248
249 in_format=format; 249 in_format=format;
250 if(in_format==IMGFMT_I420 || in_format==IMGFMT_IYUV) in_format=IMGFMT_YV12; 250 if(in_format==IMGFMT_I420 || in_format==IMGFMT_IYUV) in_format=IMGFMT_YV12;
251 srcW= width; 251 srcW= width;
252 srcH= height; 252 srcH= height;
253 vo_dwidth=width; vo_dheight=height;
253 254
254 if( flags&0x03 ) fullscreen = 1; 255 if( flags&0x03 ) fullscreen = 1;
255 if( flags&0x02 ) vm = 1; 256 if( flags&0x02 ) vm = 1;
256 if( flags&0x08 ) Flip_Flag = 1; 257 if( flags&0x08 ) Flip_Flag = 1;
257 zoomFlag = flags&0x04; 258 zoomFlag = flags&0x04;
620 if( !vo_init() ) return -1; // Can't open X11 621 if( !vo_init() ) return -1; // Can't open X11
621 622
622 return 0; 623 return 0;
623 } 624 }
624 625
625 #if 0
626 /* for runtime fullscreen switching */
627 static int vo_fs_oldx = -1;
628 static int vo_fs_oldy = -1;
629 static int vo_fs_oldwidth = -1;
630 static int vo_fs_oldheight = -1;
631 #endif
632
633 static uint32_t control(uint32_t request, void *data, ...) 626 static uint32_t control(uint32_t request, void *data, ...)
634 { 627 {
635 switch (request) { 628 switch (request) {
636 case VOCTRL_QUERY_FORMAT: 629 case VOCTRL_QUERY_FORMAT:
637 return query_format(*((uint32_t*)data)); 630 return query_format(*((uint32_t*)data));
639 return VO_TRUE; 632 return VO_TRUE;
640 case VOCTRL_GET_IMAGE: 633 case VOCTRL_GET_IMAGE:
641 return get_image(data); 634 return get_image(data);
642 case VOCTRL_FULLSCREEN: 635 case VOCTRL_FULLSCREEN:
643 vo_x11_fullscreen(); 636 vo_x11_fullscreen();
644 /*
645 if ((vo_fs_oldwidth == -1) && (vo_fs_oldheight == -1))
646 {
647 int foo;
648 Window root;
649
650 #ifdef LOCAL_LOOKUP
651 XGetGeometry(mDisplay, vo_window, &root, &foo, &foo,
652 &vo_fs_oldwidth, &vo_fs_oldheight, &foo, &foo);
653
654 XTranslateCoordinates(mDisplay, vo_window, root, 0, 0,
655 &vo_fs_oldx, &vo_fs_oldy,(Window *) &foo);
656 #else
657 vo_fs_oldwidth = vo_dwidth;
658 vo_fs_oldheight = vo_dheight;
659 vo_fs_oldx = vo_dx;
660 vo_fs_oldy = vo_dy;
661 #endif
662
663 mp_msg(MSGT_VO,MSGL_V,"X11 Fullscreen: saved old place: %dx%d-%dx%d\n",
664 vo_fs_oldx, vo_fs_oldy, vo_fs_oldwidth, vo_fs_oldheight);
665
666 // resize
667 vo_dwidth = vo_screenwidth;
668 vo_dheight = vo_screenheight;
669 vo_x11_decoration( mDisplay,vo_window,0 );
670 XMoveResizeWindow(mDisplay, vo_window, 0, 0,
671 vo_screenwidth, vo_screenheight);
672 XSync(mDisplay, False);
673 }
674 else
675 {
676 vo_x11_decoration( mDisplay,vo_window,1 );
677 XMoveResizeWindow(mDisplay, vo_window, vo_fs_oldx, vo_fs_oldy,
678 vo_fs_oldwidth, vo_fs_oldheight);
679
680
681 #ifdef LOCAL_LOOKUP
682 // restore
683 vo_dwidth = vo_fs_oldwidth;
684 vo_dheight = vo_fs_oldheight;
685 #endif
686
687 // clean
688 vo_fs_oldwidth = -1;
689 vo_fs_oldheight = -1;
690 XSync(mDisplay, False);
691 }
692 */
693 return VO_TRUE; 637 return VO_TRUE;
694 } 638 }
695 return VO_NOTIMPL; 639 return VO_NOTIMPL;
696 } 640 }