summaryrefslogtreecommitdiff
path: root/media/ffvpx/libavutil/buffer_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'media/ffvpx/libavutil/buffer_internal.h')
-rw-r--r--media/ffvpx/libavutil/buffer_internal.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/media/ffvpx/libavutil/buffer_internal.h b/media/ffvpx/libavutil/buffer_internal.h
index 54b67047e5..adb916aaa2 100644
--- a/media/ffvpx/libavutil/buffer_internal.h
+++ b/media/ffvpx/libavutil/buffer_internal.h
@@ -26,17 +26,18 @@
#include "thread.h"
/**
- * The buffer is always treated as read-only.
+ * The buffer was av_realloc()ed, so it is reallocatable.
*/
-#define BUFFER_FLAG_READONLY (1 << 0)
+#define BUFFER_FLAG_REALLOCATABLE (1 << 0)
/**
- * The buffer was av_realloc()ed, so it is reallocatable.
+ * The AVBuffer structure is part of a larger structure
+ * and should not be freed.
*/
-#define BUFFER_FLAG_REALLOCATABLE (1 << 1)
+#define BUFFER_FLAG_NO_FREE (1 << 1)
struct AVBuffer {
uint8_t *data; /**< data described by this buffer */
- int size; /**< size of data in bytes */
+ size_t size; /**< size of data in bytes */
/**
* number of existing AVBufferRef instances referring to this buffer
@@ -54,9 +55,14 @@ struct AVBuffer {
void *opaque;
/**
- * A combination of BUFFER_FLAG_*
+ * A combination of AV_BUFFER_FLAG_*
*/
int flags;
+
+ /**
+ * A combination of BUFFER_FLAG_*
+ */
+ int flags_internal;
};
typedef struct BufferPoolEntry {
@@ -71,6 +77,12 @@ typedef struct BufferPoolEntry {
AVBufferPool *pool;
struct BufferPoolEntry *next;
+
+ /*
+ * An AVBuffer structure to (re)use as AVBuffer for subsequent uses
+ * of this BufferPoolEntry.
+ */
+ AVBuffer buffer;
} BufferPoolEntry;
struct AVBufferPool {
@@ -88,10 +100,10 @@ struct AVBufferPool {
*/
atomic_uint refcount;
- int size;
+ size_t size;
void *opaque;
- AVBufferRef* (*alloc)(int size);
- AVBufferRef* (*alloc2)(void *opaque, int size);
+ AVBufferRef* (*alloc)(size_t size);
+ AVBufferRef* (*alloc2)(void *opaque, size_t size);
void (*pool_free)(void *opaque);
};