mfxBufferAllocator

Definition

 

typedef struct {

      mfxU32      reserved[4];

      mfxHDL      pthis;

      mfxStatus   (*Alloc)(mfxHDL pthis, mfxU32 nbytes,

                              mfxU16 type, mfxMemId *mid);

      mfxStatus   (*Lock)(mfxHDL pthis, mfxMemId mid, mfxU8 **ptr);

      mfxStatus   (*Unlock)(mfxHDL pthis, mfxMemId mid);

      mfxStatus   (*Free)(mfxHDL pthis, mfxMemId mid);

} mfxBufferAllocator;

Description

 

The mfxBufferAllocator structure is deprecated.

Members

 

pthis

Pointer to the allocator object

 

Alloc

Pointer to the function that allocates a linear buffer

 

Lock

Pointer to the function that locks a memory block and returns the pointer to the buffer

 

Unlock

Pointer to the function that unlocks a linear buffer; after unlocking, any pointer to the linear buffer is invalid.

 

Free

Pointer to the function that de-allocates memory

Change History

 

This structure is available since SDK API 1.0.

Deprecated since API 1.17

 

 

 

Syntax

 

mfxStatus (*Alloc)(mfxHDL pthis, mfxU32 nbytes, mfxU16 type, mfxMemId *mid);

Parameters

 

pthis

Pointer to the allocator object

 

nbytes

Number of bytes in the linear buffer

 

type

Memory type; see the ExtMemBufferType enumerator for details.

 

mid

Pointer to the allocated memory ID

Description

 

This function allocates a linear buffer and returns its block ID. The allocated memory must be 32-byte aligned.

Return Status

 

MFX_ERR_NONE

The function successfully allocated the memory block.

 

MFX_ERR_MEMORY_ALLOC

The function ran out of the specified type of memory.

Change History

 

This function is available since SDK API 1.0.

 

 

 

Syntax

 

mfxStatus (*Free)(mfxHDL pthis, mfxMemId mid);

Parameters

 

pthis

Pointer to the allocator object

 

mid

Memory block ID

Description

 

This function de-allocates memory specified by mid.

Return Status

 

MFX_ERR_NONE

The function successfully de-allocated the memory block.

 

MFX_ERR_INVALID_HANDLE

The memory block ID is invalid.

Change History

 

This function is available since SDK API 1.0.

 

 

 

Syntax

 

mfxStatus (*Lock)(mfxHDL pthis, mfxMemId mid, mfxU8 **ptr);

Parameters

 

pthis

Pointer to the allocator object

 

mid

Memory block ID

 

ptr

Pointer to the returned linear buffer pointer

Description

 

This function locks the linear buffer and returns its pointer. The returned buffer must be 32-byte aligned.

Return Status

 

MFX_ERR_NONE

The function successfully locked the memory block.

 

MFX_ERR_INVALID_HANDLE

The memory block ID is invalid.

 

MFX_ERR_LOCK_MEMORY

The function failed to lock the linear buffer.

Change History

 

This function is available since SDK API 1.0.

 

 

 

Syntax

 

mfxStatus (*Unlock)(mfxHDL pthis, mfxMemId mid);

Parameters

 

pthis

Pointer to the allocator object

 

mid

Memory block ID

Description

 

This function unlocks the linear buffer and invalidates its pointer.

Return Status

 

MFX_ERR_NONE

The function successfully unlocked the memory block.

 

MFX_ERR_INVALID_HANDLE

The memory block ID is invalid.

Change History

 

This function is available since SDK API 1.0.

 

 

 

For more complete information about compiler optimizations, see our Optimization Notice.