![]() |
MHEG5
18.9.0
MHEG5 Documentation
|
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"
Go to the source code of this file.
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, U64BIT 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, U64BIT base, U64BIT 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, U64BIT base, U64BIT 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... | |
#define DBG | ( | x | ) |
Definition at line 68 of file stmr_queue.c.
#define MIN_THRESHOLD_SIZE 1048576 |
Definition at line 73 of file stmr_queue.c.
#define PDBG | ( | x | ) | TRACE(TICS, x) |
Definition at line 67 of file stmr_queue.c.
#define QDBG_ALLOC | ( | x | ) |
Definition at line 44 of file stmr_queue.c.
#define QDBG_CHECK |
Definition at line 40 of file stmr_queue.c.
#define QDBG_FREE | ( | x | ) |
Definition at line 45 of file stmr_queue.c.
#define QDBG_FUNC_END | ( | x | ) |
Definition at line 52 of file stmr_queue.c.
#define QDBG_FUNC_START | ( | x | ) |
Definition at line 51 of file stmr_queue.c.
#define QUEUE_CHECK | ( | ) | QueueCheck() |
Definition at line 56 of file stmr_queue.c.
#define QUEUE_PRINT | ( | ) |
Definition at line 64 of file stmr_queue.c.
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 |
Definition at line 241 of file stmr_queue.c.
void MHEG5QueueDisableStreaming | ( | void | ) |
Do not allow streaming data from the queue.
Definition at line 609 of file stmr_queue.c.
void MHEG5QueueEnableStreaming | ( | U32BIT | requestId | ) |
Allow streaming data from the queue.
requestId | Request for which streaming is enabled |
Definition at line 584 of file stmr_queue.c.
U32BIT MHEG5QueueGetBufferedBytes | ( | void | ) |
Return number of buffered bytes in the queue (regardless of request)
Definition at line 570 of file stmr_queue.c.
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.
Definition at line 336 of file stmr_queue.c.
Initialise queue manager.
buffer | Buffer to use for queue items |
bufferSize | Size of buffer in bytes |
Definition at line 128 of file stmr_queue.c.
void MHEG5QueueInsertItem | ( | MHEG5QueueItem * | item | ) |
Insert a queue item into the queue.
item | Item to be inserted (allocated using QueueAllocItem) |
Definition at line 279 of file stmr_queue.c.
BOOLEAN MHEG5QueueIsStreamingEnabled | ( | void | ) |
Tell whether streaming is enabled.
Definition at line 626 of file stmr_queue.c.
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 |
Definition at line 384 of file stmr_queue.c.
void MHEG5QueueRegisterInsertCallback | ( | void(*)(U32BIT downloadId, U64BIT base, U64BIT 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 |
Definition at line 771 of file stmr_queue.c.
void MHEG5QueueRegisterReleaseCallback | ( | void(*)(U32BIT requestId, U64BIT base, U64BIT 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 |
Definition at line 786 of file stmr_queue.c.
void MHEG5QueueReleaseAllItems | ( | void | ) |
Release all queue items - clear the queue completely.
Definition at line 749 of file stmr_queue.c.
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 |
Definition at line 477 of file stmr_queue.c.
Release queue items that are related to a given request up to a marker.
requestId | Request ID |
marker | new position |
Definition at line 680 of file stmr_queue.c.
void MHEG5QueueReleaseRequestItems | ( | U32BIT | requestId | ) |
Release all queue items that are related to a given request.
requestId | Request ID |
Definition at line 636 of file stmr_queue.c.
void MHEG5QueueTerm | ( | void | ) |
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 |
Definition at line 406 of file stmr_queue.c.
void SendSignalToTask | ( | void | ) |