diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-26 13:32:00 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-26 13:32:00 +0000 |
commit | 77e6669a09d753b5a962fa2b40d20b03c1c2c7bb (patch) | |
tree | 355db4b045c9c06883a8e1217cb06378137aa482 /mencoder.c | |
parent | de19e1eb6696c04bce28d23a12c6f74c09a2ed90 (diff) | |
download | mpv-77e6669a09d753b5a962fa2b40d20b03c1c2c7bb.tar.bz2 mpv-77e6669a09d753b5a962fa2b40d20b03c1c2c7bb.tar.xz |
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
Diffstat (limited to 'mencoder.c')
-rw-r--r-- | mencoder.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/mencoder.c b/mencoder.c index c3a4029c43..efbb064437 100644 --- a/mencoder.c +++ b/mencoder.c @@ -883,7 +883,7 @@ case VCODEC_LIBAVCODEC: } #if 1 - if (out_fmt != IMGFMT_YV12) + if (out_fmt != IMGFMT_YV12 && out_fmt != IMGFMT_I420) { printf("Not supported image format! (%s)\n", vo_format_name(out_fmt)); @@ -896,8 +896,16 @@ case VCODEC_LIBAVCODEC: int size = lavc_venc_context.width * lavc_venc_context.height; /* Y */ lavc_venc_picture.data[0] = vo_image_ptr; -/* 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; + if (out_fmt == IMGFMT_YV12) + { +/* 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[1] = lavc_venc_context.width / 2; lavc_venc_picture.linesize[2] = lavc_venc_context.width / 2; |