source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/ape/7552/bape_input.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 18.2 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_input.h $
11 * $brcm_Revision: Hydra_Software_Devel/21 $
12 * $brcm_Date: 3/8/12 5:46p $
13 *
14 * Module Description: Audio Decoder Interface
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/ape/7422/bape_input.h $
19 *
20 * Hydra_Software_Devel/21   3/8/12 5:46p gskerl
21 * SW7429-18: Removed sampleWidth and preambleC from
22 * BAPE_SpdifInputFormatDetectionStatus structure.
23 *
24 * Hydra_Software_Devel/20   3/5/12 9:22a jgarrett
25 * SW7425-2455: Removing ADC and RF Inputs
26 *
27 * Hydra_Software_Devel/19   2/2/12 5:32p gskerl
28 * SW7429-18: Removed compresseddata field from BAPE_SpdifInputSettings.
29 *
30 * Hydra_Software_Devel/SW7429-18_20120120/1   1/20/12 12:42p gskerl
31 * SW7429-18: Made a first pass at rearranging the
32 * BAPE_SpdifInputFormatDetectionStatus structure
33 *
34 * Hydra_Software_Devel/17   1/9/12 6:08p gskerl
35 * SW7429-18: Added hbr flag to BAPE_MaiInputFormatDetectionStatus struct.
36 *
37 * Hydra_Software_Devel/16   1/6/12 5:12p gskerl
38 * SW7429-18: Added codec and numPcmChannels to
39 * BAPE_MaiInputFormatDetectionStatus struct
40 *
41 * Hydra_Software_Devel/15   1/6/12 4:56p gskerl
42 * SW7429-18: Added BAPE_P_NUM_ELEMS macro
43 *
44 * Hydra_Software_Devel/14   8/10/11 9:30a venkatr
45 * SWDTV-6584 : [35233] Add ADC Input for APE
46 *
47 * Hydra_Software_Devel/13   4/16/11 12:15p jgarrett
48 * SW7425-371: Removing tab characters
49 *
50 * Hydra_Software_Devel/12   4/11/11 5:54p jgarrett
51 * SWDTV-6305: Adding ADC/RF Inputs for DTV
52 *
53 * Hydra_Software_Devel/11   4/8/11 3:39p piyushg
54 * SW7422-365: Added support for the SPDIF input handling and format
55 * detection in APE
56 *
57 * Hydra_Software_Devel/10   3/23/11 11:07a piyushg
58 * SW7422-364: Initial checking for HDMI input support.
59 *
60 * Hydra_Software_Devel/9   3/1/11 3:25p jgarrett
61 * SW7422-146: Moving sample rate to input port from input capture
62 *
63 * Hydra_Software_Devel/8   2/22/11 5:43p jgarrett
64 * SW7422-146: Implemented type renaming based on filter graph review
65 * comments
66 *
67 * Hydra_Software_Devel/7   1/21/11 7:33p piyushg
68 * SW7422-146: Initial checkin for I2S input.
69 *
70 * Hydra_Software_Devel/6   1/18/11 11:04a jgarrett
71 * SW7422-146: Adding handle to input open routines
72 *
73 * Hydra_Software_Devel/5   1/12/11 4:24p jgarrett
74 * SW7422-146: Adding additional APIs
75 *
76 * Hydra_Software_Devel/4   1/7/11 5:21p jgarrett
77 * SW7422-146: Adding SPDIF/HDMI input APIs
78 *
79 * Hydra_Software_Devel/3   1/5/11 11:32a jgarrett
80 * SW7422-146: Moving sample rate to input capture
81 *
82 * Hydra_Software_Devel/2   12/16/10 4:04p jgarrett
83 * SW7422-146: Initial compilable APE for 7422
84 *
85 * Hydra_Software_Devel/1   12/14/10 2:16p jgarrett
86 * SW7422-146: Adding initial API for APE/DSP
87 *
88 ***************************************************************************/
89
90#ifndef BAPE_INPUT_H_
91#define BAPE_INPUT_H_
92
93/***************************************************************************
94Summary:
95I2S Input Handle
96***************************************************************************/
97typedef struct BAPE_I2sInput *BAPE_I2sInputHandle;
98
99/***************************************************************************
100Summary:
101I2S Input Settings
102***************************************************************************/
103typedef struct BAPE_I2sInputSettings
104{
105    unsigned sampleRate;        /* Sample rate in Hz */
106    unsigned bitsPerSample;     /* Values from 1 to 32 are supported. */
107
108    BAPE_I2sJustification   justification;    /* Data Justification*/
109    BAPE_I2sDataAlignment   dataAlignment;    /* Data Alignment */
110    BAPE_I2sLRClockPolarity lrPolarity;       /* LRCK polarity */
111    BAPE_I2sSclkPolarity    sclkPolarity;     /* SCLK polarity */
112} BAPE_I2sInputSettings;
113
114/***************************************************************************
115Summary:
116Get Default I2S Input Settings
117***************************************************************************/
118void BAPE_I2sInput_GetDefaultSettings(
119    BAPE_I2sInputSettings *pSettings        /* [out] */
120    );
121
122/***************************************************************************
123Summary:
124Open an I2S Input
125***************************************************************************/
126BERR_Code BAPE_I2sInput_Open(
127    BAPE_Handle deviceHandle,
128    unsigned index,
129    const BAPE_I2sInputSettings *pSettings,
130    BAPE_I2sInputHandle *pHandle            /* [out] */
131    );
132
133/***************************************************************************
134Summary:
135Close an I2S Input
136***************************************************************************/
137void BAPE_I2sInput_Close(
138    BAPE_I2sInputHandle handle
139    );
140
141/***************************************************************************
142Summary:
143Get I2S Input Settings
144***************************************************************************/
145void BAPE_I2sInput_GetSettings(
146    BAPE_I2sInputHandle handle,
147    BAPE_I2sInputSettings *pSettings        /* [out] */
148    );
149
150/***************************************************************************
151Summary:
152Set I2S Input Settings
153***************************************************************************/
154BERR_Code BAPE_I2sInput_SetSettings(
155    BAPE_I2sInputHandle handle,
156    const BAPE_I2sInputSettings *pSettings
157    );
158
159/***************************************************************************
160Summary:
161Get I2S Input Port Connector
162***************************************************************************/
163void BAPE_I2sInput_GetInputPort(
164    BAPE_I2sInputHandle handle,
165    BAPE_InputPort *pPort
166    );
167
168/***************************************************************************
169Summary:
170SPDIF Input Handle
171***************************************************************************/
172typedef struct BAPE_SpdifInput *BAPE_SpdifInputHandle;
173
174/***************************************************************************
175Summary:
176SPDIF Input Error handling modes
177***************************************************************************/
178typedef enum BAPE_SpdifInputErrorInsertion
179{
180    BAPE_SpdifInputErrorInsertion_eNone,        /* No values inserted */
181    BAPE_SpdifInputErrorInsertion_eZero,        /* Zeroes are inserted */
182    BAPE_SpdifInputErrorInsertion_eRepeat,      /* Repeat the previous sample */
183    BAPE_SpdifInputErrorInsertion_eMax
184} BAPE_SpdifInputErrorInsertion;
185
186/***************************************************************************
187Summary:
188SPDIF Input Settings
189***************************************************************************/
190typedef struct BAPE_SpdifInputSettings
191{
192    bool ignoreValidity;            /* If true, the validity bit will be ignored */
193    bool ignorePcmParity;           /* If true, PCM parity errors will be ignored */
194    bool ignoreCompressedParity;    /* If true, compressed parity errors will be ignored */
195    BAPE_SpdifInputErrorInsertion errorInsertion;   /* Action to take on validity or parity errors*/
196    BAVC_Timebase timebase;         /* Timebase to use for PTS insertion into PES packets */
197} BAPE_SpdifInputSettings;
198
199/***************************************************************************
200Summary:
201Get Default SPDIF Input Settings
202***************************************************************************/
203void BAPE_SpdifInput_GetDefaultSettings(
204    BAPE_SpdifInputSettings *pSettings        /* [out] */
205    );
206
207/***************************************************************************
208Summary:
209Open an SPDIF Input
210***************************************************************************/
211BERR_Code BAPE_SpdifInput_Open(
212    BAPE_Handle deviceHandle,
213    unsigned index,
214    const BAPE_SpdifInputSettings *pSettings,
215    BAPE_SpdifInputHandle *pHandle              /* [out] */
216    );
217
218/***************************************************************************
219Summary:
220Close an SPDIF Input
221***************************************************************************/
222void BAPE_SpdifInput_Close(
223    BAPE_SpdifInputHandle handle
224    );
225
226/***************************************************************************
227Summary:
228Get SPDIF Input Settings
229***************************************************************************/
230void BAPE_SpdifInput_GetSettings(
231    BAPE_SpdifInputHandle handle,
232    BAPE_SpdifInputSettings *pSettings        /* [out] */
233    );
234
235/***************************************************************************
236Summary:
237Set SPDIF Input Settings
238***************************************************************************/
239BERR_Code BAPE_SpdifInput_SetSettings(
240    BAPE_SpdifInputHandle handle,
241    const BAPE_SpdifInputSettings *pSettings
242    );
243
244/***************************************************************************
245Summary:
246Get SPDIF Input Port Connector
247***************************************************************************/
248void BAPE_SpdifInput_GetInputPort(
249    BAPE_SpdifInputHandle handle,
250    BAPE_InputPort *pPort
251    );
252
253/***************************************************************************
254Summary:
255SPDIF Format Detection Settings
256***************************************************************************/
257typedef struct BAPE_SpdifInputFormatDetectionSettings
258{
259    bool enabled;       /* Enable input format detection */
260    struct
261    {
262        void (*pCallback_isr)(void *pParam1, int param2);
263        void *pParam1;
264        int param2;
265    } formatChangeInterrupt;
266} BAPE_SpdifInputFormatDetectionSettings;
267
268/***************************************************************************
269Summary:
270Get SPDIF Format Detection Settings
271***************************************************************************/
272void BAPE_SpdifInput_GetFormatDetectionSettings(
273    BAPE_SpdifInputHandle handle,
274    BAPE_SpdifInputFormatDetectionSettings *pSettings   /* [out] */
275    );
276
277/***************************************************************************
278Summary:
279Set SPDIF Format Detection Settings
280***************************************************************************/
281BERR_Code BAPE_SpdifInput_SetFormatDetectionSettings(
282    BAPE_SpdifInputHandle handle,
283    const BAPE_SpdifInputFormatDetectionSettings *pSettings
284    );
285
286/***************************************************************************
287Summary:
288SPDIF Preamble C Data
289***************************************************************************/
290typedef struct BAPE_SpdifInputPreambleC
291{
292    BAVC_AudioCompressionStd codec;
293    bool errors;                    /* If true, payload may contain errors */
294    uint8_t bistreamNumber;         /* Bitstream Number */
295    uint8_t typeDependentInfo;      /* Data Type Dependent Information */
296} BAPE_SpdifInputPreambleC;
297
298/***************************************************************************
299Summary:
300SPDIF Format Detection Status
301***************************************************************************/
302typedef struct BAPE_SpdifInputFormatDetectionStatus
303{
304    BAVC_AudioCompressionStd codec;
305    unsigned numPcmChannels;    /* Total number of PCM audio channels, 0 for comnpressed streams */
306    unsigned sampleRate;        /* Sample rate of the incoming stream */
307    bool signalPresent;         /* If true, a signal is present */
308    bool compressed;            /* If true, stream is compressed.  If false, stream is linear PCM */
309    bool goodBiphase;       /* Incoming stream has good subframe preambles and biphase encoding transitions */
310    bool leftValidity;      /* If true, validity bit is set for left channel data */
311    bool rightValidity;     /* If true, validity bit is set for right channel data */
312
313    bool      pcValid;      /* If true, preambleC is valid for compressed streams */
314
315    bool detectionEnabled;      /* If true, detection is enabled */
316} BAPE_SpdifInputFormatDetectionStatus;
317
318/***************************************************************************
319Summary:
320Get SPDIF Format Detection Status
321***************************************************************************/
322BERR_Code BAPE_SpdifInput_GetFormatDetectionStatus(
323    BAPE_SpdifInputHandle handle,
324    BAPE_SpdifInputFormatDetectionStatus *pStatus
325    );
326
327/***************************************************************************
328Summary:
329HDMI Input Handle
330***************************************************************************/
331typedef struct BAPE_MaiInput *BAPE_MaiInputHandle;
332
333/***************************************************************************
334Summary:
335HDMI Input Settings
336***************************************************************************/
337typedef struct BAPE_MaiInputSettings
338{
339    bool ignoreValidity;            /* If true, the validity bit will be ignored */
340    bool ignorePcmParity;           /* If true, PCM parity errors will be ignored */
341    bool ignoreCompressedParity;    /* If true, compressed parity errors will be ignored */
342    BAPE_SpdifInputErrorInsertion errorInsertion;   /* Action to take on validity or parity errors*/
343    BAVC_Timebase timebase;         /* Timebase to use for PTS insertion into PES packets */
344} BAPE_MaiInputSettings;
345
346/***************************************************************************
347Summary:
348Get Default HDMI Input Settings
349***************************************************************************/
350void BAPE_MaiInput_GetDefaultSettings(
351    BAPE_MaiInputSettings *pSettings        /* [out] */
352    );
353
354/***************************************************************************
355Summary:
356Open an HDMI Input
357***************************************************************************/
358BERR_Code BAPE_MaiInput_Open(
359    BAPE_Handle deviceHandle,
360    unsigned index,
361    const BAPE_MaiInputSettings *pSettings,
362    BAPE_MaiInputHandle *pHandle              /* [out] */
363    );
364
365/***************************************************************************
366Summary:
367Close an HDMI Input
368***************************************************************************/
369void BAPE_MaiInput_Close(
370    BAPE_MaiInputHandle handle
371    );
372
373/***************************************************************************
374Summary:
375Get HDMI Input Settings
376***************************************************************************/
377void BAPE_MaiInput_GetSettings(
378    BAPE_MaiInputHandle handle,
379    BAPE_MaiInputSettings *pSettings        /* [out] */
380    );
381
382/***************************************************************************
383Summary:
384Set HDMI Input Settings
385***************************************************************************/
386BERR_Code BAPE_MaiInput_SetSettings(
387    BAPE_MaiInputHandle handle,
388    const BAPE_MaiInputSettings *pSettings
389    );
390
391/***************************************************************************
392Summary:
393Get HDMI Input Port Connector
394***************************************************************************/
395void BAPE_MaiInput_GetInputPort(
396    BAPE_MaiInputHandle handle,
397    BAPE_InputPort *pPort
398    );
399
400/***************************************************************************
401Summary:
402HDMI Format Detection Settings
403***************************************************************************/
404typedef struct BAPE_MaiInputFormatDetectionSettings
405{
406    bool enabled;       /* Enable input format detection */
407    struct
408    {
409        void (*pCallback_isr)(void *pParam1, int param2);
410        void *pParam1;
411        int param2;
412    } formatChangeInterrupt;
413} BAPE_MaiInputFormatDetectionSettings;
414
415/***************************************************************************
416Summary:
417Get HDMI Format Detection Settings
418***************************************************************************/
419void BAPE_MaiInput_GetFormatDetectionSettings(
420    BAPE_MaiInputHandle handle,
421    BAPE_MaiInputFormatDetectionSettings *pSettings   /* [out] */
422    );
423
424/***************************************************************************
425Summary:
426Set HDMI Format Detection Settings
427***************************************************************************/
428BERR_Code BAPE_MaiInput_SetFormatDetectionSettings(
429    BAPE_MaiInputHandle handle,
430    const BAPE_MaiInputFormatDetectionSettings *pSettings
431    );
432
433/***************************************************************************
434Summary:
435HDMI Input Format
436***************************************************************************/
437typedef enum BAPE_MaiInputFormat
438{
439    BAPE_MaiInputFormat_eIdle,
440    BAPE_MaiInputFormat_eMono,
441    BAPE_MaiInputFormat_ePcmStereo,
442    BAPE_MaiInputFormat_ePcm3Channel,
443    BAPE_MaiInputFormat_ePcm5_1,
444    BAPE_MaiInputFormat_eSpdifPcmStereo,
445    BAPE_MaiInputFormat_eSpdifPcm6Channel,
446    BAPE_MaiInputFormat_eSpdifPcm8Channel,
447    BAPE_MaiInputFormat_eHbrCompressed,
448    BAPE_MaiInputFormat_eHdmiOneBit,
449    BAPE_MaiInputFormat_eHdmiDirectStreamTransfer,
450    BAPE_MaiInputFormat_eHdmiPcmStereo,
451    BAPE_MaiInputFormat_eHdmiNonLinearPcm,
452    BAPE_MaiInputFormat_eSpdifLinearPcm,
453    BAPE_MaiInputFormat_eSpdifNonLinearPcm,
454    BAPE_MaiInputFormat_eMax
455} BAPE_MaiInputFormat;
456
457/***************************************************************************
458Summary:
459HDMI Format Detection Status
460***************************************************************************/
461typedef struct BAPE_MaiInputFormatDetectionStatus
462{
463    BAVC_AudioCompressionStd codec;
464    unsigned numPcmChannels;    /* Total number of PCM audio channels, 0 for comnpressed streams */
465    unsigned sampleRate;        /* Sample rate of the incoming stream */
466    unsigned sampleWidth;       /* Sample width in bits */
467    bool signalPresent;         /* If true, a signal is present */
468    bool compressed;            /* If true, stream is compressed.  If false, stream is linear PCM */
469    bool hbr;                   /* If true, stream is compressed.  If false, stream is linear PCM */
470    bool pcValid;               /* If true, preambleC is valid for compressed streams */
471    bool detectionEnabled;      /* If true, detection is enabled */
472} BAPE_MaiInputFormatDetectionStatus;
473
474/***************************************************************************
475Summary:
476Get HDMI Format Detection Status
477***************************************************************************/
478BERR_Code BAPE_MaiInput_GetFormatDetectionStatus(
479    BAPE_MaiInputHandle handle,
480    BAPE_MaiInputFormatDetectionStatus *pStatus
481    );
482
483#endif /* #ifndef BAPE_INPUT_H_ */
484
Note: See TracBrowser for help on using the repository browser.