Mercurial > mplayer.hg
comparison libvo/vo_xv.c @ 6307:72c87b2ec779
added panscan support for xmga/xvidix
author | pontscho |
---|---|
date | Wed, 05 Jun 2002 19:35:54 +0000 |
parents | ee65527096c2 |
children | da2dda48b7ec |
comparison
equal
deleted
inserted
replaced
6306:786ab42c10be | 6307:72c87b2ec779 |
---|---|
91 | 91 |
92 static uint32_t image_width; | 92 static uint32_t image_width; |
93 static uint32_t image_height; | 93 static uint32_t image_height; |
94 static uint32_t image_format; | 94 static uint32_t image_format; |
95 static int flip_flag; | 95 static int flip_flag; |
96 | |
97 static int panscan_x; | |
98 static int panscan_y; | |
99 static float panscan_amount; | |
100 | 96 |
101 static Window mRoot; | 97 static Window mRoot; |
102 static uint32_t drwX,drwY,drwBorderWidth,drwDepth; | 98 static uint32_t drwX,drwY,drwBorderWidth,drwDepth; |
103 static uint32_t dwidth,dheight; | 99 static uint32_t dwidth,dheight; |
104 | 100 |
336 unsigned int modeline_width, modeline_height; | 332 unsigned int modeline_width, modeline_height; |
337 static uint32_t vm_width; | 333 static uint32_t vm_width; |
338 static uint32_t vm_height; | 334 static uint32_t vm_height; |
339 #endif | 335 #endif |
340 | 336 |
341 panscan_x = 0; | 337 panscan_init(); |
342 panscan_y = 0; | |
343 panscan_amount = 0.0f; | |
344 | 338 |
345 aspect_save_orig(width,height); | 339 aspect_save_orig(width,height); |
346 aspect_save_prescale(d_width,d_height); | 340 aspect_save_prescale(d_width,d_height); |
347 | 341 |
348 image_height = height; | 342 image_height = height; |
602 static void draw_osd(void) | 596 static void draw_osd(void) |
603 { vo_draw_text(image_width,image_height,draw_alpha_fnc);} | 597 { vo_draw_text(image_width,image_height,draw_alpha_fnc);} |
604 | 598 |
605 static void flip_page(void) | 599 static void flip_page(void) |
606 { | 600 { |
607 if((vo_fs && (vo_panscan != panscan_amount)) || (!vo_fs && panscan_amount)) | |
608 { | |
609 int panscan_area = (vo_screenheight-vo_dheight); | |
610 | |
611 panscan_amount = vo_fs ? vo_panscan : 0; | |
612 | |
613 panscan_x = panscan_area * panscan_amount * (image_width / (float)image_height); | |
614 panscan_y = panscan_area * panscan_amount; | |
615 | |
616 XClearWindow(mDisplay, vo_window); | |
617 XFlush(mDisplay); | |
618 } | |
619 | 601 |
620 if ( Shmem_Flag ) | 602 if ( Shmem_Flag ) |
621 { | 603 { |
622 XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], | 604 XvShmPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], |
623 0, 0, image_width, image_height, | 605 0, 0, image_width, image_height, |
624 drwX-(panscan_x>>1),drwY-(panscan_y>>1),vo_dwidth+panscan_x,(vo_fs?vo_dheight - 1:vo_dheight)+panscan_y, | 606 drwX-(vo_panscan_x>>1),drwY-(vo_panscan_y>>1),vo_dwidth+vo_panscan_x,(vo_fs?vo_dheight - 1:vo_dheight)+vo_panscan_y, |
625 False); | 607 False); |
626 } | 608 } |
627 else | 609 else |
628 { | 610 { |
629 XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], | 611 XvPutImage(mDisplay, xv_port, vo_window, vo_gc, xvimage[current_buf], |
630 0, 0, image_width, image_height, | 612 0, 0, image_width, image_height, |
631 drwX-(panscan_x>>1),drwY-(panscan_y>>1),vo_dwidth+panscan_x,(vo_fs?vo_dheight - 1:vo_dheight)+panscan_y); | 613 drwX-(vo_panscan_x>>1),drwY-(vo_panscan_y>>1),vo_dwidth+vo_panscan_x,(vo_fs?vo_dheight - 1:vo_dheight)+vo_panscan_y); |
632 } | 614 } |
633 if (num_buffers>1){ | 615 if (num_buffers>1){ |
634 current_buf=(current_buf+1)%num_buffers; | 616 current_buf=(current_buf+1)%num_buffers; |
635 XFlush(mDisplay); | 617 XFlush(mDisplay); |
636 } else | 618 } else |
872 case VOCTRL_GET_IMAGE: | 854 case VOCTRL_GET_IMAGE: |
873 return get_image(data); | 855 return get_image(data); |
874 case VOCTRL_FULLSCREEN: | 856 case VOCTRL_FULLSCREEN: |
875 vo_x11_fullscreen(); | 857 vo_x11_fullscreen(); |
876 return VO_TRUE; | 858 return VO_TRUE; |
859 case VOCTRL_GUISUPPORT: | |
860 return VO_TRUE; | |
861 case VOCTRL_GET_PANSCAN: | |
862 return VO_TRUE; | |
863 case VOCTRL_SET_PANSCAN: | |
864 | |
865 // if((vo_fs && (vo_panscan != vo_panscan_amount)) || (!vo_fs && vo_panscan_amount)) | |
866 if ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) | |
867 { | |
868 panscan_calc(); | |
869 XClearWindow(mDisplay, vo_window); | |
870 XFlush(mDisplay); | |
871 } | |
872 return VO_TRUE; | |
877 } | 873 } |
878 return VO_NOTIMPL; | 874 return VO_NOTIMPL; |
879 } | 875 } |