34 #if defined(INCLUDE_IC) 53 #define MAIN_STACK_SIZE 0x2000 55 #define PRG_DONE_NONE 0 56 #define PRG_DONE_INIT 1 57 #define PRG_DONE_GRAPHICS 2 58 #define PRG_DONE_MEMORY 3 59 #define PRG_DONE_SYNCS 4 60 #define PRG_DONE_QUEUE 5 61 #define PRG_DONE_DSMCC 6 62 #define PRG_DONE_MAIN 7 63 #define PRG_DONE_TIMERS 8 64 #define PRG_DONE_HTTP 9 65 #define PRG_DONE_MHEG5 10 71 #define MAX_PP_FUNCS 4 93 static S32BIT default_service_index = 0;
97 static void *task_handle;
99 static void *stop_sema = 0;
101 static void *pause_sema = 0;
103 static void *api_mutex = 0;
120 static void DummyMainFunc(
void)
124 static BOOLEAN DummyPostFunc(
void)
135 static void MHEG5Main(
void *pArgs)
158 if (post_processes[i].
pp_func != DummyPostFunc)
164 while (post_processes[i].
pp_func());
165 post_processes[i].
pp_func = DummyPostFunc;
171 TRACE(TERROR, (
" **** EXIT **** %d ", running_state));
189 if (api_mutex == NULL)
196 if (stop_sema == NULL)
203 if (pause_sema == NULL)
219 static void DestroySyncs(
void)
266 main_proc_func = DummyMainFunc;
270 main_proc_func = func;
281 if (post_processes[i].
pp_func == func)
288 if (post_processes[i].
pp_func == DummyPostFunc)
290 post_processes[i].
pp_func = func;
298 static void ResetPostFuncs(
void )
304 post_processes[i].
pp_func = DummyPostFunc;
322 TRACE(TSTATE, (
"************** EXIT! *************"));
376 DPL1((
"ERROR: Open - Setup NULL\n"));
384 else if (task_handle)
398 main_proc_func = DummyMainFunc;
423 result = CreateSyncs();
445 if (task_handle == NULL)
447 TRACE(TERROR, (
"Failed To Create Task"));
458 #if defined(INCLUDE_IC) 461 TRACE(TERROR, (
"Failed httpOpen"));
491 TRACE(TSTATE,(
"progress=%d",progress))
498 #if defined(INCLUDE_IC) 529 TRACE(TSTATE,(
"result=%d",result))
546 if (task_handle == NULL)
561 #if defined(INCLUDE_IC) 567 result = MHEG5Exit();
614 if ( !ciplus_request_ndt &&
622 ciplus_request_ndt =
FALSE;
631 TRACE(TSTATE, (
"DSM-CC not build in"))
634 default_service = locator;
664 if (task_handle == NULL)
666 TRACE(TERROR, (
"MHEG5 Not Open"));
674 TRACE(TERROR, (
"MHEG5 already Started"));
679 prev_state = started_state;
687 if (quietMode != NULL)
692 TRACE(TSTATE, (
"serviceIndex=%x", serviceIndex))
700 started_state = prev_state;
702 TRACE(TERROR, (
"VQ_PutMsg Failed"));
721 TRACE(TSTATE, (
"action=%d", action));
733 ciplus_request_ndt =
TRUE;
752 TRACE(TSTATE, (
"done"));
771 if (task_handle == NULL)
773 TRACE(TERROR, (
"MHEG5 Not Open"));
779 prev_state = started_state;
782 TRACE(TERROR, (
"MHEG5 Not Started"));
800 started_state = prev_state;
802 TRACE(TERROR, (
"VQ_PutMsg Failed"));
808 TRACE(TSTATE, (
" vgr done"));
832 if (task_handle == NULL)
834 TRACE(TERROR, (
"MHEG5 Not Open"));
840 prev_state = started_state;
860 started_state = prev_state;
862 TRACE(TERROR, (
"VQ_PutMsg Failed"));
868 TRACE(TSTATE, (
" vgr done"));
894 if (task_handle == NULL)
896 TRACE(TERROR, (
"MHEG5 Not Open"));
902 prev_state = started_state;
903 switch (started_state)
928 started_state = prev_state;
930 TRACE(TERROR, (
"VQ_PutMsg Failed"));
936 TRACE(TSTATE, (
" vgr done"));
969 TRACE(TERROR, (
"Not Started"));
979 TRACE(TERROR, (
"VQ_PutMsg Failed"));
983 TRACE(TMHBOOT, (
"Starting reboot"));
999 static void Pause(
void *params )
1002 TRACE(TSTATE, (
"state=%d", active_state))
1009 active_state =
FALSE;
1015 static void Resume(
void *params )
1018 TRACE(TSTATE, (
"state=%d", active_state))
1025 active_state =
TRUE;
1040 if (task_handle == NULL)
1042 TRACE(TERROR, (
"MHEG5 Not Open"));
1052 TRACE(TERROR, (
"VQ_PutMsg Failed"));
1058 TRACE(TSTATE | TMHAPI, (
"done"))
1076 if (task_handle == NULL)
1078 TRACE(TERROR, (
"MHEG5 Not Open"));
1088 TRACE(TERROR, (
"VQ_PutMsg Failed"));
1092 TRACE(TSTATE | TMHAPI, (
"..."))
1122 TRACE(TMHAPI, (
"( %d, %d, %d )", screenWidth, screenHeight))
1124 if (task_handle == NULL)
1126 TRACE(TERROR, (
"MHEG5 Not Open"));
1129 else if (screenWidth < 720 || screenHeight < 576)
1131 TRACE(TERROR, (
"Bad Resolution (%d,%d)",screenWidth,screenHeight));
1136 restore_active = active_state;
1188 *dvb_locator = default_service;
1198 return default_service_index;
BOOLEAN MH5GlueActiveState(void)
U32BIT MHEG5tuneProcess(S_DvbLocator *pDvbLoc, S32BIT serviceIndex)
void STB_OSSemaphoreWait(void *semaphore)
Wait on Semaphore Indefinity or Until Released.
Implement MHEG5 engine control functions (i.e. start/stop etc)
void MH5GlueDsmccClose(void)
E_MhegErr VQ_PutMsg(S_MhegMessage *pMsg, E_PRIORITY priority)
Post event or section message on queue. Copies data into queue.
#define FUNCTION_FINISH(name)
E_MhegErr MHEG5_Close(void)
Free allocated memory region, and any other related resources. This is a synchronous blocking functio...
E_MhegErr MH5GlueDsmccOpen(U32BIT taskPriority)
F_MSG_PROCESS proc_msg_func
Interface functions to DSM-CC instance for MHEG5.
Manages the interface between MHEG5 Engine and the HTTP component.
E_MhegErr MHEG5_NotifyDvbEvent(E_DvbEvent eType, U32BIT eData)
Notifies MHEG5 of event from receiver platform This is a non-blocking function.
void STB_OSTaskDelay(U16BIT timeout)
Delay Task for Specifed Time Period.
void(* F_MainProcess)(void)
void STB_OSDeleteMutex(void *mutex)
Delete a mutex.
E_MhegErr MHEG5_Stop(void)
Tells MHEG5 engine to enter stop state (i.e. no broadcast service). This function should kill any cur...
E_MhegErr VT_TimersExit(void)
Uninitialise the timer component - all resources are freed. Other timer functions must not be called ...
E_MhegErr MHEG5_SetScreenResolution(U16BIT screenWidth, U16BIT screenHeight)
Reset OSD resolution for MHEG-5 engine.
E_MhegErr MHEG5ResetResolution(U16BIT screenWidth, U16BIT screenHeight)
void MH5GlueDsmccStop(U8BIT action)
E_MhegErr DVB_MhegIndexToDvbLocator(S32BIT serviceIndex, S_DvbLocator *location)
Convert "service index" into DVB locator information. This being original network ID...
E_HttpErr httpOpen(U32BIT task_priority)
Open the HTTP interface.
E_MhegErr MHEG5_StopWithoutKilling(void)
Suspend MHEG5 engine (while there is no valid broadcast service). This function should be called as a...
U16BIT transport_stream_id
E_MhegErr MHEG5_Suspend(void)
Suspend MHEG5 engine (while there is no valid broadcast service). When the external application is pe...
void MHEG5StreamerSetActiveState(BOOLEAN activeState)
Set the active state of the streamer. When it is not active, it is allowed to buffer data but not to ...
const char * MHEG5VersionString(void)
E_MhegErr MH5GlueDsmccStart(S_DVB_LOCATOR *pDvbLoc, U32BIT carouselId, BOOLEAN clear)
void(* F_MSG_PROCESS)(void *data)
Function to Process voyager message.
U16BIT original_network_id
E_MhegErr MHEG5_Resume(void)
Resume MHEG-5 engine.
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 sta...
void MHEG5_Terminate(void)
Terminate MHEG5 component.
void VQ_Close(void)
Close component control and section queue component. Destroys all allocated memory and resources for ...
void MH5GlueDoneRebootMessage(void)
DVB Service information functions are required by MHEG5 engine. All required functions should be non-...
void STB_OSMutexUnlock(void *mutex)
Unlock a mutex (a.k.a. 'leave', 'signal' or 'release')
This file provides the control interface for MHEG5 engine. The use of this component MUST comply with...
void MHEG5StartReboot(void *dummy)
void * STB_OSCreateSemaphore(void)
Create a Binary Semaphore. That is maximum value of 1. The initial value should be 1...
S32BIT MHEG5GetCurrentServiceIndex(void)
MHEG5ResetResolutionParams_t resetRes
void MG_Terminate(void)
Free all OSD resources.
void * STB_OSCreateMutex(void)
Create a mutex.
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 processe...
E_MhegErr MH5_SupportInitialise(S_MhegConfig *pConfig)
Initialise support module - called when 'Open' engine.
#define MHEG5_MIN_TASK_PRIORITY
E_MhegErr VT_TimersInit(U32BIT task_priority)
Initialise the timer component. This function must be called before any other timer functions are inv...
E_MhegErr MHEG5Initialise(S_MhegConfig *cfg_params)
initialise MHEG5 component
E_MhegErr VQ_GetMsg(S_MhegMessage *pElem)
Get an event or section from the component queues. This is a blocking function.
struct s_pp_list S_PP_LIST
E_MhegErr VQ_Open(S_MhegConfig *cfg_params)
Initialise component control and section queues. Allocates memory for, sets up and creates event (com...
U8BIT MHEG5HandleEngineStopAction(U8BIT action)
E_MhegErr DVB_MhegEventsStart(F_NotifyDvbEvent handler)
Start listening for DVB events.
void MHEG5GetDefaultService(S_DVB_LOCATOR *dvb_locator)
E_MhegErr MHEG5_Pause(void)
Pause MHEG-5 engine.
void MHEG5StreamerClose(void)
Close the IC streaming module.
BOOLEAN MH5GlueMemoryInitialise(void)
U16BIT MHEG5DefaultServiceId(void)
BOOLEAN(* F_PostProcess)(void)
E_MhegErr MG_Initialise(U16BIT screenWidth, U16BIT screenHeight, U8BIT colourDepth)
Initialise OSD, font, and font fill information. Should only be called at start up.
void STB_OSMutexLock(void *mutex)
Lock a mutex (a.k.a. 'enter', 'wait' or 'get').
BOOLEAN MH5GlueIsStarted(void)
The timer module allows the use of timers within the MHEG5 component. These timers can be set by othe...
E_MhegErr DVB_MhegEventsStop(void)
Stop listening for DVB events.
void httpClose(void)
Close the HTTP interface.
void MH5GlueSetMainPostFunc(F_MainProcess func)
Interaction Channel Streaming functions required by MHEG5 engine References: [1] UK1 Profile - Digita...
void MH5GlueAddPostProcessFunc(F_PostProcess func)
void MHEG5_RestoreScreen(void)
Restore MHEG OSD after reset of resolution for MHEG-5 engine.
E_MhegErr MHEG5_Reboot(void)
Reboots MHEG5 Engine This function has the same effect as calling these two: MHEG5_Stop( STOP_ACTION_...
const char * version_string
E_MhegErr MHEG5_Open(S_MhegConfig *pSetup)
Initialise MHEG5 instance. The following will be performed as a result of a call to this function: ...
void * STB_OSCreateTask(void(*function)(void *), void *param, U32BIT stack, U8BIT priority, U8BIT *name)
Create a New Task to the calling process. Upon success, the created task runs on its own stack...
void MH5GlueMemoryTerminate(void)
union s_mhg_message::@13 data
#define FUNCTION_START(name)
E_ChannelStartMode MHEG5_GetTuningInfoMode(S32BIT serviceIndex)
Get the current tuning mode for the target service. This is only relevant when MHEG5 has requested a ...
#define PRG_DONE_GRAPHICS
Engine support utility functions for MHEG5.
void STB_OSDestroyTask(void *task)
Delete Task must be called upon termination of each task as it frees all OS specific resources alloca...
U32BIT streamerBufferSize
MHEG5StopEventParams_t stop
void STB_OSDeleteSemaphore(void *semaphore)
Delete a Semaphore.
void STB_OSSemaphoreSignal(void *semaphore)
Signal a Semaphore to Release it by decrementing its counter.
E_MhegErr MHEG5StreamerOpen(void *buffer, U32BIT size, U32BIT taskPriority)
Open the IC streaming module.
Header file - Function prototypes for operating system.