[FFmpeg-devel] [PATCH v4 7/7] lavc/bsf: make BSF iteration the same as other iterators

Josh de Kock josh at itanimul.li
Sun Feb 4 23:21:45 EET 2018

On Sun, Feb 04, 2018 at 02:46:09PM +0100, Nicolas George wrote:
> Muhammad Faiz (2018-02-04):
> > What about av*iterate(int index)?

This makes no sense, it's then not an API for iteration of components.

> I like the idea of an index better than the other options evoked,
> especially the linked-list-like APIs. It is also more similar to the
> APIs for enumerated types.

If we were to add in APIs which allowed you to register external components
again, this idea wouldn't work well as indexes wouldn't necessarily correspond
to the component which it previously did after you register extra components.

The main benefit of the opaque pointers is the flexibility of how components
are stored/represented internally, and being able to change/extend it with
no API changes (only additions). Sure there is the question of 'how efficient
is it?', but it's not really a relevant question considering how frequently
the iteration functions are called (not much relative to other parts of the
library where efficiency is more crucial).

> Another option would be to return the whole list in a mallocated array,
> in a single call.

When has exposing more internals ever ended up going well?

More information about the ffmpeg-devel mailing list