[FFmpeg-devel] [PATCH 05/10] avformat/nutenc: Create put_* functions by macro

Michael Niedermayer michael at niedermayer.cc
Sat May 9 20:06:38 EEST 2020


On Sat, May 09, 2020 at 06:04:13AM +0200, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > On Mon, May 04, 2020 at 08:22:45PM +0200, Andreas Rheinhardt wrote:
> >> It allows to add analogous functions using e.g. the bytestream API
> >> instead of using an AVIOContext.
> >>
> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> >> ---
> >>  libavformat/nutenc.c | 49 ++++++++++++++++++++++++--------------------
> >>  1 file changed, 27 insertions(+), 22 deletions(-)
> > 
> > It certainly is possible to use macros to make the put functions work
> > with 2 unrelated APIs.
> > But pretty it is not, why do we need 2 APIs ?
> > 
> This is done in preparation for patch 6/10 [1] that separates the
> several variable-length elements that precede the main content (or in
> case of the syncpoint structure: that is the complete content). By
> putting them in a separate buffer one can eliminate one level of dynamic
> buffers. And given that these little buffers are naturally given as
> buffers, using the bytestream API seems the easiest and nicest way.
> 
> While one could of course achieve the same by wrapping these little
> buffers in an AVIOContext via ffio_init_context(), I don't consider this
> pretty.

I was hoping that my mildly stupid question would lead to some prettier
solution. 
as that failed, teh patch is ok

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200509/9c779bf2/attachment.sig>


More information about the ffmpeg-devel mailing list