mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
e6455d7161
commit
a8a98ee6d1
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue