| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2002-2006, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bdcc.h $ |
|---|
| 11 | * $brcm_Revision: 4 $ |
|---|
| 12 | * $brcm_Date: 9/22/06 1:32p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /BSEAV/lib/ccgfx/include/bdcc.h $ |
|---|
| 19 | * |
|---|
| 20 | * 4 9/22/06 1:32p btosi |
|---|
| 21 | * PR22275: added support for clearing the screen if the CC data stream |
|---|
| 22 | * stops for an extended period (30 seconds) |
|---|
| 23 | * |
|---|
| 24 | * 3 9/15/06 12:07p btosi |
|---|
| 25 | * PR22275: added support for font edges |
|---|
| 26 | * |
|---|
| 27 | * 2 8/17/06 1:12p btosi |
|---|
| 28 | * PR22275: consolidated common definitions into this include file |
|---|
| 29 | * |
|---|
| 30 | * 1 3/17/05 7:58p shyam |
|---|
| 31 | * PR 8365 : Add other sub-modules of ccgfx |
|---|
| 32 | * |
|---|
| 33 | ***************************************************************************/ |
|---|
| 34 | |
|---|
| 35 | #ifndef BDCC_H |
|---|
| 36 | #define BDCC_H |
|---|
| 37 | |
|---|
| 38 | #ifdef __cplusplus |
|---|
| 39 | extern "C" { |
|---|
| 40 | #endif |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | typedef enum BDCC_608_Service |
|---|
| 44 | { |
|---|
| 45 | BDCC_Min_608_Serivce = 1, |
|---|
| 46 | BDCC_Max_608_Service = 4 |
|---|
| 47 | |
|---|
| 48 | } BDCC_608_Service; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | typedef enum BDCC_708_Service |
|---|
| 52 | { |
|---|
| 53 | BDCC_Min_708_Serivce = 1, |
|---|
| 54 | BDCC_Max_708_Service = 63 |
|---|
| 55 | |
|---|
| 56 | } BDCC_708_Service; |
|---|
| 57 | |
|---|
| 58 | /* |
|---|
| 59 | ** The EIA standard defines the following pen sizes. |
|---|
| 60 | */ |
|---|
| 61 | typedef enum BDCC_PenSize |
|---|
| 62 | { |
|---|
| 63 | BDCC_PenSize_Small = 0, |
|---|
| 64 | BDCC_PenSize_Standard = 1, |
|---|
| 65 | BDCC_PenSize_Large = 2, |
|---|
| 66 | BDCC_PenSize_Max_Size = 3 |
|---|
| 67 | |
|---|
| 68 | } BDCC_PenSize ; |
|---|
| 69 | |
|---|
| 70 | /* |
|---|
| 71 | ** The EIA standard defines the following pen styles. |
|---|
| 72 | */ |
|---|
| 73 | typedef enum BDCC_PenStyle |
|---|
| 74 | { |
|---|
| 75 | BDCC_PenStyle_Standard = 0, |
|---|
| 76 | BDCC_PenStyle_Italics = 1, |
|---|
| 77 | BDCC_PenStyle_Underline = 2, |
|---|
| 78 | BDCC_PenStyle_Italics_Underline = 3 |
|---|
| 79 | |
|---|
| 80 | } BDCC_PenStyle ; |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | /* |
|---|
| 84 | ** The EIA-708 standard specifies 8 font styles. |
|---|
| 85 | */ |
|---|
| 86 | typedef enum BDCC_FontStyle |
|---|
| 87 | { |
|---|
| 88 | BDCC_FontStyle_Default = 0, |
|---|
| 89 | BDCC_FontStyle_MonoSerifs = 1, |
|---|
| 90 | BDCC_FontStyle_PropSerifs = 2, |
|---|
| 91 | BDCC_FontStyle_Mono = 3, |
|---|
| 92 | BDCC_FontStyle_Prop = 4, |
|---|
| 93 | BDCC_FontStyle_Casual = 5, |
|---|
| 94 | BDCC_FontStyle_Cursive = 6, |
|---|
| 95 | BDCC_FontStyle_SmallCaps = 7, |
|---|
| 96 | BDCC_FontStyle_Max_Value = 8 |
|---|
| 97 | |
|---|
| 98 | } BDCC_FontStyle ; |
|---|
| 99 | |
|---|
| 100 | /* |
|---|
| 101 | ** Pen and window colors have an associated opacity, enum'ed here. |
|---|
| 102 | ** The Translucent opacity is alpha blending with some unspecified alpha value. |
|---|
| 103 | */ |
|---|
| 104 | typedef enum BDCC_Opacity |
|---|
| 105 | { |
|---|
| 106 | BDCC_Opacity_Solid = 0, |
|---|
| 107 | BDCC_Opacity_Flash = 1, |
|---|
| 108 | BDCC_Opacity_Translucent = 2, |
|---|
| 109 | BDCC_Opacity_Transparent = 3 |
|---|
| 110 | |
|---|
| 111 | } BDCC_Opacity ; |
|---|
| 112 | |
|---|
| 113 | /* |
|---|
| 114 | ** The EIA-708 standard defines the following edge (outline) styles. |
|---|
| 115 | */ |
|---|
| 116 | typedef enum BDCC_Edge |
|---|
| 117 | { |
|---|
| 118 | BDCC_Edge_Style_None = 0, |
|---|
| 119 | BDCC_Edge_Style_Raised = 1, |
|---|
| 120 | BDCC_Edge_Style_Depressed = 2, |
|---|
| 121 | BDCC_Edge_Style_Uniform = 3, |
|---|
| 122 | BDCC_Edge_Style_LeftDropShadow = 4, |
|---|
| 123 | BDCC_Edge_Style_RightDropShadow = 5 |
|---|
| 124 | |
|---|
| 125 | } BDCC_Edge ; |
|---|
| 126 | |
|---|
| 127 | /* |
|---|
| 128 | * ** The EIA-708 standard specifies 4 text justifications. |
|---|
| 129 | * */ |
|---|
| 130 | typedef enum BDCC_Justify |
|---|
| 131 | { |
|---|
| 132 | BDCC_Justify_eLeft = 0, |
|---|
| 133 | BDCC_Justify_eRight = 1, |
|---|
| 134 | BDCC_Justify_eCenter= 2, |
|---|
| 135 | BDCC_Justify_eFull = 3 |
|---|
| 136 | } BDCC_Justify ; |
|---|
| 137 | |
|---|
| 138 | /* |
|---|
| 139 | * ** The EIA-708 standard specifies 4 print directions. |
|---|
| 140 | * */ |
|---|
| 141 | typedef enum BDCC_Direction |
|---|
| 142 | { |
|---|
| 143 | BDCC_Direction_eLeftToRight = 0, |
|---|
| 144 | BDCC_Direction_eRightToLeft = 1, |
|---|
| 145 | BDCC_Direction_eTopToBottom = 2, |
|---|
| 146 | BDCC_Direction_eBottomToTop = 3 |
|---|
| 147 | } BDCC_Direction ; |
|---|
| 148 | |
|---|
| 149 | /* |
|---|
| 150 | * ** Display mode constants. |
|---|
| 151 | * */ |
|---|
| 152 | typedef enum BDCC_WINLIB_Display_Modes |
|---|
| 153 | { |
|---|
| 154 | BDCC_WINLIB_Display_480i, |
|---|
| 155 | BDCC_WINLIB_Display_480p, |
|---|
| 156 | BDCC_WINLIB_Display_720p, |
|---|
| 157 | BDCC_WINLIB_Display_1080i, |
|---|
| 158 | BDCC_WINLIB_Display_1080p, |
|---|
| 159 | BDCC_WINLIB_Display_Max_Size |
|---|
| 160 | |
|---|
| 161 | }BDCC_WINLIB_Display_Modes; |
|---|
| 162 | |
|---|
| 163 | /* |
|---|
| 164 | ** The default edge width, this be overridden by the "application". |
|---|
| 165 | */ |
|---|
| 166 | #define BDCC_Edge_Width 1 |
|---|
| 167 | |
|---|
| 168 | /* |
|---|
| 169 | ** The following attributes can be overriden by the viewer. |
|---|
| 170 | */ |
|---|
| 171 | typedef struct BDCC_ENG_OverRides |
|---|
| 172 | { |
|---|
| 173 | BDCC_PenSize PenSize ; |
|---|
| 174 | BDCC_FontStyle FontStyle ; |
|---|
| 175 | unsigned int FgColor ; |
|---|
| 176 | BDCC_Opacity FgOpacity ; |
|---|
| 177 | unsigned int BgColor ; |
|---|
| 178 | BDCC_Opacity BgOpacity ; |
|---|
| 179 | unsigned int EdgeColor ; |
|---|
| 180 | BDCC_Edge EdgeType ; |
|---|
| 181 | int Italics; |
|---|
| 182 | int Underline; |
|---|
| 183 | |
|---|
| 184 | } BDCC_ENG_OverRides ; |
|---|
| 185 | |
|---|
| 186 | /* |
|---|
| 187 | ** Per the EIA documentation: if CC data is not received for 30 seconds, |
|---|
| 188 | ** the screen should be cleared. |
|---|
| 189 | */ |
|---|
| 190 | #define BDCC_Data_Timeout_MSecs ( 1000 * 30 ) |
|---|
| 191 | #define BDCC_CS_Timeout_MSecs ( 1000 * 6 ) |
|---|
| 192 | |
|---|
| 193 | /* |
|---|
| 194 | ** The following masks are used to manage attributes specified both |
|---|
| 195 | ** in the MPEG stream and by the "viewer". |
|---|
| 196 | */ |
|---|
| 197 | #define BDCC_ATTR_MASK_NONE 0x00000000 |
|---|
| 198 | |
|---|
| 199 | #define BDCC_ATTR_MASK_ANCHOR 0x00000001 |
|---|
| 200 | #define BDCC_ATTR_MASK_BORDER 0x00000002 |
|---|
| 201 | #define BDCC_ATTR_MASK_CLEARWINDOW 0x00000004 |
|---|
| 202 | #define BDCC_ATTR_MASK_DEFINED_CLR 0x00000008 |
|---|
| 203 | #define BDCC_ATTR_MASK_DEFINED_SET 0x00000010 |
|---|
| 204 | #define BDCC_ATTR_MASK_EDGECOLOR 0x00000020 |
|---|
| 205 | #define BDCC_ATTR_MASK_EDGETYPE 0x00000040 |
|---|
| 206 | #define BDCC_ATTR_MASK_EFFECT 0x00000080 |
|---|
| 207 | #define BDCC_ATTR_MASK_FILL 0x00000100 |
|---|
| 208 | #define BDCC_ATTR_MASK_FONTSTYLE 0x00000200 |
|---|
| 209 | #define BDCC_ATTR_MASK_ITALICS 0x00000400 |
|---|
| 210 | #define BDCC_ATTR_MASK_JUSTIFY 0x00000800 |
|---|
| 211 | #define BDCC_ATTR_MASK_LOCK 0x00001000 |
|---|
| 212 | #define BDCC_ATTR_MASK_PENBG 0x00002000 |
|---|
| 213 | #define BDCC_ATTR_MASK_PENFG 0x00004000 |
|---|
| 214 | #define BDCC_ATTR_MASK_PENLOC 0x00008000 |
|---|
| 215 | #define BDCC_ATTR_MASK_PENSIZE 0x00010000 |
|---|
| 216 | #define BDCC_ATTR_MASK_PENSTYLEID 0x00020000 |
|---|
| 217 | #define BDCC_ATTR_MASK_PRINTDIR 0x00040000 |
|---|
| 218 | #define BDCC_ATTR_MASK_RCCOUNT 0x00080000 |
|---|
| 219 | #define BDCC_ATTR_MASK_SCROLLDIR 0x00100000 |
|---|
| 220 | #define BDCC_ATTR_MASK_UNDERLINE 0x00200000 |
|---|
| 221 | #define BDCC_ATTR_MASK_VISIBLE 0x00400000 |
|---|
| 222 | #define BDCC_ATTR_MASK_WNDSTYLEID 0x00800000 |
|---|
| 223 | #define BDCC_ATTR_MASK_WORDWRAP 0x01000000 |
|---|
| 224 | |
|---|
| 225 | |
|---|
| 226 | |
|---|
| 227 | /******************************************** |
|---|
| 228 | * |
|---|
| 229 | * Enum: DCCERR |
|---|
| 230 | * |
|---|
| 231 | * Description: |
|---|
| 232 | * |
|---|
| 233 | * DCCERR enumerates the error codes returned |
|---|
| 234 | * by the collection of DCC Libraries. |
|---|
| 235 | * |
|---|
| 236 | ********************************************/ |
|---|
| 237 | typedef enum BDCC_Error |
|---|
| 238 | { |
|---|
| 239 | BDCC_Error_eSuccess = 0, |
|---|
| 240 | BDCC_Error_eObjectNotInitialized, |
|---|
| 241 | BDCC_Error_eInvalidParameter, |
|---|
| 242 | BDCC_Error_eOutputBufTooSmall, |
|---|
| 243 | BDCC_Error_eNullPointer, |
|---|
| 244 | BDCC_Error_eBadOutputType, |
|---|
| 245 | BDCC_Error_eBufferOverflow, |
|---|
| 246 | BDCC_Error_eArgOutOfRange, |
|---|
| 247 | BDCC_Error_eSequence, |
|---|
| 248 | BDCC_Error_eWrnPause, |
|---|
| 249 | BDCC_Error_eNoMemory |
|---|
| 250 | |
|---|
| 251 | } BDCC_Error ; |
|---|
| 252 | |
|---|
| 253 | |
|---|
| 254 | /******************************************** |
|---|
| 255 | * |
|---|
| 256 | * Structure: BDCC_OutputInfo |
|---|
| 257 | * |
|---|
| 258 | * Description: |
|---|
| 259 | * |
|---|
| 260 | * The BDCC_OutputInfo structure holds the |
|---|
| 261 | * information related to an output buffer. |
|---|
| 262 | * |
|---|
| 263 | ********************************************/ |
|---|
| 264 | typedef struct BDCC_OutputInfo |
|---|
| 265 | { |
|---|
| 266 | /* |
|---|
| 267 | * pOutputBuf |
|---|
| 268 | * |
|---|
| 269 | * This points to a buffer into which |
|---|
| 270 | * DccXxx_Process() will copy output bytes. |
|---|
| 271 | */ |
|---|
| 272 | unsigned char * pOutputBuf ; |
|---|
| 273 | |
|---|
| 274 | /* |
|---|
| 275 | * OutputBufSize |
|---|
| 276 | * |
|---|
| 277 | * The size in bytes of the buffer pointed |
|---|
| 278 | * to by pOutputBuf. |
|---|
| 279 | */ |
|---|
| 280 | unsigned int OutputBufSize ; |
|---|
| 281 | |
|---|
| 282 | /* |
|---|
| 283 | * OutputBytesProduced |
|---|
| 284 | * |
|---|
| 285 | * the DccXxx_Process() function will update this |
|---|
| 286 | * field, indicating how many bytes were copied |
|---|
| 287 | * to the output buffer. |
|---|
| 288 | */ |
|---|
| 289 | unsigned int OutputBytesProduced ; |
|---|
| 290 | |
|---|
| 291 | /* |
|---|
| 292 | * DccError |
|---|
| 293 | * |
|---|
| 294 | * Recoverable errors related to processing for |
|---|
| 295 | * a particular output are reported here. |
|---|
| 296 | */ |
|---|
| 297 | BDCC_Error DccError ; |
|---|
| 298 | |
|---|
| 299 | } BDCC_OutputInfo ; |
|---|
| 300 | |
|---|
| 301 | /*************************************************************************** |
|---|
| 302 | * Summary: |
|---|
| 303 | * Winlib rectangle |
|---|
| 304 | * |
|---|
| 305 | * Description: |
|---|
| 306 | * Winlib rectangle |
|---|
| 307 | * |
|---|
| 308 | * See Also: |
|---|
| 309 | * |
|---|
| 310 | * ****************************************************************************/ |
|---|
| 311 | typedef struct BDCC_WINLIB_Rect |
|---|
| 312 | { |
|---|
| 313 | unsigned int x; /* can be < 0 */ |
|---|
| 314 | unsigned int y; /* can be < 0 */ |
|---|
| 315 | unsigned int width; |
|---|
| 316 | unsigned int height; |
|---|
| 317 | } BDCC_WINLIB_Rect; |
|---|
| 318 | |
|---|
| 319 | |
|---|
| 320 | #ifdef __cplusplus |
|---|
| 321 | } |
|---|
| 322 | #endif |
|---|
| 323 | |
|---|
| 324 | #endif /* BDCC_H */ |
|---|