MHEG5  18.9.0
MHEG5 Documentation
glue_events.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2012 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 /*---includes for this file--------------------------------------------------*/
26 #include "stb_os.h"
27 
28 /* Component Control for sending events to component task */
29 #include "glue_queue.h"
30 #include "glue_main.h"
31 
32 /* String manipulation functions */
33 #include <string.h>
34 
35 /* Component memory managerment module */
36 #include "glue_memory.h"
37 
38 #include "glue_debug.h"
39 #include "mh5control.h"
40 #include "mh5keypress.h"
41 #include "mh5queue.h"
42 #include "mh5display.h"
43 #include "mh5fileorm.h"
44 #include "mh5prgs.h"
45 #ifdef INCLUDE_IC
46 #include "mh5misc.h"
47 #ifdef INCLUDE_ICS
48 #include "mh5streamer.h"
49 #endif
50 #endif
51 #include "glue_events.h"
52 
53 
54 /*---constant definitions for this file--------------------------------------*/
55 
56 
57 /*---local typedef structs for this file-------------------------------------*/
58 
59 /*---local (static) variable declarations for this file----------------------*/
60 
61 
62 /*---local function definitions----------------------------------------------*/
63 
64 static void NotifyDvpEvent( S_DvpEventType *params )
65 {
66  TRACE(TMHAPI, ("( %d, %d )", params->eType, params->eData))
67  switch (params->eType)
68  {
71  break;
72 
75  break;
76 
79  break;
80 
83  break;
84 
87  break;
88 
91  break;
92 
94  //MH5GlueSfmSetDemuxPath( (H_DmxRef)params->eData );
95  break;
96 
99  break;
100 
102  #if defined(INCLUDE_IC)
103  MHEG5changedICStatus();
104  #endif
105  break;
106 
107  #if defined(INCLUDE_ICS)
109  MHEG5notifyGuidanceResponse(params->eData ? MHEG5TRUE : MHEG5FALSE);
110  break;
111 
114  break;
115 
117  TRACE(TERROR, ("SUBTITLE_PREF_CHANGED"))
118  MHEG5sendAppEngineEvent( EE_SUBTITLE_PREF_CHANGED );
119  break;
120  #endif
121 
123  #if defined(INCLUDE_ICS)
124  TRACE(TERROR, ("AUDIODESC_PREF_CHANGED"))
125  MHEG5sendAppEngineEvent( EE_AUDIO_DESC_PREF_CHANGED );
126  #endif
128  break;
129 
131  TRACE(TERROR, ("AUDIO_LANG_PREF_CHANGED"))
134  break;
135 
137  TRACE(TERROR, ("SUBTITLE_LANG_PREF_CHANGED"))
139  #ifdef INCLUDE_ICS
140  MHEG5StreamerRefresh(); /* Check if refresh is needed in IC Streamer */
141  #endif
142  break;
143 
145  #if defined(INCLUDE_MHEG_PVR) || defined(INCLUDE_PVR_AU)
147  #endif
148  break;
149 
151  #if defined(INCLUDE_MHEG_PVR) || defined(INCLUDE_PVR_AU)
153  #endif
154  break;
155 
157  #if defined(INCLUDE_CONNECTED_TV)
158  MHEG5notifyApplicationLaunchStatus((MHEG5Bool)params->eData);
159  #endif
160  break;
161 
162  #if defined(COMMON_INTERFACE)
164  MHEG5notifyCiCamRemove((U32BIT)params->eData);
165  break;
166  #endif
167 
168  default:
169  TRACE(TERROR, ("( %d, %d ) Unknown/Unsupported Event", params->eType, params->eData))
170  break;
171  }
172 }
173 
174 static void NotifyEngineEvent( E_ENGINE_EVENT *pEngineEvent )
175 {
176  MHEG5sendAppEngineEvent( *pEngineEvent );
177 }
178 
179 /*---global function definitions---------------------------------------------*/
180 
181 
190 {
191  MHEG5eventMessage_t event_msg;
192 
193  TRACE(TMHAPI, (""))
194 
195  /* better to pass event on regardless of whether API state is running,
196  * because
197  * if ( MH5GlueIsStarted() )
198  */
199  event_msg.proc_msg_func = (F_MSG_PROCESS)NotifyDvpEvent;
200  event_msg.data_type = DT_VALUE;
201  event_msg.data.dvpEvent.eType = eType;
202  event_msg.data.dvpEvent.eData = eData;
203  return VQ_PutMsg(&event_msg, PRTY_NORMAL);
204 }
205 
216 {
218 }
219 
220 #if defined(INCLUDE_ICS)
221 
228 void MHEG5_NotifySubtitlePrefChanged(void)
229 {
231 }
232 
240 void MHEG5_NotifyAudioDescPrefChanged(void)
241 {
243 }
244 
257 void MHEG5_NotifyGuidanceResponse(BOOLEAN result)
258 {
260 }
261 
262 #endif /* INCLUDE_ICS */
263 
272 {
274 }
275 
284 {
286 }
287 
295 {
297 }
298 
307 {
309 }
310 
322 {
324 }
325 
334 {
335  if (isClip)
336  {
338  }
340 }
341 
351 {
352  if (isClip)
353  {
355  }
357 }
358 
367 {
369 }
370 
371 
377 {
378  S_MhegMessage msg;
379  msg.proc_msg_func = (F_MSG_PROCESS)NotifyEngineEvent;
380  msg.data_type = DT_VALUE;
381  msg.data.engineEvent = engineEvent;
382  if (VQ_PutMsg(&msg, PRTY_HIGH) != MHERR_OK)
383  {
384  TRACE(TERROR, (""))
385  }
386 }
387 
Implement MHEG5 engine control functions (i.e. start/stop etc)
void MHEG5_NotifyVideoStopped(void)
Notifies MHEG5 that the decoder has stopped playing a video stream In other words, no video is playing after this call. See MHEG5_SetVideoStream() and MHEG5_SetVideoControl(). This is a non-blocking function. If the decoder hardware does not support this indication, the DVB stack must simulate it.
Definition: glue_events.c:321
E_MhegErr VQ_PutMsg(S_MhegMessage *pMsg, E_PRIORITY priority)
Post event or section message on queue. Copies data into queue.
Definition: glue_queue.c:248
void MHEG5sendAppEngineEvent(E_ENGINE_EVENT engine_event)
Store an Engine event in the asynchronous event queue.
Definition: mh5queue.c:1633
void MHEG5_NotifyICSReady(void)
This function tells the MHEG-5 engine that the external application is ready to handle IP stream data...
Definition: glue_events.c:366
F_MSG_PROCESS proc_msg_func
Definition: glue_queue.h:198
E_DvbEvent
Definition: dvbevents.h:33
void MHEG5_NotifyVideoStarted(void)
Notifies the MHEG5 component that the previously provided video stream has started playing...
Definition: glue_events.c:306
Debug tracing.
MHEG5 queue.
void MHEG5notifyVideoStarted(void)
Definition: mh5display.c:2734
Miscellaneous.
E_MhegErr MHEG5_NotifyDvbEvent(E_DvbEvent eType, U32BIT eData)
Notifies MHEG5 of event from receiver platform This is a non-blocking function.
Definition: glue_events.c:189
void MHEG5_SendEngineEvent(E_ENGINE_EVENT engineEvent)
Send MHEG app an engine event from an external task.
Definition: glue_events.c:376
E_MhegErr
Definition: mherrors.h:28
void MHEG5_NotifyVideoPrefChanged(void)
Notifies the MHEG5 component when the video preferences change. This is a non-blocking function...
Definition: glue_events.c:215
void(* F_MSG_PROCESS)(void *data)
Function to Process voyager message.
Definition: glue_queue.h:70
Memory functions.
API for IC streamer.
void MHEG5RefreshDefaultAudio(void)
Definition: mh5control.c:1232
Implementation of the resident programs which are defined by the current profile. ...
void MHEG5_NotifySubtitleLangPrefChanged(void)
Notifies the MHEG5 component when the subtitle language preferences change. This is a non-blocking fu...
Definition: glue_events.c:271
short MHEG5Bool
Definition: mh5base.h:71
void MHEG5streamerNotifyStreamingReady(void)
Handle notification that the external application is ready to handle IP stream data.
void MHEG5notifyAudioStopped(BOOLEAN isClip)
Definition: mh5display.c:2864
Event handling. Implementation of a combined queue for events and actions. This is the eventsystem wh...
E_ENGINE_EVENT engineEvent
Definition: glue_queue.h:210
void MHEG5_NotifyICStatusChanged(void)
Notifies the MHEG5 component when the IC connection status changes. This is a non-blocking function...
Definition: glue_events.c:294
E_DvbEvent eType
Definition: glue_queue.h:184
void MHEG5notifyAudioStarted(BOOLEAN isClip)
Definition: mh5display.c:2820
#define MHEG5TRUE
Definition: mh5base.h:49
E_DATA_TYPE data_type
Definition: glue_queue.h:199
void MHEG5notifyVideoStopped(void)
Definition: mh5display.c:2772
void MHEG5_NotifyAudioStopped(BOOLEAN isClip)
Notifies the MHEG5 component that the previously provided audio clip has completed playing all requir...
Definition: glue_events.c:350
File interface functions to DSMCC component.
void MHEG5StreamerRefresh(void)
Refresh any running IC streams - called when user preferences have changed.
S_DvpEventType dvpEvent
Definition: glue_queue.h:206
#define FALSE
Definition: techtype.h:68
void MHEG5NotifyBookingResult(E_MhegErr result)
This should be called, and only called, when DVB_MhegPvrMakeBooking() has previously returned with MH...
U8BIT BOOLEAN
Definition: techtype.h:99
#define TRUE
Definition: techtype.h:69
void MHEG5_NotifyAudioLangPrefChanged(void)
Notifies the MHEG5 component when the audio language preferences change. This is a non-blocking funct...
Definition: glue_events.c:283
Implement generic MHEG5-display functions - independent from the OSD These are generic functions used...
union s_mhg_message::@13 data
#define MHEG5FALSE
Definition: mh5base.h:48
uint32_t U32BIT
Definition: techtype.h:86
Key Press related functionality.
void MHEG5_NotifyAudioStarted(BOOLEAN isClip)
Notifies the MHEG5 component that the previously provided audio stream or clip has started playing...
Definition: glue_events.c:333
E_ENGINE_EVENT
Definition: mh5queue.h:43
#define TRACE(t, x)
Definition: glue_debug.h:118
Header file - Function prototypes for operating system.