diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-24 18:13:54 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-24 18:13:54 +0000 |
commit | d60b420eae5fb9f2447a08233b0b51e0373e9ddf (patch) | |
tree | a303ed5e2402fb782ab0ca768e979348f9ae1c91 /libvo | |
parent | 39cf06f62fe4664f9c2a0135b6d6e838b81aae75 (diff) | |
download | mpv-d60b420eae5fb9f2447a08233b0b51e0373e9ddf.tar.bz2 mpv-d60b420eae5fb9f2447a08233b0b51e0373e9ddf.tar.xz |
added support for i420 and iyuv
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4341 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/vo_x11.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 5ce49c65a4..5048321283 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -170,7 +170,7 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24; XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo ); - if( flags&0x04 && format==IMGFMT_YV12 ) { + if( flags&0x04 && (format==IMGFMT_YV12 || format==IMGFMT_I420 || format==IMGFMT_IYUV)) { // software scale if(fullscreen){ image_width=vo_screenwidth; @@ -424,7 +424,8 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d // return -1; } - if( format==IMGFMT_YV12 ) yuv2rgb_init( ( depth == 24 ) ? bpp : depth,mode ); + if((format == IMGFMT_YV12) || (format == IMGFMT_I420) || (format == IMGFMT_IYUV)) + yuv2rgb_init( ( depth == 24 ) ? bpp : depth,mode ); #ifdef HAVE_NEW_GUI if ( vo_window == None ) @@ -486,10 +487,19 @@ static void flip_page( void ){ static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y ) { - + /* hack: swap planes for I420 ;) -- alex */ + if ((image_format == IMGFMT_IYUV) || (image_format == IMGFMT_I420)) + { + uint8_t *src_i420[3]; + + src_i420[0] = src[0]; + src_i420[1] = src[2]; + src_i420[2] = src[1]; + src = src_i420; + } if(scale_srcW){ uint8_t *dst[3] = {ImageData, NULL, NULL}; - SwScale_YV12slice(src,stride,y,h, + SwScale_YV12slice(src,stride,y,h, dst, image_width*((bpp+7)/8), ( depth == 24 ) ? bpp : depth, scale_srcW, scale_srcH, image_width, image_height); } else { @@ -570,6 +580,8 @@ static uint32_t query_format( uint32_t format ) switch( format ) { + case IMGFMT_I420: + case IMGFMT_IYUV: case IMGFMT_YV12: return 1; } return 0; |