/****************************************************************************** * (c)2008-2009 Broadcom Corporation * * This program is the proprietary software of Broadcom Corporation and/or its licensors, * and may only be used, duplicated, modified or distributed pursuant to the terms and * conditions of a separate, written license agreement executed between you and Broadcom * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants * no license (express or implied), right to use, or waiver of any kind with respect to the * Software, and Broadcom expressly reserves all rights in and to the Software and all * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. * * Except as expressly set forth in the Authorized License, * * 1. This program, including its structure, sequence and organization, constitutes the valuable trade * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, * and to use this information only in connection with your use of Broadcom integrated circuit products. * * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF * USE OR PERFORMANCE OF THE SOFTWARE. * * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF * ANY LIMITED REMEDY. * * $brcm_Workfile: $ * $brcm_Revision: $ * $brcm_Date: $ * * Module Description: * * The application consists of two threads, application and system thread, with no * overlapping functionality. The main application thread handles * initialization/destruction, user input, OSD and events from the system thread. * The system thread handles media processing like video decode, psi processing, * status monitoring, code downloads, etc. The system thread also monitors events * from the application thread and posts status events to the application thread. * * One advantage of this dual thread structure is that application thread is almost * always free to provide feedback on the OSD to user input. The system thread * manages most system resources without delaying or slowing user input and * corresponding OSD feedback. * * To limit complexity neither application or system thread restricts or synchronizes * use of any system resource and the assumptions is that the threads cooperate as such. * * Revision History: * * Created: 09/28/2009 by Jeff Fisher * * $brcm_Log: $ * * *****************************************************************************/ /* tinytv application */ #ifndef BAPP_NEXUS_H__ #define BAPP_NEXUS_H__ #include "nexus_platform.h" #include "nexus_surface.h" #include "nexus_display.h" #include "nexus_composite_output.h" #include "nexus_component_output.h" #include "nexus_pid_channel.h" #include "nexus_parser_band.h" #include "nexus_video_decoder.h" #include "nexus_stc_channel.h" #include "nexus_video_window.h" #include "nexus_audio_dac.h" #include "nexus_audio_output.h" #include "nexus_spdif_output.h" #include "nexus_audio_decoder.h" #include "nexus_core_utils.h" #include "bstd.h" #include "bkni.h" #include "bapp_types.h" #include "bapp_tune.h" #define BAPP_NUM_SURFACES 2 /* double buffering */ /** Summary: Central structure acting as agregator of all system resources. No attempt is made to restrict mutual access to these resources as the general application structure partitions responsibility to avoid such contention. **/ typedef struct bapp_nexus_t { /* OSD Display */ NEXUS_SurfaceHandle surface[BAPP_NUM_SURFACES]; NEXUS_SurfaceMemory mem[BAPP_NUM_SURFACES]; NEXUS_SurfaceCreateSettings createSettings[BAPP_NUM_SURFACES]; NEXUS_DisplayHandle display; NEXUS_VideoFormatInfo videoFormatInfo; NEXUS_GraphicsSettings graphicsSettings; NEXUS_PlatformSettings platformSettings; NEXUS_PlatformConfiguration platformConfig; NEXUS_DisplaySettings displaySettings; int surface_idx; /* Frontend */ bapp_tune_t tune; int band; }bapp_nexus_t; #ifdef __cplusplus extern "C" { #endif /** Summary: Allocate and reserve resources. Expects allocated bapp_nexus_t structure. This function will succeed or fail due to asserts. **/ void bapp_nexus_open(bapp_nexus_t *p_nexus, bapp_tune_type_t fe_type); /** Summary: Release resources. Expects initialized bapp_nexus_t structure This function will succeed or fail due to asserts. **/ void bapp_nexus_close(bapp_nexus_t *p_nexus); /** Summary: Return the OSD bits per pixel. **/ unsigned int bapp_get_bpp(void); /** Summary: Return the OSD pixel format. **/ unsigned int bapp_get_pixel_format(void); /** Summary: Return the OSD format. **/ unsigned int bapp_get_osd_format(void); #ifdef __cplusplus } #endif #endif /* BAPP_NEXUS_H__ */