[GStreamer][Qt] WebAudio support
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2012 14:01:43 +0000 (14:01 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2012 14:01:43 +0000 (14:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=94806

Reviewed by Simon Hausmann.

Source/WebCore:

Build system changes to support WebAudio and its GStreamer
backend. A new AudioBusQt implementation is also needed to locate
and load local .wav files. Note: WebAudio is still disabled by default in
build-webkit. Use --web-audio to explicitely enable it at build time.

* DerivedSources.pri:
* Target.pri:
* WebCore.pri:
* WebCore.qrc:
* platform/audio/HRTFElevation.cpp:
(WebCore): Use concatenated HRTF impulse response for increased
performance, just like GTK, Mac and EFL ports.
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: Undef the
signals macro so gio.h can be properly included.
* platform/audio/qt/AudioBusQt.cpp: Added.
(WebCore):
(WebCore::AudioBus::loadPlatformResource):

Source/WebKit2:

New boolean webAudioEnabled WebSetting to be used at runtime to
toggle WebAudio support on or off.

* UIProcess/API/qt/qwebpreferences.cpp:
(QWebPreferencesPrivate::testAttribute):
(QWebPreferencesPrivate::setAttribute):
(QWebPreferences::webAudioEnabled):
(QWebPreferences::setWebAudioEnabled):
* UIProcess/API/qt/qwebpreferences_p.h:
* UIProcess/API/qt/qwebpreferences_p_p.h:

Tools:

* MiniBrowser/qt/qml/BrowserWindow.qml: Enable WebAudio support.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126756 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.pri
Source/WebCore/Target.pri
Source/WebCore/WebCore.pri
Source/WebCore/WebCore.qrc
Source/WebCore/platform/audio/HRTFElevation.cpp
Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp
Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h
Source/WebKit2/UIProcess/API/qt/qwebpreferences_p_p.h
Tools/ChangeLog
Tools/MiniBrowser/qt/qml/BrowserWindow.qml

index f63dbcf..fbd7919 100644 (file)
@@ -1,3 +1,28 @@
+2012-08-27  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer][Qt] WebAudio support
+        https://bugs.webkit.org/show_bug.cgi?id=94806
+
+        Reviewed by Simon Hausmann.
+
+        Build system changes to support WebAudio and its GStreamer
+        backend. A new AudioBusQt implementation is also needed to locate
+        and load local .wav files. Note: WebAudio is still disabled by default in
+        build-webkit. Use --web-audio to explicitely enable it at build time.
+
+        * DerivedSources.pri:
+        * Target.pri:
+        * WebCore.pri:
+        * WebCore.qrc:
+        * platform/audio/HRTFElevation.cpp:
+        (WebCore): Use concatenated HRTF impulse response for increased
+        performance, just like GTK, Mac and EFL ports.
+        * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: Undef the
+        signals macro so gio.h can be properly included.
+        * platform/audio/qt/AudioBusQt.cpp: Added.
+        (WebCore):
+        (WebCore::AudioBus::loadPlatformResource):
+
 2012-08-27  Andreas Kling  <kling@webkit.org>
 
         REGRESSION(r126524): Heap-buffer-overflow in WebCore::StylePropertySet::copyPropertiesFrom
index 4145480..98d1f5f 100644 (file)
@@ -139,6 +139,7 @@ IDL_BINDINGS += \
     $$PWD/Modules/quota/StorageInfoQuotaCallback.idl \
     $$PWD/Modules/quota/StorageInfoUsageCallback.idl \
     $$PWD/Modules/webaudio/AudioBuffer.idl \
+    $$PWD/Modules/webaudio/AudioBufferCallback.idl \
     $$PWD/Modules/webaudio/AudioBufferSourceNode.idl \
     $$PWD/Modules/webaudio/AudioChannelMerger.idl \
     $$PWD/Modules/webaudio/AudioChannelSplitter.idl \
@@ -152,11 +153,19 @@ IDL_BINDINGS += \
     $$PWD/Modules/webaudio/AudioParam.idl \
     $$PWD/Modules/webaudio/AudioProcessingEvent.idl \
     $$PWD/Modules/webaudio/AudioSourceNode.idl \
+    $$PWD/Modules/webaudio/BiquadFilterNode.idl \
     $$PWD/Modules/webaudio/ConvolverNode.idl \
     $$PWD/Modules/webaudio/DelayNode.idl \
     $$PWD/Modules/webaudio/DOMWindowWebAudio.idl \
+    $$PWD/Modules/webaudio/DynamicsCompressorNode.idl \
     $$PWD/Modules/webaudio/JavaScriptAudioNode.idl \
+    $$PWD/Modules/webaudio/MediaElementAudioSourceNode.idl \
+    $$PWD/Modules/webaudio/MediaStreamAudioSourceNode.idl \
+    $$PWD/Modules/webaudio/OfflineAudioCompletionEvent.idl \
+    $$PWD/Modules/webaudio/Oscillator.idl \
     $$PWD/Modules/webaudio/RealtimeAnalyserNode.idl \
+    $$PWD/Modules/webaudio/WaveShaperNode.idl \
+    $$PWD/Modules/webaudio/WaveTable.idl \
     $$PWD/Modules/webdatabase/DOMWindowWebDatabase.idl \
     $$PWD/Modules/webdatabase/Database.idl \
     $$PWD/Modules/webdatabase/DatabaseCallback.idl \
index 68c36a8..d4463ed 100644 (file)
@@ -3112,6 +3112,18 @@ contains(DEFINES, ENABLE_GAMEPAD=1) {
         platform/qt/GamepadsQt.cpp
 }
 
+contains(DEFINES, WTF_USE_GSTREAMER=1) {
+    HEADERS += \
+            platform/graphics/gstreamer/GRefPtrGStreamer.h \
+            platform/graphics/gstreamer/GStreamerUtilities.h \
+            platform/graphics/gstreamer/GStreamerVersioning.h
+
+    SOURCES += \
+            platform/graphics/gstreamer/GRefPtrGStreamer.cpp \
+            platform/graphics/gstreamer/GStreamerUtilities.cpp \
+            platform/graphics/gstreamer/GStreamerVersioning.cpp
+}
+
 contains(DEFINES, ENABLE_VIDEO=1) {
     SOURCES += \
         html/HTMLAudioElement.cpp \
@@ -3173,10 +3185,7 @@ contains(DEFINES, ENABLE_VIDEO=1) {
 
     } else: contains(DEFINES, WTF_USE_GSTREAMER=1) {
         HEADERS += \
-            platform/graphics/gstreamer/GRefPtrGStreamer.h \
             platform/graphics/gstreamer/GStreamerGWorld.h \
-            platform/graphics/gstreamer/GStreamerUtilities.h \
-            platform/graphics/gstreamer/GStreamerVersioning.h \
             platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h \
             platform/graphics/gstreamer/VideoSinkGStreamer.h \
             platform/graphics/gstreamer/WebKitWebSourceGStreamer.h \
@@ -3184,10 +3193,7 @@ contains(DEFINES, ENABLE_VIDEO=1) {
             platform/graphics/gstreamer/PlatformVideoWindowPrivate.h \
             platform/graphics/gstreamer/ImageGStreamer.h
         SOURCES += \
-            platform/graphics/gstreamer/GRefPtrGStreamer.cpp \
             platform/graphics/gstreamer/GStreamerGWorld.cpp \
-            platform/graphics/gstreamer/GStreamerUtilities.cpp \
-            platform/graphics/gstreamer/GStreamerVersioning.cpp \
             platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp \
             platform/graphics/gstreamer/VideoSinkGStreamer.cpp \
             platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
@@ -3203,6 +3209,187 @@ contains(DEFINES, ENABLE_VIDEO=1) {
     }
 }
 
+contains(DEFINES, ENABLE_WEB_AUDIO=1) {
+    HEADERS += \
+        Modules/webaudio/AsyncAudioDecoder.h \
+        Modules/webaudio/AudioBasicInspectorNode.h \
+        Modules/webaudio/AudioBasicProcessorNode.h \
+        Modules/webaudio/AudioBufferCallback.h \
+        Modules/webaudio/AudioBuffer.h \
+        Modules/webaudio/AudioBufferSourceNode.h \
+        Modules/webaudio/AudioChannelMerger.h \
+        Modules/webaudio/AudioChannelSplitter.h \
+        Modules/webaudio/AudioContext.h \
+        Modules/webaudio/AudioDestinationNode.h \
+        Modules/webaudio/AudioGain.h \
+        Modules/webaudio/AudioGainNode.h \
+        Modules/webaudio/AudioListener.h \
+        Modules/webaudio/AudioNode.h \
+        Modules/webaudio/AudioNodeInput.h \
+        Modules/webaudio/AudioNodeOutput.h \
+        Modules/webaudio/AudioPannerNode.h \
+        Modules/webaudio/AudioParam.h \
+        Modules/webaudio/AudioParamTimeline.h \
+        Modules/webaudio/AudioProcessingEvent.h \
+        Modules/webaudio/AudioScheduledSourceNode.h \
+        Modules/webaudio/AudioSourceNode.h \
+        Modules/webaudio/AudioSummingJunction.h \
+        Modules/webaudio/BiquadDSPKernel.h \
+        Modules/webaudio/BiquadFilterNode.h \
+        Modules/webaudio/BiquadProcessor.h \
+        Modules/webaudio/ConvolverNode.h \
+        Modules/webaudio/DefaultAudioDestinationNode.h \
+        Modules/webaudio/DelayDSPKernel.h \
+        Modules/webaudio/DelayNode.h \
+        Modules/webaudio/DelayProcessor.h \
+        Modules/webaudio/DynamicsCompressorNode.h \
+        Modules/webaudio/JavaScriptAudioNode.h \
+        Modules/webaudio/MediaElementAudioSourceNode.h \
+        Modules/webaudio/MediaStreamAudioSourceNode.h \
+        Modules/webaudio/OfflineAudioCompletionEvent.h \
+        Modules/webaudio/OfflineAudioDestinationNode.h \
+        Modules/webaudio/Oscillator.h \
+        Modules/webaudio/RealtimeAnalyser.h \
+        Modules/webaudio/RealtimeAnalyserNode.h \
+        Modules/webaudio/WaveShaperDSPKernel.h \
+        Modules/webaudio/WaveShaperNode.h \
+        Modules/webaudio/WaveShaperProcessor.h \
+        Modules/webaudio/WaveTable.h \
+        platform/audio/AudioArray.h \
+        platform/audio/AudioBus.h \
+        platform/audio/AudioChannel.h \
+        platform/audio/AudioDestination.h \
+        platform/audio/AudioDSPKernel.h \
+        platform/audio/AudioDSPKernelProcessor.h \
+        platform/audio/AudioFIFO.h \
+        platform/audio/AudioFileReader.h \
+        platform/audio/AudioIOCallback.h \
+        platform/audio/AudioProcessor.h \
+        platform/audio/AudioPullFIFO.h \
+        platform/audio/AudioResampler.h \
+        platform/audio/AudioResamplerKernel.h \
+        platform/audio/AudioSourceProviderClient.h \
+        platform/audio/AudioSourceProvider.h \
+        platform/audio/AudioUtilities.h \
+        platform/audio/Biquad.h \
+        platform/audio/Cone.h \
+        platform/audio/DenormalDisabler.h \
+        platform/audio/DirectConvolver.h \
+        platform/audio/Distance.h \
+        platform/audio/DynamicsCompressor.h \
+        platform/audio/DynamicsCompressorKernel.h \
+        platform/audio/EqualPowerPanner.h \
+        platform/audio/FFTConvolver.h \
+        platform/audio/FFTFrame.h \
+        platform/audio/HRTFDatabase.h \
+        platform/audio/HRTFDatabaseLoader.h \
+        platform/audio/HRTFElevation.h \
+        platform/audio/HRTFKernel.h \
+        platform/audio/HRTFPanner.h \
+        platform/audio/MultiChannelResampler.h \
+        platform/audio/Panner.h \
+        platform/audio/ReverbAccumulationBuffer.h \
+        platform/audio/ReverbConvolver.h \
+        platform/audio/ReverbConvolverStage.h \
+        platform/audio/Reverb.h \
+        platform/audio/ReverbInputBuffer.h \
+        platform/audio/SincResampler.h \
+        platform/audio/VectorMath.h \
+        platform/audio/ZeroPole.h
+
+    SOURCES += \
+        bindings/js/JSAudioBufferSourceNodeCustom.cpp \
+        bindings/js/JSAudioContextCustom.cpp \
+        bindings/js/JSDOMWindowWebAudioCustom.cpp \
+        bindings/js/JSJavaScriptAudioNodeCustom.cpp \
+        Modules/webaudio/AsyncAudioDecoder.cpp \
+        Modules/webaudio/AudioBasicInspectorNode.cpp \
+        Modules/webaudio/AudioBasicProcessorNode.cpp \
+        Modules/webaudio/AudioBuffer.cpp \
+        Modules/webaudio/AudioBufferSourceNode.cpp \
+        Modules/webaudio/AudioChannelMerger.cpp \
+        Modules/webaudio/AudioChannelSplitter.cpp \
+        Modules/webaudio/AudioContext.cpp \
+        Modules/webaudio/AudioDestinationNode.cpp \
+        Modules/webaudio/AudioGainNode.cpp \
+        Modules/webaudio/AudioListener.cpp \
+        Modules/webaudio/AudioNode.cpp \
+        Modules/webaudio/AudioNodeInput.cpp \
+        Modules/webaudio/AudioNodeOutput.cpp \
+        Modules/webaudio/AudioPannerNode.cpp \
+        Modules/webaudio/AudioParam.cpp \
+        Modules/webaudio/AudioParamTimeline.cpp \
+        Modules/webaudio/AudioProcessingEvent.cpp \
+        Modules/webaudio/AudioScheduledSourceNode.cpp \
+        Modules/webaudio/AudioSummingJunction.cpp \
+        Modules/webaudio/BiquadDSPKernel.cpp \
+        Modules/webaudio/BiquadFilterNode.cpp \
+        Modules/webaudio/BiquadProcessor.cpp \
+        Modules/webaudio/ConvolverNode.cpp \
+        Modules/webaudio/DefaultAudioDestinationNode.cpp \
+        Modules/webaudio/DelayDSPKernel.cpp \
+        Modules/webaudio/DelayNode.cpp \
+        Modules/webaudio/DelayProcessor.cpp \
+        Modules/webaudio/DynamicsCompressorNode.cpp \
+        Modules/webaudio/JavaScriptAudioNode.cpp \
+        Modules/webaudio/MediaElementAudioSourceNode.cpp \
+        Modules/webaudio/MediaStreamAudioSourceNode.cpp \
+        Modules/webaudio/OfflineAudioCompletionEvent.cpp \
+        Modules/webaudio/OfflineAudioDestinationNode.cpp \
+        Modules/webaudio/Oscillator.cpp \
+        Modules/webaudio/RealtimeAnalyser.cpp \
+        Modules/webaudio/RealtimeAnalyserNode.cpp \
+        Modules/webaudio/WaveShaperDSPKernel.cpp \
+        Modules/webaudio/WaveShaperNode.cpp \
+        Modules/webaudio/WaveShaperProcessor.cpp \
+        Modules/webaudio/WaveTable.cpp \
+        platform/audio/AudioBus.cpp \
+        platform/audio/AudioChannel.cpp \
+        platform/audio/AudioDSPKernelProcessor.cpp \
+        platform/audio/AudioFIFO.cpp \
+        platform/audio/AudioPullFIFO.cpp \
+        platform/audio/AudioResampler.cpp \
+        platform/audio/AudioResamplerKernel.cpp \
+        platform/audio/AudioUtilities.cpp \
+        platform/audio/Biquad.cpp \
+        platform/audio/Cone.cpp \
+        platform/audio/DirectConvolver.cpp \
+        platform/audio/Distance.cpp \
+        platform/audio/DynamicsCompressor.cpp \
+        platform/audio/DynamicsCompressorKernel.cpp \
+        platform/audio/EqualPowerPanner.cpp \
+        platform/audio/FFTConvolver.cpp \
+        platform/audio/FFTFrame.cpp \
+        platform/audio/FFTFrameStub.cpp \
+        platform/audio/HRTFDatabase.cpp \
+        platform/audio/HRTFDatabaseLoader.cpp \
+        platform/audio/HRTFElevation.cpp \
+        platform/audio/HRTFKernel.cpp \
+        platform/audio/HRTFPanner.cpp \
+        platform/audio/MultiChannelResampler.cpp \
+        platform/audio/Panner.cpp \
+        platform/audio/qt/AudioBusQt.cpp \
+        platform/audio/ReverbAccumulationBuffer.cpp \
+        platform/audio/ReverbConvolver.cpp \
+        platform/audio/ReverbConvolverStage.cpp \
+        platform/audio/Reverb.cpp \
+        platform/audio/ReverbInputBuffer.cpp \
+        platform/audio/SincResampler.cpp \
+        platform/audio/VectorMath.cpp \
+        platform/audio/ZeroPole.cpp
+
+    contains(DEFINES, WTF_USE_GSTREAMER=1) {
+        HEADERS += \
+            platform/audio/gstreamer/AudioDestinationGStreamer.h \
+            platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.h
+        SOURCES += \
+            platform/audio/gstreamer/AudioDestinationGStreamer.cpp \
+            platform/audio/gstreamer/AudioFileReaderGStreamer.cpp \
+            platform/audio/gstreamer/FFTFrameGStreamer.cpp \
+            platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
+    }
+}
+
 contains(DEFINES, ENABLE_FULLSCREEN_API=1) {
     SOURCES += \
         rendering/RenderFullScreen.cpp
index 2804b83..6e1ac6a 100644 (file)
@@ -165,6 +165,11 @@ contains(DEFINES, ENABLE_GAMEPAD=1) {
     PKGCONFIG += libudev
 }
 
+contains(DEFINES, WTF_USE_GSTREAMER=1) {
+    DEFINES += ENABLE_GLIB_SUPPORT=1
+    PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10
+}
+
 contains(DEFINES, ENABLE_VIDEO=1) {
     contains(DEFINES, WTF_USE_QTKIT=1) {
         INCLUDEPATH += $$SOURCE_DIR/platform/graphics/mac
@@ -174,17 +179,22 @@ contains(DEFINES, ENABLE_VIDEO=1) {
                 -framework QuartzCore -framework QTKit
 
     } else:contains(DEFINES, WTF_USE_GSTREAMER=1) {
-        DEFINES += ENABLE_GLIB_SUPPORT=1
-
         INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gstreamer
-
-        PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10 gstreamer-video-0.10
+        PKGCONFIG += gstreamer-video-0.10
     } else:contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
         CONFIG   *= mobility
         MOBILITY *= multimedia
     }
 }
 
+contains(DEFINES, ENABLE_WEB_AUDIO=1) {
+    contains(DEFINES, WTF_USE_GSTREAMER=1) {
+        DEFINES += WTF_USE_WEBAUDIO_GSTREAMER=1
+        INCLUDEPATH += $$SOURCE_DIR/platform/audio/gstreamer
+        PKGCONFIG += gstreamer-audio-0.10 gstreamer-fft-0.10
+    }
+}
+
 contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
     contains(QT_CONFIG, opengles2): LIBS += -lEGL
     mac: LIBS += -framework IOSurface -framework CoreFoundation
index 1208e9e..e9e7bad 100644 (file)
@@ -15,4 +15,7 @@
     <file alias="deleteButton.png">Resources/deleteButton.png</file>
     <file alias="inputSpeech.png">Resources/inputSpeech.png</file>
 </qresource>
+<qresource prefix="/webkit/resources/audio">
+    <file alias="Composite">platform/audio/resources/Composite.wav</file>
+</qresource>
 </RCC>
index 080b391..25e4589 100644 (file)
@@ -60,7 +60,7 @@ const size_t ResponseFrameSize = 256;
 // The impulse responses may be resampled to a different sample-rate (depending on the audio hardware) when they are loaded.
 const float ResponseSampleRate = 44100;
 
-#if PLATFORM(GTK) || PLATFORM(MAC) || PLATFORM(EFL)
+#if PLATFORM(MAC) || USE(WEBAUDIO_GSTREAMER)
 #define USE_CONCATENATED_IMPULSE_RESPONSES
 #endif
 
index 18372fc..540c979 100644 (file)
 #include "AudioFileReader.h"
 
 #include "AudioBus.h"
+
+#if PLATFORM(QT)
+// Clear out offending Qt macro so the following header, gio.h, can be included.
+// https://bugs.webkit.org/show_bug.cgi?id=95081
+#undef signals
+#endif
+
 #include <gio/gio.h>
 #include <gst/app/gstappsink.h>
 #include <gst/audio/multichannel.h>
index ccbfb7b..95ffc47 100644 (file)
@@ -1,3 +1,21 @@
+2012-08-27  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer][Qt] WebAudio support
+        https://bugs.webkit.org/show_bug.cgi?id=94806
+
+        Reviewed by Simon Hausmann.
+
+        New boolean webAudioEnabled WebSetting to be used at runtime to
+        toggle WebAudio support on or off.
+
+        * UIProcess/API/qt/qwebpreferences.cpp:
+        (QWebPreferencesPrivate::testAttribute):
+        (QWebPreferencesPrivate::setAttribute):
+        (QWebPreferences::webAudioEnabled):
+        (QWebPreferences::setWebAudioEnabled):
+        * UIProcess/API/qt/qwebpreferences_p.h:
+        * UIProcess/API/qt/qwebpreferences_p_p.h:
+
 2012-08-27  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt][WK2] REGRESSION(r126067): It made qmltests::DoubleTapToZoom::test_basic() fail
index e66f368..e27f512 100644 (file)
@@ -71,6 +71,10 @@ bool QWebPreferencesPrivate::testAttribute(QWebPreferencesPrivate::WebAttribute
         return WKPreferencesGetCSSCustomFilterEnabled(preferencesRef());
 #endif
 #endif
+#if ENABLE(WEB_AUDIO)
+    case WebAudioEnabled:
+        return WKPreferencesGetWebAudioEnabled(preferencesRef());
+#endif
     default:
         ASSERT_NOT_REACHED();
         return false;
@@ -124,6 +128,11 @@ void QWebPreferencesPrivate::setAttribute(QWebPreferencesPrivate::WebAttribute a
         break;
 #endif
 #endif
+#if ENABLE(WEB_AUDIO)
+    case WebAudioEnabled:
+        WKPreferencesSetWebAudioEnabled(preferencesRef(), enable);
+        break;
+#endif
     default:
         ASSERT_NOT_REACHED();
     }
@@ -513,6 +522,25 @@ void QWebPreferences::setWebGLEnabled(bool enable)
 #endif
 }
 
+bool QWebPreferences::webAudioEnabled() const
+{
+#if ENABLE(WEB_AUDIO)
+    return d->testAttribute(QWebPreferencesPrivate::WebAudioEnabled);
+#else
+    return false;
+#endif
+}
+
+void QWebPreferences::setWebAudioEnabled(bool enable)
+{
+#if ENABLE(WEB_AUDIO)
+    d->setAttribute(QWebPreferencesPrivate::WebAudioEnabled, enable);
+    emit webAudioEnabledChanged();
+#else
+    UNUSED_PARAM(enable);
+#endif
+}
+
 WKPreferencesRef QWebPreferencesPrivate::preferencesRef() const
 {
     WKPageGroupRef pageGroupRef = toAPI(webViewPrivate->webPageProxy->pageGroup());
index 8618f4f..373df75 100644 (file)
@@ -44,6 +44,7 @@ public:
     Q_PROPERTY(bool frameFlatteningEnabled READ frameFlatteningEnabled WRITE setFrameFlatteningEnabled NOTIFY frameFlatteningEnabledChanged FINAL)
     Q_PROPERTY(bool developerExtrasEnabled READ developerExtrasEnabled WRITE setDeveloperExtrasEnabled NOTIFY developerExtrasEnabledChanged FINAL)
     Q_PROPERTY(bool webGLEnabled READ webGLEnabled WRITE setWebGLEnabled NOTIFY webGLEnabledChanged FINAL)
+    Q_PROPERTY(bool webAudioEnabled READ webAudioEnabled WRITE setWebAudioEnabled NOTIFY webAudioEnabledChanged FINAL)
 
     Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily NOTIFY standardFontFamilyChanged FINAL)
     Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily NOTIFY fixedFontFamilyChanged FINAL)
@@ -95,6 +96,9 @@ public:
     bool webGLEnabled() const;
     void setWebGLEnabled(bool enable);
 
+    bool webAudioEnabled() const;
+    void setWebAudioEnabled(bool enable);
+
     QString standardFontFamily() const;
     void setStandardFontFamily(const QString& family);
 
@@ -136,6 +140,7 @@ Q_SIGNALS:
     void frameFlatteningEnabledChanged();
     void developerExtrasEnabledChanged();
     void webGLEnabledChanged();
+    void webAudioEnabledChanged();
 
     void standardFontFamilyChanged();
     void fixedFontFamilyChanged();
index 004500c..c606bbe 100644 (file)
@@ -40,7 +40,8 @@ public:
         DnsPrefetchEnabled,
         DeveloperExtrasEnabled,
         WebGLEnabled,
-        CSSCustomFilterEnabled
+        CSSCustomFilterEnabled,
+        WebAudioEnabled
     };
 
     enum FontFamily {
index 09779b6..8d72d38 100644 (file)
@@ -1,3 +1,12 @@
+2012-08-27  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer][Qt] WebAudio support
+        https://bugs.webkit.org/show_bug.cgi?id=94806
+
+        Reviewed by Simon Hausmann.
+
+        * MiniBrowser/qt/qml/BrowserWindow.qml: Enable WebAudio support.
+
 2012-08-27  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         Rename RegisterProtocolHandler API to NavigatorContentUtils
index 8cd58eb..c73308e 100644 (file)
@@ -357,6 +357,7 @@ Rectangle {
         experimental.devicePixelRatio: 1.5
         experimental.preferences.fullScreenEnabled: true
         experimental.preferences.webGLEnabled: true
+        experimental.preferences.webAudioEnabled: true
         experimental.preferredMinimumContentsWidth: 980
         experimental.itemSelector: ItemSelector { }
         experimental.alertDialog: AlertDialog { }