| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2007-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: nexus_video_input.h $ |
|---|
| 39 | * $brcm_Revision: 17 $ |
|---|
| 40 | * $brcm_Date: 4/22/11 3:13p $ |
|---|
| 41 | * |
|---|
| 42 | * Module Description: |
|---|
| 43 | * |
|---|
| 44 | * Revision History: |
|---|
| 45 | * |
|---|
| 46 | * $brcm_Log: /nexus/modules/display/7400/include/nexus_video_input.h $ |
|---|
| 47 | * |
|---|
| 48 | * 17 4/22/11 3:13p vsilyaev |
|---|
| 49 | * SW7425-416: Updated 3D display API |
|---|
| 50 | * |
|---|
| 51 | * 16 8/19/10 2:03p jhaberf |
|---|
| 52 | * SW35230-1059: Added HDMI 3D support to nexus header files |
|---|
| 53 | * |
|---|
| 54 | * 15 9/21/09 2:55p erickson |
|---|
| 55 | * SW3548-2475: update comments. if NEXUS_VideoInputStatus.videoPresent is |
|---|
| 56 | * false, the other fields have meaning. |
|---|
| 57 | * |
|---|
| 58 | * 14 9/9/09 1:18p erickson |
|---|
| 59 | * SW7405-2977: remove unneeded #include |
|---|
| 60 | * |
|---|
| 61 | * 13 9/1/09 4:23p erickson |
|---|
| 62 | * SWDEPRECATED-2425: update comments |
|---|
| 63 | * |
|---|
| 64 | * 12 4/2/09 9:38a jgarrett |
|---|
| 65 | * PR 53654: Adding option to suspend dynamic RTS for a source |
|---|
| 66 | * |
|---|
| 67 | * 11 3/20/09 1:59p jgarrett |
|---|
| 68 | * PR 53465: Adding numeric refresh rate |
|---|
| 69 | * |
|---|
| 70 | * 10 12/16/08 11:50a jgarrett |
|---|
| 71 | * PR 50002: Adding NEXUS_VideoInput_ForcePending |
|---|
| 72 | * |
|---|
| 73 | * 9 5/9/08 12:44p erickson |
|---|
| 74 | * PR39453: add sourcePending callback, set status.sourcePending based on |
|---|
| 75 | * VDC dirty bits. |
|---|
| 76 | * |
|---|
| 77 | * 8 4/30/08 3:08p erickson |
|---|
| 78 | * PR39453: add 3548/3556 features |
|---|
| 79 | * |
|---|
| 80 | * 7 4/4/08 10:08a erickson |
|---|
| 81 | * PR40513: add repeat |
|---|
| 82 | * |
|---|
| 83 | * 6 3/12/08 4:31p erickson |
|---|
| 84 | * PR40412: NEXUS_VideoInput_GetStatus requires NEXUS_Error |
|---|
| 85 | * |
|---|
| 86 | * 5 2/29/08 5:39p erickson |
|---|
| 87 | * PR40156: implement ColorMatrix function |
|---|
| 88 | * |
|---|
| 89 | * 4 1/31/08 9:52a erickson |
|---|
| 90 | * PR36808: added include |
|---|
| 91 | * |
|---|
| 92 | * 3 1/23/08 9:22p vobadm |
|---|
| 93 | * PR35457: update docs |
|---|
| 94 | * |
|---|
| 95 | * 2 1/23/08 2:39p erickson |
|---|
| 96 | * PR35457: update docs |
|---|
| 97 | * |
|---|
| 98 | * 1 1/18/08 2:16p jgarrett |
|---|
| 99 | * PR 38808: Merging to main branch |
|---|
| 100 | * |
|---|
| 101 | * Nexus_Devel/9 12/18/07 1:34p erickson |
|---|
| 102 | * PR38213: analog video input rework |
|---|
| 103 | * |
|---|
| 104 | * Nexus_Devel/8 11/30/07 10:53a erickson |
|---|
| 105 | * PR35457: api update |
|---|
| 106 | * |
|---|
| 107 | * Nexus_Devel/7 11/2/07 4:42p vsilyaev |
|---|
| 108 | * PR 36696: Used connector model for VideoInput's and VideoOutput's |
|---|
| 109 | * |
|---|
| 110 | * Nexus_Devel/6 10/4/07 3:34p vsilyaev |
|---|
| 111 | * PR 34662: Removed VideoInput descriptor |
|---|
| 112 | * |
|---|
| 113 | * Nexus_Devel/5 9/28/07 12:25p vsilyaev |
|---|
| 114 | * PR 34662: Added sync thunk layer |
|---|
| 115 | * |
|---|
| 116 | * Nexus_Devel/4 9/21/07 4:11p vsilyaev |
|---|
| 117 | * PR 34662: Added VideoInput API |
|---|
| 118 | * |
|---|
| 119 | * Nexus_Devel/3 9/12/07 1:52p vsilyaev |
|---|
| 120 | * PR 34419: Updated display API |
|---|
| 121 | * |
|---|
| 122 | * Nexus_Devel/2 9/10/07 4:35p vsilyaev |
|---|
| 123 | * PR 34662: Added nexus_display_types.h |
|---|
| 124 | * |
|---|
| 125 | * Nexus_Devel/1 9/7/07 2:30p vsilyaev |
|---|
| 126 | * PR 34419: New video modules |
|---|
| 127 | * |
|---|
| 128 | **************************************************************************/ |
|---|
| 129 | #ifndef NEXUS_VIDEO_INPUT_H__ |
|---|
| 130 | #define NEXUS_VIDEO_INPUT_H__ |
|---|
| 131 | |
|---|
| 132 | #include "nexus_types.h" |
|---|
| 133 | #include "nexus_display_types.h" |
|---|
| 134 | |
|---|
| 135 | #ifdef __cplusplus |
|---|
| 136 | extern "C" { |
|---|
| 137 | #endif |
|---|
| 138 | |
|---|
| 139 | /** |
|---|
| 140 | Summary: |
|---|
| 141 | Settings which are generic to all video inputs |
|---|
| 142 | **/ |
|---|
| 143 | typedef struct NEXUS_VideoInputSettings |
|---|
| 144 | { |
|---|
| 145 | bool mute; /* Send the muteColor to the VideoWindow. Actual source data is discarded. |
|---|
| 146 | This only applies to analog/hdmi sources. See NEXUS_VideoDecoderSettings.mute for digital. */ |
|---|
| 147 | NEXUS_Pixel muteColor; /* Color of muted video in NEXUS_PixelFormat_eA8_R8_G8_B8 colorspace */ |
|---|
| 148 | bool repeat; /* Repeat last picture to the VideoWindow. This can be used for a continuous picture during channel change. |
|---|
| 149 | This only applies to analog/hdmi sources. See NEXUS_VideoDecoder_ChannelChangeMode for digital. |
|---|
| 150 | If mute==true, it will override repeat==true. */ |
|---|
| 151 | NEXUS_CallbackDesc sourceChanged; /* Called whenever anything in NEXUS_VideoInputStatus changes. */ |
|---|
| 152 | NEXUS_CallbackDesc sourcePending; /* Called whenever NEXUS_VideoInputStatus.sourcePending goes true and a NEXUS_VideoInput_SetResumeMode(videoInput, NEXUS_VideoInputResumeMode_eNow) is required. |
|---|
| 153 | See NEXUS_VideoInput_SetResumeMode for more information about source pending and dynamic RTS. */ |
|---|
| 154 | struct { |
|---|
| 155 | bool enable; |
|---|
| 156 | NEXUS_VideoFormat videoFormat; |
|---|
| 157 | NEXUS_Video3DStructure structure; |
|---|
| 158 | NEXUS_Video3DSubSample subSample; |
|---|
| 159 | bool overrideOrientation; /* force to override source orientation */ |
|---|
| 160 | NEXUS_VideoOrientation orientation; /* orientation of the 3D source */ |
|---|
| 161 | } video3DSettings; /* Settings for 3D sources. */ |
|---|
| 162 | } NEXUS_VideoInputSettings; |
|---|
| 163 | |
|---|
| 164 | /** |
|---|
| 165 | Summary: |
|---|
| 166 | Get current settings |
|---|
| 167 | **/ |
|---|
| 168 | void NEXUS_VideoInput_GetSettings( |
|---|
| 169 | NEXUS_VideoInput input, |
|---|
| 170 | NEXUS_VideoInputSettings *pSettings /* [out] */ |
|---|
| 171 | ); |
|---|
| 172 | |
|---|
| 173 | /** |
|---|
| 174 | Summary: |
|---|
| 175 | Apply new settings |
|---|
| 176 | **/ |
|---|
| 177 | NEXUS_Error NEXUS_VideoInput_SetSettings( |
|---|
| 178 | NEXUS_VideoInput input, |
|---|
| 179 | const NEXUS_VideoInputSettings *pSettings |
|---|
| 180 | ); |
|---|
| 181 | |
|---|
| 182 | /** |
|---|
| 183 | Summary: |
|---|
| 184 | Status which is generic to all video inputs |
|---|
| 185 | **/ |
|---|
| 186 | typedef struct NEXUS_VideoInputStatus |
|---|
| 187 | { |
|---|
| 188 | bool videoPresent; /* If true, then active video is detected at the source. |
|---|
| 189 | If false, the other members of NEXUS_VideoInputStatus will be based on the previous active format. */ |
|---|
| 190 | unsigned width, height; |
|---|
| 191 | NEXUS_AspectRatio aspectRatio; |
|---|
| 192 | NEXUS_VideoFormat format; /* You can determine if a source is progressive using NEXUS_VideoFormat_GetInfo(format). */ |
|---|
| 193 | NEXUS_VideoFrameRate frameRate; /* This is an enumerated frame rate code */ |
|---|
| 194 | unsigned refreshRate; /* This is a numeric refresh rate (aka frame rate) value in 1/1000 Hz. e.g. 29.97 = 29970. */ |
|---|
| 195 | bool sourcePending; /* Set to true if Nexus is in NEXUS_VideoInputResumeMode_eManual mode and is currently waiting for an eNow trigger. |
|---|
| 196 | When this is changed to true, you will receive a NEXUS_VideoInputSettings.sourcePending callback. |
|---|
| 197 | This will not be set to false until NEXUS_VideoInput_SetResumeMode(videoInput, NEXUS_VideoInputResumeMode_eNow) is called. */ |
|---|
| 198 | } NEXUS_VideoInputStatus; |
|---|
| 199 | |
|---|
| 200 | /** |
|---|
| 201 | Summary: |
|---|
| 202 | Get current status |
|---|
| 203 | **/ |
|---|
| 204 | NEXUS_Error NEXUS_VideoInput_GetStatus( |
|---|
| 205 | NEXUS_VideoInput input, |
|---|
| 206 | NEXUS_VideoInputStatus *pStatus /* [out] */ |
|---|
| 207 | ); |
|---|
| 208 | |
|---|
| 209 | /** |
|---|
| 210 | Summary: |
|---|
| 211 | The application must call NEXUS_VideoInput_Shutdown after the NEXUS_VideoInput |
|---|
| 212 | has been disconnected from all video windows. |
|---|
| 213 | This is needed to free internally cached data. |
|---|
| 214 | **/ |
|---|
| 215 | void NEXUS_VideoInput_Shutdown( |
|---|
| 216 | NEXUS_VideoInput input |
|---|
| 217 | ); |
|---|
| 218 | |
|---|
| 219 | /** |
|---|
| 220 | Summary: |
|---|
| 221 | Get current color space convertor matrix |
|---|
| 222 | **/ |
|---|
| 223 | void NEXUS_VideoInput_GetColorMatrix( |
|---|
| 224 | NEXUS_VideoInput input, |
|---|
| 225 | NEXUS_ColorMatrix *pColorMatrix /* [out] */ |
|---|
| 226 | ); |
|---|
| 227 | |
|---|
| 228 | /** |
|---|
| 229 | Summary: |
|---|
| 230 | Set new color space convertor matrix |
|---|
| 231 | |
|---|
| 232 | Description: |
|---|
| 233 | This only works for analog and HDMI inputs. |
|---|
| 234 | It does not work for VideoDecoder inputs. |
|---|
| 235 | **/ |
|---|
| 236 | NEXUS_Error NEXUS_VideoInput_SetColorMatrix( |
|---|
| 237 | NEXUS_VideoInput input, |
|---|
| 238 | const NEXUS_ColorMatrix *pColorMatrix |
|---|
| 239 | ); |
|---|
| 240 | |
|---|
| 241 | /********************* |
|---|
| 242 | Summary: |
|---|
| 243 | Modes used in NEXUS_VideoInput_SetResumeMode |
|---|
| 244 | |
|---|
| 245 | Description: |
|---|
| 246 | This controls a feature often referred to as "source pending". |
|---|
| 247 | **********************/ |
|---|
| 248 | typedef enum |
|---|
| 249 | { |
|---|
| 250 | NEXUS_VideoInputResumeMode_eAuto, /* Resume displaying video automatically after source changes. No action is needed by the application. */ |
|---|
| 251 | NEXUS_VideoInputResumeMode_eManual, /* Do not resume displaying video after a source change. Instead, wait for the user to make any related |
|---|
| 252 | changes, then resume when they call NEXUS_VideoInput_SetResumeMode(videoInput, NEXUS_VideoInputResumeMode_eNow). */ |
|---|
| 253 | NEXUS_VideoInputResumeMode_eNow, /* Use this enum as a trigger when in NEXUS_VideoInputResumeMode_eManual mode; eNow is not a mode. |
|---|
| 254 | After calling NEXUS_VideoInput_SetResumeMode(videoInput, NEXUS_VideoInputResumeMode_eNow), the videoInput will |
|---|
| 255 | be in eManual mode. */ |
|---|
| 256 | NEXUS_VideoInputResumeMode_eFreezeRts /* Only applicable to systems that implement dynamic RTS. If this option is selected, the current RTS |
|---|
| 257 | bandwidth will be maintained across all format changes. This will allow seamless source resolution |
|---|
| 258 | changes without an intermediate black screen. However, this mode has very strict usage guidelines. Please |
|---|
| 259 | make sure all possible source resolutions while this option is selected will have the same constraints and |
|---|
| 260 | RTS set ID in your usage mode spreadsheet to avoid display bandwidth overflows. To enter this mode, your |
|---|
| 261 | application should set the resume mode to manual and wait for a source pending callback indicating the |
|---|
| 262 | correct resolution. Once that callback has been received, enter this mode to freeze the bandwidth for that |
|---|
| 263 | mode. To exit this mode, you must select either eAuto or eManual. Please note, some changes such as window |
|---|
| 264 | size may still cause video to mute while bandwidth is adjusted. */ |
|---|
| 265 | } NEXUS_VideoInputResumeMode; |
|---|
| 266 | |
|---|
| 267 | /** |
|---|
| 268 | Summary: |
|---|
| 269 | Set the resume mode for a video source. Used for picture quality and dynamic RTS. |
|---|
| 270 | |
|---|
| 271 | Description: |
|---|
| 272 | When a video source changes, the application may need to make multiple adjustments to the picture quality or memory RTS (real-time scheduling) settings |
|---|
| 273 | before displaying the next frame of video. The ResumeMode allows the application to do this. |
|---|
| 274 | Resume mode is also known as "source pending." |
|---|
| 275 | |
|---|
| 276 | There are two main resume modes: eAuto and eManual. eAuto requires no further action by the application. |
|---|
| 277 | Video will be displayed immediately after a source change, as if the "source pending" feature was not there. |
|---|
| 278 | Dynamic RTS changes will be applied automatically. The only picture quality changes that will be made is to limit features based on RTS requirements. |
|---|
| 279 | The default resume mode is eAuto. |
|---|
| 280 | |
|---|
| 281 | In eManual mode, the application can make PQ changes and (if handleDynamicRts is false) can make RTS changes in the source pending state. |
|---|
| 282 | In eManual mode the application must either wait for a NEXUS_VideoInputSettings.sourceChanged event |
|---|
| 283 | or poll the NEXUS_VideoInputStatus.sourcePending boolean. |
|---|
| 284 | Once in source pending state, the application should call NEXUS_VideoInput_GetStatus, make changes based on the new source type, |
|---|
| 285 | then call NEXUS_VideoInput_SetResumeMode(videoInput, NEXUS_VideoInputResumeMode_eNow). |
|---|
| 286 | Video display will resume and Nexus will remain in eManual mode. |
|---|
| 287 | |
|---|
| 288 | If you switch sources to a VideoWindow and you are in eManual mode, Nexus will trigger a sourceChanged callback and the |
|---|
| 289 | system will be in a sourcePending state, as if there was a source format change. |
|---|
| 290 | |
|---|
| 291 | If you use eManual mode, Nexus will still default to handling dynamic RTS. If you would like to manually control dynamic RTS, |
|---|
| 292 | you should set NEXUS_VideoInputResumeMode_eNow and also set NEXUS_DisplayModuleSettings.handleDynamicRts = false at system initialization time. |
|---|
| 293 | |
|---|
| 294 | See nexus/examples/source_pending.c for a working example. |
|---|
| 295 | **/ |
|---|
| 296 | NEXUS_Error NEXUS_VideoInput_SetResumeMode( |
|---|
| 297 | NEXUS_VideoInput videoInput, |
|---|
| 298 | NEXUS_VideoInputResumeMode resumeMode |
|---|
| 299 | ); |
|---|
| 300 | |
|---|
| 301 | /*************************************************************************** |
|---|
| 302 | Summary: |
|---|
| 303 | Force a video source to the pending state |
|---|
| 304 | |
|---|
| 305 | Description: |
|---|
| 306 | If the video input is in eManual resume mode, this can force |
|---|
| 307 | the video input to the pending state. This will allow the |
|---|
| 308 | video pipeline to be stopped while RTS changes are made. |
|---|
| 309 | **************************************************************************/ |
|---|
| 310 | NEXUS_Error NEXUS_VideoInput_ForcePending( |
|---|
| 311 | NEXUS_VideoInput videoInput |
|---|
| 312 | ); |
|---|
| 313 | |
|---|
| 314 | #ifdef __cplusplus |
|---|
| 315 | } |
|---|
| 316 | #endif |
|---|
| 317 | |
|---|
| 318 | #endif /* NEXUS_VIDEO_INPUT_H__ */ |
|---|