History

avutil/buffer: constify some function parameters

James Almer committed 5 years ago

Commit ccfdef71 parent f58abfb4 files · +11 −7Browse files

Unified · Split

4 files
  1. doc/APIchanges +4 −0
  2. libavutil/buffer.c +3 −3
  3. libavutil/buffer.h +3 −3
  4. libavutil/version.h +1 −1
doc/APIchanges+4−0
@@ -14,6 +14,10 @@ libavutil: 2021-04-27 · 13 unmodified lines
1414
1515 API changes, most recent first:
1616
17+2021-09-17 - xxxxxxxxxx - lavu 57.5.101 - buffer.h
18+ Constified the input parameters in av_buffer_replace(), av_buffer_ref(),
19+ and av_buffer_pool_buffer_get_opaque().
20+
1721 2021-09-08 - xxxxxxxxxx - lavu 57.5.100 - hwcontext_d3d11va.h
1822 Add AVD3D11VAFramesContext.texture_infos
1923
libavutil/buffer.c+3−3
@@ -90,7 +90,7 @@ AVBufferRef *av_buffer_allocz(size_t size) · 89 unmodified lines
9090 return ret;
9191 }
9292
93−AVBufferRef *av_buffer_ref(AVBufferRef *buf)
93+AVBufferRef *av_buffer_ref(const AVBufferRef *buf)
9494 {
9595 AVBufferRef *ret = av_mallocz(sizeof(*ret));
9696
@@ -216,7 +216,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, size_t size) · 119 unmodified lines
216216 return 0;
217217 }
218218
219−int av_buffer_replace(AVBufferRef **pdst, AVBufferRef *src)
219+int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
220220 {
221221 AVBufferRef *dst = *pdst;
222222 AVBufferRef *tmp;
@@ -395,7 +395,7 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool) · 172 unmodified lines
395395 return ret;
396396 }
397397
398−void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref)
398+void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref)
399399 {
400400 BufferPoolEntry *buf = ref->buffer->opaque;
401401 av_assert0(buf);
libavutil/buffer.h+3−3
@@ -145,7 +145,7 @@ void av_buffer_default_free(void *opaque, uint8_t *data); · 144 unmodified lines
145145 * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on
146146 * failure.
147147 */
148−AVBufferRef *av_buffer_ref(AVBufferRef *buf);
148+AVBufferRef *av_buffer_ref(const AVBufferRef *buf);
149149
150150 /**
151151 * 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); · 60 unmodified lines
212212 * @return 0 on success
213213 * AVERROR(ENOMEM) on memory allocation failure.
214214 */
215−int av_buffer_replace(AVBufferRef **dst, AVBufferRef *src);
215+int av_buffer_replace(AVBufferRef **dst, const AVBufferRef *src);
216216
217217 /**
218218 * @}
@@ -313,7 +313,7 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool); · 94 unmodified lines
313313 * therefore you have to use this function to access the original opaque
314314 * parameter of an allocated buffer.
315315 */
316−void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref);
316+void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref);
317317
318318 /**
319319 * @}
libavutil/version.h+1−1
@@ -80,7 +80,7 @@ · 79 unmodified lines
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 57
8282 #define LIBAVUTIL_VERSION_MINOR 5
83−#define LIBAVUTIL_VERSION_MICRO 100
83+#define LIBAVUTIL_VERSION_MICRO 101
8484
8585 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
8686 LIBAVUTIL_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t