[MPlayer-cvslog] r31016 - trunk/libvo/vo_corevideo.m

reimar subversion at mplayerhq.hu
Mon Apr 5 15:11:07 CEST 2010


Author: reimar
Date: Mon Apr  5 15:11:06 2010
New Revision: 31016

Log:
Fix RGB support for corevideo: corevideo can only support
ARGB and BGRA, which depending on endianness matches only one
of RGB32 and BGR32.
Also add RGB24 support which works independent of endianness,

Modified:
   trunk/libvo/vo_corevideo.m

Modified: trunk/libvo/vo_corevideo.m
==============================================================================
--- trunk/libvo/vo_corevideo.m	Mon Apr  5 09:22:21 2010	(r31015)
+++ trunk/libvo/vo_corevideo.m	Mon Apr  5 15:11:06 2010	(r31016)
@@ -104,8 +104,11 @@ static void draw_alpha(int x0, int y0, i
 {
 	switch (image_format)
 	{
-		case IMGFMT_BGR32:
-		case IMGFMT_RGB32:
+		case IMGFMT_RGB24:
+			vo_draw_alpha_rgb24(w,h,src,srca,stride,image_data+3*(y0*image_width+x0),3*image_width);
+			break;
+		case IMGFMT_ARGB:
+		case IMGFMT_BGRA:
 			vo_draw_alpha_rgb32(w,h,src,srca,stride,image_data+4*(y0*image_width+x0),4*image_width);
 			break;
 		case IMGFMT_YUY2:
@@ -171,8 +174,11 @@ static int config(uint32_t width, uint32
 	image_height = height;
 	switch (image_format)
 	{
-		case IMGFMT_BGR32:
-		case IMGFMT_RGB32:
+		case IMGFMT_RGB24:
+			image_depth = 24;
+			break;
+		case IMGFMT_ARGB:
+		case IMGFMT_BGRA:
 			image_depth = 32;
 			break;
 		case IMGFMT_YUY2:
@@ -300,18 +306,26 @@ static uint32_t draw_image(mp_image_t *m
 
 static int query_format(uint32_t format)
 {
+    const int supportflags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN;
 	image_format = format;
 
     switch(format)
 	{
 		case IMGFMT_YUY2:
 			pixelFormat = kYUVSPixelFormat;
-			return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN;
+			return supportflags;
 
-		case IMGFMT_RGB32:
-		case IMGFMT_BGR32:
+		case IMGFMT_RGB24:
+			pixelFormat = k24RGBPixelFormat;
+			return supportflags;
+
+		case IMGFMT_ARGB:
 			pixelFormat = k32ARGBPixelFormat;
-			return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_OSD | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN;
+			return supportflags;
+
+		case IMGFMT_BGRA:
+			pixelFormat = k32BGRAPixelFormat;
+			return supportflags;
     }
     return 0;
 }


More information about the MPlayer-cvslog mailing list