al_cc.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. /**
  2. * Copyright(c) 2012 Sunmedia Technologies - All Rights Reserved.
  3. *
  4. * @file
  5. *
  6. * @brief this file defines closed caption and vchip interface for app layer.
  7. *
  8. * The file supports the closed caption and vchip functions by used for app layer.
  9. * The datas related closed caption functions include analog and digitial datas and
  10. * the datas related vchip functions include analog datas only.
  11. */
  12. #ifndef __AL_CC_H__
  13. #define __AL_CC_H__
  14. #include "al_basictypes.h"
  15. #ifdef __cplusplus
  16. extern "C"{
  17. #endif
  18. /**
  19. * @brief number definition for closed caption service.
  20. *
  21. * before starting to start closed caption funtion, it needs select closed caption
  22. * service number for gotten source data.
  23. */
  24. typedef enum
  25. {
  26. AL_CC_SERV_CC1 = 1, /**< CC1 service*/
  27. AL_CC_SERV_CC2, /**< CC2 service*/
  28. AL_CC_SERV_CC3, /**< CC3 service*/
  29. AL_CC_SERV_CC4, /**< CC4 service*/
  30. AL_CC_SERV_TXT1, /**< TEXT1 service*/
  31. AL_CC_SERV_TXT2, /**< TEXT2 service*/
  32. AL_CC_SERV_TXT3, /**< TEXT3 service*/
  33. AL_CC_SERV_TXT4, /**< TEXT4 service*/
  34. AL_CC_SERV_CS1, /**< CS1 service*/
  35. AL_CC_SERV_CS2, /**< CS2 service*/
  36. AL_CC_SERV_CS3, /**< CS3 service*/
  37. AL_CC_SERV_CS4, /**< CS4 service*/
  38. AL_CC_SERV_CS5, /**< CS5 service*/
  39. AL_CC_SERV_CS6, /**< CS6 service*/
  40. AL_CC_SERV_MAX /**< invalid service*/
  41. }AL_CC_Serv_Num_t;
  42. typedef enum
  43. {
  44. AL_CC_SRC_ATV = 0,
  45. AL_CC_SRC_DTV,
  46. AL_CC_SRC_MAX
  47. }AL_CC_Source_Type_t;
  48. /**
  49. * @brief font size definition for closed caption.
  50. */
  51. typedef enum
  52. {
  53. AL_CC_FONT_SIZE_DEFAULT, /**< default font size*/
  54. AL_CC_FONT_SIZE_SMALL, /**< small font size*/
  55. AL_CC_FONT_SIZE_MEDIUM, /**< medium font size*/
  56. AL_CC_FONT_SIZE_LARGE /**< large font size*/
  57. } AL_CC_Font_Size_t;
  58. /**
  59. * @brief font style definition for closed caption.
  60. */
  61. typedef enum
  62. {
  63. AL_CC_FONT_STYLE_DEFAULT = 0, /**< default style*/
  64. AL_CC_FONT_STYLE_MONO_SERIF, /**< monospaced with serifs style*/
  65. AL_CC_FONT_STYLE_PROPORTIONAL_SERIF, /**< proportionally spaced with serifs style*/
  66. AL_CC_FONT_STYLE_MONO_SANS_SERIF, /**< monospaced without serifs style*/
  67. AL_CC_FONT_STYLE_PROPORTIONAL_SANS_SERIF,/**<proportionally spaced without serifs*/
  68. AL_CC_FONT_STYLE_CASUAL, /**< casual font type*/
  69. AL_CC_FONT_STYLE_CURSIVE, /**< cursive font type*/
  70. AL_CC_FONT_STYLE_SMALL_CAPTITALS /**< small capitals*/
  71. } AL_CC_Font_Style_t;
  72. /**
  73. * @brief color type definition for closed caption.
  74. */
  75. typedef enum
  76. {
  77. AL_CC_COLOR_TYPE_DEFAULT, /**< default color*/
  78. AL_CC_COLOR_TYPE_BLACK, /**< black color*/
  79. AL_CC_COLOR_TYPE_WHITE, /**< white color*/
  80. AL_CC_COLOR_TYPE_RED, /**< red color*/
  81. AL_CC_COLOR_TYPE_GREEN, /**< green color*/
  82. AL_CC_COLOR_TYPE_BLUE, /**< blue color*/
  83. AL_CC_COLOR_TYPE_YELLOW, /**< yellow color*/
  84. AL_CC_COLOR_TYPE_MAGENTA, /**< magenta color*/
  85. AL_CC_COLOR_TYPE_CYAN /**< cyan color*/
  86. } AL_CC_Color_Type_t;
  87. /**
  88. * @brief opacity type definition for closed caption.
  89. */
  90. typedef enum
  91. {
  92. AL_CC_OPACITY_TYPE_DEFAULT, /**< default type*/
  93. AL_CC_OPACITY_TYPE_SOLID, /**< solid type*/
  94. AL_CC_OPACITY_TYPE_FLASHING, /**< flashing type*/
  95. AL_CC_OPACITY_TYPE_TRANSLUCENT, /**< translucent type*/
  96. AL_CC_OPACITY_TYPE_TRANSPARENT /**< transparent type*/
  97. } AL_CC_Opacity_Type_t;
  98. /**
  99. * @brief border type definition for closed caption.
  100. */
  101. typedef enum
  102. {
  103. AL_CC_BORDER_TYPE_DEFAULT, /**< default type*/
  104. AL_CC_BORDER_TYPE_RAISED, /**< raised type*/
  105. AL_CC_BORDER_TYPE_DEPRESSED, /**< depressed type*/
  106. AL_CC_BORDER_TYPE_UNIFORM, /**< uniform type*/
  107. AL_CC_BORDER_TYPE_LEFTDROPSHADOW,/**< left drop shadow type*/
  108. AL_CC_BORDER_TYPE_RIGHTDROPSHADOW/**< right drop shadow type*/
  109. } AL_CC_Border_Type_t;
  110. /**
  111. * @brief setting closed caption information by user.
  112. */
  113. typedef struct _AL_CC_Info_t
  114. {
  115. AL_CC_Serv_Num_t CcServNum; /**< set closed caption service number*/
  116. AL_CC_Font_Size_t CcFontSize; /**< set closed caption font size*/
  117. AL_CC_Font_Style_t CcFontStyle; /**< set closed caption font style*/
  118. AL_CC_Color_Type_t CcFgColor; /**< set closed caption char fg color*/
  119. AL_CC_Opacity_Type_t CcFgOpacity; /**< set closed caption char fg opacity*/
  120. AL_CC_Color_Type_t CcBgColor; /**< set closed caption char bg color*/
  121. AL_CC_Opacity_Type_t CcBgOpacity; /**< set closed caption char bg opacity*/
  122. AL_CC_Color_Type_t CcWindowColor; /**< set closed caption window color*/
  123. AL_CC_Opacity_Type_t CcWindowOpacity; /**< set closed caption window opacity*/
  124. AL_CC_Color_Type_t CcFontEdgeColor; /**< set closed caption edge color*/
  125. AL_CC_Border_Type_t CcFontEdgeType; /**< set closed caption edge type*/
  126. }AL_CC_Info_t;
  127. /**
  128. * @brief tv rate value definition for vchip us rating region.
  129. */
  130. typedef enum
  131. {
  132. AL_VCHIP_TV_RATE_NULL, /**< none*/
  133. AL_VCHIP_TV_RATE_G, /**< general audience*/
  134. AL_VCHIP_TV_RATE_PG, /**< parental guidance suggested*/
  135. AL_VCHIP_TV_RATE_14, /**< parents strongly cautioned*/
  136. AL_VCHIP_TV_RATE_MA /**< mature audience only*/
  137. }AL_VCHIP_US_TV_Rate_t;
  138. /**
  139. * @brief dialog rate value definition for vchip us rating region.
  140. */
  141. typedef enum
  142. {
  143. AL_VCHIP_DIALOG_RATE_NULL, /**< none*/
  144. AL_VCHIP_DIALOG_RATE_PG, /**< some suggestive diaglog*/
  145. AL_VCHIP_DIALOG_RATE_14, /**< intensely suggestive diaglog*/
  146. }AL_VCHIP_US_Dia_Rate_t;
  147. /**
  148. * @brief language rate value definition for vchip us rating region.
  149. */
  150. typedef enum
  151. {
  152. AL_VCHIP_LANGUAGE_RATE_NULL, /**< none*/
  153. AL_VCHIP_LANGUAGE_RATE_PG, /**< infrequent coarse language*/
  154. AL_VCHIP_LANGUAGE_RATE_14, /**< strong coarse language*/
  155. AL_VCHIP_LANGUAGE_RATE_MA /**< crude indecent language*/
  156. }AL_VCHIP_US_Lan_Rate_t;
  157. /**
  158. * @brief sex rate value definition for vchip us rating region.
  159. */
  160. typedef enum
  161. {
  162. AL_VCHIP_SEX_RATE_NULL, /**< none*/
  163. AL_VCHIP_SEX_RATE_PG, /**< some sexual situations*/
  164. AL_VCHIP_SEX_RATE_14, /**< intense sexual situations*/
  165. AL_VCHIP_SEX_RATE_MA /**< explicit sexual activity*/
  166. }AL_VCHIP_US_Sex_Rate_t;
  167. /**
  168. * @brief violence rate value definition for vchip us rating region.
  169. */
  170. typedef enum
  171. {
  172. AL_VCHIP_VIOLENCE_RATE_NULL, /**< none*/
  173. AL_VCHIP_VIOLENCE_RATE_PG, /**< moderate violence*/
  174. AL_VCHIP_VIOLENCE_RATE_14, /**< intense violence*/
  175. AL_VCHIP_VIOLENCE_RATE_MA /**< graphic violence*/
  176. }AL_VCHIP_US_Vio_Rate_t;
  177. /**
  178. * @brief children rate value definition for vchip us rating region.
  179. */
  180. typedef enum
  181. {
  182. AL_VCHIP_CHILD_RATE_NULL, /**< none*/
  183. AL_VCHIP_CHILD_RATE_Y, /**< all children*/
  184. AL_VCHIP_CHILD_RATE_Y7, /**< childen age 7 and above*/
  185. AL_VCHIP_CHILD_RATE_Y7_FV /**< fantasy violence for childen age 7 and above*/
  186. }AL_VCHIP_US_Child_Rate_t;
  187. /**
  188. * @brief mpaa rate value definition for vchip us rating region.
  189. */
  190. typedef enum
  191. {
  192. AL_VCHIP_MPAA_RATE_NULL,
  193. AL_VCHIP_MPAA_RATE_NA, /**< none*/
  194. AL_VCHIP_MPAA_RATE_G, /**< suitable for all ages*/
  195. AL_VCHIP_MPAA_RATE_PG, /**< parental guidance suggested*/
  196. AL_VCHIP_MPAA_RATE_PG13, /**< parental strongly cautioned*/
  197. AL_VCHIP_MPAA_RATE_R, /**< restricted, under 17 must be accompanied by adult*/
  198. AL_VCHIP_MPAA_RATE_NC17, /**< no one 17 and under admitted*/
  199. AL_VCHIP_MPAA_RATE_X, /**< no one 17 and under admitted*/
  200. AL_VCHIP_MPAA_RATE_NR /**< not rated by mpaa*/
  201. }AL_VCHIP_MPAA_Rate_t;
  202. /**
  203. * @brief rate value definition for canadian english rating region.
  204. */
  205. typedef enum
  206. {
  207. AL_VCHIP_CANADIAN_ENGLISH_NULL = 0x0,
  208. AL_VCHIP_CANADIAN_ENGLISH_RATE_E = 0x8,/**< exempt*/
  209. AL_VCHIP_CANADIAN_ENGLISH_RATE_C = 0x1,/**< programming intended for children under age 8*/
  210. AL_VCHIP_CANADIAN_ENGLISH_RATE_C8 = 0x2,/**< programming generally considered acceptable for children
  211. 8 years and over to watch on their own*/
  212. AL_VCHIP_CANADIAN_ENGLISH_RATE_G = 0x3,/**< general audience*/
  213. AL_VCHIP_CANADIAN_ENGLISH_RATE_PG = 0x4,/**< parental guidance*/
  214. AL_VCHIP_CANADIAN_ENGLISH_RATE_14 = 0x5,/**< programming contains themes or content which may not
  215. be suitable for viewers under the age of 14*/
  216. AL_VCHIP_CANADIAN_ENGLISH_RATE_18 = 0x6,/**< adult*/
  217. }AL_VCHIP_CAN_ENG_Rate_t;
  218. /**
  219. * @brief rate value definition for canadian french rating region.
  220. */
  221. typedef enum
  222. {
  223. AL_VCHIP_CANADIAN_FRENCH_NULL = 0,
  224. AL_VCHIP_CANADIAN_FRENCH_RATE_E = 0x8,/**< exempt*/
  225. AL_VCHIP_CANADIAN_FRENCH_RATE_G = 0x1,/**< general*/
  226. AL_VCHIP_CANADIAN_FRENCH_RATE_8ANS = 0x2,/**< 8+ general -not recommended for young children*/
  227. AL_VCHIP_CANADIAN_FRENCH_RATE_13ANS = 0x3,/**< programming may not be suitable for children under the
  228. age of 13*/
  229. AL_VCHIP_CANADIAN_FRENCH_RATE_16ANS = 0x4,/**< programming is not suitable for children under the age of 16*/
  230. AL_VCHIP_CANADIAN_FRENCH_RATE_18ANS = 0x5,/**< programming restricted to adults*/
  231. }AL_VCHIP_CAN_FRE_Rate_t;
  232. typedef struct _AL_VCHIP_US_Rate_t
  233. {
  234. AL_VCHIP_US_TV_Rate_t TvRate; /**< tv rate*/
  235. AL_VCHIP_US_Dia_Rate_t DiaRate; /**< dialog rate*/
  236. AL_VCHIP_US_Lan_Rate_t LanRate; /**< language rate*/
  237. AL_VCHIP_US_Sex_Rate_t SexRate; /**< sex rate*/
  238. AL_VCHIP_US_Vio_Rate_t VioRate; /**< violence rate*/
  239. AL_VCHIP_US_Child_Rate_t ChildRate; /**< children rate*/
  240. }AL_VCHIP_TVPG_Rate_t;
  241. /**
  242. * @brief us rate information definition.
  243. */
  244. typedef struct
  245. {
  246. AL_VCHIP_TVPG_Rate_t TVPGRate;
  247. AL_VCHIP_MPAA_Rate_t MPAARate; /**< mpaa rate*/
  248. }AL_VCHIP_US_Rate_t;
  249. /**
  250. * @brief canadian rate information definition.
  251. */
  252. typedef struct _AL_VCHIP_CAN_Rate_t
  253. {
  254. AL_VCHIP_CAN_ENG_Rate_t CanEngRate; /**< canadian english language rate*/
  255. AL_VCHIP_CAN_FRE_Rate_t CanFreRate; /**< canadian french language*/
  256. }AL_VCHIP_CAN_Rate_t;
  257. /**
  258. * @brief getting vchip rate region information from flash or eeprom.
  259. */
  260. typedef struct _AL_CC_VCHIP_Rate_t
  261. {
  262. AL_VCHIP_US_Rate_t USRateRegion; /**< us region information*/
  263. AL_VCHIP_CAN_Rate_t CANRateRegion; /**< canadian region information*/
  264. } AL_CC_VCHIP_Rate_Region_t;
  265. /**
  266. * @brief closed caption start function.
  267. *
  268. * The function will start to get cc and xds data from tt slicer and
  269. * creat decode thread to decode cc and xds data.
  270. *
  271. * @param srctype mid layer need source type to decode cc608 or cc708.
  272. *
  273. * @return AL_SUCCESS if starting is successful, AL_FAILURE
  274. * otherwise.
  275. */
  276. AL_Return_t AL_CC_Start(AL_CC_Source_Type_t srctype);
  277. /**
  278. * @brief closed caption stop function.
  279. *
  280. * 1.The function will stop to get cc and xds data from tt slicer and
  281. * stop to decode cc and xds data;
  282. * 2.The function will stop to display cc on the screen.
  283. *
  284. * @param al_void.
  285. *
  286. * @return AL_SUCCESS if starting is successful, AL_FAILURE
  287. * otherwise.
  288. */
  289. AL_Return_t AL_CC_Stop(al_void);
  290. /**
  291. * @brief closed caption start to display function.
  292. *
  293. * The function will display closed caption on the screen
  294. *
  295. * @param *CCInfo the display information gotten from eeprom/flash if user setting
  296. * the display information on the main menu.
  297. *
  298. * @return AL_SUCCESS if starting is successful, AL_FAILURE
  299. * otherwise.
  300. */
  301. AL_Return_t AL_CC_View(AL_CC_Info_t *CCInfo);
  302. /**
  303. * @brief closed caption stop to display function.
  304. *
  305. * The function will stop to display closed caption.
  306. *
  307. * @param al_void.
  308. *
  309. * @return AL_SUCCESS if stopping is successful, AL_FAILURE
  310. * otherwise.
  311. */
  312. AL_Return_t AL_CC_Unview(al_void);
  313. /**
  314. * @brief the function will reset closed caption module, following initialization
  315. * or a programe change.
  316. *
  317. * @param al_void.
  318. *
  319. * @return AL_SUCCESS if reseting is successful, AL_FAILURE
  320. * therwise.
  321. */
  322. AL_Return_t AL_CC_Reset(al_void);
  323. /**
  324. * @brief the function will get closed caption data being valid or not.
  325. *
  326. * @param *Status gotten the signal status value. if gotten closed caption is
  327. * successful, the gotten signal status is al_true, else the gotten signal status
  328. * is al_false.
  329. *
  330. * @return AL_SUCCESS if gotten signal is successful, AL_FAILURE
  331. * therwise.
  332. */
  333. AL_Return_t AL_CC_GetSignalStatus(al_bool *Status);
  334. #ifdef __cplusplus
  335. }
  336. #endif
  337. #endif