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) |
Returns an id representing the VdoBuffer . More... | |
gint | vdo_buffer_get_fd (VdoBuffer *self) |
Returns a file descriptor representing the VdoBuffer . More... | |
gint64 | vdo_buffer_get_offset (VdoBuffer *self) |
Returns 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 buffer is complete or not. More... | |
gpointer | vdo_buffer_get_opaque (VdoBuffer *self) |
Opaque pointers contain user provided custom information. More... | |
gpointer | vdo_buffer_get_data (VdoBuffer *self) |
Returns a pointer to the underlying buffer. More... | |
VdoFrame * | vdo_buffer_get_frame (VdoBuffer *self) |
Returns a pointer to the underlying frame. More... | |
A memory buffer.
Copyright (C) 2018-2019, 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 | ) |
Returns a pointer to the underlying buffer.
Beware this pointer is only valid for as long as the VdoBuffer itself is valid.
self | A VdoBuffer. |
NULL
if allocation failed. gint vdo_buffer_get_fd | ( | VdoBuffer * | self | ) |
Returns a file descriptor representing the VdoBuffer
.
self | A VdoBuffer. |
VdoFrame* vdo_buffer_get_frame | ( | VdoBuffer * | self | ) |
Returns 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 |
NULL
if self
was NULL
guint32 vdo_buffer_get_id | ( | VdoBuffer * | self | ) |
Returns an id representing the VdoBuffer
.
The id is not guaranteed to be globally unique.
self | A VdoBuffer. |
gint64 vdo_buffer_get_offset | ( | VdoBuffer * | self | ) |
Returns file offset to the VdoBuffer
.
self | A VdoBuffer. |
gpointer vdo_buffer_get_opaque | ( | VdoBuffer * | self | ) |
Opaque pointers contain 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 buffer is complete or not.
As the size of compressed objects is not known in advance they may have to span multiple buffers. As soon as an entire object has arrived it will be indicated by TRUE
.
self | A VdoBuffer. |
TRUE
means complete, FALSE
means incomplete 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 |
g_object_unref()
. 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 |
g_object_unref()
.