[FFmpeg-devel] [PATCH/RFC] Per-codec option system
Robert Swain
robert.swain
Wed Sep 30 10:03:43 CEST 2009
Hello,
2009/9/29 Ronald S. Bultje <rsbultje at gmail.com>:
> On Tue, Sep 29, 2009 at 2:21 PM, Jason Garrett-Glaser
> <darkshikari at gmail.com> wrote:
>> A very simple implementation of a string option system, with x264
>> completed as an example. ?Not implemented in ffmpeg.c yet.
>
> I privmsg'ed you a way to do at least some of this:
> - add a AOptions*opts at the end of AVCodec, like pix_fmts (can also
> be done in AVMuxer if necessary) and then rename it to AVStuffOption
> - make this an array of, per codec:
>
> AVOption options = {
> ? { "bitrate", TYPE_INT, OFFSET_IN_STRUCT(MyCodecContext, bit_rate), rest },
> ? { ... },
> };
>
> ? ?open_codec,
> ? ?close_codec,
> ? ?encode_frame,
> ? ?&options (or NULL, if none)
> };
>
> This allows setting, help and listing, see libavcodec/opt.h. I don't
> know how to do defaults, I guess you might add a function pointer to
> set defaults like you did or specify a default in the AVOption
> struct...
Jason: This is the approach of which I was thinking. It allows
defaults, ranges, types, help descriptions, etc.
Regards,
Rob
More information about the ffmpeg-devel
mailing list