mid_cc.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. /******************************************************************************
  2. *
  3. * @file pl_cc.h
  4. *
  5. * @brief This file contains some function to surport cc and vchip.\n
  6. *
  7. * @note Modified by yong.bai on 2010/04/16. \n
  8. * All rights reserved.
  9. *
  10. * @author
  11. *
  12. ******************************************************************************/
  13. #ifndef _MID_CC_H_
  14. #define _MID_CC_H_
  15. /*******************************************************************************
  16. * Header include
  17. ******************************************************************************/
  18. #include "types.h"
  19. //#include "gsl.h"
  20. #include "cc708_interface.h"
  21. #include "cc608_interface.h"
  22. /*******************************************************************************
  23. * Constant
  24. ******************************************************************************/
  25. #define CC_COLOR_TRANSPARENT (0x00000000)
  26. #define CC_COLOR_BLACK (0xff000000)
  27. #define CC_COLOR_WHITE (0xffffffff)
  28. #define CC_COLOR_RED (0xffff0000)
  29. #define CC_COLOR_BLUE (0xff0000ff)
  30. #define CC_COLOR_GREEN (0xff00ff00)
  31. #define CC_COLOR_YELLOW (0xffffff00)
  32. #define CC_COLOR_MAGENTA (0xffff00ff)
  33. #define CC_COLOR_CYAN (0xff00ffff)
  34. #define CC_COLOR_GREY (0xff808080)
  35. /*xds event*/
  36. typedef enum
  37. {
  38. XDS_CURRENT_PROG_TITLE = 0,
  39. XDS_FUTURE_PROG_TITLE,
  40. XDS_EVENT_MAX
  41. }XDSEvent_t;
  42. typedef void (*Vchip_Callback_f)(UINT8 ucData1, UINT8 ucData2);
  43. typedef void (*Xds_Callback_f)(XDSEvent_t eventtype, void *param);
  44. typedef struct
  45. {
  46. Vchip_Callback_f vchip_callback;
  47. Xds_Callback_f xds_callback;
  48. }MID_CC_CallBack_t;
  49. typedef enum
  50. {
  51. MID_CC_SRC_ATV = 0,
  52. MID_CC_SRC_DTV,
  53. MID_CC_SRC_MAX
  54. }MID_CC_Source_Type_t;
  55. /*cc service type*/
  56. typedef enum
  57. {
  58. SERVICETYPE_CC1 = 1,
  59. SERVICETYPE_CC2,
  60. SERVICETYPE_CC3,
  61. SERVICETYPE_CC4,
  62. SERVICETYPE_TT1,
  63. SERVICETYPE_TT2,
  64. SERVICETYPE_TT3,
  65. SERVICETYPE_TT4,
  66. SERVICETYPE_CS1,
  67. SERVICETYPE_CS2,
  68. SERVICETYPE_CS3,
  69. SERVICETYPE_CS4,
  70. SERVICETYPE_CS5,
  71. SERVICETYPE_CS6,
  72. SERVICETYPE_MAX
  73. } EServicetype_e;
  74. /* return value types */
  75. typedef enum
  76. {
  77. MID_CC_FAILURE = -1,
  78. MID_CC_INVALID_PARAM = -2,
  79. MID_CC_SUCCESS = 0,
  80. } MID_Ret_e;
  81. /*CC type definition*/
  82. typedef enum
  83. {
  84. CC_TYPE_CC708,
  85. CC_TYPE_CC608,
  86. CC_TYPE_MAX
  87. } CCType_t;
  88. enum //Sam081129
  89. {
  90. PL_CC_LINE21_RUNNING,
  91. PL_CC_LINE21_STOP
  92. };
  93. /* cc start status */
  94. typedef enum
  95. {
  96. CC_VIEW,
  97. CC_UNVIEW,
  98. CC_START,
  99. CC_STOP,
  100. CC_INIT,
  101. CC_TERMINAL
  102. }MID_CC_STATUS_T;
  103. /* Aspect ratio */
  104. typedef enum CCWindowAspectRatio_t {
  105. CC_WINDOW_ASPECT_RATIO_4_3,
  106. CC_WINDOW_ASPECT_RATIO_16_9,
  107. CC_WINDOW_ASPECT_RATIO_OTHERS,
  108. CC_WINDOW_ASPECT_RATIO_TOTAL
  109. }CCWindowAspectRatio_t;
  110. /* Window opacity type */
  111. typedef enum CCWindowOpacityType_t {
  112. CCWIN_OPACITY_DEFAULT,
  113. CCWIN_OPACITY_SOLID,
  114. CCWIN_OPACITY_FLASHING,
  115. CCWIN_OPACITY_TRANSLUCENT,
  116. CCWIN_OPACITY_TRANSPARENT
  117. }CCWindowOpacityType_t;
  118. /* Window edge types */
  119. typedef enum CCWindowEdgeType_t {
  120. CC_EDGE_DEFAULT,
  121. CC_EDGE_RAISED ,
  122. CC_EDGE_DEPRESSED,
  123. CC_EDGE_UNIFORM ,
  124. CC_EDGE_LEFT_DROP_SHADOW,
  125. CC_EDGE_RIGHT_DROP_SHADOW
  126. }CCWindowEdgeType_t;
  127. /* Dimension of the video */
  128. typedef enum CCWindowResolution_t {
  129. CC_WINDOW_RESOLUTION_640x480,
  130. CC_WINDOW_RESOLUTION_704x480,
  131. CC_WINDOW_RESOLUTION_720x480,
  132. CC_WINDOW_RESOLUTION_1280x720,
  133. CC_WINDOW_RESOLUTION_1920x1080,
  134. CC_WINDOW_RESOLUTION_TOTAL
  135. }CCWindowResolution_t;
  136. /* FontOpacity type */
  137. typedef enum CCFontOpacityType_t {
  138. CCFONT_OPACITY_DEFAULT,
  139. CCFONT_OPACITY_SOLID,
  140. CCFONT_OPACITY_FLASHING,
  141. CCFONT_OPACITY_TRANSLUCENT,
  142. CCFONT_OPACITY_TRANSPARENT
  143. }CCFontOpacityType_t;
  144. /* Different font styles */
  145. typedef enum CCFontStyle_t {
  146. CCFONT_STYLE_DEFAULT = 0,
  147. CCFONT_STYLE_MONO_SERIF,
  148. CCFONT_STYLE_PROPORTIONAL_SERIF,
  149. CCFONT_STYLE_MONO_SANS_SERIF,
  150. CCFONT_STYLE_PROPORTIONAL_SANS_SERIF,
  151. CCFONT_STYLE_CASUAL,
  152. CCFONT_STYLE_CURSIVE,
  153. CCFONT_STYLE_SMALL_CAPTITALS
  154. }CCFontStyle_t;
  155. /* Different font sizes */
  156. typedef enum CCFontSize_t {
  157. CCFONT_SIZE_DEFAULT,
  158. CCFONT_SIZE_SMALL ,
  159. CCFONT_SIZE_MEDIUM,
  160. CCFONT_SIZE_LARGE
  161. }CCFontSize_t;
  162. /* Font edge types */
  163. typedef enum CCFontEdgeType_t {
  164. CCFONT_EDGE_DEFAULT,
  165. CCFONT_EDGE_RAISED,
  166. CCFONT_EDGE_DEPRESSED,
  167. CCFONT_EDGE_UNIFORM,
  168. CCFONT_EDGE_LEFT_DROP_SHADOW,
  169. CCFONT_EDGE_RIGHT_DROP_SHADOW
  170. }CCFontEdgeType_t;
  171. /* CC Display Types */
  172. typedef enum CCDisaplyType_t {
  173. CCDISP_TYPE_608,
  174. CCDISP_TYPE_708,
  175. CCDISP_TYPE_MAX
  176. }CCDisplayType_t;
  177. /*CC Color*/
  178. typedef enum
  179. {
  180. CCCOLOR_TYPE_DEFAULT, /**< default color*/
  181. CCCOLOR_TYPE_BLACK, /**< black color*/
  182. CCCOLOR_TYPE_WHITE, /**< white color*/
  183. CCCOLOR_TYPE_RED, /**< red color*/
  184. CCCOLOR_TYPE_GREEN, /**< green color*/
  185. CCCOLOR_TYPE_BLUE, /**< blue color*/
  186. CCCOLOR_TYPE_YELLOW, /**< yellow color*/
  187. CCCOLOR_TYPE_MAGENTA, /**< magenta color*/
  188. CCCOLOR_TYPE_CYAN /**< cyan color*/
  189. } CCColorType_t;
  190. /* Font attributes */
  191. typedef struct CCFontAttrib_t {
  192. Boolean italic;
  193. Boolean underline;
  194. Boolean bold;
  195. CCColorType_t fgColor;
  196. CCColorType_t bgColor;
  197. CCColorType_t EdgeColor;
  198. CCFontOpacityType_t FgOpacityType;
  199. CCFontOpacityType_t BgOpacityType;
  200. CCFontStyle_t FontStyle;
  201. CCFontSize_t FontSize;
  202. CCFontEdgeType_t FontEdgeType;
  203. }CCFontAttrib_t;
  204. /* CC Init structure */
  205. typedef struct CCInitAttrib_t {
  206. UINT32 WindowColor;
  207. UINT32 EdgeColor;
  208. CCWindowAspectRatio_t WindowAspectRatio;
  209. CCWindowOpacityType_t WindowOpacity;
  210. CCWindowEdgeType_t WindowEdge;
  211. CCFontAttrib_t CCFontAttrib;
  212. }CCInitAttrib_t;
  213. /* cc Initializing */
  214. MID_Ret_e MID_CC_Initialize(MID_CC_CallBack_t callback);
  215. /*cc start*/
  216. MID_Ret_e MID_CC_Start(MID_CC_Source_Type_t srctype);
  217. MID_Ret_e MID_CC_View(EServicetype_e service_no, CCType_t cc_type, CCInitAttrib_t *stCcInitAttrib);
  218. /* get current cc status */
  219. MID_CC_STATUS_T MID_Get_CC_Status(void);
  220. /*cc stop*/
  221. MID_Ret_e MID_CC_Stop(void);
  222. MID_Ret_e MID_CC_Unview(void);
  223. /*cc reset*/
  224. void MID_CC_Reset(void);
  225. /* cc terminating*/
  226. MID_Ret_e MID_CC_Terminate(void);
  227. /* get cc vchip version*/
  228. void MID_Get_CC_Vchip_version(void **cc_vchip_version);
  229. unsigned char MID_CC_GetSignalStatus(void);
  230. #endif // _PL_CC_H_