13#if AVCPP_CXX_STANDARD >= 20
97 const uint8_t*
data() const noexcept;
111#if AVCPP_CXX_STANDARD >= 20
116 std::span<const uint8_t>
span() const noexcept;
174 BufferRef(uint8_t *
data,
size_t size,
void (*free)(
void *opaque, uint8_t *
data),
void *opaque,
int flags = 0) noexcept;
187 BufferRef(const uint8_t *
data,
size_t size,
void (*free)(
void *opaque, uint8_t *
data),
void *opaque,
int flags = 0) noexcept;
200#if AVCPP_CXX_STANDARD >= 20
210 BufferRef(std::span<uint8_t>
data,
void (*free)(
void *opaque, uint8_t *
data),
void *opaque,
int flags = 0) noexcept;
282 using BufferRefView::
ref;
Error codes, error categories and the OptionalErrorCode convention.
void null_deleter(void *, uint8_t *)
Buffer deleter that do nothing.
BufferRefView()=default
Construct null buffer.
int refCount() const noexcept
Report current reference counter of the buffer.
std::size_t size() const noexcept
Nested buffer size.
BufferRef ref()
Create reference to the view data, refCount() will be increased.
AVBufferRef * makeRef(iam_sure_what_i_do_tag) const noexcept
Make an reference of the exsting buffer.
bool isWritable() const noexcept
Report writable flag.
const uint8_t * data() const noexcept
Pointer to the data block start.
BufferRefView(const BufferRef &ref)
View an owning buffer, read-only.
std::span< const uint8_t > constSpan() const noexcept
Force request const span.
std::span< const uint8_t > span() const noexcept
Span interface to obtain nested buffer data.
const uint8_t * constData() const noexcept
Force request const data.
BufferRefView(BufferRef &ref)
View an owning buffer.
BufferRef clone(int flags=0) const noexcept
Make deep copy of the existing buffer.
Light weight wrapper for the FFmpeg AVBufferRef functionality.
Definition buffer.h:136
static BufferRef wrap(const AVBufferRef *buf, int flags=0) noexcept
Wrap constant raw buffer reference.
BufferRef(BufferRef &&other) noexcept
Just move owning of the nested AVBufferRef pointer into new instance.
BufferRef()=default
Construct null buffer.
void makeWritable(OptionalErrorCode ec=throws())
Make buffer writable.
~BufferRef() noexcept
Unref nested AVBufferRef.
BufferRef(std::size_t size, bool keepUninit=true) noexcept
Allocate referenced buffer with given size.
void resize(std::size_t size, OptionalErrorCode ec=throws())
Resize given buffer.
static BufferRef ref(const AVBufferRef *buf) noexcept
Reference non-const buffer reference and wrap it.
void swap(BufferRef &other) noexcept
Swap nested data with other.
BufferRef(const BufferRef &other) noexcept
Make a buffer reference.
void reset() noexcept
Force to unref nested data.
AVBufferRef * release() noexcept
Release owning of the buffer and return existing raw AVBufferRef.
BufferRef(std::span< uint8_t > data, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags=0) noexcept
Same to BufferRef(data, size, free, opaque, flags) but pass data via std::span() interface.
Carries the caller's choice between exceptions and error codes.
Definition averror.h:96
FFmpeg types re-exported for the public API and small value wrappers.
Root namespace of the library.
Definition audioresampler.h:19
OptionalErrorCode throws()
Helper to construct null OptionalErrorCode object.
Definition averror.h:310
Tag to confirm usage of the Low Level functionality.
Definition buffer.h:57