source: svn/newcon3bcm2_21bu/magnum/portinginterface/ape/7552/bape.h @ 43

Last change on this file since 43 was 43, checked in by megakiss, 11 years ago

광주방송 OTC 주파수 369Mhz로 변경

  • Property svn:executable set to *
File size: 14.3 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2006-2012, 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: bape.h $
11 * $brcm_Revision: Hydra_Software_Devel/20 $
12 * $brcm_Date: 1/31/12 6:17p $
13 *
14 * Module Description: Audio Decoder Interface
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/ape/7422/bape.h $
19 *
20 * Hydra_Software_Devel/20   1/31/12 6:17p jgarrett
21 * SW7425-2268: Adding initial voice conferencing support
22 *
23 * Hydra_Software_Devel/19   12/19/11 4:27p jgarrett
24 * SW7425-1018: Adding initial A/85 implementation
25 *
26 * Hydra_Software_Devel/18   8/24/11 11:53a jgarrett
27 * SW7425-724: Adding RF Audio Encoder
28 *
29 * Hydra_Software_Devel/17   8/12/11 6:53p jgarrett
30 * SWDTV-6627: Refactoring initial EQ code
31 *
32 * Hydra_Software_Devel/16   7/15/11 5:51p jgarrett
33 * SWDTV-6761: Adding StudioSound API
34 *
35 * Hydra_Software_Devel/15   6/1/11 6:30p jgarrett
36 * SW7425-406: Updating buffer comments
37 *
38 * Hydra_Software_Devel/14   5/23/11 12:46p gskerl
39 * SW7231-128: Changed tabs to spaces
40 *
41 * Hydra_Software_Devel/13   5/18/11 2:30p gskerl
42 * SW7231-128: Added BCHP_PWR support to APE
43 *
44 * Hydra_Software_Devel/12   5/14/11 11:33a jgarrett
45 * SWDTV-6763: Adding 3D Surround
46 *
47 * Hydra_Software_Devel/11   5/14/11 11:22a jgarrett
48 * SWDTV-6762: Adding Audyssey ADV/ABX
49 *
50 * Hydra_Software_Devel/10   5/13/11 6:39p jgarrett
51 * SW7425-410: Adding AVL
52 *
53 * Hydra_Software_Devel/9   5/11/11 7:04p jgarrett
54 * SW7422-410: Adding CustomProcessing
55 *
56 * Hydra_Software_Devel/8   4/16/11 12:15p jgarrett
57 * SW7425-371: Removing tab characters
58 *
59 * Hydra_Software_Devel/7   4/11/11 5:54p jgarrett
60 * SWDTV-6305: Adding ADC/RF Inputs for DTV
61 *
62 * Hydra_Software_Devel/6   3/21/11 7:08p jgarrett
63 * SW7422-356: Adding MuxOutput
64 *
65 * Hydra_Software_Devel/5   2/22/11 5:43p jgarrett
66 * SW7422-146: Implemented type renaming based on filter graph review
67 * comments
68 *
69 * Hydra_Software_Devel/4   1/12/11 4:24p jgarrett
70 * SW7422-146: Adding additional APIs
71 *
72 * Hydra_Software_Devel/3   12/16/10 4:04p jgarrett
73 * SW7422-146: Initial compilable APE for 7422
74 *
75 * Hydra_Software_Devel/2   12/14/10 2:39p jgarrett
76 * SW7408-146: Renaming MixerOutput to OutputPort
77 *
78 * Hydra_Software_Devel/1   12/14/10 2:16p jgarrett
79 * SW7422-146: Adding initial API for APE/DSP
80 *
81 ***************************************************************************/
82
83#ifndef BAPE_H_
84#define BAPE_H_
85
86#include "bchp.h"
87#include "bint.h"
88#include "bmem.h"
89#include "breg_mem.h"
90#include "btmr.h"
91#include "bimg.h"
92#include "bdsp.h"
93#include "bape_types.h"
94#include "bape_mixer.h"
95#include "bape_decoder.h"
96#include "bape_playback.h"
97#include "bape_input.h"
98#include "bape_output.h"
99#include "bape_mux_output.h"
100#include "bape_pll.h"
101#include "bape_input_capture.h"
102#include "bape_output_capture.h"
103#include "bape_encoder.h"
104#include "bape_dolby_digital_reencode.h"
105#include "bape_dolby_volume.h"
106#include "bape_tru_surround.h"
107#include "bape_tru_volume.h"
108#include "bape_custom_processing.h"
109#include "bape_auto_volume_level.h"
110#include "bape_audyssey_abx.h"
111#include "bape_audyssey_adv.h"
112#include "bape_3d_surround.h"
113#include "bape_studio_sound.h"
114#include "bape_equalizer.h"
115#include "bape_rf_encoder.h"
116#include "bape_echo_canceller.h"
117
118/*=************************ Module Overview ********************************
119APE (Audio Processing Engine) is a porting interface (PI) module that
120controls the audio subsystem.  This includes the AIO (mixer, inputs, outputs)
121as well as the decode processor (DSP or CPU).
122 
123Device:
124-------
125An APE Device is identified by a device handle (BAPE_Handle).  This is the
126top-level interface to the audio subsystem.
127 
128Decoder:
129--------
130A decoder is capable of decoding digital audio into PCM samples and also
131providing compressed passthrough of input data.  This is identified by
132a BAPE_DecoderHandle.  Decoding is done in a decode processor, and the
133output can be fed into a mixer.  Optionally, post-processing (BAPE_Processor)
134may be inserted between the decoder and the mixer.   Decoders can read
135from a RAVE context (BAVC_XptContextMap) or on some systems can read
136from an input port (BAPE_InputPort).  The latter is useful for external
137inputs that provide compressed data (e.g. SPDIF) or inputs that require
138post processing.   
139
140Playback:
141---------
142Playback is used for playing host-generated PCM data.  It is also an
143input to a mixer.
144 
145InputCapture:
146-------------
147InputCapture is used to capture PCM input from an input port (BAPE_InputPort)
148and feeds data into a mixer.
149 
150InputGroup:
151-----------
152Input groups allow for multiple stereo inputs to be grouped together
153and treated as multichannel data.  This is useful if you want to combine
154three stereo playback channels to generate 5.1 audio for example.  Grouped
155inputs will always start synchronously in the mixer.
156 
157Mixer:
158------
159Mixers are used to mix one or more inputs to one or more outputs.  A
160mixer is always required to bind an output to its input(s).   Mixers
161provide input volume scaling as well as output volume scaling.  All
162inputs to a mixer must run at the same sample rate, and correspondingly
163they will be sample rate converted to either a fixed sample rate value
164or they can slave to a master input's sampling rate.  It is possible
165for an input to be routed to more than one mixer.  For example, the
166application may want different input volume levels applied to one
167output vs. another one.  For example, you could use two mixers to
168send a decode input mixed with a playback input to one output setting
169both inputs to half volume.  You could simultaneously route the same
170decode input to another output at full volume with no playback
171by using two mixers and applying different volume levels to each.
172Inputs to a mixer are connected using a generic connector type
173(BAPE_Connector), and similarly outputs are connected using
174a generic connector type (BAPE_OutputPort).
175 
176Outputs:
177--------
178Several different output types are supported by this module.  They include
179audio DACs (BAPE_DacHandle), SPDIF transmitters (BAPE_SpdifOutputHandle),
180I2S transmitters (BAPE_I2sOutputHandle) and the MAI interface to HDMI
181(BAPE_MaiOutputHandle).  Outputs must always be connected to a single
182mixer to receive data, even if they are receiving compressed output.
183Output data can also be captured by the host by connecting an
184BAPE_OutputCaptureHandle.
185 
186Inputs:
187-------
188External audio inputs are supported by this module.  BAPE_I2sInput
189represents an I2S receiver.  In the future, other inputs may be
190added as well.
191 
192Example Connection Diagrams:
193----------------------------
1941) Single decoder routed to DAC + SPDIF
195BAPE_DecoderHandle (stereo data) -> BAPE_MixerHandle -> BAPE_DacHandle + BAPE_SpdifOutputHandle
196 
1972) Decoder + host data mixed to DAC, Decoder data routed directly to SPDIF (PCM)
198BAPE_PlaybackHandle --------------\ 
199BAPE_DecoderHandle (stereo data) --> BAPE_MixerHandle1 -> BAPE_DacHandle
200                                 \-> BAPE_MixerHandle2 -> BAPE_SpdifOutputHandle
201 
2023) Decode to DAC with compressed passthrough to SPDIF
203 
204BAPE_DecoderHandle1 (stereo data)     -> BAPE_MixerHandle1 -> BAPE_DacHandle
205BAPE_DecoderHandle2 (compressed data) -> BAPE_MixerHandle2 -> BAPE_SpdifOutputHandle
206 
2074) Decode to DAC and I2S with DAC delayed to compensate for an external
208audio processor on I2S.
209BAPE_DecoderHandle (stereo data) --> BAPE_MixerHandle1 (delay=0) -> BAPE_DacHandle
210                                 \-> BAPE_MixerHandle2 (delay=n) -> BAPE_I2sOutputHandle
211 
2125) I2S stereo input routed to DAC
213BAPE_I2sInput -> BAPE_InputCapture -> BAPE_MixerHandle -> BAPE_DacHandle
214 
2156) Decode of primary audio mixed with decode of secondary audio (e.g. MP3 sound effect)
216BAPE_DecoderHandle1 (stereo data) --> BAPE_MixerHandle -> BAPE_DacHandle
217BAPE_DecoderHandle2 (stereo data) -/
218 
219***************************************************************************/
220
221/***************************************************************************
222Summary:
223Device Settings
224***************************************************************************/
225typedef struct BAPE_Settings
226{
227    unsigned maxDspTasks;               /* Maximum DSP tasks.  One task is required for each decoder and FW Mixer that will run concurrently. */
228    unsigned maxIndependentDelay;       /* Max independent delay value in ms */
229    unsigned maxPcmSampleRate;          /* Max PCM sample rate in Hz */
230    bool rampPcmSamples;                /* If true (default), PCM samples will be ramped up/down on startup, shutdown, and underflow conditions. 
231                                           Set to false if you want to disable this feature for testing or verification purposes. */
232    bool highBitRateEnabled;            /* If set to true, compressed buffers are large enough to accomodate 4x the decode
233                                           sample rate.  This is required for AC3+ Passthrough over HDMI. */
234    unsigned numCompressedBuffers;      /* Number of discrete compressed decoder output buffers required.  This is the
235                                           number of outputs that will receive discrete compressed content.
236                                           Independent delay does not affect this number, only different content sources. */ 
237    unsigned numPcmBuffers;             /* Number of discrete PCM decoder output buffers required.  This is the
238                                           number of outputs that will receive discrete stereo content plus the
239                                           number of outputs that will receive discrete multichannel output * the number
240                                           of channel pairs involved in multichannel (3 for 5.1, 4 for 7.1). 
241                                           Independent delay does not affect this number, only different content sources.
242                                           These buffers are also used when non-DSP data sources (e.g. Playback or Equalizer) connect
243                                           as input to DSP mixers. */ 
244    BAPE_LoudnessEquivalenceMode loudnessMode;  /* Loudness Equivalence Mode.  Default is BAPE_LoudnessEquivalenceMode_eNone. */
245} BAPE_Settings;
246
247/***************************************************************************
248Summary:
249Get default settings for an audio processor
250***************************************************************************/
251void BAPE_GetDefaultSettings(
252    BAPE_Settings *pSettings    /* [out] */
253    );
254
255/***************************************************************************
256Summary:
257Open an audio processor
258***************************************************************************/
259BERR_Code BAPE_Open(
260    BAPE_Handle *pHandle,   /* [out] returned handle */
261    BCHP_Handle chpHandle,
262    BREG_Handle regHandle,
263    BMEM_Handle memHandle,
264    BINT_Handle intHandle,
265    BTMR_Handle tmrHandle,
266    BDSP_Handle dspHandle,
267    const BAPE_Settings *pSettings  /* NULL will use default settings */
268    );
269
270/***************************************************************************
271Summary:
272Close an audio processor
273***************************************************************************/
274void BAPE_Close(
275    BAPE_Handle handle
276    );
277
278/***************************************************************************
279Summary:
280Device Level Interrupts
281***************************************************************************/
282typedef struct BAPE_InterruptHandlers
283{
284    struct
285    {
286        void (*pCallback_isr)(void *pParam1, int param2);
287        void *pParam1;
288        int param2;       
289    } watchdog;
290} BAPE_InterruptHandlers;
291
292/***************************************************************************
293Summary:
294Get Currently Registered Interrupt Handlers
295***************************************************************************/
296void BAPE_GetInterruptHandlers(
297    BAPE_Handle handle,
298    BAPE_InterruptHandlers *pInterrupts     /* [out] */
299    );
300
301/***************************************************************************
302Summary:
303Set Interrupt Handlers
304 
305Description:
306To disable any unwanted interrupt, pass NULL for its callback routine
307***************************************************************************/
308BERR_Code BAPE_SetInterruptHandlers(
309    BAPE_Handle handle,
310    const BAPE_InterruptHandlers *pInterrupts
311    );
312
313/***************************************************************************
314Summary:
315Process a watchdog interrupt
316***************************************************************************/
317BERR_Code BAPE_ProcessWatchdogInterrupt(
318    BAPE_Handle handle
319    );
320
321/***************************************************************************
322Summary:
323Retrieve the audio path delay value in ms.
324***************************************************************************/
325void BAPE_GetDecoderPathDelay(
326    BAPE_Handle handle,
327    unsigned *pDelay    /* [out] in ms */
328    );
329
330/***************************************************************************
331Summary:
332Returns single null terminated line from the debug log
333***************************************************************************/
334BERR_Code BAPE_GetDebugLog(
335    BAPE_Handle handle,
336    char *buf,
337    size_t buf_len
338    );
339
340/***************************************************************************
341Summary:
342Standby settings. Currently unused.
343****************************************************************************/
344typedef struct BAPE_StandbySettings
345{
346    bool dummy; /* placeholder to avoid compiler warning */
347} BAPE_StandbySettings;
348
349/***************************************************************************
350Summary:
351Enter Standby mode
352***************************************************************************/
353BERR_Code BAPE_Standby(
354    BAPE_Handle handle,             /* [in]APE device handle */
355    BAPE_StandbySettings *pSettings /* [in] standby settings */
356    );
357
358/***************************************************************************
359Summary:
360Resume from standby mode
361***************************************************************************/
362BERR_Code BAPE_Resume(
363    BAPE_Handle handle      /* [in] APE device handle */
364    );
365
366#endif
367
Note: See TracBrowser for help on using the repository browser.