1 /*
2  * Copyright (C) 2017 The Android Open Source Project
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 #ifndef MEDIA_AUDIO_HIDL_TEST_COMMON_H
18 #define MEDIA_AUDIO_HIDL_TEST_COMMON_H
19 
20 #include <media_hidl_test_common.h>
21 
22 /*
23  * Common audio utils
24  */
25 void enumerateProfile(sp<IOmxNode> omxNode, OMX_U32 portIndex,
26                       std::vector<int32_t>* arrProfile);
27 
28 void setupPCMPort(sp<IOmxNode> omxNode, OMX_U32 portIndex, int32_t nChannels,
29                   OMX_NUMERICALDATATYPE eNumData, int32_t nBitPerSample,
30                   int32_t nSamplingRate, OMX_AUDIO_PCMMODETYPE ePCMMode);
31 
32 void setupMP3Port(sp<IOmxNode> omxNode, OMX_U32 portIndex,
33                   OMX_AUDIO_MP3STREAMFORMATTYPE eFormat, int32_t nChannels,
34                   int32_t nBitRate, int32_t nSampleRate);
35 
36 void setupFLACPort(sp<IOmxNode> omxNode, OMX_U32 portIndex, int32_t nChannels,
37                    int32_t nSampleRate, int32_t nCompressionLevel);
38 
39 void setupOPUSPort(sp<IOmxNode> omxNode, OMX_U32 portIndex, int32_t nChannels,
40                    int32_t nBitRate, int32_t nSampleRate);
41 
42 void setupAMRPort(sp<IOmxNode> omxNode, OMX_U32 portIndex, int32_t nBitRate,
43                   bool isAMRWB);
44 
45 void setupVORBISPort(sp<IOmxNode> omxNode, OMX_U32 portIndex, int32_t nChannels,
46                      int32_t nBitRate, int32_t nSampleRate, int32_t nQuality);
47 
48 void setupAACPort(sp<IOmxNode> omxNode, OMX_U32 portIndex,
49                   OMX_AUDIO_AACPROFILETYPE eAACProfile,
50                   OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat,
51                   int32_t nChannels, int32_t nBitRate, int32_t nSampleRate);
52 
53 #endif  // MEDIA_AUDIO_HIDL_TEST_COMMON_H
54