summaryrefslogtreecommitdiffstats
path: root/libvo/vo_corevideo.m
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-05 07:15:22 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-04-05 07:15:22 +0000
commita8a98ee6d12e41d47d03ddf27ad402b30fd2544b (patch)
tree28daff56071597e9f359bd5d16b9382d8250b411 /libvo/vo_corevideo.m
parente6455d7161ebc8245cec46492b6aca0773170312 (diff)
downloadmpv-a8a98ee6d12e41d47d03ddf27ad402b30fd2544b.tar.bz2
mpv-a8a98ee6d12e41d47d03ddf27ad402b30fd2544b.tar.xz
Implement VOCTRL_DRAW_IMAGE instead of the deprecated draw_frame, avoiding
an extra memcpy in case of stride mismatch. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31014 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_corevideo.m')
-rw-r--r--libvo/vo_corevideo.m16
1 files changed, 6 insertions, 10 deletions
diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m
index 6a62a08ef6..1e16366225 100644
--- a/libvo/vo_corevideo.m
+++ b/libvo/vo_corevideo.m
@@ -287,17 +287,12 @@ static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
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, void *data, ...)
{
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));