[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

MediaBufferAllocator

Functions for buffer allocation

Synopsis:

static MediaBufferAllocator media_buffer_allocator =
{
    AllocateBuffers,
    FreeBuffers,
    AcquireBuffer,
    ReleaseBuffer
}

Description:

The Multimedia library implements a MediaBufferAllocator that your filters can use.

This interface defines custom buffer allocation and manipulation. You can implement buffer allocating, locking, and unlocking using this interface.

AllocateBuffers()

int32_t (*AllocateBuffers)(MmChannel_t *channel,
                           const MmFormat_t *format);

This function should allocate buffers for a given channel with the given format specifications.

If successful, this function should return 0.

FreeBuffers()

int32_t (*FreeBuffers)(MmChannel_t *channel); 

This function should free the buffers for the channel.

If successful, this function should return 0.

AcquireBuffer()

MmBuffer_t *(*AcquireBuffer)(MmChannel_t *channel,
                             uint32_t unused);

This function should acquire a buffer for a channel with a minimum size of the min_buffersize field of the MmFormat_t structure filled in at format negotiation time, and return a pointer to it, or NULL if it can't acquire a buffer.

ReleaseBuffer()

int32_t (*ReleaseBuffer)(MmChannel_t *channel,
                         MmBuffer_t *buffer);

This function should release the given buffer from the channel for subsequent use.

If successful, this function should return 0.

Classification:

Neutrino

See also:

Extending the Multimedia Framework.


[Previous] [Contents] [Index] [Next]