avutil/buffer: constify some function parameters

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2021-09-17 00:06:45 -03:00
parent f58abfbedc
commit ccfdef79b1
4 changed files with 11 additions and 7 deletions

View File

@ -14,6 +14,10 @@ libavutil: 2021-04-27
API changes, most recent first:
2021-09-17 - xxxxxxxxxx - lavu 57.5.101 - buffer.h
Constified the input parameters in av_buffer_replace(), av_buffer_ref(),
and av_buffer_pool_buffer_get_opaque().
2021-09-08 - xxxxxxxxxx - lavu 57.5.100 - hwcontext_d3d11va.h
Add AVD3D11VAFramesContext.texture_infos

View File

@ -90,7 +90,7 @@ AVBufferRef *av_buffer_allocz(size_t size)
return ret;
}
AVBufferRef *av_buffer_ref(AVBufferRef *buf)
AVBufferRef *av_buffer_ref(const AVBufferRef *buf)
{
AVBufferRef *ret = av_mallocz(sizeof(*ret));
@ -216,7 +216,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, size_t size)
return 0;
}
int av_buffer_replace(AVBufferRef **pdst, AVBufferRef *src)
int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
{
AVBufferRef *dst = *pdst;
AVBufferRef *tmp;
@ -395,7 +395,7 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool)
return ret;
}
void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref)
void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref)
{
BufferPoolEntry *buf = ref->buffer->opaque;
av_assert0(buf);

View File

@ -145,7 +145,7 @@ void av_buffer_default_free(void *opaque, uint8_t *data);
* @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on
* failure.
*/
AVBufferRef *av_buffer_ref(AVBufferRef *buf);
AVBufferRef *av_buffer_ref(const AVBufferRef *buf);
/**
* Free a given reference and automatically free the buffer if there are no more
@ -212,7 +212,7 @@ int av_buffer_realloc(AVBufferRef **buf, size_t size);
* @return 0 on success
* AVERROR(ENOMEM) on memory allocation failure.
*/
int av_buffer_replace(AVBufferRef **dst, AVBufferRef *src);
int av_buffer_replace(AVBufferRef **dst, const AVBufferRef *src);
/**
* @}
@ -313,7 +313,7 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);
* 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);
void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref);
/**
* @}

View File

@ -80,7 +80,7 @@
#define LIBAVUTIL_VERSION_MAJOR 57
#define LIBAVUTIL_VERSION_MINOR 5
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \