[MPlayer-cvslog] r25210 - in trunk: etc/codecs.conf libmpcodecs/vd_raw.c

reimar subversion at mplayerhq.hu
Fri Nov 30 12:31:31 CET 2007


Author: reimar
Date: Fri Nov 30 12:31:31 2007
New Revision: 25210

Log:
Add support for Apple's yuv2 raw format


Modified:
   trunk/etc/codecs.conf
   trunk/libmpcodecs/vd_raw.c

Modified: trunk/etc/codecs.conf
==============================================================================
--- trunk/etc/codecs.conf	(original)
+++ trunk/etc/codecs.conf	Fri Nov 30 12:31:31 2007
@@ -2213,6 +2213,15 @@ videocodec rawyuy2
   fourcc yuy2,YUY2
   out YUY2
 
+videocodec rawyuv2
+  info "RAW YUV2"
+  status working
+  driver raw
+  format 0x0 0x32565559
+  format 0x20776172 0x32565559
+  fourcc yuv2,YUV2
+  out YUY2
+
 videocodec rawuyvy
   info "RAW UYVY"
   status working

Modified: trunk/libmpcodecs/vd_raw.c
==============================================================================
--- trunk/libmpcodecs/vd_raw.c	(original)
+++ trunk/libmpcodecs/vd_raw.c	Fri Nov 30 12:31:31 2007
@@ -22,6 +22,7 @@ static int control(sh_video_t *sh,int cm
     switch(cmd){
     case VDCTRL_QUERY_FORMAT:
 	if (*(int *)arg == format) return CONTROL_TRUE;
+	if (*(int *)arg == IMGFMT_YUY2 && format == MKTAG('y', 'u', 'v', '2')) return CONTROL_TRUE;
 	return CONTROL_FALSE;
     }
     return CONTROL_UNKNOWN;
@@ -57,6 +58,7 @@ static void uninit(sh_video_t *sh){
 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
     mp_image_t* mpi;
     int frame_size;
+    int format = sh->bih ? sh->bih->biCompression : sh->format;
     
     if(len<=0) return NULL; // skipped frame
 
@@ -104,6 +106,11 @@ static mp_image_t* decode(sh_video_t *sh
 #endif
 	}
 	frame_size=mpi->stride[0]*mpi->h;
+	if (format == MKTAG('y', 'u', 'v', '2')) {
+	  int i;
+	  for (i = 1; i < frame_size; i += 2)
+	    mpi->planes[0][i] ^= 128;
+	}
 	if(mpi->bpp<8) frame_size=frame_size*mpi->bpp/8;
     }
 



More information about the MPlayer-cvslog mailing list