MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Macros | Typedefs | Enumerations | Functions
glue_main.c File Reference

MHEG5 Main task. More...

#include "stb_os.h"
#include "glue_memory.h"
#include "glue_debug.h"
#include "glue_queue.h"
#include "glue_timers.h"
#include "glue_main.h"
#include "mheg5_control.h"
#include "dvb_service.h"
#include "glue_dsmcc.h"
#include "mh5control.h"
#include "mh5support.h"
#include "glue_events.h"
#include "mg_osd.h"

Macros

#define MAIN_STACK_SIZE   0x2000
 
#define PRG_DONE_NONE   0
 
#define PRG_DONE_INIT   1
 
#define PRG_DONE_GRAPHICS   2
 
#define PRG_DONE_MEMORY   3
 
#define PRG_DONE_SYNCS   4
 
#define PRG_DONE_QUEUE   5
 
#define PRG_DONE_DSMCC   6
 
#define PRG_DONE_MAIN   7
 
#define PRG_DONE_TIMERS   8
 
#define PRG_DONE_HTTP   9
 
#define PRG_DONE_MHEG5   10
 
#define MAX_PP_FUNCS   4
 

Typedefs

typedef struct s_pp_list S_PP_LIST
 

Enumerations

enum  E_ApiStatus { VS_STOPPED, VS_TUNING, VS_RUNNING, VS_REBOOT }
 

Functions

BOOLEAN MH5GlueIsStarted (void)
 
void MH5GlueDoneRebootMessage (void)
 
void MH5GlueSetMainPostFunc (F_MainProcess func)
 
void MH5GlueAddPostProcessFunc (F_PostProcess func)
 
E_MhegErr MHEG5_Open (S_MhegConfig *pSetup)
 Initialise MHEG5 instance. The following will be performed as a result of a call to this function: More...
 
E_MhegErr MHEG5_Close (void)
 Free allocated memory region, and any other related resources. This is a synchronous blocking function. Must be called after MHEG5_Stop and normal use of the MHEG5 is completed. More...
 
E_MhegErr MHEG5_Start (S32BIT serviceIndex, E_ChannelStartMode *quietMode)
 This function starts MHEG5 engine on the current broadcast service. It will cause MHEG5 engine to start retrieving the associated service information (i.e. PMT) and launch an appropriate broadcast application. This should mean MHEG5 engine will mount an associated DSM-CC carousel for this application. If this should fail, MHEG5 engine will periodically try to mount the DSM-CC boot carousel in order to launch the default MHEG-5 auto boot application. This is a non-blocking function, which may return before completion. It should be called whenever a tuning process has completed and the external application is aware of a new broadcast service. More...
 
E_MhegErr MHEG5_Stop (void)
 Tells MHEG5 engine to enter stop state (i.e. no broadcast service). This function should kill any currently running MHEG5 broadcast application, and release allocated memory and resources. This is a synchronous blocking function. More...
 
E_MhegErr MHEG5_StopWithoutKilling (void)
 Suspend MHEG5 engine (while there is no valid broadcast service). This function should be called as an alternative to MHEG5_Stop, in cases when the CI+ host control module requests a tune and the keep_app_running flag is set to 1. In cases when keep_app_running is set to 0, or if the implemented version of host control doesn't have the keep_app_running flag, use MHEG5_Stop. This will not kill the running MHEG application. This suspend state will remain in effect until MHEG5_Start or MHEG5_Stop is called. This is a synchronous blocking function. More...
 
E_MhegErr MHEG5_Suspend (void)
 Suspend MHEG5 engine (while there is no valid broadcast service). When the external application is performing a tune as requested by MHEG5, this function should be called as an alternative to MHEG5_Stop. This may or may not kill the running MHEG application. This suspend state will remain in effect until MHEG5_Start or MHEG5_Stop is called. This is a synchronous blocking function. More...
 
E_MhegErr MHEG5_Reboot (void)
 Reboots MHEG5 Engine This function has the same effect as calling these two: MHEG5_Stop( STOP_ACTION_CLEAR_DSMCC ); MHEG5_Start( current_service_dvb_locator ); Only this is a little more efficient process. This is a not synchronous blocking function. More...
 
BOOLEAN MH5GlueActiveState (void)
 
E_MhegErr MHEG5_Pause (void)
 Pause MHEG-5 engine. More...
 
E_MhegErr MHEG5_Resume (void)
 Resume MHEG-5 engine. More...
 
E_MhegErr MHEG5_SetScreenResolution (U16BIT screenWidth, U16BIT screenHeight)
 Reset OSD resolution for MHEG-5 engine. More...
 
void MHEG5_RestoreScreen (void)
 Restore MHEG OSD after reset of resolution for MHEG-5 engine. More...
 
E_MhegErr MHEG5_SetActiveState (BOOLEAN newActiveState)
 Set the active state for the MHEG-5 engine. When the active state is True, the MHEG-5 engine processes synchronous and asynchronous events as normal. When it is False, the MHEG-5 engine these events will be queued, but not processed. This allows the MHEG-5 component to be paused whilst another application has display focus (such as an EPG). This is a synchronous blocking function. Section 6.9 of reference [1] discusses the behaviour for pausing the MHEG-5 engine. This implementation is "Non-transparent". More...
 
void MHEG5GetDefaultService (S_DVB_LOCATOR *dvb_locator)
 
U16BIT MHEG5DefaultServiceId (void)
 
S32BIT MHEG5GetCurrentServiceIndex (void)
 

Detailed Description

MHEG5 Main task.

Date
26 October 2011
Author
Adam Sturtridge

Function Documentation

E_MhegErr MHEG5_Close ( void  )

Free allocated memory region, and any other related resources. This is a synchronous blocking function. Must be called after MHEG5_Stop and normal use of the MHEG5 is completed.

Close MHEG engine. Free allocated MHEG5 engine memory region, and any other related resources. This is a synchronous blocking function. Must be called after MHEG5_Stop and normal use of MHEG5 engine has completed.

Returns
MHERR_OK - Success MHERR_COMP_NOT_OPEN - Component not ready to close.
E_MhegErr MHEG5_Open ( S_MhegConfig pSetup)

Initialise MHEG5 instance. The following will be performed as a result of a call to this function:

Initialise MHEG5 engine instance. The following will be performed as a result of a call to this function:

  • The component memory region will be allocated
  • MHEG5 will be initialised using the setup values provided.
  • allocates and initialises memory for the sub-components. This function may return MHERR_BAD_PARAMETER if the specified values of the component setup are outside the required range. This is a synchronous blocking function. This function must be called before VFX_Start and before normal use
    Parameters
    pSetupPointer configuration parameters. This defines many configuration options for MHEG5
    Returns
    MHERR_OK - Success MHERR_COMP_ALREADY_OPEN - Component already opened. MHERR_BAD_PARAMETER - Invalid parameter. MHERR_VERSION_MISMATCH - Setup version does not match library MHERR_BAD_TASK_PRIORITY MHERR_ALLOCATING_MEMORY_REGION MHERR_SYSTEM_RESOURCE_...
E_MhegErr MHEG5_Pause ( void  )

Pause MHEG-5 engine.

This allows MHEG5 engine to be paused whilst another application has display focus (such as an EPG). This is a synchronous blocking function. Section 16.9 of reference [1] discusses the behaviour for pausing the engine. This implementation is "Non-transparent". This may be called independently of start/stop of engine.

Parameters
None.
Returns
None.
E_MhegErr MHEG5_Reboot ( void  )

Reboots MHEG5 Engine This function has the same effect as calling these two: MHEG5_Stop( STOP_ACTION_CLEAR_DSMCC ); MHEG5_Start( current_service_dvb_locator ); Only this is a little more efficient process. This is a not synchronous blocking function.

Reboots MHGE5 Engine This function has the same effect as calling these two: MHEG5_Stop( STOP_ACTION_CLEAR_DSMCC ); MHEG5_Start( current_service_dvb_locator ); Only this is a little more efficient process. This is a not synchronous blocking function.

Returns
MHERR_OK - Success MHERR_COMP_NOT_STARTED - Component not ready to reboot.
void MHEG5_RestoreScreen ( void  )

Restore MHEG OSD after reset of resolution for MHEG-5 engine.

Refresh screen after resolution change with MHEG5_SetScreenResolution() This is a non-blocking function.

Parameters
None.
Returns
None.
E_MhegErr MHEG5_Resume ( void  )

Resume MHEG-5 engine.

This allows Voyageer to be resumed after another application has had display focus (such as an EPG). This is a synchronous blocking function. Section 16.9 of reference [1] discusses the behaviour for pausing the engine. This implementation is "Non-transparent". This may be called independently of start/stop of engine.

Parameters
None.
Returns
None.
E_MhegErr MHEG5_SetActiveState ( BOOLEAN  newActiveState)

Set the active state for the MHEG-5 engine. When the active state is True, the MHEG-5 engine processes synchronous and asynchronous events as normal. When it is False, the MHEG-5 engine these events will be queued, but not processed. This allows the MHEG-5 component to be paused whilst another application has display focus (such as an EPG). This is a synchronous blocking function. Section 6.9 of reference [1] discusses the behaviour for pausing the MHEG-5 engine. This implementation is "Non-transparent".

Parameters
newActiveStateNew setting of the MHEG-5 engine active state.
Returns
MHERR_OK - Success MHERR_COMP_NOT_STARTED - Component not started.
E_MhegErr MHEG5_SetScreenResolution ( U16BIT  screenWidth,
U16BIT  screenHeight 
)

Reset OSD resolution for MHEG-5 engine.

Sets the screen resolution to new size. This function is required when the external application wishes to change the screen resolution. This is a synchronous blocking function. It will return when MHEG5 engine has finished using the previous resolution. After returning from this function, MHEG5 engine will NOT refresh the OSD or AV until MHEG5_RestoreScreen() is called.

Parameters
None.
Returns
None.
E_MhegErr MHEG5_Start ( S32BIT  serviceIndex,
E_ChannelStartMode *  quietMode 
)

This function starts MHEG5 engine on the current broadcast service. It will cause MHEG5 engine to start retrieving the associated service information (i.e. PMT) and launch an appropriate broadcast application. This should mean MHEG5 engine will mount an associated DSM-CC carousel for this application. If this should fail, MHEG5 engine will periodically try to mount the DSM-CC boot carousel in order to launch the default MHEG-5 auto boot application. This is a non-blocking function, which may return before completion. It should be called whenever a tuning process has completed and the external application is aware of a new broadcast service.

Parameters
serviceIndex"Service Index" for the new service
quietModepointer to return channel change mode that MHEG5 requires of the external application. Can be NULL, if not interested in mode.
Returns
MHERR_OK - Success MHERR_COMP_NOT_OPEN - Component not ready to start. MHERR_COMP_ALREADY_STARTED - Component has already been started. MHERR_BAD_PARAMETER - Invalid parameter.
E_MhegErr MHEG5_Stop ( void  )

Tells MHEG5 engine to enter stop state (i.e. no broadcast service). This function should kill any currently running MHEG5 broadcast application, and release allocated memory and resources. This is a synchronous blocking function.

Returns
MHERR_OK - Success MHERR_COMP_NOT_STARTED - Component not ready to stop.
E_MhegErr MHEG5_StopWithoutKilling ( void  )

Suspend MHEG5 engine (while there is no valid broadcast service). This function should be called as an alternative to MHEG5_Stop, in cases when the CI+ host control module requests a tune and the keep_app_running flag is set to 1. In cases when keep_app_running is set to 0, or if the implemented version of host control doesn't have the keep_app_running flag, use MHEG5_Stop. This will not kill the running MHEG application. This suspend state will remain in effect until MHEG5_Start or MHEG5_Stop is called. This is a synchronous blocking function.

Returns
MHERR_OK - Success MHERR_REQUEST_IGNORED - Already suspended MHERR_COMP_NOT_STARTED - Component not ready to stop.
E_MhegErr MHEG5_Suspend ( void  )

Suspend MHEG5 engine (while there is no valid broadcast service). When the external application is performing a tune as requested by MHEG5, this function should be called as an alternative to MHEG5_Stop. This may or may not kill the running MHEG application. This suspend state will remain in effect until MHEG5_Start or MHEG5_Stop is called. This is a synchronous blocking function.

Returns
MHERR_OK - Success MHERR_REQUEST_IGNORED - Already suspended MHERR_COMP_NOT_STARTED - Component not ready to stop.