DVBCore
1.0
Open source DVB engine
|
00001 /******************************************************************************* 00002 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org) 00003 * Copyright © 2004 Ocean Blue Software Ltd 00004 * 00005 * This file is part of a DTVKit Software Component 00006 * You are permitted to copy, modify or distribute this file subject to the terms 00007 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org 00008 * 00009 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 00010 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 00011 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 00012 * 00013 * If you or your organisation is not a member of DTVKit then you have access 00014 * to this source code outside of the terms of the licence agreement 00015 * and you are expected to delete this and any associated files immediately. 00016 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org 00017 *******************************************************************************/ 00026 // pre-processor mechanism so multiple inclusions don't cause compilation error 00027 00028 #ifndef _STBEBUTT_H 00029 #define _STBEBUTT_H 00030 00031 //---Constant and macro definitions for public use----------------------------- 00032 00033 //---Enumerations for public use----------------------------------------------- 00034 00035 typedef enum e_ebutt_event 00036 { 00037 // These are the four FastText shortcuts, usually represented by red, green, 00038 // yellow and blue keys on the handset. 00039 EBUTT_EVENT_QUICK_NAVIGATE_1, 00040 EBUTT_EVENT_QUICK_NAVIGATE_2, 00041 EBUTT_EVENT_QUICK_NAVIGATE_3, 00042 EBUTT_EVENT_QUICK_NAVIGATE_4, 00043 // The ten numeric keys used to input page indexes. 00044 EBUTT_EVENT_0, 00045 EBUTT_EVENT_1, 00046 EBUTT_EVENT_2, 00047 EBUTT_EVENT_3, 00048 EBUTT_EVENT_4, 00049 EBUTT_EVENT_5, 00050 EBUTT_EVENT_6, 00051 EBUTT_EVENT_7, 00052 EBUTT_EVENT_8, 00053 EBUTT_EVENT_9, 00054 // This is the home key, which returns to the nominated index page for this 00055 // service. 00056 EBUTT_EVENT_INDEXPAGE, 00057 // These are used to quickly increment/decrement the page index. 00058 EBUTT_EVENT_NEXTPAGE, 00059 EBUTT_EVENT_PREVIOUSPAGE, 00060 // These are used to navigate the sub-pages when in 'hold' mode. 00061 EBUTT_EVENT_NEXTSUBPAGE, 00062 EBUTT_EVENT_PREVIOUSSUBPAGE, 00063 // These are used to traverse the page history (if caching requested). 00064 EBUTT_EVENT_BACKPAGE, 00065 EBUTT_EVENT_FORWARDPAGE, 00066 // This is used to toggle hold on the current page. 00067 EBUTT_EVENT_HOLD, 00068 // Reveal hidden page content (as defined in EBU specification) 00069 EBUTT_EVENT_REVEAL, 00070 // This key toggles 'clear' mode (page hidden until updated) 00071 EBUTT_EVENT_CLEAR, 00072 // Used to toggle transparent background ('video mix' mode) 00073 EBUTT_EVENT_MIX_VIDEO, 00074 // Used to toggle double height top / double-height bottom / normal height display. 00075 EBUTT_EVENT_DOUBLE_HEIGHT, 00076 // Functional enhancement may offer finer scrolling of double-height display. 00077 EBUTT_EVENT_DOUBLE_SCROLL_UP, 00078 EBUTT_EVENT_DOUBLE_SCROLL_DOWN, 00079 // Used to initiate/cancel 'timer' mode (clear and re-display page at set time) 00080 EBUTT_EVENT_TIMER 00081 } 00082 E_EBUTT_EVENT; 00083 00084 00085 typedef enum e_ebutt_caching_method 00086 { 00087 // No caching is performed - only presently displayed page and optionally next requested 00088 // page information is held in the system. 00089 EBUTT_CACHING_METHOD_NONE = 0, 00090 00091 // An nominal number of pages in the carousel numbering sequence that are close to the currently 00092 // displayed page are cached. 00093 // The minimal amount of memory allocation is required for this simple caching. 00094 EBUTT_CACHING_METHOD_PREVIOUS_NEXT, 00095 00096 // As for EBUTT_CACHING_METHOD_PREVIOUS_NEXT, but also... 00097 // Previously visited pages are cached, up to a nominal limit. 00098 // The allows for easy travelral of a chain of recently visited pages. 00099 // Some memory allocation is required for this caching. 00100 EBUTT_CACHING_METHOD_HISTORY, 00101 00102 // As for EBUTT_CACHING_METHOD_HISTORY, but also... 00103 // The FLOF (or FastText) page navigation links are cached for the 00104 // currently displayed page. 00105 // More complex memory allocation is required for this caching. 00106 EBUTT_CACHING_METHOD_NAVIGATION, 00107 00108 // As for EBUTT_CACHING_METHOD_NAVIGATION, but also... 00109 // The pages defined in a tree of navigation links to the currently 00110 // displayed page are cached. 00111 // Complex memory allocation is required for this caching. 00112 EBUTT_CACHING_METHOD_NAVIGATION_TREE, 00113 00114 // All TeleText carousel content is cached - offers optimal performance. 00115 // Significant amounts of memory allocation are required for this caching. 00116 EBUTT_CACHING_METHOD_ALL 00117 } 00118 E_EBUTT_CACHING_METHOD; 00119 00120 typedef enum e_ebutt_character_set_designation 00121 { 00122 EBUTT_CHARACTER_SET_DESIGNATION_LATIN_DEFAULT = 0, 00123 EBUTT_CHARACTER_SET_DESIGNATION_LATIN_POLISH = 1, 00124 EBUTT_CHARACTER_SET_DESIGNATION_LATIN_TURKISH = 2, 00125 EBUTT_CHARACTER_SET_DESIGNATION_LATIN_SERBIAN_RUMANIAN = 3, 00126 EBUTT_CHARACTER_SET_DESIGNATION_CYRILLIC = 4, 00127 EBUTT_CHARACTER_SET_DESIGNATION_GREEK_TURKISH = 6, 00128 EBUTT_CHARACTER_SET_DESIGNATION_LATIN_ARABIC = 8, 00129 EBUTT_CHARACTER_SET_DESIGNATION_HEBREW_ARABIC = 10 00130 } 00131 E_EBUTT_CHARACTER_SET_DESIGNATION; 00132 00133 //---Global type defs for public use------------------------------------------- 00134 00135 typedef struct s_ebutt_font 00136 { 00137 U8BIT character_width; 00138 U8BIT character_height; 00139 00140 U32BIT seperator_row_mask; 00141 U32BIT seperator_column_mask; 00142 00143 U8BIT *font_table_set_ptr[13]; // each points to 96 * character_width * character_height values 00144 // whereby each value is a pixel representation. 00145 00146 U8BIT *font_table_option_subset_ptr; // each points to 169 * character_width * character_height values 00147 // whereby each value is a pixel representation. 00148 } 00149 S_EBUTT_FONT; 00150 00151 /* Pointer to "midware held" ebutt font data */ 00152 extern const S_EBUTT_FONT *const ebutt_font_ptr; 00153 00154 //---Global Function prototypes for public use--------------------------------- 00155 00156 //************************************************************************************************** 00157 // 00158 // Function Name : STB_EBUTT_Initialise 00159 // 00160 // Description : This must be called to invoke the EBU TeleText driver module before all other 00161 // functionality can be accessed. This initiates the relevant resources used by the 00162 // driver module. 00163 // As a consequence of calling this function, no TeleText processing will occur until 00164 // other functions are called. 00165 // It is envisaged that this function may be called within the general initialisation 00166 // of the STB layer. 00167 // 00168 // Parameters : None. 00169 // 00170 // Returns : TRUE if initialisation was successful, FALSE otherwise. 00171 // 00172 //************************************************************************************************** 00173 BOOLEAN STB_EBUTT_Initialise(void); 00174 00175 //************************************************************************************************** 00176 // 00177 // Function Name : STB_EBUTT_Kill 00178 // 00179 // Description : This is the accompanying function to STB_EBUTT_Initialise( ), and is called to 00180 // shut-down the EBU TeleText driver module and release the relevant resources used 00181 // by the driver module. 00182 // This may not be used in some implementations. 00183 // 00184 // Parameters : None. 00185 // 00186 // Returns : Nothing. 00187 // 00188 //************************************************************************************************** 00189 void STB_EBUTT_Kill(U8BIT path); 00190 00191 //************************************************************************************************** 00192 // 00193 // Function Name : STB_EBUTT_Start, STB_EBUTT_Stop 00194 // 00195 // Description : These functions are called to control whether received TeleText data is processed. 00196 // Using this functionality ensures that the process of collating page information can 00197 // be halted when processing resources are a consideration. 00198 // It is envisaged that some implementations may wish only to collate TeleText content 00199 // only when the display is being shown, 00200 // whilst other designs may which to cache significant page content as a background 00201 // process. 00202 // Abstracting this functionality from the initialisation routines gives the option 00203 // to support both solution types. 00204 // 00205 // Parameters : BOOLEAN reset_cache - clears all pages from the cache if set to TRUE, saving 00206 // memory resources. 00207 // 00208 // Returns : Nothing. 00209 // 00210 //************************************************************************************************** 00211 void STB_EBUTT_Start(U8BIT path, U16BIT text_pid, U8BIT magazine, U8BIT page); 00212 00213 void STB_EBUTT_Stop(U8BIT path, BOOLEAN reset_cache); 00214 00215 /*!************************************************************************** 00216 * @brief Allows teletext PES data packets to be injected by an external module, 00217 * which will be decoded and displayed. 00218 * @param data_ptr - pointer to first whole PES packet data 00219 * @param data_length - number of bytes of data provided 00220 * @return TRUE if the data is valid EBU teletext PES data, FALSE otherwise 00221 ****************************************************************************/ 00222 BOOLEAN STB_EBUTT_InjectData(U8BIT *data_ptr, U32BIT data_length); 00223 00224 //************************************************************************************************** 00225 // 00226 // Function Name : STB_EBUTT_Show 00227 // 00228 // Description : Called to initiate continuous display of TeleText page content. 00229 // This will result in either the index page defined in the service data stream 00230 // being selected, or the previously displayed page (prior to a call to 00231 // STB_EBUTT_Hide( ) being made) from being reinstated. 00232 // This function can be called irrespective of the use of the STB_EBUTT_Start( ) / 00233 // STB_EBUTT_Stop( ) functions, but of course may result in no TeleText data being 00234 // displayed if none already exists within the cache. 00235 // The return value indicates whether initialisation of the display mechanism has been 00236 // successful or not. 00237 // 00238 // Parameters : E_STB_EBUTT_CHARACTER_SET_DESIGNATION character_set_designation - 00239 // used to specifiy the default character set designation for a level 1.0 00240 // Teletext broadcast. This is useful to configure the implementation to work 00241 // correctly when used with regionalised broadcasts. 00242 // BOOLEAN navigate_to_index_page - set it TRUE if the index page defined within the 00243 // Teletext service is used, or the last visited page 00244 // is re-displayed. 00245 // 00246 // Returns : TRUE if initialisation of diaply mechanism was successful, FALSE otherwise. 00247 // 00248 //************************************************************************************************** 00249 BOOLEAN STB_EBUTT_Show(E_EBUTT_CHARACTER_SET_DESIGNATION character_set_designation, 00250 BOOLEAN navigate_to_index_page, BOOLEAN show_header); 00251 00252 //************************************************************************************************** 00253 // 00254 // Function Name : STB_EBUTT_Hide 00255 // 00256 // Description : Called to halt the continuous display of TeleText page content, and to clear the 00257 // relevant area of the application display. 00258 // 00259 // Parameters : None. 00260 // 00261 // Returns : Nothing. 00262 // 00263 //************************************************************************************************** 00264 void STB_EBUTT_Hide(void); 00265 00266 //************************************************************************************************** 00267 // 00268 // Function Name : STB_EBUTT_Hide 00269 // 00270 // Description : Called to define the strategy used to determine what page content is to be 00271 // displayed form the TeleText carousel content. 00272 // 00273 // Parameters : E_EBUTT_CACHING_METHOD ebutt_caching_method - 00274 // 00275 // Returns : Nothing. 00276 // 00277 //************************************************************************************************** 00278 void STB_EBUTT_SetCacheMethod(E_EBUTT_CACHING_METHOD ebutt_caching_method); 00279 00280 //************************************************************************************************** 00281 // 00282 // Function Name : STB_EBUTT_NotifyEvent 00283 // 00284 // Description : Called whenever a TeleText-specific event being invoked. This is used to pass 00285 // relevant user input to the driver, and the enumerate type supplied is defined 00286 // independently of any IR handset / keypad. 00287 // 00288 // Parameters : E_EBUTT_EVENT event_type - 00289 // 00290 // Returns : Nothing. 00291 // 00292 //************************************************************************************************** 00293 void STB_EBUTT_NotifyEvent(E_EBUTT_EVENT event_type); 00294 00295 //************************************************************************************************** 00296 // 00297 // Function Name : STB_EBUTT_NotifyServiceChange 00298 // 00299 // Description : Called whenever the application permits a TV/Radio service change during a TeleText 00300 // display session. This is provided because an update of the display to new page 00301 // content is required. 00302 // 00303 // Parameters : None. 00304 // 00305 // Returns : Nothing. 00306 // 00307 //************************************************************************************************** 00308 void STB_EBUTT_NotifyServiceChange(void); 00309 00310 //************************************************************************************************** 00311 // 00312 // Function Name : STB_EBUTT_SetDisplayBrightness 00313 // 00314 // Description : Called to adjust the display brightness (colour intensity) of the Teletext pages. 00315 // 00316 // Parameters : U8BIT gun_intensity - a RGB gun intensity, ranging from 255 (brightest) to 00317 // 127 (darkest) 00318 // 00319 // Returns : Nothing. 00320 // 00321 //************************************************************************************************** 00322 void STB_EBUTT_SetDisplayBrightness(U8BIT gun_intensity); 00323 00324 //************************************************************************************************** 00325 // 00326 // Function Name : STB_EBUTT_IncreaseDisplayBrightness / STB_EBUTT_DecreaseDisplayBrightness 00327 // 00328 // Description : Called to adjust the display brightness (colour intensity) of the Teletext pages. 00329 // 00330 // Parameters : None. 00331 // 00332 // Returns : Nothing. 00333 // 00334 //************************************************************************************************** 00335 void STB_EBUTT_IncreaseDisplayBrightness(void); 00336 00337 void STB_EBUTT_DecreaseDisplayBrightness(void); 00338 00339 //************************************************************************************************** 00340 // 00341 // Function Name : STB_EBUTT_SetDisplayAntiAliasing 00342 // 00343 // Description : Called to adjust the display anti-aliasing level of the Teletext pages. 00344 // This is used to control 'flicker' on TV displays. 00345 // 00346 // Parameters : U8BIT antialias_level - a factor between zero (no anti-alaising) to 8 (full 00347 // anti-aliasing 00348 // 00349 // Returns : Nothing. 00350 // 00351 //************************************************************************************************** 00352 void STB_EBUTT_SetDisplayAntiAliasing(U8BIT antialias_level); 00353 00354 //************************************************************************************************** 00355 // 00356 // Function Name : STB_EBUTT_IncreaseDisplayAntiAliasing / STB_EBUTT_DecreaseDisplayAntiAliasing 00357 // 00358 // Description : Called to adjust the display anti-aliasing level of the Teletext pages. 00359 // 00360 // Parameters : None. 00361 // 00362 // Returns : Nothing. 00363 // 00364 //************************************************************************************************** 00365 void STB_EBUTT_IncreaseDisplayAntiAliasing(void); 00366 void STB_EBUTT_DecreaseDisplayAntiAliasing(void); 00367 00368 //************************************************************************************************** 00369 // 00370 // Function Name : STB_EBUTT_SetDisplayMixTransparency 00371 // 00372 // Description : Called to adjust the display video-mix transparency level of the Teletext pages. 00373 // 00374 // Parameters : U8BIT transparency_level - a factor between zero (no transparency) to 255 (full 00375 // transparency) 00376 // 00377 // Returns : Nothing. 00378 // 00379 //************************************************************************************************** 00380 void STB_EBUTT_SetDisplayMixTransparency(U8BIT transparency_level); 00381 00382 //************************************************************************************************** 00383 // 00384 // Function Name : STB_EBUTT_IncreaseDisplayMixTransparency / STB_EBUTT_DecreaseDisplayMixTransparency 00385 // 00386 // Description : Called to adjust the display video-mix transparency level of the Teletext pages. 00387 // 00388 // Parameters : None. 00389 // 00390 // Returns : Nothing. 00391 // 00392 //************************************************************************************************** 00393 void STB_EBUTT_IncreaseDisplayMixTransparency(void); 00394 void STB_EBUTT_DecreaseDisplayMixTransparency(void); 00395 00396 //************************************************************************************************** 00397 // 00398 // Function Name : STB_EBUTT_IsDisplayHeld 00399 // 00400 // Description : Called to ascertain whether the present page is in 'hold' mode or not. 00401 // Thus function is useful when allocating handet keys to events on the basis of 00402 // the current functional state of the Teletext driver. 00403 // 00404 // Parameters : None. 00405 // 00406 // Returns : TRUE if the displayed page is held, FALSE otherwise. 00407 // 00408 //************************************************************************************************** 00409 BOOLEAN STB_EBUTT_IsDisplayHeld(void); 00410 00411 //************************************************************************************************** 00412 // 00413 // Function Name : STB_EBUTT_IsDisplayDoubleHeight 00414 // 00415 // Description : Called to ascertain whether the present page is in 'double height' mode or not. 00416 // Thus function is useful when allocating handet keys to events on the basis of 00417 // the current functional state of the Teletext driver. 00418 // 00419 // Parameters : None. 00420 // 00421 // Returns : TRUE if the displayed page is double height, FALSE otherwise. 00422 // 00423 //************************************************************************************************** 00424 BOOLEAN STB_EBUTT_IsDisplayDoubleHeight(void); 00425 00426 #endif // _STBEBUTT_H 00427 00428 //***************************************************************************** 00429 // End of file 00430 //*****************************************************************************