mirror of https://github.com/mpv-player/mpv
added support for I420 input (used by TV V4L) in lavc encoder
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3765 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
de19e1eb66
commit
77e6669a09
10
mencoder.c
10
mencoder.c
|
@ -883,7 +883,7 @@ case VCODEC_LIBAVCODEC:
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
if (out_fmt != IMGFMT_YV12)
|
if (out_fmt != IMGFMT_YV12 && out_fmt != IMGFMT_I420)
|
||||||
{
|
{
|
||||||
printf("Not supported image format! (%s)\n",
|
printf("Not supported image format! (%s)\n",
|
||||||
vo_format_name(out_fmt));
|
vo_format_name(out_fmt));
|
||||||
|
@ -896,8 +896,16 @@ case VCODEC_LIBAVCODEC:
|
||||||
int size = lavc_venc_context.width * lavc_venc_context.height;
|
int size = lavc_venc_context.width * lavc_venc_context.height;
|
||||||
|
|
||||||
/* Y */ lavc_venc_picture.data[0] = vo_image_ptr;
|
/* Y */ lavc_venc_picture.data[0] = vo_image_ptr;
|
||||||
|
if (out_fmt == IMGFMT_YV12)
|
||||||
|
{
|
||||||
/* U */ lavc_venc_picture.data[2] = lavc_venc_picture.data[0] + size;
|
/* U */ lavc_venc_picture.data[2] = lavc_venc_picture.data[0] + size;
|
||||||
/* V */ lavc_venc_picture.data[1] = lavc_venc_picture.data[2] + size/4;
|
/* V */ lavc_venc_picture.data[1] = lavc_venc_picture.data[2] + size/4;
|
||||||
|
}
|
||||||
|
else /* IMGFMT_I420 */
|
||||||
|
{
|
||||||
|
/* U */ lavc_venc_picture.data[1] = lavc_venc_picture.data[0] + size;
|
||||||
|
/* V */ lavc_venc_picture.data[2] = lavc_venc_picture.data[1] + size/4;
|
||||||
|
}
|
||||||
lavc_venc_picture.linesize[0] = lavc_venc_context.width;
|
lavc_venc_picture.linesize[0] = lavc_venc_context.width;
|
||||||
lavc_venc_picture.linesize[1] = lavc_venc_context.width / 2;
|
lavc_venc_picture.linesize[1] = lavc_venc_context.width / 2;
|
||||||
lavc_venc_picture.linesize[2] = lavc_venc_context.width / 2;
|
lavc_venc_picture.linesize[2] = lavc_venc_context.width / 2;
|
||||||
|
|
Loading…
Reference in New Issue