|
libvdo
|
A memory buffer. More...
#include "vdo-frame.h"

Go to the source code of this file.
Functions | |
| VdoBuffer * | vdo_buffer_new (gint fd, gsize capacity, guint64 offset, gpointer opaque) |
| Create a buffer which is owned by an external framework. More... | |
| VdoBuffer * | vdo_buffer_new_full (gint fd, gsize capacity, guint64 offset, gpointer opaque, VdoMap *settings) |
| Create a buffer with custom buffer properties. More... | |
| guint32 | vdo_buffer_get_id (VdoBuffer *self) |
| Return an id representing the VdoBuffer. More... | |
| gint | vdo_buffer_get_fd (VdoBuffer *self) |
| Return a file descriptor representing the VdoBuffer. More... | |
| gint64 | vdo_buffer_get_offset (VdoBuffer *self) |
| Return file offset to the VdoBuffer. More... | |
| gsize | vdo_buffer_get_capacity (VdoBuffer *self) |
| Returns the entire buffer capacity of the VdoBuffer. More... | |
| gboolean | vdo_buffer_is_complete (VdoBuffer *self) |
| Indicates whether the TemporalUnit is complete after this frame. More... | |
| gboolean | vdo_buffer_is_contiguous (VdoBuffer *self) |
| Indicates whether the buffer is contiguous or sparse. More... | |
| gpointer | vdo_buffer_get_opaque (VdoBuffer *self) |
| Get a pointer to an opaque, containing user provided custom information. More... | |
| gpointer | vdo_buffer_get_data (VdoBuffer *self) |
| Return a pointer to the underlying buffer. More... | |
| VdoFrame * | vdo_buffer_get_frame (VdoBuffer *self) |
| Return a pointer to the underlying frame. More... | |
A memory buffer.
Copyright (C) 2018-2025, Axis Communications AB, Lund
| gsize vdo_buffer_get_capacity | ( | VdoBuffer * | self | ) |
Returns the entire buffer capacity of the VdoBuffer.
For alignment purposes the buffer may be larger than requested.
| self | A VdoBuffer. |
| gpointer vdo_buffer_get_data | ( | VdoBuffer * | self | ) |
Return a pointer to the underlying buffer.
Beware this pointer is only valid for as long as the VdoBuffer itself is valid.
The layout of the data depends on the VdoFormat and VdoFrameType. For H.26x this is always Annex B with long start-code 0x00000001.
For example a single VdoBuffer with format VDO_FRAME_TYPE_H265_IDR might contain [NAL_VPS][NAL_SPS][NAL_PPS][IDR-Slice].
In the above example vdo_frame_get_header_size is the byte offset to the IDR-Slice.
| self | A VdoBuffer. |
| gint vdo_buffer_get_fd | ( | VdoBuffer * | self | ) |
Return a file descriptor representing the VdoBuffer.
| self | A VdoBuffer. |
| VdoFrame* vdo_buffer_get_frame | ( | VdoBuffer * | self | ) |
Return a pointer to the underlying frame.
Beware this pointer is only valid for as long as the VdoBuffer itself is valid.
| self | A VdoBuffer, or NULL. |
| guint32 vdo_buffer_get_id | ( | VdoBuffer * | self | ) |
Return an id representing the VdoBuffer.
The id is not guaranteed to be globally unique.
| self | A VdoBuffer. |
| gint64 vdo_buffer_get_offset | ( | VdoBuffer * | self | ) |
Return file offset to the VdoBuffer.
| self | A VdoBuffer. |
| gpointer vdo_buffer_get_opaque | ( | VdoBuffer * | self | ) |
Get a pointer to an opaque, containing user provided custom information.
The opaque pointer has no predefined meaning inside the vdo framework itself, it is meant to facilitate interoperability with other existing frameworks as well as caching the buffer data pointer(see vdo_buffer_get_data).
| self | A VdoBuffer. |
| gboolean vdo_buffer_is_complete | ( | VdoBuffer * | self | ) |
Indicates whether the TemporalUnit is complete after this frame.
This is only relevant for AV1 as other formats are complete.
| self | A VdoBuffer. |
| gboolean vdo_buffer_is_contiguous | ( | VdoBuffer * | self | ) |
Indicates whether the buffer is contiguous or sparse.
By default all buffers are contiguous unless the stream option "frame.chunks" is true, enabling chunks is necessary for zero-copy on some platforms.
Contiguous buffers have trivial layout (■■■). They can be accessed with vdo_buffer_get_data().
Sparse buffers are spread over multiple chunks with gaps in between (■□■□■). They must be accessed with vdo_frame_take_chunk() or vdo_frame_take_chunk_ex().
| self | A VdoBuffer. |
| VdoBuffer* vdo_buffer_new | ( | gint | fd, |
| gsize | capacity, | ||
| guint64 | offset, | ||
| gpointer | opaque | ||
| ) |
Create a buffer which is owned by an external framework.
Default: VDO_BUFFER_ACCESS_CPU_RD (suitable for normal consumers) The fd will not be closed by g_object_unref.
| fd | A mmap compatible file descriptor |
| capacity | The buffer capacity |
| offset | The offset to the start of the buffer |
| opaque | The opaque custom information associated with the buffer |
| VdoBuffer* vdo_buffer_new_full | ( | gint | fd, |
| gsize | capacity, | ||
| guint64 | offset, | ||
| gpointer | opaque, | ||
| VdoMap * | settings | ||
| ) |
Create a buffer with custom buffer properties.
Default: VDO_BUFFER_ACCESS_ANY_RW (suitable for producers) The fd will not be closed by g_object_unref.
| fd | A mmap compatible file descriptor |
| capacity | The buffer capacity |
| offset | The offset to the start of the buffer |
| opaque | The opaque custom information associated with the buffer |
| settings | Override default buffer properties such as VdoBufferAccess |