1 | /* |
2 | Copyright (c) 2012, Broadcom Europe Ltd |
3 | All rights reserved. |
4 | |
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the following conditions are met: |
7 | * Redistributions of source code must retain the above copyright |
8 | notice, this list of conditions and the following disclaimer. |
9 | * Redistributions in binary form must reproduce the above copyright |
10 | notice, this list of conditions and the following disclaimer in the |
11 | documentation and/or other materials provided with the distribution. |
12 | * Neither the name of the copyright holder nor the |
13 | names of its contributors may be used to endorse or promote products |
14 | derived from this software without specific prior written permission. |
15 | |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY |
20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ |
27 | |
28 | /* |
29 | * SDTV common host header for TV service |
30 | */ |
31 | |
32 | #ifndef _VC_SDTV_H_ |
33 | #define _VC_SDTV_H_ |
34 | |
35 | /** Different SDTV modes */ |
36 | /** colour */ |
37 | typedef enum SDTV_COLOUR_ |
38 | { |
39 | SDTV_COLOUR_UNKNOWN = 0x0, |
40 | SDTV_COLOUR_RGB = 0x4, |
41 | SDTV_COLOUR_YPRPB = 0x8, |
42 | SDTV_COLOUR_FORCE_32BIT = 0x80000000 |
43 | } SDTV_COLOUR_T; |
44 | /** operation mode */ |
45 | typedef enum SDTV_MODE_T_ |
46 | { |
47 | SDTV_MODE_NTSC = 0, /**<Normal NTSC */ |
48 | SDTV_MODE_NTSC_J = 1, /**<Japanese version of NTSC - no pedestal.*/ |
49 | SDTV_MODE_PAL = 2, /**<Normal PAL */ |
50 | SDTV_MODE_PAL_M = 3, /**<Brazilian version of PAL - 525/60 rather than 625/50, different subcarrier */ |
51 | SDTV_MODE_FORMAT_MASK = 0x3, |
52 | |
53 | SDTV_MODE_OUTPUT_MASK = 0xc, |
54 | |
55 | SDTV_MODE_YPRPB_480i = (SDTV_MODE_NTSC | SDTV_COLOUR_YPRPB), |
56 | SDTV_MODE_RGB_480i = (SDTV_MODE_NTSC | SDTV_COLOUR_RGB), |
57 | SDTV_MODE_YPRPB_576i = (SDTV_MODE_PAL | SDTV_COLOUR_YPRPB), |
58 | SDTV_MODE_RGB_576i = (SDTV_MODE_PAL | SDTV_COLOUR_RGB), |
59 | |
60 | SDTV_MODE_PROGRESSIVE = 0x10, /**<240p progressive output*/ |
61 | |
62 | SDTV_MODE_OFF = 0x80, |
63 | SDTV_MODE_FORCE_32BIT = 0x80000000 |
64 | } SDTV_MODE_T; |
65 | |
66 | /** Different aspect ratios */ |
67 | typedef enum SDTV_ASPECT_T_ |
68 | { |
69 | // TODO: extend this to allow picture placement/size to be communicated. |
70 | SDTV_ASPECT_UNKNOWN = 0, /**<Unknown */ |
71 | SDTV_ASPECT_4_3 = 1, /**<4:3 */ |
72 | SDTV_ASPECT_14_9 = 2, /**<14:9 */ |
73 | SDTV_ASPECT_16_9 = 3, /**<16:9 */ |
74 | SDTV_ASPECTFORCE_32BIT = 0x80000000 |
75 | } SDTV_ASPECT_T; |
76 | |
77 | /** SDTV power on option */ |
78 | typedef struct SDTV_OPTIONS_T_ |
79 | { |
80 | SDTV_ASPECT_T aspect; |
81 | } SDTV_OPTIONS_T; |
82 | |
83 | /** |
84 | * Different copy protection modes |
85 | * At the moment we have only implemented Macrovision |
86 | */ |
87 | typedef enum |
88 | { |
89 | SDTV_CP_NONE = 0, /**<No copy protection */ |
90 | SDTV_CP_MACROVISION_TYPE1 = 1, /**<Macrovision Type 1 */ |
91 | SDTV_CP_MACROVISION_TYPE2 = 2, /**<Macrovision Type 2 */ |
92 | SDTV_CP_MACROVISION_TYPE3 = 3, /**<Macrovision Type 3 */ |
93 | SDTV_CP_MACROVISION_TEST1 = 4, /**<Macrovision Test 1 */ |
94 | SDTV_CP_MACROVISION_TEST2 = 5, /**<Macrovision Test 2 */ |
95 | SDTV_CP_CGMS_COPYFREE = 6, /**<CGMS copy freely */ |
96 | SDTV_CP_CGMS_COPYNOMORE = 7, /**<CGMS copy no more */ |
97 | SDTV_CP_CGMS_COPYONCE = 8, /**<CGMS copy once */ |
98 | SDTV_CP_CGMS_COPYNEVER = 9, /**<CGMS copy never */ |
99 | SDTV_CP_WSS_COPYFREE = 10, /**<WSS no restriction */ |
100 | SDTV_CP_WSS_COPYRIGHT_COPYFREE = 11, /**<WSS copyright asserted */ |
101 | SDTV_CP_WSS_NOCOPY = 12, /**<WSS copying restricted */ |
102 | SDTV_CP_WSS_COPYRIGHT_NOCOPY = 13, /**<WSS copying restriced, copyright asserted */ |
103 | SDTV_CP_FORCE_32BIT = 0x80000000 |
104 | } SDTV_CP_MODE_T; |
105 | |
106 | /** |
107 | * SDTV internal state |
108 | */ |
109 | typedef struct { |
110 | uint32_t state; |
111 | uint32_t width; |
112 | uint32_t height; |
113 | uint16_t frame_rate; |
114 | uint16_t scan_mode; |
115 | SDTV_MODE_T mode; |
116 | SDTV_OPTIONS_T display_options; |
117 | SDTV_COLOUR_T colour; |
118 | SDTV_CP_MODE_T cp_mode; |
119 | } SDTV_DISPLAY_STATE_T; |
120 | |
121 | /** |
122 | * SDTV notifications |
123 | */ |
124 | typedef enum |
125 | { |
126 | VC_SDTV_UNPLUGGED = 1 << 16, /**<SDTV cable unplugged, subject to platform support */ |
127 | VC_SDTV_ATTACHED = 1 << 17, /**<SDTV cable is plugged in */ |
128 | VC_SDTV_NTSC = 1 << 18, /**<SDTV is in NTSC mode */ |
129 | VC_SDTV_PAL = 1 << 19, /**<SDTV is in PAL mode */ |
130 | VC_SDTV_CP_INACTIVE = 1 << 20, /**<Copy protection disabled */ |
131 | VC_SDTV_CP_ACTIVE = 1 << 21 /**<Copy protection enabled */ |
132 | } VC_SDTV_NOTIFY_T; |
133 | #define VC_SDTV_STANDBY (VC_SDTV_ATTACHED) /* For backward code compatibility, to be consistent with HDMI */ |
134 | |
135 | /** |
136 | * Callback reason and arguments from vec middleware |
137 | * Each callback comes with two optional uint32_t parameters. |
138 | * Reason param1 param2 remark |
139 | * VC_SDTV_UNPLUGGED - - cable is unplugged |
140 | * VC_SDTV_STANDBY - - cable is plugged in |
141 | * VC_SDTV_NTSC SDTV_MODE_T SDTV_ASPECT_T NTSC mode active with said aspect ratio |
142 | * VC_SDTV_PAL SDTV_MODE_T SDTV_ASPECT_T PAL mode active with said aspect ratio |
143 | * VC_SDTV_CP_INACTIVE - - copy protection is inactive |
144 | * VC_SDTV_CP_ACTIVE SDTV_CP_MODE_T - copy protection is active |
145 | */ |
146 | |
147 | #endif |
148 | |