MHEG5  15.3.0
source/glue/src/glue_queue.c File Reference

MHEG5 Queue. More...

#include "techtype.h"
#include "stb_os.h"
#include "glue_memory.h"
#include "glue_debug.h"
#include "glue_queue.h"

Data Structures

struct  s_msg_queue
struct  s_q_notify

Defines

#define UP_MSGS_WHEN_Q_FULL
#define Q_STATS(s)
#define CRITICAL_Q_SIZE   (1 << 3)
#define HIGH_Q_SIZE   (1 << 3)
#define NORMAL_Q_SIZE   (1 << 8)
#define LOW_Q_SIZE   (1 << 4)
#define EXCLUSION_RATIO   (35)

Typedefs

typedef struct s_msg_queue S_MSG_QUEUE
typedef struct s_q_notify S_Q_NOTIFY

Functions

E_MhegErr VQ_Open (S_MhegConfig *cfg_params)
 Initialise component control and section queues. Allocates memory for, sets up and creates event (component control) and section queues.
void VQ_Close (void)
 Close component control and section queue component. Destroys all allocated memory and resources for event and section queues. Must be called before MHEG5 main task starts.
E_MhegErr VQ_PutMsg (S_MhegMessage *pMsg, E_PRIORITY priority)
 Post an event or section into component queues. Copies data into queue.
E_MhegErr VQ_GetMsg (S_MhegMessage *pMsg)
 Get an event or section from the component queues. This is a blocking function.
U16BIT VQ_GetSizeFree (E_PRIORITY priority)
 Get size available on a queue.
BOOLEAN VQ_EventNeedsProcessing (void)
 Check whether any events on component queues needs processing.
void * VQ_RegisterNotify (F_QueueNotify normal_rcvd, F_QueueNotify critical_rcvd, F_QueueNotify critical_done)
void VQ_UnRegisterNotify (void *qn)

Detailed Description

MHEG5 Queue.

Date:
19 October 2011
Author:
Adam Sturtridge

Function Documentation

void VQ_Close ( void  )

Close component control and section queue component. Destroys all allocated memory and resources for event and section queues. Must be called before MHEG5 main task starts.

Close component control and section queue component. Destroys all allocated memory and resources for event and section queues.

Returns:
void
BOOLEAN VQ_EventNeedsProcessing ( void  )

Check whether any events on component queues needs processing.

Returns:
TRUE - if processing required
E_MhegErr VQ_GetMsg ( S_MhegMessage pMsg)

Get an event or section from the component queues. This is a blocking function.

Parameters:
pEventPointer to component event or section data structure.
Returns:
MHERR_OK - Completed successfully. MHERR_COMP_NOT_OPEN - Component queues not open. MHERR_INTERNAL - System error.
U16BIT VQ_GetSizeFree ( E_PRIORITY  priority)

Get size available on a queue.

Parameters:
pEventPointer to component event or section data structure.
Returns:
number left in queue.
E_MhegErr VQ_Open ( S_MhegConfig cfg_params)

Initialise component control and section queues. Allocates memory for, sets up and creates event (component control) and section queues.

Parameters:
num_section_buffersMaximum number of sections in queue
Returns:
MHERR_OK - Completed successfully. MHERR_BAD_PARAMETER - Invalid parameter. MHERR_COMP_ALREADY_OPEN - Component queues already open. MHERR_ALLOCATING_MEMORY_REGION - Not enough memory to allocate. MHERR_INTERNAL - System error.
E_MhegErr VQ_PutMsg ( S_MhegMessage pMsg,
E_PRIORITY  priority 
)

Post an event or section into component queues. Copies data into queue.

Post event or section message on queue. Copies data into queue.

Parameters:
pEventPointer to component event.
msg_sizedata size excluding size of S_MhegMessage
Returns:
MHERR_OK - Completed successfully. MHERR_BAD_PARAMETER - Invalid parameter. MHERR_COMP_NOT_OPEN - Component queues not open. MHERR_INTERNAL - System error. MHERR_ALLOCATING_MEMORY_REGION - Not enough memory to allocate. MHERR_QUEUE_FULL - Queue full.
void* VQ_RegisterNotify ( F_QueueNotify  normal_rcvd,
F_QueueNotify  critical_rcvd,
F_QueueNotify  critical_done 
)
Parameters:
critical_rcvdPointer to function signalling a critical event
critical_donePointer to function inform critical event done
Returns:
void
void VQ_UnRegisterNotify ( void *  qn)
Parameters:
normal_rcvdPointer to function signalling an async event
Returns:
void
 All Data Structures Files Functions Variables Typedefs Defines