Diff
Modified: trunk/Source/WebCore/ChangeLog (191843 => 191844)
--- trunk/Source/WebCore/ChangeLog 2015-10-31 17:35:51 UTC (rev 191843)
+++ trunk/Source/WebCore/ChangeLog 2015-10-31 17:48:47 UTC (rev 191844)
@@ -1,3 +1,22 @@
+2015-10-31 Philippe Normand <[email protected]>
+
+ [GStreamer][Mac] Fix WebAudio build
+ https://bugs.webkit.org/show_bug.cgi?id=150030
+
+ Reviewed by Darin Adler.
+
+ Wrap Accelerate.framework API calls around USE(ACCELERATE) ifdefs.
+
+ * platform/audio/Biquad.cpp:
+ (WebCore::Biquad::Biquad):
+ (WebCore::Biquad::process):
+ (WebCore::Biquad::reset):
+ * platform/audio/Biquad.h:
+ * platform/audio/DirectConvolver.cpp:
+ (WebCore::DirectConvolver::process):
+ * platform/audio/FFTFrame.h:
+ * platform/audio/VectorMath.cpp:
+
2015-10-31 Brian Burg <[email protected]>
Builtins generator should put WebCore-only wrappers in the per-builtin header
Modified: trunk/Source/WebCore/platform/audio/Biquad.cpp (191843 => 191844)
--- trunk/Source/WebCore/platform/audio/Biquad.cpp 2015-10-31 17:35:51 UTC (rev 191843)
+++ trunk/Source/WebCore/platform/audio/Biquad.cpp 2015-10-31 17:48:47 UTC (rev 191844)
@@ -37,7 +37,7 @@
#include <stdio.h>
#include <wtf/MathExtras.h>
-#if OS(DARWIN)
+#if USE(ACCELERATE)
// Work around a bug where VForce.h forward declares std::complex in a way that's incompatible with libc++ complex.
#define __VFORCE_H
#include <Accelerate/Accelerate.h>
@@ -45,13 +45,13 @@
namespace WebCore {
-#if OS(DARWIN)
+#if USE(ACCELERATE)
const int kBufferSize = 1024;
#endif
Biquad::Biquad()
{
-#if OS(DARWIN)
+#if USE(ACCELERATE)
// Allocate two samples more for filter history
m_inputBuffer.allocate(kBufferSize + 2);
m_outputBuffer.allocate(kBufferSize + 2);
@@ -69,7 +69,7 @@
void Biquad::process(const float* sourceP, float* destP, size_t framesToProcess)
{
-#if OS(DARWIN)
+#if USE(ACCELERATE)
// Use vecLib if available
processFast(sourceP, destP, framesToProcess);
@@ -118,7 +118,7 @@
#endif
}
-#if OS(DARWIN)
+#if USE(ACCELERATE)
// Here we have optimized version using Accelerate.framework
@@ -172,12 +172,12 @@
destP[1] = destP[framesToProcess - 1 + 2];
}
-#endif // OS(DARWIN)
+#endif // USE(ACCELERATE)
void Biquad::reset()
{
-#if OS(DARWIN)
+#if USE(ACCELERATE)
// Two extra samples for filter history
double* inputP = m_inputBuffer.data();
inputP[0] = 0;
Modified: trunk/Source/WebCore/platform/audio/Biquad.h (191843 => 191844)
--- trunk/Source/WebCore/platform/audio/Biquad.h 2015-10-31 17:35:51 UTC (rev 191843)
+++ trunk/Source/WebCore/platform/audio/Biquad.h 2015-10-31 17:48:47 UTC (rev 191844)
@@ -88,7 +88,7 @@
double m_a1;
double m_a2;
-#if OS(DARWIN)
+#if USE(ACCELERATE)
void processFast(const float* sourceP, float* destP, size_t framesToProcess);
void processSliceFast(double* sourceP, double* destP, double* coefficientsP, size_t framesToProcess);
Modified: trunk/Source/WebCore/platform/audio/DirectConvolver.cpp (191843 => 191844)
--- trunk/Source/WebCore/platform/audio/DirectConvolver.cpp 2015-10-31 17:35:51 UTC (rev 191843)
+++ trunk/Source/WebCore/platform/audio/DirectConvolver.cpp 2015-10-31 17:48:47 UTC (rev 191844)
@@ -73,7 +73,7 @@
// Copy samples to 2nd half of input buffer.
memcpy(inputP, sourceP, sizeof(float) * framesToProcess);
-#if OS(DARWIN)
+#if USE(ACCELERATE)
#if defined(__ppc__) || defined(__i386__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -352,7 +352,7 @@
}
destP[i++] = sum;
}
-#endif // OS(DARWIN)
+#endif // USE(ACCELERATE)
// Copy 2nd half of input buffer to 1st half.
memcpy(m_buffer.data(), inputP, sizeof(float) * framesToProcess);
Modified: trunk/Source/WebCore/platform/audio/FFTFrame.h (191843 => 191844)
--- trunk/Source/WebCore/platform/audio/FFTFrame.h 2015-10-31 17:35:51 UTC (rev 191843)
+++ trunk/Source/WebCore/platform/audio/FFTFrame.h 2015-10-31 17:48:47 UTC (rev 191844)
@@ -31,10 +31,6 @@
#include "AudioArray.h"
-#if OS(DARWIN)
-#include <Accelerate/Accelerate.h>
-#endif
-
#if USE(WEBAUDIO_GSTREAMER)
#include <glib.h>
G_BEGIN_DECLS
@@ -42,6 +38,10 @@
G_END_DECLS
#endif // USE(WEBAUDIO_GSTREAMER)
+#if USE(ACCELERATE)
+#include <Accelerate/Accelerate.h>
+#endif
+
#include <memory>
#include <wtf/Forward.h>
#include <wtf/Threading.h>
@@ -90,7 +90,7 @@
void interpolateFrequencyComponents(const FFTFrame& frame1, const FFTFrame& frame2, double x);
-#if OS(DARWIN)
+#if USE(ACCELERATE)
DSPSplitComplex& dspSplitComplex() { return m_frame; }
DSPSplitComplex dspSplitComplex() const { return m_frame; }
Modified: trunk/Source/WebCore/platform/audio/VectorMath.cpp (191843 => 191844)
--- trunk/Source/WebCore/platform/audio/VectorMath.cpp 2015-10-31 17:35:51 UTC (rev 191843)
+++ trunk/Source/WebCore/platform/audio/VectorMath.cpp 2015-10-31 17:48:47 UTC (rev 191844)
@@ -28,7 +28,7 @@
#include "VectorMath.h"
-#if OS(DARWIN)
+#if USE(ACCELERATE)
#include <Accelerate/Accelerate.h>
#endif
@@ -47,7 +47,7 @@
namespace VectorMath {
-#if OS(DARWIN)
+#if USE(ACCELERATE)
// On the Mac we use the highly optimized versions in Accelerate.framework
// In 32-bit mode (__ppc__ or __i386__) <Accelerate/Accelerate.h> includes <vecLib/vDSP_translate.h> which defines macros of the same name as
// our namespaced function names, so we must handle this case differently. Other architectures (64bit, ARM, etc.) do not include this header file.
@@ -690,7 +690,7 @@
}
}
-#endif // OS(DARWIN)
+#endif // USE(ACCELERATE)
} // namespace VectorMath