[FFmpeg-devel] [PATCH 001/279] Add a new channel layout API

Nicolas George george at nsup.org
Tue Dec 14 14:53:55 EET 2021


James Almer (12021-12-14):
> You could attach it dynamically allocated strings too, and to prevent the
> need for the module allocating them to outlive the layout, we could add an
> opaque pointer to AVChannelLayout (not AVChannelCustom) and a user set
> free() call back to pass that pointer to, on uninit().

So you want to shift the responsibility to worry about pointer lifetime
and ownership to the API user. Sure, we can do that. We can always shift
responsibility to API users, but that is not very nice to them.

I think the best solution would be to make this new structure
ref-counted.

Remember that I proposed a template to make ref-counted structures
easily:
https://ffmpeg.org/pipermail/ffmpeg-devel/2020-June/265227.html
(Notice that it was soon after the first version of this API was posted:
I was thinking of it already then.)

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/20211214/a449233b/attachment.sig>


More information about the ffmpeg-devel mailing list