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

reimar subversion at mplayerhq.hu
Mon Apr 5 09:15:22 CEST 2010


Author: reimar
Date: Mon Apr  5 09:15:22 2010
New Revision: 31014

Log:
Implement VOCTRL_DRAW_IMAGE instead of the deprecated draw_frame, avoiding
an extra memcpy in case of stride mismatch.

Modified:
   trunk/libvo/vo_corevideo.m

Modified: trunk/libvo/vo_corevideo.m
==============================================================================
--- trunk/libvo/vo_corevideo.m	Sun Apr  4 21:56:26 2010	(r31013)
+++ trunk/libvo/vo_corevideo.m	Mon Apr  5 09:15:22 2010	(r31014)
@@ -287,17 +287,12 @@ static int draw_slice(uint8_t *src[], in
 
 static int draw_frame(uint8_t *src[])
 {
-	switch (image_format)
-	{
-		case IMGFMT_BGR32:
-		case IMGFMT_RGB32:
-			fast_memcpy(image_data, src[0], image_width*image_height*image_bytes);
-			break;
+	return 0;
+}
 
-		case IMGFMT_YUY2:
-			memcpy_pic(image_data, src[0], image_width * 2, image_height, image_width * 2, image_width * 2);
-			break;
-	}
+static uint32_t draw_image(mp_image_t *mpi)
+{
+	memcpy_pic(image_data, mpi->planes[0], image_width*image_bytes, image_height, image_width*image_bytes, mpi->stride[0]);
 
 	return 0;
 }
@@ -405,6 +400,7 @@ static int control(uint32_t request, voi
 {
 	switch (request)
 	{
+		case VOCTRL_DRAW_IMAGE: return draw_image(data);
 		case VOCTRL_PAUSE: return int_pause = 1;
 		case VOCTRL_RESUME: return int_pause = 0;
 		case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data));


More information about the MPlayer-cvslog mailing list