[FFmpeg-devel] [PATCH v6 1/5] avformat: Add av_stream_add_coded_side_data()

Anton Khirnov anton at khirnov.net
Tue Jan 14 21:39:10 EET 2020


Quoting Gaullier Nicolas (2020-01-13 23:16:44)
> >If the intention is to use this code from avformat_find_stream_info(),
> >then why should it be public? The documentation is very unclear as to
> >when/how an API user is supposed to call it.
> >
> >Anton Khirnov
> 
> Sorry about that, I should have explained this in the cover letter, or maybe even in the commit msg.
> The reason is that this code already exists in ffmpeg.c (executed in case of non-codec copy if I remember correctly)
> and now I need it to be shared and used in avformat_find_stream_info also (for probing in general, and for codec copy in particular) to avoid code duplication.
> The fact is that initially, I had regrouped all this refactoring in a single commit, thus resulting in a clear full picture but it was not correct to mix libav and fftools changes, so I split the commit but an explanation was lacking, I missed that, sorry.
> I propose to describe this in the commit msg, this should be enough as the code/usage itself already exists in ffmpeg.c so maybe it is not necessary to add public documentation.

The issue here is that adding a public function is kind of a big deal,
since once it's there it's hard to change or remove it. It's not
something to be done lightly.
So every new public API function must have a well-defined purpose and
use case. Since this function is not all that well-defined, and also
very small and simple I think it's better to just duplicate it.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list