![]() |
MHEG5
22.11.0
|
IC Streamer queue manager. More...
#include <string.h>
#include "stb_os.h"
#include "glue_memory.h"
#include "glue_debug.h"
#include "mh5profile.h"
#include "stmr_queue.h"
#include "stmr_common.h"
#include "stmr_task.h"
#include "stmr_dl.h"
Macros | |
#define | QDBG_CHECK |
#define | QDBG_ALLOC(x) |
#define | QDBG_FREE(x) |
#define | QDBG_FUNC_START(x) |
#define | QDBG_FUNC_END(x) |
#define | QUEUE_CHECK() QueueCheck() |
#define | QUEUE_PRINT() |
#define | PDBG(x) TRACE(TICS, x) |
#define | DBG(x) |
#define | MIN_THRESHOLD_SIZE 1048576 |
Functions | |
void | SendSignalToTask (void) |
E_MhegErr | MHEG5QueueInit (U8BIT *buffer, U32BIT bufferSize) |
Initialise queue manager. More... | |
MHEG5QueueItem * | MHEG5QueueAllocItem (U32BIT requestId, U32BIT len) |
Allocate a new queue item and initialise with request ID and block length. More... | |
void | MHEG5QueueInsertItem (MHEG5QueueItem *item) |
Insert a queue item into the queue. More... | |
MHEG5QueueItem * | MHEG5QueueGetHeadItem (void) |
Return the item at the head of the queue (the next item to consume). The function returns an "invalid" item if streaming is disabled. It returns NULL if the queue is empty. Task : STREAMING. More... | |
BOOLEAN | MHEG5QueueIsValidItem (MHEG5QueueItem *item) |
Tell whether the item returned by MHEG5QueueGetHeadItem is valid. If the item is invalid, then streaming is disabled. More... | |
void | MHEG5QueueUpdateItem (MHEG5QueueItem *item, U32BIT processed) |
Update the number of bytes processed in a queue item. The same item will be returned by the next call to MHEG5QueueGetHeadItem. If the item is no longer in the queue (because the queue has been cleared), the item is freed and no changes are made to the queue or to the item. More... | |
void | MHEG5QueueReleaseItem (MHEG5QueueItem *item) |
Release an item from the queue. If the item is no longer in the queue (because the queue has been cleared), the item is freed and no changes are made to the queue. More... | |
U32BIT | MHEG5QueueGetBufferedBytes (void) |
Return number of buffered bytes in the queue (regardless of request) More... | |
void | MHEG5QueueEnableStreaming (U32BIT requestId) |
Allow streaming data from the queue. More... | |
void | MHEG5QueueDisableStreaming (void) |
Do not allow streaming data from the queue. More... | |
BOOLEAN | MHEG5QueueIsStreamingEnabled (void) |
Tell whether streaming is enabled. More... | |
void | MHEG5QueueReleaseRequestItems (U32BIT requestId) |
Release all queue items that are related to a given request. More... | |
void | MHEG5QueueReleaseItems (U32BIT requestId, U64HL marker) |
Release queue items that are related to a given request up to a marker. More... | |
void | MHEG5QueueReleaseAllItems (void) |
Release all queue items - clear the queue completely. More... | |
void | MHEG5QueueRegisterInsertCallback (void(*callback)(U32BIT downloadId, U64HL base, U64HL position, U32BIT len, BOOLEAN last)) |
Register notification callback for item insertion event. If a callback is already registered for the event, it will be replaced. More... | |
void | MHEG5QueueRegisterReleaseCallback (void(*callback)(U32BIT requestId, U64HL base, U64HL position, U32BIT len, BOOLEAN last)) |
Register notification callback for item release events. If a callback is already registered for the event, it will be replaced. More... | |
void | MHEG5QueueTerm (void) |
Terminate queue manager. More... | |
IC Streamer queue manager.
MHEG5QueueItem* MHEG5QueueAllocItem | ( | U32BIT | requestId, |
U32BIT | len | ||
) |
Allocate a new queue item and initialise with request ID and block length.
requestId | Request ID |
len | Size of stream data block in bytes |
void MHEG5QueueDisableStreaming | ( | void | ) |
Do not allow streaming data from the queue.
void MHEG5QueueEnableStreaming | ( | U32BIT | requestId | ) |
Allow streaming data from the queue.
requestId | Request for which streaming is enabled |
U32BIT MHEG5QueueGetBufferedBytes | ( | void | ) |
Return number of buffered bytes in the queue (regardless of request)
MHEG5QueueItem* MHEG5QueueGetHeadItem | ( | void | ) |
Return the item at the head of the queue (the next item to consume). The function returns an "invalid" item if streaming is disabled. It returns NULL if the queue is empty. Task : STREAMING.
Return the item at the head of the queue (the next item to consume). The function returns an "invalid" item if streaming is disabled. It returns NULL if the queue is empty.
E_MhegErr MHEG5QueueInit | ( | U8BIT * | buffer, |
U32BIT | bufferSize | ||
) |
Initialise queue manager.
buffer | Buffer to use for queue items |
bufferSize | Size of buffer in bytes |
void MHEG5QueueInsertItem | ( | MHEG5QueueItem * | item | ) |
Insert a queue item into the queue.
item | Item to be inserted (allocated using QueueAllocItem) |
BOOLEAN MHEG5QueueIsStreamingEnabled | ( | void | ) |
Tell whether streaming is enabled.
BOOLEAN MHEG5QueueIsValidItem | ( | MHEG5QueueItem * | item | ) |
Tell whether the item returned by MHEG5QueueGetHeadItem is valid. If the item is invalid, then streaming is disabled.
item | Queue item to check |
void MHEG5QueueRegisterInsertCallback | ( | void(*)(U32BIT downloadId, U64HL base, U64HL position, U32BIT len, BOOLEAN last) | callback | ) |
Register notification callback for item insertion event. If a callback is already registered for the event, it will be replaced.
callback | Item insertion callback |
void MHEG5QueueRegisterReleaseCallback | ( | void(*)(U32BIT requestId, U64HL base, U64HL position, U32BIT len, BOOLEAN last) | callback | ) |
Register notification callback for item release events. If a callback is already registered for the event, it will be replaced.
callback | Item release callback |
void MHEG5QueueReleaseAllItems | ( | void | ) |
Release all queue items - clear the queue completely.
void MHEG5QueueReleaseItem | ( | MHEG5QueueItem * | item | ) |
Release an item from the queue. If the item is no longer in the queue (because the queue has been cleared), the item is freed and no changes are made to the queue.
item | Queue item to release |
void MHEG5QueueReleaseItems | ( | U32BIT | requestId, |
U64HL | marker | ||
) |
Release queue items that are related to a given request up to a marker.
requestId | Request ID |
marker | new position |
void MHEG5QueueReleaseRequestItems | ( | U32BIT | requestId | ) |
Release all queue items that are related to a given request.
requestId | Request ID |
void MHEG5QueueTerm | ( | void | ) |
Terminate queue manager.
void MHEG5QueueUpdateItem | ( | MHEG5QueueItem * | item, |
U32BIT | processed | ||
) |
Update the number of bytes processed in a queue item. The same item will be returned by the next call to MHEG5QueueGetHeadItem. If the item is no longer in the queue (because the queue has been cleared), the item is freed and no changes are made to the queue or to the item.
item | Queue item to update |
processed | Number of bytes processed |