| 1 | /****************************************************************************** |
|---|
| 2 | * (c)2008-2009 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: $ |
|---|
| 39 | * $brcm_Revision: $ |
|---|
| 40 | * $brcm_Date: $ |
|---|
| 41 | * |
|---|
| 42 | * Module Description: |
|---|
| 43 | * |
|---|
| 44 | * The application consists of two threads, application and system thread, with no |
|---|
| 45 | * overlapping functionality. The main application thread handles |
|---|
| 46 | * initialization/destruction, user input, OSD and events from the system thread. |
|---|
| 47 | * The system thread handles media processing like video decode, psi processing, |
|---|
| 48 | * status monitoring, code downloads, etc. The system thread also monitors events |
|---|
| 49 | * from the application thread and posts status events to the application thread. |
|---|
| 50 | * |
|---|
| 51 | * One advantage of this dual thread structure is that application thread is almost |
|---|
| 52 | * always free to provide feedback on the OSD to user input. The system thread |
|---|
| 53 | * manages most system resources without delaying or slowing user input and |
|---|
| 54 | * corresponding OSD feedback. |
|---|
| 55 | * |
|---|
| 56 | * To limit complexity neither application or system thread restricts or synchronizes |
|---|
| 57 | * use of any system resource and the assumptions is that the threads cooperate as such. |
|---|
| 58 | * |
|---|
| 59 | * Revision History: |
|---|
| 60 | * |
|---|
| 61 | * Created: 09/28/2009 by Jeff Fisher |
|---|
| 62 | * |
|---|
| 63 | * $brcm_Log: $ |
|---|
| 64 | * |
|---|
| 65 | * |
|---|
| 66 | *****************************************************************************/ |
|---|
| 67 | /* tinytv application */ |
|---|
| 68 | #ifndef BAPP_NEXUS_H__ |
|---|
| 69 | #define BAPP_NEXUS_H__ |
|---|
| 70 | |
|---|
| 71 | #include "nexus_platform.h" |
|---|
| 72 | #include "nexus_surface.h" |
|---|
| 73 | #include "nexus_display.h" |
|---|
| 74 | #include "nexus_composite_output.h" |
|---|
| 75 | #include "nexus_component_output.h" |
|---|
| 76 | #include "nexus_pid_channel.h" |
|---|
| 77 | #include "nexus_parser_band.h" |
|---|
| 78 | #include "nexus_video_decoder.h" |
|---|
| 79 | #include "nexus_stc_channel.h" |
|---|
| 80 | #include "nexus_video_window.h" |
|---|
| 81 | #include "nexus_audio_dac.h" |
|---|
| 82 | #include "nexus_audio_output.h" |
|---|
| 83 | #include "nexus_spdif_output.h" |
|---|
| 84 | #include "nexus_audio_decoder.h" |
|---|
| 85 | |
|---|
| 86 | #include "nexus_core_utils.h" |
|---|
| 87 | #include "bstd.h" |
|---|
| 88 | #include "bkni.h" |
|---|
| 89 | |
|---|
| 90 | #include "bapp_types.h" |
|---|
| 91 | #include "bapp_tune.h" |
|---|
| 92 | |
|---|
| 93 | #define BAPP_NUM_SURFACES 2 /* double buffering */ |
|---|
| 94 | /** |
|---|
| 95 | Summary: |
|---|
| 96 | Central structure acting as agregator of all system resources. No attempt is made |
|---|
| 97 | to restrict mutual access to these resources as the general application structure |
|---|
| 98 | partitions responsibility to avoid such contention. |
|---|
| 99 | **/ |
|---|
| 100 | |
|---|
| 101 | typedef struct bapp_nexus_t |
|---|
| 102 | { |
|---|
| 103 | /* OSD Display */ |
|---|
| 104 | NEXUS_SurfaceHandle surface[BAPP_NUM_SURFACES]; |
|---|
| 105 | NEXUS_SurfaceMemory mem[BAPP_NUM_SURFACES]; |
|---|
| 106 | NEXUS_SurfaceCreateSettings createSettings[BAPP_NUM_SURFACES]; |
|---|
| 107 | NEXUS_DisplayHandle display; |
|---|
| 108 | NEXUS_VideoFormatInfo videoFormatInfo; |
|---|
| 109 | NEXUS_GraphicsSettings graphicsSettings; |
|---|
| 110 | NEXUS_PlatformSettings platformSettings; |
|---|
| 111 | NEXUS_PlatformConfiguration platformConfig; |
|---|
| 112 | NEXUS_DisplaySettings displaySettings; |
|---|
| 113 | int surface_idx; |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | /* Frontend */ |
|---|
| 117 | bapp_tune_t tune; |
|---|
| 118 | int band; |
|---|
| 119 | |
|---|
| 120 | }bapp_nexus_t; |
|---|
| 121 | |
|---|
| 122 | #ifdef __cplusplus |
|---|
| 123 | extern "C" { |
|---|
| 124 | #endif |
|---|
| 125 | |
|---|
| 126 | /** |
|---|
| 127 | Summary: |
|---|
| 128 | Allocate and reserve resources. Expects allocated bapp_nexus_t structure. |
|---|
| 129 | This function will succeed or fail due to asserts. |
|---|
| 130 | **/ |
|---|
| 131 | void bapp_nexus_open(bapp_nexus_t *p_nexus, |
|---|
| 132 | bapp_tune_type_t fe_type); |
|---|
| 133 | |
|---|
| 134 | /** |
|---|
| 135 | Summary: |
|---|
| 136 | Release resources. Expects initialized bapp_nexus_t structure |
|---|
| 137 | This function will succeed or fail due to asserts. |
|---|
| 138 | **/ |
|---|
| 139 | void bapp_nexus_close(bapp_nexus_t *p_nexus); |
|---|
| 140 | /** |
|---|
| 141 | Summary: |
|---|
| 142 | Return the OSD bits per pixel. |
|---|
| 143 | **/ |
|---|
| 144 | unsigned int bapp_get_bpp(void); |
|---|
| 145 | |
|---|
| 146 | /** |
|---|
| 147 | Summary: |
|---|
| 148 | Return the OSD pixel format. |
|---|
| 149 | **/ |
|---|
| 150 | unsigned int bapp_get_pixel_format(void); |
|---|
| 151 | |
|---|
| 152 | /** |
|---|
| 153 | Summary: |
|---|
| 154 | Return the OSD format. |
|---|
| 155 | **/ |
|---|
| 156 | unsigned int bapp_get_osd_format(void); |
|---|
| 157 | |
|---|
| 158 | #ifdef __cplusplus |
|---|
| 159 | } |
|---|
| 160 | #endif |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | #endif /* BAPP_NEXUS_H__ */ |
|---|