[FFmpeg-devel] [PATCH 3/4] mxfenc: write optional field dominance flag in picture description
Tomas Härdin
tomas.hardin at codemill.se
Thu May 31 13:42:42 CEST 2012
On Sun, 2012-05-27 at 14:21 +0200, Matthieu Bouron wrote:
> ---
> $title
> ---
> libavformat/mxfenc.c | 15 ++++++++++++++-
> tests/ref/lavf/mxf | 6 +++---
> tests/ref/lavf/mxf_d10 | 2 +-
> 3 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 1d11bae..fce8446 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -73,6 +73,7 @@ typedef struct {
> const UID *codec_ul;
> int order; ///< interleaving order if dts are equal
> int interlaced; ///< whether picture is interlaced
> + int field_dominance; ///< tff=1, bff=2
Wasn't there a plan to add this information to AVCodecContext?
top_field_first IIRC.
> @@ -790,8 +792,11 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
> int stored_height = (st->codec->height+15)/16*16;
> int display_height;
> int f1, f2;
> + unsigned desc_size = size+8+8+8+8+8+8+5+16+sc->interlaced*4+12+20;
> + if (sc->interlaced && sc->field_dominance)
> + desc_size += 5;
>
> - mxf_write_generic_desc(s, st, key, size+8+8+8+8+8+8+5+16+sc->interlaced*4+12+20);
> + mxf_write_generic_desc(s, st, key, desc_size);
Looks correct.
Just noting that I think this could be reworked to use the "write
everything, then update the length" approach that movenc uses.
/Tomas
More information about the ffmpeg-devel
mailing list