Changeset 191844 in webkit


Ignore:
Timestamp:
Oct 31, 2015, 10:48:47 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer][Mac] Fix WebAudio build
https://bugs.webkit.org/show_bug.cgi?id=150030

Patch by Philippe Normand <pnormand@igalia.com> on 2015-10-31
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:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r191842 r191844  
     12015-10-31  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer][Mac] Fix WebAudio build
     4        https://bugs.webkit.org/show_bug.cgi?id=150030
     5
     6        Reviewed by Darin Adler.
     7
     8        Wrap Accelerate.framework API calls around USE(ACCELERATE) ifdefs.
     9
     10        * platform/audio/Biquad.cpp:
     11        (WebCore::Biquad::Biquad):
     12        (WebCore::Biquad::process):
     13        (WebCore::Biquad::reset):
     14        * platform/audio/Biquad.h:
     15        * platform/audio/DirectConvolver.cpp:
     16        (WebCore::DirectConvolver::process):
     17        * platform/audio/FFTFrame.h:
     18        * platform/audio/VectorMath.cpp:
     19
    1202015-10-31  Brian Burg  <bburg@apple.com>
    221
  • trunk/Source/WebCore/platform/audio/Biquad.cpp

    r176537 r191844  
    3838#include <wtf/MathExtras.h>
    3939
    40 #if OS(DARWIN)
     40#if USE(ACCELERATE)
    4141// Work around a bug where VForce.h forward declares std::complex in a way that's incompatible with libc++ complex.
    4242#define __VFORCE_H
     
    4646namespace WebCore {
    4747
    48 #if OS(DARWIN)
     48#if USE(ACCELERATE)
    4949const int kBufferSize = 1024;
    5050#endif
     
    5252Biquad::Biquad()
    5353{
    54 #if OS(DARWIN)
     54#if USE(ACCELERATE)
    5555    // Allocate two samples more for filter history
    5656    m_inputBuffer.allocate(kBufferSize + 2);
     
    7070void Biquad::process(const float* sourceP, float* destP, size_t framesToProcess)
    7171{
    72 #if OS(DARWIN)
     72#if USE(ACCELERATE)
    7373    // Use vecLib if available
    7474    processFast(sourceP, destP, framesToProcess);
     
    119119}
    120120
    121 #if OS(DARWIN)
     121#if USE(ACCELERATE)
    122122
    123123// Here we have optimized version using Accelerate.framework
     
    173173}
    174174
    175 #endif // OS(DARWIN)
     175#endif // USE(ACCELERATE)
    176176
    177177
    178178void Biquad::reset()
    179179{
    180 #if OS(DARWIN)
     180#if USE(ACCELERATE)
    181181    // Two extra samples for filter history
    182182    double* inputP = m_inputBuffer.data();
  • trunk/Source/WebCore/platform/audio/Biquad.h

    r175149 r191844  
    8989    double m_a2;
    9090
    91 #if OS(DARWIN)
     91#if USE(ACCELERATE)
    9292    void processFast(const float* sourceP, float* destP, size_t framesToProcess);
    9393    void processSliceFast(double* sourceP, double* destP, double* coefficientsP, size_t framesToProcess);
  • trunk/Source/WebCore/platform/audio/DirectConvolver.cpp

    r185983 r191844  
    7474    memcpy(inputP, sourceP, sizeof(float) * framesToProcess);
    7575
    76 #if OS(DARWIN)
     76#if USE(ACCELERATE)
    7777#if defined(__ppc__) || defined(__i386__)
    7878#pragma clang diagnostic push
     
    353353        destP[i++] = sum;
    354354    }
    355 #endif // OS(DARWIN)
     355#endif // USE(ACCELERATE)
    356356
    357357    // Copy 2nd half of input buffer to 1st half.
  • trunk/Source/WebCore/platform/audio/FFTFrame.h

    r172431 r191844  
    3232#include "AudioArray.h"
    3333
    34 #if OS(DARWIN)
    35 #include <Accelerate/Accelerate.h>
    36 #endif
    37 
    3834#if USE(WEBAUDIO_GSTREAMER)
    3935#include <glib.h>
     
    4238G_END_DECLS
    4339#endif // USE(WEBAUDIO_GSTREAMER)
     40
     41#if USE(ACCELERATE)
     42#include <Accelerate/Accelerate.h>
     43#endif
    4444
    4545#include <memory>
     
    9191    void interpolateFrequencyComponents(const FFTFrame& frame1, const FFTFrame& frame2, double x);
    9292
    93 #if OS(DARWIN)
     93#if USE(ACCELERATE)
    9494    DSPSplitComplex& dspSplitComplex() { return m_frame; }
    9595    DSPSplitComplex dspSplitComplex() const { return m_frame; }
  • trunk/Source/WebCore/platform/audio/VectorMath.cpp

    r185988 r191844  
    2929#include "VectorMath.h"
    3030
    31 #if OS(DARWIN)
     31#if USE(ACCELERATE)
    3232#include <Accelerate/Accelerate.h>
    3333#endif
     
    4848namespace VectorMath {
    4949
    50 #if OS(DARWIN)
     50#if USE(ACCELERATE)
    5151// On the Mac we use the highly optimized versions in Accelerate.framework
    5252// In 32-bit mode (__ppc__ or __i386__) <Accelerate/Accelerate.h> includes <vecLib/vDSP_translate.h> which defines macros of the same name as
     
    691691}
    692692
    693 #endif // OS(DARWIN)
     693#endif // USE(ACCELERATE)
    694694
    695695} // namespace VectorMath
Note: See TracChangeset for help on using the changeset viewer.