• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 Amlogic Corporation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 
19 /**
20 * @file aformat.h
21 * @brief  Porting from decoder driver for audio format
22 * @author Tim Yao <timyao@amlogic.com>
23 * @version 1.0.0
24 * @date 2011-02-24
25 */
26 /* Copyright (C) 2007-2011, Amlogic Inc.
27 * All right reserved
28 *
29 */
30 
31 /*
32  * AMLOGIC Audio/Video streaming port driver.
33  *
34  * This program is free software; you can redistribute it and/or modify
35  * it under the terms of the GNU General Public License as published by
36  * the Free Software Foundation; either version 2 of the named License,
37  * or any later version.
38  *
39  * This program is distributed in the hope that it will be useful,
40  * but WITHOUT ANY WARRANTY; without even the implied warranty of
41  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42  * GNU General Public License for more details.
43  *
44  * You should have received a copy of the GNU General Public License
45  * along with this program; if not, write to the Free Software
46  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
47  *
48  * Author:  Tim Yao <timyao@amlogic.com>
49  *
50  */
51 
52 #ifndef AFORMAT_H
53 #define AFORMAT_H
54 
55 typedef enum {
56     AFORMAT_UNKNOWN = -1,
57     AFORMAT_MPEG   = 0,
58     AFORMAT_PCM_S16LE = 1,
59     AFORMAT_AAC   = 2,
60     AFORMAT_AC3   = 3,
61     AFORMAT_ALAW = 4,
62     AFORMAT_MULAW = 5,
63     AFORMAT_DTS = 6,
64     AFORMAT_PCM_S16BE = 7,
65     AFORMAT_FLAC = 8,
66     AFORMAT_COOK = 9,
67     AFORMAT_PCM_U8 = 10,
68     AFORMAT_ADPCM = 11,
69     AFORMAT_AMR  = 12,
70     AFORMAT_RAAC  = 13,
71     AFORMAT_WMA  = 14,
72     AFORMAT_WMAPRO   = 15,
73     AFORMAT_PCM_BLURAY  = 16,
74     AFORMAT_ALAC  = 17,
75     AFORMAT_VORBIS    = 18,
76     AFORMAT_AAC_LATM   = 19,
77     AFORMAT_APE   = 20,
78     AFORMAT_EAC3   = 21,
79     AFORMAT_PCM_WIFIDISPLAY = 22,
80     AFORMAT_DRA    = 23,
81     AFORMAT_SIPR   = 24,
82     AFORMAT_TRUEHD = 25,
83     AFORMAT_MPEG1  = 26, //AFORMAT_MPEG-->mp3,AFORMAT_MPEG1-->mp1,AFROMAT_MPEG2-->mp2
84     AFORMAT_MPEG2  = 27,
85     AFORMAT_WMAVOI = 28,
86     AFORMAT_WMALOSSLESS =29,
87     AFORMAT_OPUS = 30,
88     AFORMAT_UNSUPPORT ,
89     AFORMAT_MAX
90 
91 } aformat_t;
92 
93 #define AUDIO_EXTRA_DATA_SIZE   (8192)
94 #define IS_AFMT_VALID(afmt) ((afmt > AFORMAT_UNKNOWN) && (afmt < AFORMAT_MAX))
95 
96 #define IS_AUIDO_NEED_EXT_INFO(afmt) ((afmt == AFORMAT_ADPCM) \
97                                  ||(afmt == AFORMAT_VORBIS) \
98                                  ||(afmt == AFORMAT_OPUS) \
99                                  ||(afmt == AFORMAT_WMA) \
100                                  ||(afmt == AFORMAT_WMAPRO) \
101                                  ||(afmt == AFORMAT_PCM_S16BE) \
102                                  ||(afmt == AFORMAT_PCM_S16LE) \
103                                  ||(afmt == AFORMAT_PCM_U8) \
104                                  ||(afmt == AFORMAT_PCM_BLURAY) \
105                                  ||(afmt == AFORMAT_AMR)\
106                                  ||(afmt == AFORMAT_ALAC)\
107                                  ||(afmt == AFORMAT_AC3) \
108                                  ||(afmt == AFORMAT_EAC3) \
109                                  ||(afmt == AFORMAT_APE) \
110                                  ||(afmt == AFORMAT_FLAC)\
111                                  ||(afmt == AFORMAT_PCM_WIFIDISPLAY) \
112                                  ||(afmt == AFORMAT_COOK) \
113                                  ||(afmt == AFORMAT_RAAC)) \
114                                  ||(afmt == AFORMAT_TRUEHD) \
115                                  ||(afmt == AFORMAT_WMAVOI) \
116                                  ||(afmt == AFORMAT_WMALOSSLESS)
117 
118 #define IS_AUDIO_NOT_SUPPORT_EXCEED_2CH(afmt) ((afmt == AFORMAT_RAAC) \
119                                         ||(afmt == AFORMAT_COOK) \
120                                         /*||(afmt == AFORMAT_FLAC)*/)
121 
122 #define IS_AUDIO_NOT_SUPPORT_EXCEED_6CH(afmt) ((afmt == AFORMAT_WMAPRO))
123 #define IS_AUDIO_NOT_SUPPORT_EXCEED_FS48k(afmt) ((afmt == AFORMAT_WMAPRO))
124 
125 
126 #define IS_AUIDO_NEED_PREFEED_HEADER(afmt) ((afmt == AFORMAT_VORBIS) )
127 #define IS_AUDIO_NOT_SUPPORTED_BY_AUDIODSP(afmt,codec)  \
128                             ((afmt == AFORMAT_AAC_LATM || afmt == AFORMAT_AAC) \
129                              &&codec->profile == 0/* FF_PROFILE_AAC_MAIN*/)
130 
131 #define IS_SUB_NEED_PREFEED_HEADER(sfmt) ((sfmt == CODEC_ID_DVD_SUBTITLE) )
132 
133 #endif /* AFORMAT_H */
134 
135