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:
alex 2001-12-26 13:32:00 +00:00
parent de19e1eb66
commit 77e6669a09
1 changed files with 11 additions and 3 deletions

View File

@ -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;
/* U */ lavc_venc_picture.data[2] = lavc_venc_picture.data[0] + size; if (out_fmt == IMGFMT_YV12)
/* V */ lavc_venc_picture.data[1] = lavc_venc_picture.data[2] + size/4; {
/* 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;
}
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;