source: svn/newcon3bcm2_21bu/nexus/modules/audio/7552/src/nexus_audio_module.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 36.9 KB
Line 
1/***************************************************************************
2*     (c)2004-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_audio_module.h $
39* $brcm_Revision: 33 $
40* $brcm_Date: 12/13/11 9:44p $
41*
42* API Description:
43*   API name: Audio Module
44*    Module includes
45*
46* Revision History:
47*
48* $brcm_Log: /nexus/modules/audio/7422/src/nexus_audio_module.h $
49*
50* 33   12/13/11 9:44p bandrews
51* SW7425-1772: merge to main
52*
53* SW7425-1772/2   12/12/11 10:29p bandrews
54* SW7425-1772: merge from main
55*
56* 32   12/12/11 8:14a jgarrett
57* SW7425-1756: Adding stream status callback and bitrate/mode change
58*  handling
59*
60* 31   11/18/11 3:04p jgarrett
61* SW7425-1756: Adding PTS callbacks and overflow callback
62*
63* SW7425-1772/1   12/12/11 10:02p bandrews
64* SW7425-1772: add priority scheme to stc channel
65*
66* 30   11/3/11 6:53p jgarrett
67* SW7422-400: Enabling audio debug logs on 40nm APE chips
68*
69* 29   11/2/11 6:26p jgarrett
70* SW7422-400: Adding routines for audio DSP debug
71*
72* 28   10/11/11 4:46p jgarrett
73* SW7425-1349: Adding AudioDummyOutput
74*
75* 27   9/27/11 4:36p jgarrett
76* SW7408-304: Destroying IMG context on shutdown
77*
78* 26   9/8/11 8:45a jgarrett
79* SWDTV-6627: Adding nexus EQ support
80*
81* 25   8/26/11 12:03p jgarrett
82* SW7425-742: Merge to main branch
83*
84* SW7425-724/1   8/24/11 11:55a jgarrett
85* SW7425-724: Adding RF Audio Encoder
86*
87* 24   8/18/11 5:51p jgarrett
88* SWDTV-6306: Merge DTV APE changes to main branch
89*
90* Nexus_APE_Integration/6   8/11/11 6:26p jgarrett
91* SWDTV-6306: Adding SPDIF and RF Input
92*
93* Nexus_APE_Integration/5   8/10/11 5:16p jgarrett
94* SWDTV-6306: Adding implicit capture to DSP instead of FMM for DTV
95*
96* Nexus_APE_Integration/4   8/8/11 5:38p jgarrett
97* SWDTV-6761: Adding StudioSound
98*
99* Nexus_APE_Integration/3   8/4/11 1:57p gskerl
100* SW7125-1014 : Merged changes to Nexus_APE_Integration branch
101*
102* Nexus_APE_Integration/2   7/8/11 6:40p jgarrett
103* SWDTV-6760: Adding I2sMultiOutput
104*
105* Nexus_APE_Integration/1   7/1/11 5:50p jgarrett
106* SWDTV-6306: Integrated to latest 7422 baseline and nexus audio
107*  directory structure
108*
109* 23   7/21/11 4:13p gmohile
110* SW7125-1014 : Rework power management
111*
112* 22   6/28/11 10:33a jgarrett
113* SW7422-406: Adding input volume settings for DSP mixers
114*
115* 21   6/20/11 5:42p jgarrett
116* SW7425-409: Merging VP6 support to main branch
117*
118* SW7425-409/1   6/6/11 7:16p jgarrett
119* SW7425-409: Adding DSP video decoder extensions for VDE
120*
121* 20   5/16/11 5:19p jgarrett
122* SWDTV-6762: Adding Audyssey ADV/ABX
123*
124* 19   5/16/11 4:57p jgarrett
125* SWDTV-6763: Adding 3D Surround
126*
127* 18   5/13/11 6:38p jgarrett
128* SW7425-410: Adding AVL
129*
130* 17   5/13/11 2:04p gskerl
131* SW7422-354: Added prototype for NEXUS_AudioReturnChannel_P_SetMaster()
132*
133* 18   5/13/11 6:32p jgarrett
134* SW7425-410: Adding AVL
135*
136* 16   5/11/11 7:07p jgarrett
137* SW7422-410: Adding CustomVoice for APE
138*
139* 15   4/27/11 6:52p jgarrett
140* SW7420-1826: Adding AudioOutputGroup
141*
142* 14   4/26/11 11:35a jgarrett
143* SW7425-437: Resolving kernel mode shutdown issues
144*
145* 13   4/11/11 5:52p jgarrett
146* SWDTV-6306: Adding preliminary Nexus APE support for DTV
147*
148* 12   3/24/11 10:58a jgarrett
149* SW7422-146: Fixing kernel mode build
150*
151* 11   3/23/11 6:28p jgarrett
152* SW7422-352: adding HDMI input support to nexus
153*
154* 10   3/23/11 4:29p jgarrett
155* SW7422-403: Fixing sync mute and DSOLA
156*
157* 9   3/21/11 7:05p jgarrett
158* SW7422-356: Adding MuxOutput support in APE/Nexus
159*
160* 8   3/1/11 7:25p jgarrett
161* SW7422-146: Adding DTS/AC3 encoders
162*
163* 7   2/28/11 2:58p jgarrett
164* SW7422-146: Added input capture to I2sInput
165*
166* 6   2/22/11 5:30p jgarrett
167* SW7422-146: Fixing build errors
168*
169* 5   1/13/11 5:25p jgarrett
170* SW7422-146: Adding encoder hooks
171*
172* 4   1/10/11 4:20p jgarrett
173* SW7422-146: Adding missing module-level routines
174*
175* 3   1/10/11 3:26p jgarrett
176* SW7422-146: Adding full nexus API set
177*
178* 2   1/4/11 2:39p jgarrett
179* SW7422-146: Adding 7425 APE support
180*
181* 1   12/17/10 3:56p jgarrett
182* SW7422-146: Adding initial nexus on APE for 7422
183*
184***************************************************************************/
185
186#ifndef NEXUS_AUDIO_MODULE_H_
187#define NEXUS_AUDIO_MODULE_H_
188
189#include "bape.h"
190
191#include "nexus_base.h"
192#include "nexus_audio_thunks.h"
193#include "nexus_types.h"
194#include "nexus_audio_types.h"
195#include "nexus_audio_init.h"
196#include "nexus_audio_mixer.h"
197#include "nexus_audio_input.h"
198#include "nexus_audio_output.h"
199#include "nexus_audio_capture.h"
200#include "nexus_audio_mux_output.h"
201#include "priv/nexus_audio_input_priv.h"
202#include "priv/nexus_audio_output_priv.h"
203#include "priv/nexus_core_img.h"
204#include "priv/nexus_core_img_id.h"
205#include "nexus_audio_dac.h"
206#include "nexus_audio_playback.h"
207#include "priv/nexus_core.h"
208#include "priv/nexus_core_audio.h"
209#include "nexus_spdif_output.h"
210#include "nexus_i2s_input.h"
211#include "nexus_i2s_output.h"
212#include "nexus_audio_decoder.h"
213#include "nexus_audio_decoder_extra.h"
214#include "nexus_audio_decoder_trick.h"
215#include "bape.h"
216#include "priv/nexus_rave_priv.h"
217#include "priv/nexus_stc_channel_priv.h"
218#include "priv/nexus_audio_decoder_priv.h"
219#include "nexus_ac3_encode.h"
220#include "nexus_audio_encoder.h"
221#include "nexus_dolby_digital_reencode.h"
222#include "nexus_dolby_volume.h"
223#include "nexus_dts_encode.h"
224#include "nexus_tru_surround_hd.h"
225#include "nexus_tru_surround_xt.h"
226#include "nexus_tru_volume.h"
227#include "nexus_audio.h"
228#include "nexus_audio_module.h"
229#include "priv/nexus_audio_standby_priv.h"
230#include "nexus_audio_output_group.h"
231#include "nexus_audio_dummy_output.h"
232#include "nexus_auto_volume_level.h"
233#include "nexus_3d_surround.h"
234#include "nexus_audyssey_abx.h"
235#include "nexus_audyssey_adv.h"
236#if NEXUS_AUDIO_BUFFER_CAPTURE_EXT
237#include "nexus_audio_buffer_capture.h"
238#include "nexus_audio_buffer_capture_priv.h"
239#endif
240#include "nexus_analog_audio_input.h"
241#include "nexus_analog_audio_decoder.h"
242#include "nexus_audio_equalizer.h"
243#include "nexus_audio_return_channel.h"
244#include "nexus_rf_audio_decoder.h"
245#include "nexus_rf_audio_encoder.h"
246#include "nexus_spdif_input.h"
247#include "nexus_studio_sound.h"
248#include "nexus_audio_dsp.h"
249#if NEXUS_DTV_PLATFORM
250/* DTV-Specifc Files */
251#include "bana.h"
252#if BCHP_CHIP == 35230 || BCHP_CHIP == 35125 || BCHP_CHIP == 35126 || BCHP_CHIP == 35233
253#if NEXUS_HAS_FRONTEND
254#define NEXUS_CONNECT_RFAUDIO_AND_FRONTEND 1
255#endif
256#endif
257#if NEXUS_CONNECT_RFAUDIO_AND_FRONTEND
258#include "nexus_frontend.h"
259#endif
260#else
261/* STB-Specific Files */
262#endif
263#if NEXUS_CVOICE
264#include "nexus_custom_voice.h"
265#endif
266#if NEXUS_NUM_DSP_VIDEO_DECODERS
267#include "nexus_audio_dsp_video_decoder_module.h"
268#endif
269
270/***************************************************************************
271Summary:
272    BAPE Handle and helper macro
273***************************************************************************/
274#define NEXUS_AUDIO_DEVICE_HANDLE g_NEXUS_audioModuleData.apeHandle
275
276#ifdef NEXUS_MODULE_SELF
277#error Cant be in two modules at the same time
278#endif
279
280#define NEXUS_MODULE_NAME audio
281#define NEXUS_MODULE_SELF g_NEXUS_audioModule
282
283extern NEXUS_ModuleHandle g_NEXUS_audioModule;
284
285typedef struct NEXUS_AudioModuleData
286{
287    BDSP_Handle dspHandle;
288    BAPE_Handle apeHandle;
289    NEXUS_AudioModuleSettings settings;
290    void *pImageContext;
291    bool watchdogDeferred;
292} NEXUS_AudioModuleData;
293
294extern NEXUS_AudioModuleData g_NEXUS_audioModuleData;
295
296BDBG_OBJECT_ID_DECLARE(NEXUS_AudioEncoder);
297/***************************************************************************
298Summary:
299    Audio encoder object
300 ***************************************************************************/
301typedef struct NEXUS_AudioEncoder
302{
303    BDBG_OBJECT(NEXUS_AudioEncoder)
304    BAPE_EncoderHandle encoder;
305    NEXUS_AudioInputObject connector;
306    NEXUS_AudioInput input;
307} NEXUS_AudioEncoder;
308
309/***************************************************************************
310Summary:
311    Audio decoder object
312 ***************************************************************************/
313typedef struct NEXUS_AudioDecoder
314{
315    BDBG_OBJECT(NEXUS_AudioDecoder)
316    unsigned index;
317    NEXUS_AudioDecoderSettings settings;
318    NEXUS_AudioDecoderStartSettings programSettings;
319    bool opened;
320    bool started;                   /* Has the channel been started by the app? */
321    bool running;                   /* Is the channel actually active? (enabled && started) */
322    bool trickMute;                 /* decoder muted (while running) by request from the trick modes operations (Keep this unconditional for sake of simplicity) */
323    bool trickForceStopped;         /* decoder muted (stopped) by request from the trick modes operations (Keep this unconditional for sake of simplicity) */
324    bool isDss;
325    bool isPlayback;
326    bool tsmPermitted;
327    bool tsmEnabled;
328    bool isDescriptorDecoder;
329    bool locked;
330    BAPE_DecoderHandle channel;
331    BAPE_DecoderStartSettings apeStartSettings;
332    NEXUS_RaveStatus raveStatus;
333    NEXUS_RaveHandle raveContext;
334    BKNI_EventHandle sampleRateEvent;
335    BKNI_EventHandle channelChangeReportEvent;
336    BKNI_EventHandle inputFormatChangeEvent;
337    NEXUS_EventCallbackHandle sampleRateCallback;
338    NEXUS_EventCallbackHandle channelChangeReportEventHandler;
339    NEXUS_EventCallbackHandle inputFormatChangeEventHandler;
340    NEXUS_IsrCallbackHandle lockCallback;
341    NEXUS_IsrCallbackHandle firstPtsCallback;
342    NEXUS_IsrCallbackHandle ptsErrorCallback;
343    NEXUS_IsrCallbackHandle fifoOverflowCallback;
344    NEXUS_IsrCallbackHandle streamStatusCallback;
345    NEXUS_StcChannelDecoderType stcDecoderType;
346    unsigned stcPriority;
347    unsigned ptsErrorCount;
348    NEXUS_AudioInputFormat compressedFormat;
349    NEXUS_AudioOutputList outputLists[NEXUS_AudioDecoderConnectorType_eMax];
350    NEXUS_AudioInputObject connectors[NEXUS_AudioDecoderConnectorType_eMax];
351    NEXUS_AudioDecoderTrickState trickState;
352    NEXUS_AudioInputSyncSettings syncSettings;
353#if NEXUS_HAS_ASTM
354    struct
355    {
356        bool permitted;
357        NEXUS_AudioDecoderAstmSettings settings;
358        NEXUS_AudioDecoderAstmStatus status;
359    } astm;
360#endif
361    NEXUS_AudioOutput hdmiOutput;
362    NEXUS_IsrCallbackHandle sourceChangeAppCallback;
363    NEXUS_AudioDecoderHandle descriptorParent;
364    uint32_t lastCdbValidPointer;
365    uint32_t lastCdbReadPointer;
366    unsigned staticFifoCount, numFifoOverflows, numFifoUnderflows;
367    NEXUS_TimerHandle fifoWatchdogTimer;
368} NEXUS_AudioDecoder;
369
370/***************************************************************************
371Summary:
372    Initialize the audio input module 
373 ***************************************************************************/
374NEXUS_Error NEXUS_AudioInput_P_Init(void);
375
376/***************************************************************************
377Summary:
378    Un-Initialize the audio input module 
379 ***************************************************************************/
380void NEXUS_AudioInput_P_Uninit(void);
381
382/***************************************************************************
383Summary:
384    Determine if an input chain is running.  All nodes upstream from the
385    specified node will be searched.
386 ***************************************************************************/
387bool NEXUS_AudioInput_P_IsRunning(
388    NEXUS_AudioInput input
389    );
390
391/***************************************************************************
392Summary:
393    Remove all mixer outputs attached to this object and below.  Used when an
394    an input/mixer will become invalid.
395 ***************************************************************************/
396NEXUS_Error NEXUS_AudioInput_P_RemoveMixerOutputs(
397    NEXUS_AudioInput input
398    );
399
400/***************************************************************************
401Summary:
402    Determine format of incoming data.  All nodes upstream from the specified
403    node will be searched until a format is found.
404 ***************************************************************************/
405NEXUS_AudioInputFormat NEXUS_AudioInput_P_GetFormat(
406    NEXUS_AudioInput input
407    );
408
409/***************************************************************************
410Summary:
411    Add an input to the specified connector.  Sanity checks in terms of how
412    many inputs are supported, etc. should be done by the caller.
413 ***************************************************************************/
414NEXUS_Error NEXUS_AudioInput_P_AddInput(
415    NEXUS_AudioInput destination,
416    NEXUS_AudioInput source);
417
418/***************************************************************************
419Summary:
420    Remove all inputs to the specified connector.
421 ***************************************************************************/
422NEXUS_Error NEXUS_AudioInput_P_RemoveAllInputs(
423    NEXUS_AudioInput destination
424    );
425
426/***************************************************************************
427Summary:
428    Remove a single input from the specified connector.
429 ***************************************************************************/
430NEXUS_Error NEXUS_AudioInput_P_RemoveInput(NEXUS_AudioInput destination, NEXUS_AudioInput source);
431
432/***************************************************************************
433Summary:
434    Determine if the specified source is an input to the destination
435    connector.
436 ***************************************************************************/
437bool NEXUS_AudioInput_P_IsConnected(
438    NEXUS_AudioInput destination,
439    NEXUS_AudioInput source
440    );
441
442/***************************************************************************
443Summary:
444    Retrieve all outputs downstream from this connector.
445 ***************************************************************************/
446NEXUS_Error NEXUS_AudioInput_P_GetOutputs(
447    NEXUS_AudioInput input,
448    NEXUS_AudioOutputList *pOutputList,
449    bool directOnly                         /* If true, only outputs connected to this channel will be returned.
450                                               If false, all outputs downstream will be returned, including those
451                                               attached to downstream mixers.
452                                            */
453    );
454
455/***************************************************************************
456Summary:
457    Set connection-specific data for the binding between the specified
458    source and destination connectors.  The data will be copied and stored
459    inside the connector object.  It will be lost when the connection is
460    broken.
461 ***************************************************************************/
462NEXUS_Error NEXUS_AudioInput_P_SetConnectionData(
463    NEXUS_AudioInput destination,
464    NEXUS_AudioInput source,
465    const void *pData,
466    size_t dataSize
467    );
468
469/***************************************************************************
470Summary:
471    Retrieve a pointer to the stored connection data between this source
472    and destination.  May be NULL if not previously set.
473 ***************************************************************************/
474const void *NEXUS_AudioInput_P_GetConnectionData(
475    NEXUS_AudioInput destination,
476    NEXUS_AudioInput source
477    );
478
479/***************************************************************************
480Summary:
481    Connect an audio output to the specified connector.
482 ***************************************************************************/
483NEXUS_Error NEXUS_AudioInput_P_ConnectOutput(
484    NEXUS_AudioInput input,
485    NEXUS_AudioOutput output
486    );
487
488/***************************************************************************
489Summary:
490    Disconnect an audio output from the specified connector.
491 ***************************************************************************/
492NEXUS_Error NEXUS_AudioInput_P_DisconnectOutput(
493    NEXUS_AudioInput input,
494    NEXUS_AudioOutput output
495    );
496
497/***************************************************************************
498Summary:
499    Prepare the input chain to start, building downstream connections.
500 ***************************************************************************/
501NEXUS_Error NEXUS_AudioInput_P_PrepareToStart(
502    NEXUS_AudioInput input
503    );
504
505/***************************************************************************
506Summary:
507    Notify the input chain of a data format change (e.g. sample rate)
508 ***************************************************************************/
509NEXUS_Error NEXUS_AudioInput_P_FormatChanged(
510    NEXUS_AudioInput input,
511    NEXUS_AudioInputFormatData *pData
512    );
513
514/***************************************************************************
515Summary:
516    Returns the first object downstream from the current object that matches
517    the specified type.  This is a depth-first search, not breadth-first.
518 ***************************************************************************/
519NEXUS_AudioInput NEXUS_AudioInput_P_FindByType(
520    NEXUS_AudioInput input,
521    NEXUS_AudioInputType type
522    );
523
524/***************************************************************************
525Summary:
526    Called when AudioOutputSettings are changed so that mixers can be updated
527    accordingly.
528 ***************************************************************************/
529NEXUS_Error NEXUS_AudioInput_P_OutputSettingsChanged(
530    NEXUS_AudioInput input, 
531    NEXUS_AudioOutput output
532    );
533
534/***************************************************************************
535Summary:
536    Get the mixer input volume for a particular input
537 ***************************************************************************/
538void NEXUS_AudioInput_P_GetVolume(
539    NEXUS_AudioInput input, 
540    BAPE_MixerInputVolume *pInputVolume    /* [out] */
541    );
542
543/***************************************************************************
544Summary:
545    Set the mixer input volume for a particular input
546 ***************************************************************************/
547NEXUS_Error NEXUS_AudioInput_P_SetVolume(
548    NEXUS_AudioInput input, 
549    const BAPE_MixerInputVolume *pInputVolume
550    );
551
552/***************************************************************************
553Summary:
554    Propagate mixer input volume into a mixer object in nexus
555 ***************************************************************************/
556NEXUS_Error NEXUS_AudioMixer_P_SetInputVolume(
557    NEXUS_AudioMixerHandle handle, 
558    NEXUS_AudioInput input,
559    const BAPE_MixerInputVolume *pInputVolume
560    );
561
562/***************************************************************************
563Summary:
564    Get an external input port handle
565 ***************************************************************************/
566BAPE_InputPort NEXUS_AudioInput_P_GetInputPort(
567    NEXUS_AudioInput input
568    );
569
570/***************************************************************************
571Summary:
572Input Port Status Information
573 ***************************************************************************/
574typedef struct NEXUS_AudioInputPortStatus
575{
576    bool signalPresent;         /* If true, a signal is present */
577    bool compressed;            /* If true, stream is compressed.  If false, stream is linear PCM */
578    NEXUS_AudioCodec codec;     /* Stream Codec */
579    unsigned numPcmChannels;    /* Number of PCM channels if codec == NEXUS_AudioCodec_ePcm */
580    unsigned sampleRate;        /* Sample Rate in Hz */
581} NEXUS_AudioInputPortStatus;
582
583/***************************************************************************
584Summary:
585Determine if this input supports dynamic format changes
586 ***************************************************************************/
587bool NEXUS_AudioInput_P_SupportsFormatChanges(
588    NEXUS_AudioInput input
589    );
590
591/***************************************************************************
592Summary:
593Enable/Disable interrupt for dynamic format changes
594 ***************************************************************************/
595NEXUS_Error NEXUS_AudioInput_P_SetFormatChangeInterrupt(
596    NEXUS_AudioInput input,
597    void (*pCallback_isr)(void *, int),
598    void *pParam1,
599    int param2
600    );
601
602/***************************************************************************
603Summary:
604Get Input Status Information
605 
606Description:
607Retrieves input status information.  This is currently only supported for
608HDMI or SPDIF inputs.
609 ***************************************************************************/
610NEXUS_Error NEXUS_AudioInput_P_GetInputPortStatus(
611    NEXUS_AudioInput input,
612    NEXUS_AudioInputPortStatus *pStatus     /* [out] */
613    );
614
615/***************************************************************************
616Summary:
617Force a particular input to stop
618 
619Description:
620This function should only be used when the system is shutting down to
621avoid clobbering application state.
622 ***************************************************************************/
623void NEXUS_AudioInput_P_ForceStop(NEXUS_AudioInput input);
624
625/***************************************************************************
626Summary:
627    NEXUS audio output private data.
628 ***************************************************************************/
629BDBG_OBJECT_ID_DECLARE(NEXUS_AudioOutputData);
630typedef struct NEXUS_AudioOutputData
631{
632    BDBG_OBJECT(NEXUS_AudioOutputData)
633    NEXUS_AudioOutputSettings settings;
634    NEXUS_AudioInput input;
635    NEXUS_AudioOutputSyncSettings syncSettings;
636    NEXUS_AudioOutputStatus status;
637    NEXUS_AudioEqualizerHandle equalizer;
638    BAVC_AudioSamplingRate sampleRate;
639    bool settingsChanged;
640    bool trickMute;
641} NEXUS_AudioOutputData;
642
643/***************************************************************************
644Summary:
645    Is an output a DAC slave?
646 ***************************************************************************/
647bool NEXUS_AudioOutput_P_IsDacSlave(
648    NEXUS_AudioOutput output
649    );
650
651/***************************************************************************
652Summary:
653    Is an output a SPDIF slave (e.g. ARC)?
654 ***************************************************************************/
655bool NEXUS_AudioOutput_P_IsSpdifSlave(
656    NEXUS_AudioOutput output
657    );
658
659/***************************************************************************
660Summary:
661    Set a DAC slave source.
662 ***************************************************************************/
663NEXUS_Error NEXUS_AudioOutput_P_SetSlaveSource(
664    NEXUS_AudioOutput slaveHandle,
665    NEXUS_AudioOutput sourceHandle
666    );
667
668/***************************************************************************
669Summary:
670    Get mixer settings required for an output
671 ***************************************************************************/
672void NEXUS_AudioOutput_P_GetMixerSettings(
673    NEXUS_AudioOutput output, 
674    BAPE_MixerSettings *pSettings /* [out] */
675    );
676
677/***************************************************************************
678Summary:
679    Set output format
680 ***************************************************************************/
681void NEXUS_AudioOutput_P_SetOutputFormat(
682    NEXUS_AudioOutput output, 
683    NEXUS_AudioInputFormat format
684    );
685
686/***************************************************************************
687Summary:
688    Determine if an audio output is active
689 ***************************************************************************/
690bool NEXUS_AudioOutput_P_IsRunning(
691    NEXUS_AudioOutput output
692    );
693   
694/***************************************************************************
695Summary:
696    Create output-private data structure
697 ***************************************************************************/
698NEXUS_AudioOutputData *NEXUS_AudioOutput_P_CreateData(
699    NEXUS_AudioOutput output
700    );
701   
702/***************************************************************************
703Summary:
704    Get the equalizer handle for an output
705 ***************************************************************************/
706NEXUS_AudioEqualizerHandle NEXUS_AudioOutput_P_GetEqualizer(
707    NEXUS_AudioOutput output
708    );
709
710/***************************************************************************
711Summary:
712    Get the equalizer handle for an output
713 ***************************************************************************/
714void NEXUS_AudioEqualizer_P_GetStages(
715    NEXUS_AudioEqualizerHandle handle,
716    BAPE_EqualizerStageHandle **pStages,
717    unsigned *pNumStages
718    );
719
720#if NEXUS_HAS_AUDIO_MUX_OUTPUT
721/***************************************************************************
722Summary:
723    Link audio mux output to a particular node
724 ***************************************************************************/
725NEXUS_Error NEXUS_AudioMuxOutput_P_AddInput(
726    NEXUS_AudioMuxOutputHandle handle, 
727    NEXUS_AudioInput input
728    );
729
730/***************************************************************************
731Summary:
732    Unlink audio mux output from a particular node
733 ***************************************************************************/
734void NEXUS_AudioMuxOutput_P_RemoveInput(
735    NEXUS_AudioMuxOutputHandle handle, 
736    NEXUS_AudioInput input
737    );
738#endif
739
740/***************************************************************************
741Summary:
742    Set the Spdif master for a slaved Audio Return Channel output.
743 ***************************************************************************/
744NEXUS_Error NEXUS_AudioReturnChannel_P_SetMaster(
745    NEXUS_AudioOutput slaveHandle,      /* handle of ARC (slave) output device */
746    NEXUS_AudioOutput sourceHandle      /* handle of SPDIF master */
747    );
748
749/***************************************************************************
750Summary:
751    Initialize the decoder module
752 ***************************************************************************/
753NEXUS_Error NEXUS_AudioDecoder_P_Init(void);
754
755/***************************************************************************
756Summary:
757    Un-Initialize the decoder module
758 ***************************************************************************/
759void NEXUS_AudioDecoder_P_Uninit(void);
760
761/***************************************************************************
762Summary:
763    Is a decoder running?
764 ***************************************************************************/
765bool NEXUS_AudioDecoder_P_IsRunning(NEXUS_AudioDecoderHandle handle);
766
767/***************************************************************************
768Summary:
769    Set TSM state for the decoder
770 ***************************************************************************/
771void NEXUS_AudioDecoder_P_SetTsm(NEXUS_AudioDecoderHandle handle);
772
773/***************************************************************************
774Summary:
775    Set Decode rate for the decoder
776 ***************************************************************************/
777void NEXUS_AudioDecoder_P_SetDecodeRate(NEXUS_AudioDecoderHandle handle);
778
779/***************************************************************************
780Summary:
781    Start the decoder
782 ***************************************************************************/
783NEXUS_Error NEXUS_AudioDecoder_P_Start(NEXUS_AudioDecoderHandle handle);
784
785/***************************************************************************
786Summary:
787    Stop the decoder
788 ***************************************************************************/
789NEXUS_Error NEXUS_AudioDecoder_P_Stop(NEXUS_AudioDecoderHandle handle, bool flush);
790
791/***************************************************************************
792Summary:
793    Set trick mode mute
794 ***************************************************************************/
795NEXUS_Error NEXUS_AudioDecoder_P_SetTrickMute(NEXUS_AudioDecoderHandle decoder, bool muted);
796
797/***************************************************************************
798Summary:
799    Reset decoder trick state
800 ***************************************************************************/
801void NEXUS_AudioDecoder_P_TrickReset( NEXUS_AudioDecoderHandle decoder);
802
803/***************************************************************************
804Summary:
805    Reset audio DSP(s)
806 ***************************************************************************/
807void NEXUS_AudioDecoder_P_Reset(void);
808
809/***************************************************************************
810Summary:
811    Is a playback running?
812 ***************************************************************************/
813bool NEXUS_AudioPlayback_P_IsRunning(NEXUS_AudioPlaybackHandle handle);
814
815/***************************************************************************
816Summary:
817    Convert TruVolume settings to magnum
818 ***************************************************************************/
819void NEXUS_TruVolume_P_ConvertSettings(const NEXUS_TruVolumeSettings *pNexus, BAPE_TruVolumeSettings *pMagnum);
820
821/***************************************************************************
822Summary:
823    Convert TruSurroundHd settings to magnum
824 ***************************************************************************/
825void NEXUS_TruSurroundHd_P_ConvertSettings(const NEXUS_TruSurroundHdSettings *pNexus, BAPE_TruSurroundHdSettings *pMagnum);
826
827/***************************************************************************
828Summary:
829    Is an I2sInput running?
830 ***************************************************************************/
831bool NEXUS_I2sInput_P_IsRunning(NEXUS_I2sInputHandle handle);
832
833#if NEXUS_NUM_RF_AUDIO_DECODERS > 0
834BDBG_OBJECT_ID_DECLARE(NEXUS_RfAudioDecoder);
835typedef struct NEXUS_RfAudioDecoder
836{
837    BDBG_OBJECT(NEXUS_RfAudioDecoder)
838    bool started;
839    bool running;
840    bool opened;
841    unsigned outputScaling;
842    NEXUS_RfAudioDecoderSettings settings;
843        BAPE_DecoderHandle decoder;
844        BAPE_InputCaptureHandle inputCapture;
845        BAPE_RfInputHandle input;
846    NEXUS_AudioInputObject connector;
847    NEXUS_RfAudioDecoderMode currentMode;
848    void *pStatusData;
849    BKNI_EventHandle statusEvent, stopEvent, stopAckEvent;
850    NEXUS_TaskCallbackHandle statusChangedCallback;
851    NEXUS_TaskCallbackHandle standardDetectedCallback;
852    BANA_Handle hAna;
853    bool runMagShiftThread;
854    NEXUS_ThreadHandle magShiftThread;
855    BKNI_EventHandle magShiftChangeEvent;
856    bool runAudioClipThread;
857    NEXUS_ThreadHandle audioClipThread;
858    BKNI_EventHandle audioClipEvent;
859} NEXUS_RfAudioDecoder;
860
861/***************************************************************************
862Summary:
863    Init the RF audio decoder sub-module
864 ***************************************************************************/
865NEXUS_Error NEXUS_RfAudioDecoder_P_Init(void);
866
867/***************************************************************************
868Summary:
869    Un-Init the RF audio decoder sub-module
870 ***************************************************************************/
871void NEXUS_RfAudioDecoder_P_Uninit(void);
872
873/***************************************************************************
874Summary:
875    Determine if a capture channel is running.
876 ***************************************************************************/
877bool NEXUS_RfAudioDecoder_P_IsRunning(
878    NEXUS_RfAudioDecoderHandle handle
879    );
880
881/***************************************************************************
882Summary:
883    Initialize RF Audio decoder status
884 ***************************************************************************/
885NEXUS_Error NEXUS_RfAudioDecoder_P_InitStatus(
886    NEXUS_RfAudioDecoderHandle handle
887    );
888
889/***************************************************************************
890Summary:
891    Uninitialize RF Audio decoder status
892 ***************************************************************************/
893void NEXUS_RfAudioDecoder_P_UninitStatus(
894    NEXUS_RfAudioDecoderHandle handle
895    );
896
897/***************************************************************************
898Summary:
899    Reset A2 Primary Carrier Status on channel change
900 ***************************************************************************/
901void NEXUS_RfAudioDecoder_P_ResetStatus(
902    NEXUS_RfAudioDecoderHandle handle,
903    bool retune
904    );
905#endif
906
907#if NEXUS_NUM_ANALOG_AUDIO_INPUTS
908BDBG_OBJECT_ID_DECLARE(NEXUS_AnalogAudioInput);
909/***************************************************************************
910Summary:
911    Analog Audio Input
912 ***************************************************************************/
913typedef struct NEXUS_AnalogAudioInput
914{
915    BDBG_OBJECT(NEXUS_AnalogAudioInput)
916    NEXUS_AnalogAudioInputSettings settings;
917    NEXUS_AudioInputObject connector;
918} NEXUS_AnalogAudioInput;
919#endif
920
921#if NEXUS_NUM_ANALOG_AUDIO_DECODERS
922/***************************************************************************
923Summary:
924    Determine if a capture channel is running.
925 ***************************************************************************/
926bool NEXUS_AnalogAudioDecoder_P_IsRunning(
927    NEXUS_AnalogAudioDecoderHandle handle
928    );
929#endif
930
931#if NEXUS_NUM_SPDIF_INPUTS
932NEXUS_Error NEXUS_SpdifInput_P_GetInputPortStatus(
933    NEXUS_SpdifInputHandle input,
934    NEXUS_AudioInputPortStatus *pStatus     /* [out] */
935    );
936   
937NEXUS_Error NEXUS_SpdifInput_P_SetFormatChangeInterrupt(
938    NEXUS_SpdifInputHandle handle,
939    void (*pCallback_isr)(void *, int),
940    void *pParam1,
941    int param2
942    );
943#endif
944
945/***************************************************************************
946Summary:
947    Input Capture Indexes
948 ***************************************************************************/
949#define NEXUS_AUDIO_CAPTURE_INDEX_BASE (0)
950#define NEXUS_I2S_CAPTURE_INDEX_BASE (0)
951#if NEXUS_DTV_PLATFORM
952#define NEXUS_ADC_CAPTURE_INDEX_BASE (NEXUS_I2S_CAPTURE_INDEX_BASE + NEXUS_NUM_I2S_INPUTS)
953#define NEXUS_RF_CAPTURE_INDEX_BASE (NEXUS_ADC_CAPTURE_INDEX_BASE + NEXUS_NUM_ANALOG_AUDIO_DECODERS)
954#else
955#define NEXUS_ADC_CAPTURE_INDEX_BASE (0)
956#define NEXUS_RF_CAPTURE_INDEX_BASE (0)
957#endif
958#define NEXUS_AUDIO_CAPTURE_INDEX(typ, idx) (((typ)==NEXUS_AudioInputType_eI2s)?NEXUS_I2S_CAPTURE_INDEX_BASE+(idx):\
959                                             ((typ)==NEXUS_AudioInputType_eAnalogDecoder)?NEXUS_ADC_CAPTURE_INDEX_BASE+(idx):\
960                                             ((typ)==NEXUS_AudioInputType_eRfDecoder)?NEXUS_RF_CAPTURE_INDEX_BASE+(idx):\
961                                             (BDBG_ASSERT(0),0))
962 
963/***************************************************************************
964Summary:
965    Audio Decoder Indexes
966 ***************************************************************************/
967#define NEXUS_AUDIO_DECODER_INDEX_BASE (0)
968#define NEXUS_I2S_DECODER_INDEX_BASE (NEXUS_NUM_AUDIO_DECODERS)
969#if NEXUS_DTV_PLATFORM
970#define NEXUS_ADC_DECODER_INDEX_BASE (NEXUS_I2S_DECODER_INDEX_BASE + NEXUS_NUM_I2S_INPUTS)
971#define NEXUS_RF_DECODER_INDEX_BASE (NEXUS_ADC_DECODER_INDEX_BASE + NEXUS_NUM_ANALOG_AUDIO_DECODERS)
972#else
973#define NEXUS_ADC_DECODER_INDEX_BASE (0)
974#define NEXUS_RF_DECODER_INDEX_BASE (0)
975#endif
976#define NEXUS_AUDIO_DECODER_INDEX(typ, idx) (((typ)==NEXUS_AudioInputType_eDecoder)?NEXUS_AUDIO_DECODER_INDEX_BASE+(idx):\
977                                             ((typ)==NEXUS_AudioInputType_eI2s)?NEXUS_I2S_DECODER_INDEX_BASE+(idx):\
978                                             ((typ)==NEXUS_AudioInputType_eAnalogDecoder)?NEXUS_ADC_DECODER_INDEX_BASE+(idx):\
979                                             ((typ)==NEXUS_AudioInputType_eRfDecoder)?NEXUS_RF_DECODER_INDEX_BASE+(idx):\
980                                             (BDBG_ASSERT(0),0))
981
982/***************************************************************************
983Summary:
984    Convert between nexus/avc codecs
985 ***************************************************************************/
986NEXUS_AudioCodec NEXUS_Audio_P_MagnumToCodec(BAVC_AudioCompressionStd codec);
987BAVC_AudioCompressionStd NEXUS_Audio_P_CodecToMagnum(NEXUS_AudioCodec codec);
988
989#endif /* #ifndef NEXUS_AUDIO_MODULE_H_ */
Note: See TracBrowser for help on using the repository browser.