# HG changeset patch # User gpoirier # Date 1155887708 0 # Node ID d4ab276e5987c799cead2fa48627cf2ef261c988 # Parent 2194398c2c0f813dd489ec9319747d60a2d94c0d Add YV12 support, patch by Steve Lhomme % steve P lhomme A free P fr % Original thread: Date: Aug 17, 2006 5:45 PM Subject: Re: [Ffmpeg-devel] [PATCH] AVISynth support diff -r 2194398c2c0f -r d4ab276e5987 raw.c --- a/raw.c Thu Aug 17 16:32:08 2006 +0000 +++ b/raw.c Fri Aug 18 07:55:08 2006 +0000 @@ -38,6 +38,7 @@ const PixelFormatTag pixelFormatTags[] = { { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') }, + { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') }, { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') }, { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') }, { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') }, @@ -141,6 +142,15 @@ } flip(avctx, picture); + + if (avctx->codec_tag == MKTAG('Y', 'V', '1', '2')) + { + // swap fields + unsigned char *tmp = picture->data[1]; + picture->data[1] = picture->data[2]; + picture->data[2] = tmp; + } + *data_size = sizeof(AVPicture); return buf_size; }