source: svn/trunk/newcon3bcm2_21bu/dta/src/settop_api/bsettop_decode_audio.h

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

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 6.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2005, 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: bsettop_decode_audio.h $
11 * $brcm_Revision: 4 $
12 * $brcm_Date: 8/10/05 3:17p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /BSEAV/api/include/bsettop_stream.h $
19 ***************************************************************************/
20#ifndef BSETTOP_DECODE_AUDIO_H__
21#define BSETTOP_DECODE_AUDIO_H__
22
23#include "bsettop_types.h"
24#include "bsettop_stream.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30typedef struct baudio_decode *baudio_decode_t;
31typedef struct baudio_decode_status {
32        unsigned fifo_depth;
33        unsigned fifo_size;
34        uint32_t pts;
35        uint32_t stc;
36        bool hold_enable;
37        uint16_t pid;
38        bool copyright; /* for ac3 Dolby IEC-60958 status flag */
39} baudio_decode_status;
40/*
41Summary:
42    Audio rate change callback
43*/
44typedef void (*baudio_decode_change_cb_t)(baudio_decode_t audio,        /* audio decode contect handle */
45                                                                                        void *data_ptr,                 /* rate_change_data */
46                                                                                        void *cbData                    /* BRAP_DSPCHN_SampleRateChangeInfo* */
47                                                                                        );
48typedef enum baudio_downmix {
49        baudio_downmix_stereo, /* If applicable, down mix source to stereo output [default]. */
50        baudio_downmix_multichannel, /* Output decoded data as-is. If number of channels exceeds HW capabilities,
51                downmix to match maximum number of output channels. No audio will be lost. */
52        baudio_downmix_none, /* Output decoded data as-is. If number of channels exceeds HW capabilities,
53                additional audio channels will be lost. */
54        baudio_downmix_left, /* Take left channel and duplicate to left/right outputs. */
55        baudio_downmix_right, /* Take right channel and duplicate to left/right outputs. */
56        baudio_downmix_monomix  /* Mix left and right channels and output result to left/right outputs. This only applies if the stream
57                is a dual mono stream. If not, it will be equivalent to baudio_downmix_stereo. */
58} baudio_downmix;
59
60/*
61 * Summary:
62 *
63 * Dual Mono channel select modes
64 * */
65typedef enum baudio_dualmono {
66        baudio_dualmono_left,   /* BRAP_DSPCHN_DualMonoMode_eLeftMono Selects left source channel of dual mono audio */
67        baudio_dualmono_right,  /* BRAP_DSPCHN_DualMonoMode_eRightMono Selects right source channel of dual mono audio */
68        baudio_dualmono_stereo, /* BRAP_DSPCHN_DualMonoMode_eStere Pass-Thru */   
69        baudio_dualmono_monomix /* BRAP_DSPCHN_DualMonoMode_eDualMonoMix Mixes left and right channels */
70} baudio_dualmono;
71
72/*
73 * Summary:
74 * Controls the downmix type used by the AAC audio decoder
75 * */
76typedef enum baudio_aac_downmix
77{
78        baudio_aac_downmix_matrix = 0, // BRAP_DSPCHN_AAC_DownmixType_eMatrix
79        baudio_aac_downmix_arib = 1, // BRAP_DSPCHN_AAC_DownmixType_eArib
80        baudio_aac_downmix_ltrt = 2 // BRAP_DSPCHN_AAC_DownmixType_eLtRt
81} baudio_aac_downmix;
82
83typedef enum baudio_dolby_drc_mode
84{
85        baudio_dolby_drc_mode_custom_a, // BRAP_DSPCHN_Ac3CompMode_eCustomA
86        baudio_dolby_drc_mode_custom_d, // BRAP_DSPCHN_Ac3CompMode_eCustomD
87        baudio_dolby_drc_mode_line, // BRAP_DSPCHN_Ac3CompMode_eLine
88        baudio_dolby_drc_mode_rf, // BRAP_DSPCHN_Ac3CompMode_eRf
89        baudio_dolby_drc_mode_off // BRAP_DSPCHN_Ac3CompMode_eOff
90} baudio_dolby_drc_mode;
91
92typedef enum baudio_dolby_stereo_downmix_mode
93{
94        baudio_dolby_stereo_downmix_mode_automatic, // BRAP_DSPCHN_Ac3StereoMode_eAuto
95        baudio_dolby_stereo_downmix_mode_dolby_surround_compatible, // BRAP_DSPCHN_Ac3StereoMode_eLtRt
96        baudio_dolby_stereo_downmix_mode_standard // BRAP_DSPCHN_Ac3StereoMode_eLoRo
97} baudio_dolby_stereo_downmix_mode;
98
99typedef struct baudio_dolby_settings
100{
101        baudio_dolby_drc_mode drc_mode;
102        baudio_dolby_stereo_downmix_mode stereo_downmix_mode;
103        unsigned short cut;
104        unsigned short boost;
105        bool lfe;
106        bool dialog_norm; /* this should be true for normal operation */
107} baudio_dolby_settings;
108
109typedef struct baudio_aac_settings
110{
111        baudio_aac_downmix downmix;
112} baudio_aac_settings;
113
114typedef struct baudio_decode_config {
115        baudio_decode_change_cb_t rate_change_cb;               /* normaly used to notify HDMI of rate change */
116        void *rate_change_data;                                                         /* passed to baudio_decode_change_cb_t in data_ptr */
117        unsigned int left_volume;
118        unsigned int right_volume;
119        bool mute;
120        bool deemphasized;                                                              /* Disable for test purposes */
121        bool hdmi_compress;
122        bool mono_mix;
123        baudio_downmix downmix;
124        baudio_dualmono dualmono;
125        baudio_dolby_settings dolby;
126        baudio_aac_downmix aac_downmix;
127        bool hd_mute;
128        bool copyright; /* for ac3 Dolby IEC-60958 status flag */
129        uint8_t category_code; /* for ac3 Dolby IEC-60958 status flag */
130        bool avl; /* avl is enabled */
131        int avl_target;
132        int avl_lowerbound;
133        int avl_fixedboost;
134} baudio_decode_config;
135
136baudio_decode_t baudio_decode_open(bobject_t id);
137void baudio_decode_close(baudio_decode_t codec);
138bresult baudio_decode_start(baudio_decode_t codec, 
139                                                        bdisplay_t display, 
140                                                        bstream_t stream);
141void baudio_decode_stop(baudio_decode_t codec);
142bresult baudio_decode_get_status(baudio_decode_t codec, 
143                                                                 baudio_decode_status *status);
144void baudio_decode_get_config(baudio_decode_t codec, 
145                                                          baudio_decode_config *config);
146bresult baudio_decode_set_config(baudio_decode_t codec, 
147                                                                 const baudio_decode_config *config);
148void baudio_decode_get_avl_level(baudio_decode_t audio, int num_energy, long *level);
149void baudio_decode_test_tone(baudio_decode_t audio, 
150                                                         uint32_t *samples, /* array of samples, num_samples long */
151                                                         uint32_t num_samples, /* Number of samples, should be less than sample array size */
152                                                         bool leftChannel,      /* true - program left channel, flase program right channel */
153                                                         bool enable /* enable/disable hifidac tone test */
154                                                         );
155/**
156Summary:
157        Supported video format. Returns NULL if stream_type (from PMT) not supported.
158 **/
159bsettop_av_stream_type_t *bdecode_supported_audio(unsigned char stream_type);
160
161#ifdef __cplusplus
162}
163#endif
164
165#endif /* BSETTOP_DECODE_AUDIO_H__ */
166
167
Note: See TracBrowser for help on using the repository browser.