ai_teletext.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /**
  2. * Copyright(c) 2011 Sunmedia Technologies - All Rights Reserved.
  3. *
  4. * @file
  5. *
  6. * @brief this file defines teletext interface for afw layer.
  7. *
  8. * The file supports teletext functions by used for afw layer, and the datas related
  9. * teletext functions are "EBU teletext" datas. "EBU teletext" datas include teletext subtitle
  10. * datas. So the function in the file includes teletext subtitle function.
  11. */
  12. #ifndef __AI_TELETEXT_H__
  13. #define __AI_TELETEXT_H__
  14. #include "al_basictypes.h"
  15. #include "al_teletext.h"
  16. #include "mid_ttx_intf.h"
  17. #ifdef __cplusplus
  18. extern "C"{
  19. #endif
  20. /**
  21. * @brief teletext init function.
  22. *
  23. * This api is used to create mutex for protecting the shared resource
  24. * and so on.
  25. *
  26. * @param al_void.
  27. *
  28. * @return AL_SUCCESS if initialization is successful, AL_FAILURE
  29. * otherwise.
  30. */
  31. AL_Return_t AI_TTX_Init(TT_Callback_f TT_CallBack);
  32. /**
  33. * @brief teletext uninit function.
  34. *
  35. * This api is used to delete mutex for protecting the shared resource
  36. * and so on.
  37. *
  38. * @param al_void.
  39. *
  40. * @return AL_SUCCESS if uninitialization is successful, AL_FAILURE
  41. * otherwise.
  42. */
  43. AL_Return_t AI_TTX_Uninit(al_void);
  44. /**
  45. * @brief the function can parse teletext descriptor in PMT.
  46. *
  47. * After parsing PMT, PSI listener will start to work. When the stream
  48. * type is private data of PES packet, the teletext descriptor will be parsing.
  49. * When parsing the teletext descriptor, the information: teletext pid, teletext
  50. * language, teletext type, teletext magazine number and page number will be
  51. * stored to teletext buffer.
  52. *
  53. * @param *Data teletext descpriptor data.
  54. *
  55. * @param DataLen the number of bytes of descriptors.
  56. *
  57. * @param Pid teletext pid.
  58. *
  59. * @return AL_SUCCESS if parsing teletext descriptor is successful,
  60. * AL_FAILURE otherwise.
  61. */
  62. AL_Return_t AI_TTX_ParseDesc(al_uint8 *Data, al_uint16 DataLen, al_uint16 Pid);
  63. /**
  64. * @brief the function can set subtitle display window freezed or not.
  65. *
  66. * After the video is freezed with pressing freeze key, if the subtitle is
  67. * displaying on the screen, the subtitle needs be freezed. Else the
  68. * video isn't freezed with pressing freeze key again, if the subtitle is
  69. * displaying on the screen, the subtitle needn't be freezed.
  70. *
  71. * @param FreezeStatus if freeze is true, the subtitle needs be freezed.
  72. * Else if freeze is false, the subtitle needn't be freezed.
  73. *
  74. * @return al_void.
  75. */
  76. al_void AI_TTX_SetSubtitleFreeze(al_bool FreezeStatus);
  77. /**
  78. * @brief the function will start subtitle to display.
  79. *
  80. * The function will change teletext mode to subtitle mode, and start to display
  81. * subtitle on the screen. The function will create teletext decoder thread, and init
  82. * slicer param. The demux channel of teletext channel will be opened with teletext
  83. * pid and the subtitle page number and language will be set to middleware layer,
  84. * and the parsing task will start to decode subtitle page.
  85. *
  86. * @param Index user selects subtitle number on the subtitle menu, and using index, the special
  87. * subtitle descriptor information will be gotten from teletext descriptor buffer.
  88. *
  89. * @return AL_SUCCESS if teletext subtitle starting is successful,
  90. * AL_FAILURE otherwise.
  91. */
  92. AL_Return_t AI_TTX_StartSubtitle(al_uint8 Index);
  93. /**
  94. * @brief the function will stop subtitle to display.
  95. *
  96. * @param al_void.
  97. *
  98. * @return AL_SUCCESS if teletext subtitle stop is successful,
  99. * AL_FAILURE otherwise.
  100. */
  101. AL_Return_t AI_TTX_StopSubtitle(al_void);
  102. /**
  103. * @brief the function can get file ts teletext subtitle information from pe module
  104. *
  105. * when play recorded file, if need to display teletext subtitle on the screen, the file ts
  106. * teletext subtitle information need to be gotten from pe module.
  107. *
  108. * @param SubInfo the subtitle information will be getton from PE module.
  109. *
  110. * @return AL_SUCCESS if getting file ts teletext subtitle information is successful,
  111. * AL_FAILURE otherwise.
  112. */
  113. AL_Return_t AI_TTX_GetFileTsSubInfo(AL_TTX_Desc_Info_t SubInfo);
  114. /**
  115. * @brief get wss data function
  116. *
  117. * This api is used to get wss data from ttdecoder.
  118. *
  119. * @param al_void.
  120. *
  121. * @return wss data.
  122. */
  123. al_uint16 AI_TTX_GetWSSData(al_void);
  124. #ifdef __cplusplus
  125. }
  126. #endif
  127. #endif