Modify release_picture_callback to take a picture instead of a data pointer
Note that this is an API/ABI breaking change and I expect some pushback :)
release_picture_callback
is awkward to use in its current form. It provides the raw buf
pointer, which might be meaningless to the allocator (e.g. if the allocator didn't use data[0]
to store the primary pointer, or if the allocator allocated multiple buffers). Also, the API documentation doesn't document how this buf
pointer is derived (which could be fixed with a doc change, but I find this approach preferable).
I find the allocator API easier to use and understand (as a user of dav1d) if alloc_picture_callback
and release_picture_callback
both have the same API (picture in, picture out). This makes fewer assumptions about how the allocators work, which I think is a good thing.