[FFmpeg-devel] [PATCH 10/10] avfilter/avfilter: Hide most internal AVFilterLink fields

Nicolas George george at nsup.org
Wed Aug 11 11:31:08 EEST 2021


Andreas Rheinhardt (12021-08-11):
> AVFilterLink does not have a separate structure for its internal fields.
> Instead these fields are in the public avfilter.h header together with
> a typical public/private separation line. But because one of these
> fields (not a pointer) has a non-public type, they are #ifdef'ed away
> and need to be made visible by a magic define. This is very ugly.
> 
> This commit changes this: Most of these internal fields are moved to
> a new structure which also contains the public AVFilterLink as its first
> member, so that they can be allocated together. The fields that have
> been moved are those for which most uses happen in the libavfilter core
> and not in the filters themselves. The latter will be dealt with later.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
> I have not found a truely good way of moving the other fields without
> using filterlink() everywhere; I try to concentrate this as much as
> possible in libavfilter's core files (as opposed to the actual filters).

I oppose this. It makes more code and requires filter developers to
remember which fields are public and which fields are private. I wrote
it the way it is precisely to avoid these two drawbacks.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210811/66f5bc66/attachment.sig>


More information about the ffmpeg-devel mailing list