#include <stdatomic.h>
#include <stdint.h>
+#include "internal.h"
#include "buffer.h"
#include "thread.h"
-/**
- * The buffer is always treated as read-only.
- */
-#define BUFFER_FLAG_READONLY (1 << 0)
/**
* The buffer was av_realloc()ed, so it is reallocatable.
*/
-#define BUFFER_FLAG_REALLOCATABLE (1 << 1)
+#define BUFFER_FLAG_REALLOCATABLE (1 << 0)
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
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 {
*/
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);
};