|
AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
Go to the documentation of this file.
19 mAllocateAlignment = 0;
24 mpAllocateName =
NULL;
59 if (pName !=
NULL && *pName !=
'\0')
61 size_t sharedSize = size;
64 if ((mpAllocate ==
NULL) && (sharedSize != 0))
69 mAllocateSize = sharedSize;
71 mpBuffer = mpAllocate;
72 mBufferSize = mAllocateSize;
76 size_t bytesForNameStr = strlen(pName) + 1;
77 mpAllocateName =
new char[bytesForNameStr];
79 strncpy(mpAllocateName, pName, bytesForNameStr);
93 if (mpAllocate ==
NULL)
100 mpBuffer = mpAllocate;
101 mBufferSize = mAllocateSize;
107 if (mpAllocate ==
NULL)
112 mAllocateSize = size;
113 mAllocateAlignment = alignment;
115 mpBuffer = mpAllocate;
116 mBufferSize = mAllocateSize;
123 if ((mAllocateAlignment != 0) && (mBufferAlignment < mAllocateAlignment))
138 if (mpAllocate !=
NULL)
140 if (mpAllocateName !=
NULL)
146 if (mAllocateAlignment != 0)
159 mAllocateAlignment = 0;
163 mBufferAlignment = 0;
164 mpAllocateName =
NULL;
182 return (uint32_t*)mpBuffer;
196 return mBufferAlignment;
203 return mpAllocateName;
210 mDataOffset = offset;
212 if ((mDataOffset + mDataSize) > mBufferSize)
232 if ((mDataOffset + mDataSize) > mBufferSize)
250 return mpBuffer + mDataOffset;
255 AJABuffer::ComputeAlignment()
257 mBufferAlignment = 0;
258 if (mpBuffer !=
NULL)
260 mBufferAlignment = 1;
261 for (int32_t i = 0; i < 12; i++)
263 if (((uintptr_t)mpBuffer & ((uintptr_t)0x1 << i)) != 0)
267 mBufferAlignment *= 2;
@ AJA_DebugSeverity_Error
uint32_t * GetUINT32Buffer()
size_t GetBufferAlignment()
static void FreeAligned(void *pMemory)
const char * GetBufferName()
static void * AllocateShared(size_t *size, const char *pShareName, bool global=true)
static void * Allocate(size_t size)
AJAStatus SetDataSize(size_t size)
AJAStatus SetDataOffset(size_t offset)
#define AJA_REPORT(_index_, _severity_, _format_,...)
static void FreeShared(void *pMemory)
Implementation of AJABuffer class.
AJAStatus AllocateBuffer(size_t size, size_t alignment=0, char *pName=NULL)
AJAStatus AttachBuffer(uint8_t *pBuffer, size_t size)
#define AJA_ASSERT(_expression_)
static void * AllocateAligned(size_t size, size_t alignment)
Declares the AJAMemory class.
Declares the AJADebug class.
static void Free(void *pMemory)