MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
mheg5_control.h
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  *******************************************************************************/
50 #ifndef _MHEG5_CONTROL_H
51 #define _MHEG5_CONTROL_H
52 
53 #include "techtype.h"
54 #include "dvblocator.h"
55 #include "mherrors.h"
56 
57 /*---Constant and macro definitions for public use-----------------------------*/
58 
59 /* Section buffer, buffer size (bytes) */
60 #define SECTION_BUFFER_SIZE (4 * 1024)
61 
62 /* Minimum section buffers */
63 #define MHEG5_MIN_SECTION_BUFFERS (100)
64 
65 /* Minimum task priority */
66 #define MHEG5_MIN_TASK_PRIORITY (4)
67 
68 #define NVM_OVERHEAD_SIZE (2 * 1024)
69 #define NVM_STORE_SIZE_AU (64 * 1024)
70 #define NVM_STORE_SIZE_SA (512 * 1024)
71 #define AU_NVM_MINIMUM_SIZE ((1024 * 1024 * 2) + NVM_STORE_SIZE_AU + NVM_OVERHEAD_SIZE)
72 #define SA_NVM_MINIMUM_SIZE ((1024 * 1024 * 32) + NVM_STORE_SIZE_SA + NVM_OVERHEAD_SIZE)
73 
74 /* Interaction Channel Streamer: buffer sizes (bytes) */
75 #define ICS_DEFAULT_BUFFER_SIZE (3 * 1024 * 1024)
76 #define ICS_MINIMUM_BUFFER_SIZE (768 * 1024)
77 
78 /* Values for colourDepth */
79 #define COLOUR_FORMAT_PALETTE 8
80 #define COLOUR_FORMAT_ARGB4444 16
81 #define COLOUR_FORMAT_ARGB7888 31 /* ST based platform */
82 #define COLOUR_FORMAT_ARGB8888 32
83 
84 /*---Enumerations for public use-----------------------------------------------*/
85 
86 typedef enum
87 {
88  CPROFILE_NONE,
89 
90  CPROFILE_UK = (1 << 0), /* United Kingdom only */
91  CPROFILE_NZ = (1 << 1), /* New Zealand only */
92  CPROFILE_AU = (1 << 2), /* Australia only */
93  CPROFILE_HK = (1 << 3), /* Hong Kong only */
94  CPROFILE_SA = (1 << 4), /* South Africa only */
95  CPROFILE_ALL = 0x1f, /* all countries above (but not FreeSat) */
96  CPROFILE_FREESAT = (1 << 8) /* FreeSat profile only */
97 } E_COUNTRY_PROFILE, E_MHEG_PROFILE;
98 
99 /*
100  * Receiver Capabilities
101  */
102 typedef enum
103 {
104  VC_DEFAULT = 0,
105 
106  VC_SUPPORT_MHEG_NATIVE_APP = (1 << 0),
107  VC_SUPPORT_MHEG_UK_PVR = (1 << 0),
108  VC_SUPPORT_MHEG_PVR = (1 << 1),
109  VC_SUPPORT_MHEG_NZ_PVR = (1 << 1),
110  VC_SUPPORT_MHEG_AU_PVR = (1 << 2),
111  VC_SUPPORT_MHEG_INTERACTION_CHANNEL = (1 << 3),
112  VC_SUPPORT_MHEG_IC_STREAMING = (1 << 4),
113  VC_SUPPORT_NON_LINEAR_PLAYBACK_KEYS = (1 << 5),
114  VC_SUPPORT_MHEG_IC_STREAMING_HD = (1 << 6),
115  VC_SUPPORT_OIPF_BROWSER_PROFILE = (1 << 7),
116 
117 /* Unless VC_HD_VIDEO_NOT_SUPPORTED is set, it is assumed that the receiver
118  * can and must support decoding of:
119  * 1. H.264 video/iframes
120  * 2. HE-AAC audio
121  * 3. E-AC3 audio. */
122  VC_HD_VIDEO_NOT_SUPPORTED = (1 << 17),
123 
124 /* Unless VC_SUBT_NOT_SIMULTANEOUS is set, it is assumed the receiver can present
125  * DVB subtitles and presentation engine Visibles simultaneously,
126  * without restriction (see [1] 16.5.1.1) */
127  VC_SUBTITLES_NOT_SIMULTANEOUS = (1 << 18),
128 
129  /* The following MHEG SD scalings are unlikely to be specified, but are here for completeness */
130  VC_NO_VIDEO_OFF_SCREEN = (1 << 27),
131  VC_NO_BITMAP_OFF_SCREEN = (1 << 28),
132  VC_ONLY_SD_DOUBLE_SCALING = (1 << 29),
133  VC_ONLY_SD_STANDARD_SCALING = (1 << 30),
134  VC_ONLY_SD_QUARTER_SCALING = (1 << 31)
135 } E_MHEG5_CAPABILITES;
136 
137 typedef enum
138 {
139  /* Display banner and new channel info to user to indicate that channel has changed */
140  CHANNEL_START_NORMAL,
141 
142  /* No banner displayed, act to user as though on original channel */
143  CHANNEL_START_QUIETLY,
144 
145  /* No banner displayed, but still show new channel info to user */
146  CHANNEL_START_QUIET_SHOW_INFO,
147 } E_ChannelStartMode;
148 
149 /*---Global type defs for public use-------------------------------------------*/
150 
151 /* MHEG5 engine setup structure */
152 typedef struct
153 {
154  /* MHEG5 engine task priority value - passed to STB_OSCreateTask
155  * The specified task priority value is used by the main task for MHEG5 engine
156  * MHEG5 engine's timer task is 2 levels ABOVE this
157  */
158  U32BIT taskPriority;
159 
160  /*
161  * Receiver Capabilities - as given by E_MHEG5_CONFIG above
162  */
163  E_MHEG5_CAPABILITES capabilities;
164 
165  /*
166  * Screen resolution parameters - required by MHEG5 engine graphics
167  */
168  U16BIT screenWidth;
169  U16BIT screenHeight;
170  U8BIT colourDepth;
171 
172  /* Manufacturer string (passed to MHEG) indicating hardware and software specific
173  * support.
174  * Format: mmmcccvvv
175  * Where:
176  * mmm = unique manufacturer name
177  * ccc = unique model code
178  * vvv = principal version
179  */
180  U8BIT *manufacturerString;
181 
182  /*
183  * Country profile support required
184  * Set to CPROFILE_NONE if only require HbbTv support
185  */
186  E_COUNTRY_PROFILE countryProfile;
187 
188  /* Size of Non-Volitile Memory file system for caching broadcast data
189  * MHEG5 Australia profile requires a minimum of 2MB plus 64K.
190  * MHEG5 South Africa profile requires minimum of 32MB plus 512K.
191  * MHEG5 engine monitors the size of the cached data and ensures that the limit
192  * is not exceeded.
193  */
194  U32BIT nvmSize;
195 
196  /* IP streamer buffer
197  *
198  * Streaming content from IP connection requires a buffer. The size is
199  * not specified, but the MHEG-5 component is not allowed to buffer more
200  * than 3 Megabytes.
201  *
202  * The size affects the ability of the receiver to deal with jitter and
203  * variable bitrate. Minimum size is 768 Kbytes.
204  * Less than minimum size, or NULL will disable IP streaming.
205  */
206  void *streamerBuffer;
207  U32BIT streamerBufferSize;
208 
209  /*
210  * Pointer to version string as defined by macro "MHEG5_VER_STRING"
211  */
212  const char *version_string;
213 } S_MhegConfig;
214 
215 /*---Global Function prototypes for public use---------------------------------*/
216 
237 E_MhegErr MHEG5_Open( S_MhegConfig *pSetup );
238 
247 E_MhegErr MHEG5_Close(void);
248 
268 E_MhegErr MHEG5_Start( S32BIT serviceIndex, E_ChannelStartMode *quietMode );
269 
278 E_MhegErr MHEG5_Stop( void );
279 
292 E_MhegErr MHEG5_Suspend( void );
293 
310 E_MhegErr MHEG5_StopWithoutKilling( void );
311 
322 E_MhegErr MHEG5_Pause(void);
323 
334 E_MhegErr MHEG5_Resume(void);
335 
350 E_MhegErr MHEG5_SetScreenResolution( U16BIT screenWidth, U16BIT screenHeight );
351 
365 E_MhegErr MHEG5_SetSurfaceThreshold(S32BIT pixels);
366 
372 void MHEG5_RestoreScreen(void);
373 
378 void* MHEG5_DsmccInstance(void);
379 
388 E_ChannelStartMode MHEG5_GetTuningInfoMode( S32BIT serviceIndex );
389 
390 #endif /* _PM_CONTROL_H */
E_MhegErr MHEG5_Stop(void)
Tells MHEG5 engine to enter stop state (i.e. no broadcast service). This function should kill any cur...
Definition: glue_main.c:764
E_MhegErr MHEG5_Resume(void)
This allows Voyageer to be resumed after another application has had display focus (such as an EPG)...
Definition: glue_main.c:1070
void * MHEG5_DsmccInstance(void)
Get the DSMCC instance handle.
Definition: glue_dsmcc.c:778
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...
Definition: glue_main.c:659
MHEG5 engine interface error codes.
E_MhegErr MHEG5_Open(S_MhegConfig *pSetup)
Initialise MHEG5 engine instance. The following will be performed as a result of a call to this funct...
Definition: glue_main.c:361
E_MhegErr MHEG5_Suspend(void)
Suspend MHEG5 engine (while there is no valid broadcast service). When the external application is pe...
Definition: glue_main.c:887
E_MhegErr MHEG5_SetScreenResolution(U16BIT screenWidth, U16BIT screenHeight)
Sets the screen resolution to new size. This function is required when the external application wishe...
Definition: glue_main.c:1115
System Wide Global Technical Data Type Definitions.
Definition: mheg5_control.h:152
E_MhegErr MHEG5_StopWithoutKilling(void)
Suspend MHEG5 engine (while there is no valid broadcast service). This function should be called as a...
Definition: glue_main.c:825
E_MhegErr MHEG5_Pause(void)
This allows MHEG5 engine to be paused whilst another application has display focus (such as an EPG)...
Definition: glue_main.c:1035
void MHEG5_RestoreScreen(void)
Refresh screen after resolution change with MHEG5_SetScreenResolution() This is a non-blocking functi...
Definition: glue_main.c:1159
E_MhegErr MHEG5_Close(void)
Close MHEG engine. Free allocated MHEG5 engine memory region, and any other related resources...
Definition: glue_main.c:541
Definition of DVB locator and DVB component types.
E_MhegErr MHEG5_SetSurfaceThreshold(S32BIT pixels)
Set the minimum number of pixels that force the MHEG-5 engine to release a surface immediately after ...
E_ChannelStartMode MHEG5_GetTuningInfoMode(S32BIT serviceIndex)
Get the current tuning mode for the target service. This is only relevant when MHEG5 has requested a ...
Definition: mh5control.c:934