From 3348e36c51e91e78020bcc6578eda83d97c31bec Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Mon, 7 Jul 2014 10:21:44 -0700 Subject: 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 --- services/audioflinger/test-resample.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'services/audioflinger/test-resample.cpp') 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 #include #include #include @@ -30,6 +28,8 @@ #include #include #include +#include +#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); -- cgit v1.1