[FFmpeg-devel] [PATCH v3 11/18] swscale: expose SwsContext publicly

Niklas Haas ffmpeg at haasn.xyz
Thu Oct 24 12:28:16 EEST 2024


On Thu, 24 Oct 2024 11:14:32 +0200 Anton Khirnov <anton at khirnov.net> wrote:
> Quoting Niklas Haas (2024-10-20 22:05:20)
> > +/**
> > + * Main external API structure. New fields can be added to the end with
> > + * minor version bumps. Removal, reordering and changes to existing fields
> > + * require a major version bump. sizeof(SwsContext) is not part of the ABI.
> > + */
> > +typedef struct SwsContext {
> > +    const AVClass *av_class;
> > +
> > +    /**
> > +     * Private context used for internal data.
> > +     */
> > +    struct SwsInternal *internal;
>
> Why is this visible in the public context?

I was following the precedent established by AVCodecContext.

If you prefer, I could instead allocate SwsInternal as a superset of
SwsContext. That would actually make a lot of the code changes a bit cleaner
to implement, and avoids some pointer dereferencing.


More information about the ffmpeg-devel mailing list