[FFmpeg-devel] Moving enum AVFieldOrder to libavutil?

Hendrik Leppkes h.leppkes at gmail.com
Sat Mar 24 02:32:54 EET 2018

On Sat, Mar 24, 2018 at 1:07 AM, Marton Balint <cus at passwd.hu> wrote:
> On Fri, 23 Mar 2018, Devin Heitmueller wrote:
>> Hello,
>> I am in the process of reworking libavfilter to pass along the field order
>> across links.  For the moment I followed the model found in AVFrame where
>> there are two int fields: “interlaced_frame” and “top_field_first”.  However
>> it seems like it would be more appropriate to use the enum AVFieldOrder,
>> which is a single field and provides more flexibility (including being able
>> to be set to “unknown” if appropriate).
>> Does anyone have an objection to moving the definition of AVFieldOrder to
>> libavutil, so it can be taken advantage of by libavfilter?  Right now it’s
>> in libavcodec, and from what I understand libavfilter does not depend on
>> libavcodec.
> AVFieldOrder is already a mess, so I would not use that directly. There was
> a discussion why it is currently inconsistent between codecs:
> https://patchwork.ffmpeg.org/patch/4699/
> Maybe cleaner to introduce a new enum which defines the semantics better.
> Also, as far as I understand, an AVFrame is always storing the fields as
> interleaved, so strictly speaking an AVFrame (AVFilter) field order and
> AVCodecParameters field order is not entirely the same thing, that is one
> more reasone for a separate (new) type.

AVFrame can already indicate this. Since fields are always
interleaved, all you need is the "interlaced_frame" and
"top_field_first" elements which already exists as part of AVFrame.
Not sure why we need another method to replace this.

- Hendrik

More information about the ffmpeg-devel mailing list