[FFmpeg-devel] [PATCH 1/6] lavfi/buffersink: add accessors for the stream properties.
James Almer
jamrial at gmail.com
Fri Dec 23 18:52:44 EET 2016
On 12/23/2016 11:31 AM, Nicolas George wrote:
> L'octidi 28 frimaire, an CCXXV, Nicolas George a écrit :
>> +AVRational av_buffersink_get_frame_rate (const AVFilterContext *ctx);
>> +int av_buffersink_get_w (const AVFilterContext *ctx);
>> +int av_buffersink_get_h (const AVFilterContext *ctx);
>> +AVRational av_buffersink_get_sample_aspect_ratio (const AVFilterContext *ctx);
>
> So, I ask this of everybody who care: what API do you prefer?
>
> This one, i.e.:
>
> encoder->width = av_buffersink_get_w(sink);
> encoder->height = av_buffersink_get_h(sink);
> encoder->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(sink);
>
> Or one with a single access to all the properties:
>
> const AVBufferSinkProperties *fmt = av_buffersink_get_properties(sink);
> encoder->width = fmt->w;
> encoder->height = fmt->h;
> encoder->sample_aspect_ratio = fmt->sample_aspect_ratio;
>
> Regards,
I very much prefer the latter. Only one symbol, a (hopefully) easily
extensible struct if needed, etc.
More information about the ffmpeg-devel
mailing list