summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/test-resample.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-07-07 10:21:44 -0700
committerAndy Hung <hunga@google.com>2014-07-07 10:29:36 -0700
commit3348e36c51e91e78020bcc6578eda83d97c31bec (patch)
treeee3df8ed9f79863fc34589813710896a7e08af86 /services/audioflinger/test-resample.cpp
parent075abae2a954bf3edf18ad1705c2c0f188454ae0 (diff)
downloadframeworks_av-3348e36c51e91e78020bcc6578eda83d97c31bec.zip
frameworks_av-3348e36c51e91e78020bcc6578eda83d97c31bec.tar.gz
frameworks_av-3348e36c51e91e78020bcc6578eda83d97c31bec.tar.bz2
Replace int bitDepth with audio_format_t in Resampler
Remove mBitDepth from class (not used). Replace with audio_format_t in factory method to distinguish between float and pcm 16-bit. Change-Id: I166860796c68285077ef4458d8758d19b82523f9
Diffstat (limited to 'services/audioflinger/test-resample.cpp')
-rw-r--r--services/audioflinger/test-resample.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/audioflinger/test-resample.cpp b/services/audioflinger/test-resample.cpp
index e14b4ae..78c9927 100644
--- a/services/audioflinger/test-resample.cpp
+++ b/services/audioflinger/test-resample.cpp
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-#include "AudioResampler.h"
-#include <media/AudioBufferProvider.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -30,6 +28,8 @@
#include <audio_utils/primitives.h>
#include <audio_utils/sndfile.h>
#include <utils/Vector.h>
+#include <media/AudioBufferProvider.h>
+#include "AudioResampler.h"
using namespace android;
@@ -329,7 +329,7 @@ int main(int argc, char* argv[]) {
printf("%zu input frames\n", input_frames);
}
- int bit_depth = useFloat ? 32 : 16;
+ audio_format_t format = useFloat ? AUDIO_FORMAT_PCM_FLOAT : AUDIO_FORMAT_PCM_16_BIT;
int output_channels = channels > 2 ? channels : 2; // output is at least stereo samples
size_t output_framesize = output_channels * (useFloat ? sizeof(float) : sizeof(int32_t));
size_t output_frames = ((int64_t) input_frames * output_freq) / input_freq;
@@ -342,7 +342,7 @@ int main(int argc, char* argv[]) {
//
// On fast devices, filters should be generated between 0.1ms - 1ms.
// (single threaded).
- AudioResampler* resampler = AudioResampler::create(bit_depth, channels,
+ AudioResampler* resampler = AudioResampler::create(format, channels,
8000, quality);
int looplimit = 100;
timespec start, end;
@@ -380,7 +380,7 @@ int main(int argc, char* argv[]) {
}
void* output_vaddr = malloc(output_size);
- AudioResampler* resampler = AudioResampler::create(bit_depth, channels,
+ AudioResampler* resampler = AudioResampler::create(format, channels,
output_freq, quality);