1 /*
2  ** Copyright 2003-2010, VisualOn, Inc.
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 	File:		voAAC.h
18 
19 	Content:	AAC codec APIs & data types
20 
21 *******************************************************************************/
22 
23 #ifndef __voAAC_H__
24 #define __voAAC_H__
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29 
30 #include "voAudio.h"
31 
32 /*!
33  * the frame type that the decoder supports
34  */
35 typedef enum {
36 	VOAAC_RAWDATA			= 0,	/*!<contains only raw aac data in a frame*/
37 	VOAAC_ADTS				= 1,	/*!<contains ADTS header + raw AAC data in a frame*/
38 	VOAAC_FT_MAX			= VO_MAX_ENUM_VALUE
39 } VOAACFRAMETYPE;
40 
41 /*!
42  * the structure for AAC encoder input parameter
43  */
44 typedef  struct {
45   int	  sampleRate;          /*! audio file sample rate */
46   int	  bitRate;             /*! encoder bit rate in bits/sec */
47   short   nChannels;		   /*! number of channels on input (1,2) */
48   short   adtsUsed;			   /*! whether write adts header */
49 } AACENC_PARAM;
50 
51 /* AAC Param ID */
52 #define VO_PID_AAC_Mdoule				0x42211000
53 #define VO_PID_AAC_ENCPARAM				VO_PID_AAC_Mdoule | 0x0040  /*!< get/set AAC encoder parameter, the parameter is a pointer to AACENC_PARAM */
54 
55 /* AAC decoder error ID */
56 #define VO_ERR_AAC_Mdoule				0x82210000
57 #define VO_ERR_AAC_UNSFILEFORMAT		(VO_ERR_AAC_Mdoule | 0xF001)
58 #define VO_ERR_AAC_UNSPROFILE			(VO_ERR_AAC_Mdoule | 0xF002)
59 
60 /**
61  * Get audio encoder API interface
62  * \param pEncHandle [out] Return the AAC Encoder handle.
63  * \retval VO_ERR_OK Succeeded.
64  */
65 VO_S32 VO_API voGetAACEncAPI (VO_AUDIO_CODECAPI * pEncHandle);
66 
67 #ifdef __cplusplus
68 }
69 #endif /* __cplusplus */
70 
71 #endif // __voAAC_H__
72 
73 
74 
75