diff options
Diffstat (limited to 'Source/WebCore/platform/audio')
| -rw-r--r-- | Source/WebCore/platform/audio/FFTFrame.cpp | 4 | ||||
| -rw-r--r-- | Source/WebCore/platform/audio/FFTFrameStub.cpp | 4 | ||||
| -rw-r--r-- | Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp | 8 | ||||
| -rw-r--r-- | Source/WebCore/platform/audio/HRTFDatabaseLoader.h | 7 | ||||
| -rw-r--r-- | Source/WebCore/platform/audio/SincResampler.h | 2 | ||||
| -rw-r--r-- | Source/WebCore/platform/audio/fftw/FFTFrameFFTW.cpp | 4 | ||||
| -rw-r--r-- | Source/WebCore/platform/audio/mkl/FFTFrameMKL.cpp | 10 |
7 files changed, 35 insertions, 4 deletions
diff --git a/Source/WebCore/platform/audio/FFTFrame.cpp b/Source/WebCore/platform/audio/FFTFrame.cpp index d9979d9..fbb5dfe 100644 --- a/Source/WebCore/platform/audio/FFTFrame.cpp +++ b/Source/WebCore/platform/audio/FFTFrame.cpp @@ -32,6 +32,10 @@ #include "FFTFrame.h" +#ifndef NDEBUG +#include <stdio.h> +#endif + #include <wtf/Complex.h> #include <wtf/MathExtras.h> #include <wtf/OwnPtr.h> diff --git a/Source/WebCore/platform/audio/FFTFrameStub.cpp b/Source/WebCore/platform/audio/FFTFrameStub.cpp index c76c0e2..5494cd0 100644 --- a/Source/WebCore/platform/audio/FFTFrameStub.cpp +++ b/Source/WebCore/platform/audio/FFTFrameStub.cpp @@ -79,6 +79,10 @@ void FFTFrame::doInverseFFT(float* data) ASSERT_NOT_REACHED(); } +void FFTFrame::initialize() +{ +} + void FFTFrame::cleanup() { ASSERT_NOT_REACHED(); diff --git a/Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp b/Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp index 4368d22..4fcce31 100644 --- a/Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp +++ b/Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp @@ -120,6 +120,14 @@ bool HRTFDatabaseLoader::isLoaded() const return m_hrtfDatabase.get(); } + +void HRTFDatabaseLoader::waitForLoaderThreadCompletion() +{ + ASSERT(!isMainThread()); + ASSERT(m_databaseLoaderThread); + waitForThreadCompletion(m_databaseLoaderThread, 0); +} + HRTFDatabase* HRTFDatabaseLoader::defaultHRTFDatabase() { if (!s_loader) diff --git a/Source/WebCore/platform/audio/HRTFDatabaseLoader.h b/Source/WebCore/platform/audio/HRTFDatabaseLoader.h index 72002c5..6dc02a6 100644 --- a/Source/WebCore/platform/audio/HRTFDatabaseLoader.h +++ b/Source/WebCore/platform/audio/HRTFDatabaseLoader.h @@ -46,11 +46,18 @@ public: // Must be called from the main thread. static PassRefPtr<HRTFDatabaseLoader> createAndLoadAsynchronouslyIfNecessary(double sampleRate); + // Returns the singleton HRTFDatabaseLoader. + static HRTFDatabaseLoader* loader() { return s_loader; } + // Both constructor and destructor must be called from the main thread. ~HRTFDatabaseLoader(); // Returns true once the default database has been completely loaded. bool isLoaded() const; + + // May not be called on the main thread. + // This is so a different background thread may synchronize with the loader thread. + void waitForLoaderThreadCompletion(); HRTFDatabase* database() { return m_hrtfDatabase.get(); } diff --git a/Source/WebCore/platform/audio/SincResampler.h b/Source/WebCore/platform/audio/SincResampler.h index 92adb95..62339b3 100644 --- a/Source/WebCore/platform/audio/SincResampler.h +++ b/Source/WebCore/platform/audio/SincResampler.h @@ -40,7 +40,7 @@ public: // scaleFactor == sourceSampleRate / destinationSampleRate // kernelSize can be adjusted for quality (higher is better) // numberOfKernelOffsets is used for interpolation and is the number of sub-sample kernel shifts. - SincResampler(double scaleFactor, unsigned kernelSize = 64, unsigned numberOfKernelOffsets = 32); + SincResampler(double scaleFactor, unsigned kernelSize = 32, unsigned numberOfKernelOffsets = 32); // Processes numberOfSourceFrames from source to produce numberOfSourceFrames / scaleFactor frames in destination. void process(float* source, float* destination, unsigned numberOfSourceFrames); diff --git a/Source/WebCore/platform/audio/fftw/FFTFrameFFTW.cpp b/Source/WebCore/platform/audio/fftw/FFTFrameFFTW.cpp index 878ed9f..1a344a6 100644 --- a/Source/WebCore/platform/audio/fftw/FFTFrameFFTW.cpp +++ b/Source/WebCore/platform/audio/fftw/FFTFrameFFTW.cpp @@ -29,6 +29,8 @@ #if ENABLE(WEB_AUDIO) +#if !OS(DARWIN) && USE(WEBAUDIO_FFTW) + #include "FFTFrame.h" #include <wtf/MathExtras.h> @@ -298,4 +300,6 @@ fftwf_plan FFTFrame::fftwPlanForSize(unsigned fftSize, Direction direction, } // namespace WebCore +#endif // !OS(DARWIN) && USE(WEBAUDIO_FFTW) + #endif // ENABLE(WEB_AUDIO) diff --git a/Source/WebCore/platform/audio/mkl/FFTFrameMKL.cpp b/Source/WebCore/platform/audio/mkl/FFTFrameMKL.cpp index 3ac6b36..6bf2c1e 100644 --- a/Source/WebCore/platform/audio/mkl/FFTFrameMKL.cpp +++ b/Source/WebCore/platform/audio/mkl/FFTFrameMKL.cpp @@ -30,6 +30,8 @@ #if ENABLE(WEB_AUDIO) +#if !OS(DARWIN) && USE(WEBAUDIO_MKL) + #include "FFTFrame.h" #include "mkl_vml.h" @@ -172,7 +174,7 @@ void FFTFrame::doFFT(float* data) { // Compute Forward transform. MKL_LONG status = DftiComputeForward(m_handle, data, m_complexData.data()); - ASSERT(DftiErrorClass(status, DFTI_NO_ERROR)); + ASSERT_UNUSED(status, DftiErrorClass(status, DFTI_NO_ERROR)); // De-interleave to separate real and complex arrays. FIXME: // figure out if it's possible to get MKL to use split-complex @@ -197,7 +199,7 @@ void FFTFrame::doInverseFFT(float* data) // Compute backward transform. MKL_LONG status = DftiComputeBackward(m_handle, interleavedData, data); - ASSERT(DftiErrorClass(status, DFTI_NO_ERROR)); + ASSERT_UNUSED(status, DftiErrorClass(status, DFTI_NO_ERROR)); } void FFTFrame::initialize() @@ -212,7 +214,7 @@ void FFTFrame::cleanup() for (int i = 0; i < kMaxFFTPow2Size; ++i) { if (descriptorHandles[i]) { MKL_LONG status = DftiFreeDescriptor(&descriptorHandles[i]); - ASSERT(DftiErrorClass(status, DFTI_NO_ERROR)); + ASSERT_UNUSED(status, DftiErrorClass(status, DFTI_NO_ERROR)); } } @@ -261,4 +263,6 @@ DFTI_DESCRIPTOR_HANDLE FFTFrame::descriptorHandleForSize(unsigned fftSize) } // namespace WebCore +#endif // !OS(DARWIN) && USE(WEBAUDIO_MKL) + #endif // ENABLE(WEB_AUDIO) |
