avutil/buffer: add av_buffer_pool_buffer_get_opaque
In order to access the original opaque parameter of a buffer in the buffer pool. (The buffer pool implementation overrides the normal opaque parameter but also saves it so it is accessible). v2: add assertion check before dereferencing the BufferPoolEntry. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@@ -284,6 +284,19 @@ void av_buffer_pool_uninit(AVBufferPool **pool);
|
||||
*/
|
||||
AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);
|
||||
|
||||
/**
|
||||
* Query the original opaque parameter of an allocated buffer in the pool.
|
||||
*
|
||||
* @param ref a buffer reference to a buffer returned by av_buffer_pool_get.
|
||||
* @return the opaque parameter set by the buffer allocator function of the
|
||||
* buffer pool.
|
||||
*
|
||||
* @note the opaque parameter of ref is used by the buffer pool implementation,
|
||||
* therefore you have to use this function to access the original opaque
|
||||
* parameter of an allocated buffer.
|
||||
*/
|
||||
void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user