1.1.3.5.5 DRV_GENERICCODEC_WriteQueuePurge Function

bool DRV_GENERICCODEC_WriteQueuePurge( const DRV_HANDLE handle )

Summary

Removes all buffer requests from the write queue.

Description

This function removes all the buffer requests from the write queue. The client can use this function to purge the queue on timeout or to remove unwanted stalled buffer requests or in any other use case.

Preconditions

DRV_GENERICCODEC_Open must have been called to obtain a valid opened device handle.

Parameters

ParametersDescription
handleHandle of the communication channel as returned by the DRV_GENERICCODEC_Open function.

Returns

True - Write queue purge is successful.

False - Write queue purge has failed.

Remarks

This function is thread safe when used in an RTOS environment. Avoid this function call from within the callback.

Example

_// myCodecHandle is the handle returned by the DRV_GENERICCODEC_Open function._

_// Use DRV_GENERICCODEC_BufferAddWrite to queue write requests_

_// Application timeout function, where remove queued buffers._ void APP_TimeOut(void) { if(false == DRV_GENERICCODEC_WriteQueuePurge(myCodecHandle)) { _//Couldn't purge the write queue, try again._ } else { _//Queue purge successful._}

}

C

bool DRV_GENERICCODEC_WriteQueuePurge(const DRV_HANDLE handle);