AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
AJABuffer Class Reference

#include <buffer.h>

Public Member Functions

 AJABuffer ()
 
virtual ~AJABuffer ()
 
AJAStatus AttachBuffer (uint8_t *pBuffer, size_t size)
 
AJAStatus AllocateBuffer (size_t size, size_t alignment=0, char *pName=NULL)
 
AJAStatus FreeBuffer ()
 
uint8_t * GetBuffer ()
 
uint32_t * GetUINT32Buffer ()
 
size_t GetBufferSize ()
 
size_t GetBufferAlignment ()
 
const char * GetBufferName ()
 
AJAStatus SetDataOffset (size_t offset)
 
size_t GetDataOffset ()
 
AJAStatus SetDataSize (size_t size)
 
size_t GetDataSize ()
 
uint8_t * GetData ()
 

Detailed Description

Class that represents a memory buffer.

Definition at line 16 of file buffer.h.

Constructor & Destructor Documentation

◆ AJABuffer()

AJABuffer::AJABuffer ( )

Definition at line 15 of file buffer.cpp.

◆ ~AJABuffer()

AJABuffer::~AJABuffer ( )
virtual

Definition at line 31 of file buffer.cpp.

Member Function Documentation

◆ AllocateBuffer()

AJAStatus AJABuffer::AllocateBuffer ( size_t  size,
size_t  alignment = 0,
char *  pName = NULL 
)

Allocate memory from the system.

Parameters
[in]sizeSize of the memory buffer.
[in]alignmentMemory buffer alignment in bytes.
[in]pNameName of shared memory buffer to attach.
Returns
AJA_STATUS_SUCCESS Buffer successfully allocated AJA_STATUS_FAIL Allocation failed

Definition at line 54 of file buffer.cpp.

◆ AttachBuffer()

AJAStatus AJABuffer::AttachBuffer ( uint8_t *  pBuffer,
size_t  size 
)

Attach a preallocated buffer.

Parameters
[in]pBufferAddress of the memory to attach.
[in]sizeSize of the memory region.
Returns
AJA_STATUS_SUCCESS Buffer successfully attached AJA_STATUS_FAIL Attach failed

Definition at line 38 of file buffer.cpp.

◆ FreeBuffer()

AJAStatus AJABuffer::FreeBuffer ( )

Free allocated memory back to the system

Returns
AJA_STATUS_SUCCESS Buffer successfully freed AJA_STATUS_FAIL Free failed

Definition at line 136 of file buffer.cpp.

◆ GetBuffer()

uint8_t * AJABuffer::GetBuffer ( )

Get the buffer address.

Returns
Address of the buffer.

Definition at line 174 of file buffer.cpp.

◆ GetBufferAlignment()

size_t AJABuffer::GetBufferAlignment ( )

Get the buffer alignment.

Returns
Alignment of the buffer in bytes.

Definition at line 194 of file buffer.cpp.

◆ GetBufferName()

const char * AJABuffer::GetBufferName ( )

Get the name of the shared buffer.

Returns
Name of the shared buffer, NULL if not shared.

Definition at line 201 of file buffer.cpp.

◆ GetBufferSize()

size_t AJABuffer::GetBufferSize ( )

Get the buffer size.

Returns
Size of the buffer.

Definition at line 187 of file buffer.cpp.

◆ GetData()

uint8_t * AJABuffer::GetData ( )

Get the address of the data region in the buffer.

Returns
Address of the data.

Definition at line 248 of file buffer.cpp.

◆ GetDataOffset()

size_t AJABuffer::GetDataOffset ( )

Get the offset of the data in the buffer.

Returns
Offset of the data.

Definition at line 221 of file buffer.cpp.

◆ GetDataSize()

size_t AJABuffer::GetDataSize ( )

Get the size of the data region in the buffer.

Returns
Size of the data.

Definition at line 241 of file buffer.cpp.

◆ GetUINT32Buffer()

uint32_t * AJABuffer::GetUINT32Buffer ( )

Definition at line 180 of file buffer.cpp.

◆ SetDataOffset()

AJAStatus AJABuffer::SetDataOffset ( size_t  offset)

Set the offset of the data in the buffer.

Parameters
[in]offsetOffset of the data.
Returns
AJA_STATUS_SUCCESS Data offset set AJA_STATUS_RANGE Data offset + data size > buffer size

Definition at line 208 of file buffer.cpp.

◆ SetDataSize()

AJAStatus AJABuffer::SetDataSize ( size_t  size)

Set the size of the data region in the buffer

Parameters
[in]sizeSize of the data.
Returns
AJA_STATUS_SUCCESS Size set AJA_STATUS_RANGE Data offset + data size > buffer size

Definition at line 228 of file buffer.cpp.


The documentation for this class was generated from the following files: