Rolling out r150555. It borked about 30 media tests.
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 May 2013 03:36:15 +0000 (03:36 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 May 2013 03:36:15 +0000 (03:36 +0000)
Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* html/HTMLMediaElement.h:
* platform/audio/AudioSession.cpp:
(WebCore):
(WebCore::AudioSession::AudioSession):
(WebCore::AudioSession::preferredBufferDuration):
(WebCore::AudioSession::setPreferredBufferDuration):
* platform/audio/AudioSession.h:
* platform/audio/AudioSessionListener.h:
(AudioSessionListener):
* platform/audio/AudioSessionManager.cpp: Removed.
* platform/audio/AudioSessionManager.h: Removed.
* platform/audio/ios/AudioDestinationIOS.cpp:
(WebCore::AudioDestinationIOS::configure):
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::preferredBufferDuration):
(WebCore::AudioSession::setPreferredBufferDuration):
* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestination::hardwareSampleRate):
(WebCore::AudioDestinationMac::AudioDestinationMac):
(WebCore::AudioDestinationMac::configure):
* platform/audio/mac/AudioDestinationMac.h:
(AudioDestinationMac):
* platform/audio/mac/AudioSessionMac.cpp: Removed.
* platform/audio/mac/AudioSessionManagerMac.cpp: Removed.

Source/WTF:

* wtf/Platform.h:

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

17 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/platform/audio/AudioSession.cpp
Source/WebCore/platform/audio/AudioSession.h
Source/WebCore/platform/audio/AudioSessionListener.h
Source/WebCore/platform/audio/AudioSessionManager.cpp [deleted file]
Source/WebCore/platform/audio/AudioSessionManager.h [deleted file]
Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp
Source/WebCore/platform/audio/ios/AudioSessionIOS.mm
Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp
Source/WebCore/platform/audio/mac/AudioDestinationMac.h
Source/WebCore/platform/audio/mac/AudioSessionMac.cpp [deleted file]
Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp [deleted file]

index c52555e..0be272c 100644 (file)
@@ -1,11 +1,8 @@
-2013-05-22  Jer Noble  <jer.noble@apple.com>
+2013-05-22  Dean Jackson  <dino@apple.com>
 
-        Mac: Set the default audio buffer size to a large value for <video> elements.
-        https://bugs.webkit.org/show_bug.cgi?id=116342
+        Rolling out r150555. It borked about 30 media tests.
 
-        Reviewed by Eric Carlson.
-
-        * wtf/Platform.h: Add a WTF_USE_AUDIO_SESSION setting.
+        * wtf/Platform.h:
 
 2013-05-21  Anders Carlsson  <andersca@apple.com>
 
index 8cf1516..5bea9ed 100644 (file)
 #define WTF_USE_MARKER_REMOVAL_UPON_EDITING 1
 #endif /* #if PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) */
 
-#if PLATFORM(MAC) || PLATFORM(IOS)
-#define WTF_USE_AUDIO_SESSION 1
-#endif
-
 #endif /* WTF_Platform_h */
index 3aa352d..1e2c34a 100644 (file)
@@ -1,3 +1,35 @@
+2013-05-22  Dean Jackson  <dino@apple.com>
+
+        Rolling out r150555. It borked about 30 media tests.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        * html/HTMLMediaElement.h:
+        * platform/audio/AudioSession.cpp:
+        (WebCore):
+        (WebCore::AudioSession::AudioSession):
+        (WebCore::AudioSession::preferredBufferDuration):
+        (WebCore::AudioSession::setPreferredBufferDuration):
+        * platform/audio/AudioSession.h:
+        * platform/audio/AudioSessionListener.h:
+        (AudioSessionListener):
+        * platform/audio/AudioSessionManager.cpp: Removed.
+        * platform/audio/AudioSessionManager.h: Removed.
+        * platform/audio/ios/AudioDestinationIOS.cpp:
+        (WebCore::AudioDestinationIOS::configure):
+        * platform/audio/ios/AudioSessionIOS.mm:
+        (WebCore::AudioSession::preferredBufferDuration):
+        (WebCore::AudioSession::setPreferredBufferDuration):
+        * platform/audio/mac/AudioDestinationMac.cpp:
+        (WebCore::AudioDestination::hardwareSampleRate):
+        (WebCore::AudioDestinationMac::AudioDestinationMac):
+        (WebCore::AudioDestinationMac::configure):
+        * platform/audio/mac/AudioDestinationMac.h:
+        (AudioDestinationMac):
+        * platform/audio/mac/AudioSessionMac.cpp: Removed.
+        * platform/audio/mac/AudioSessionManagerMac.cpp: Removed.
+
 2013-05-20  Jeffrey Pfau  <jpfau@apple.com>
 
         Active DOM object resumption should match reason for suspending
         * page/PageGroupLoadDeferrer.cpp:
         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer): Add matching resume reason
 
-2013-05-22  Jer Noble  <jer.noble@apple.com>
-
-        Unreviewed build fix; cast OSStatus to an int before passing it to printf.
-
-        * platform/audio/mac/AudioSessionMac.cpp:
-        (WebCore::AudioSession::setPreferredBufferSize):
-
 2013-05-22  Dean Jackson  <dino@apple.com>
 
         Don't snapshot plugins that can't be snapshotted
         * rendering/RenderSnapshottedPlugIn.cpp:
         (WebCore::RenderSnapshottedPlugIn::handleEvent): Don't set play state here. Let the restart functions do it.
 
-2013-05-22  Jer Noble  <jer.noble@apple.com>
-
-        Mac: Set the default audio buffer size to a large value for <video> elements.
-        https://bugs.webkit.org/show_bug.cgi?id=116342
-
-        Reviewed by Eric Carlson.
-
-        To enable power savings by waking up the audio hardware less often, set the
-        requested buffer frame size to a large value, such as 4096. Since this results
-        in approximately 100ms worth of buffer, set the buffer size to a much lower
-        value when playing WebAudio, which is much more sensitive to latency than video
-        or audio elements.
-
-        Introduce a new class, AudioSessionManager, as well as a helper class,
-        AudioSessionManagerToken. Audio elements, video elements, and WebAudio destination
-        nodes will create and retain a token, and release the token in their destructor.
-        This allows the AudioSessionManager to track how many of what type of audio-
-        generating objects are in existence.
-
-        This requires implementing AudioSession for Mac platforms. Move the implementation
-        for retrieving the hardware sample rate and setting the buffer duration into
-        AudioSessionMac from AudioDestinationMac, to be shared with AudioSessionManagerMac.
-
-        Change the AudioSession method preferredBufferLength() into preferredBufferSize(),
-        as the callers really want to specify a buffer size, not a buffer duration. On iOS,
-        where the available API requires a duration, perform the conversion from duration to
-        size on behalf of the caller.
-
-        * html/HTMLMediaElement.h:  Add a AudioSessionManagerToken member.
-        * html/HTMLMediaElement.cpp:
-        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the token.
-        * platform/audio/AudioSession.cpp:
-        (WebCore::AudioSession::preferredBufferSize): Renamed from preferredBufferLength.
-        (WebCore::AudioSession::setPreferredBufferSize): Renamed from setPreferredBufferLength.
-        * platform/audio/AudioSession.h:
-        * platform/audio/AudioSessionManager.cpp:
-        (AudioSessionManagerToken::create): Simple factory method.
-        (AudioSessionManagerToken::AudioSessionManagerToken): Call AudioSessionManager::incrementCount().
-        (AudioSessionManagerToken::~AudioSessionManagerToken): Call AudioSessionManager::decrementCount().
-        (AudioSessionManager::sharedManager): Simple singleton method.
-        (AudioSessionManager::AudioSessionManager): Simple constructor.
-        (AudioSessionManager::has): Return whether the type is present.
-        (AudioSessionManager::incrementCount): Increment, then call updateSessionState()
-        (AudioSessionManager::decrementCount): Decrement, then call updateSessionState()
-        (AudioSessionManager::updateSessionState): Stub, does nothing.
-        * platform/audio/AudioSessionManager.h:
-        * platform/audio/ios/AudioDestinationIOS.cpp:
-        (WebCore::AudioDestinationIOS::configure): Call setPreferredBufferSize() instead of setPreferredBufferLength()
-        * platform/audio/ios/AudioSessionIOS.mm:
-        (WebCore::AudioSession::preferredBufferSize): Renamed from preferredBufferLength.
-        (WebCore::AudioSession::setPreferredBufferSize): Renamed from setPreferredBufferLength
-        * platform/audio/mac/AudioDestinationMac.cpp:
-        (WebCore::AudioDestination::hardwareSampleRate): Call AudioSession::sampleRate().
-        (WebCore::AudioDestinationMac::AudioDestinationMac): Create the AudioSessionManagerToken.
-        (WebCore::AudioDestinationMac::configure): Do not set the buffer size (this is done in AudioSessionManagerMac).
-        * platform/audio/mac/AudioDestinationMac.h:
-        * platform/audio/mac/AudioSessionMac.cpp: Added.
-        (WebCore::defaultDevice): Added, returns the default audio device.
-        (WebCore::AudioSession::AudioSession): Simple constructor.
-        (WebCore::AudioSession::~AudioSession): Simple destructor.
-        (WebCore::AudioSession::category): Stub, unimplemented.
-        (WebCore::AudioSession::setCategory): Ditto.
-        (WebCore::AudioSession::categoryOverride): Ditto.
-        (WebCore::AudioSession::setCategoryOverride): Ditto.
-        (WebCore::AudioSession::numberOfOutputChannels): Ditto.
-        (WebCore::AudioSession::setActive): Ditto.
-        (WebCore::AudioSession::sampleRate): Use the HAL to return the default audio device sample rate.
-        (WebCore::AudioSession::preferredBufferSize): Return the current HAL setting.
-        (WebCore::AudioSession::setPreferredBufferSize): Set the buffer size.
-        * platform/audio/mac/AudioSessionManagerMac.cpp:
-        (AudioSessionManager::updateSessionState): Set the buffer size depending on what audio outputs are present.
-        * WebCore.xcodeproj/project.pbxproj: Add the new files to the project.
-
 2013-05-22  Max Vujovic  <mvujovic@adobe.com>
 
         [CSS Shaders] valueForCustomFilterTransformParameter should check that renderer is a RenderBox
index d3f73dd..d664d52 100644 (file)
                CD37B39815C1B971006DC898 /* DiagnosticLoggingKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */; };
                CD47B3FC16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD47B3FA16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm */; };
                CD4AC52A1496AE9A0087C4EF /* Composite.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD4AC5281496AE2F0087C4EF /* Composite.wav */; };
-               CD54DE4717468B6F005E5B36 /* AudioSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */; };
-               CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */; };
                CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD7E05211651A84100C1201F /* WebCoreAVFResourceLoader.mm */; };
                CD82030A1395AB6A00F956C6 /* WebVideoFullscreenController.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8203061395AB6A00F956C6 /* WebVideoFullscreenController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CD82030B1395AB6A00F956C6 /* WebVideoFullscreenController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8203071395AB6A00F956C6 /* WebVideoFullscreenController.mm */; settings = {COMPILER_FLAGS = "-Wno-undef -Wno-deprecated-declarations"; }; };
                CDA98E0D1603FE4A00FEA3B1 /* MediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DCA1601508A00FEA3B1 /* MediaKeys.cpp */; };
                CDA98E0E1603FE5800FEA3B1 /* MediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA98DC716014F2C00FEA3B1 /* MediaKeySession.cpp */; };
                CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */; };
-               CDAE8C091746B95700532D78 /* AudioSessionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAE8C071746B95700532D78 /* AudioSessionManager.cpp */; };
                CDB859F7160D48A400E5B07F /* MediaKeyEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB859F4160D489900E5B07F /* MediaKeyEvent.cpp */; };
                CDB859FA160D494900E5B07F /* JSMediaKeyEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB859F8160D493E00E5B07F /* JSMediaKeyEvent.cpp */; };
                CDC26B40160A8CC60026757B /* MockCDM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDC26B3C160A62B00026757B /* MockCDM.cpp */; };
                CD47B3FA16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CDMPrivateAVFoundation.mm; path = Modules/encryptedmedia/CDMPrivateAVFoundation.mm; sourceTree = "<group>"; };
                CD4AC5281496AE2F0087C4EF /* Composite.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = Composite.wav; path = platform/audio/resources/Composite.wav; sourceTree = SOURCE_ROOT; };
                CD4E0AFA11F7BC27009D3811 /* fullscreen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = fullscreen.css; sourceTree = "<group>"; };
-               CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionManagerMac.cpp; sourceTree = "<group>"; };
-               CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionMac.cpp; sourceTree = "<group>"; };
                CD7E05201651A84100C1201F /* WebCoreAVFResourceLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebCoreAVFResourceLoader.h; path = objc/WebCoreAVFResourceLoader.h; sourceTree = "<group>"; };
                CD7E05211651A84100C1201F /* WebCoreAVFResourceLoader.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WebCoreAVFResourceLoader.mm; path = objc/WebCoreAVFResourceLoader.mm; sourceTree = "<group>"; };
                CD8203061395AB6A00F956C6 /* WebVideoFullscreenController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenController.h; sourceTree = "<group>"; };
                CDA98E0C1603CF3C00FEA3B1 /* CDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDMPrivate.h; path = Modules/encryptedmedia/CDMPrivate.h; sourceTree = "<group>"; };
                CDAA8D0714D385600061EA60 /* PlatformClockCM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCM.h; sourceTree = "<group>"; };
                CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformClockCM.mm; sourceTree = "<group>"; };
-               CDAE8C071746B95700532D78 /* AudioSessionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionManager.cpp; sourceTree = "<group>"; };
-               CDAE8C081746B95700532D78 /* AudioSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSessionManager.h; sourceTree = "<group>"; };
                CDB859F2160D489900E5B07F /* MediaKeyError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeyError.h; sourceTree = "<group>"; };
                CDB859F3160D489900E5B07F /* MediaKeyError.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeyError.idl; sourceTree = "<group>"; };
                CDB859F4160D489900E5B07F /* MediaKeyEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaKeyEvent.cpp; sourceTree = "<group>"; };
                                CDA79821170A22DC00D45C55 /* AudioSession.h */,
                                CDA79823170A258300D45C55 /* AudioSession.cpp */,
                                CDA79822170A24F400D45C55 /* AudioSessionListener.h */,
-                               CDAE8C071746B95700532D78 /* AudioSessionManager.cpp */,
-                               CDAE8C081746B95700532D78 /* AudioSessionManager.h */,
                                FD31605312B026F700C1A359 /* AudioSourceProvider.h */,
                                FD62F52D145898D80094B0ED /* AudioSourceProviderClient.h */,
                                FD31605412B026F700C1A359 /* AudioUtilities.cpp */,
                                FD3160B812B0272A00C1A359 /* AudioFileReaderMac.cpp */,
                                FD3160B912B0272A00C1A359 /* AudioFileReaderMac.h */,
                                FD3160BA12B0272A00C1A359 /* FFTFrameMac.cpp */,
-                               CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */,
-                               CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */,
                        );
                        path = mac;
                        sourceTree = "<group>";
                                84730D7C1248F0B300D3A9C9 /* FEDisplacementMap.cpp in Sources */,
                                4358E8801360A31700E4748C /* FEDropShadow.cpp in Sources */,
                                84730D7E1248F0B300D3A9C9 /* FEFlood.cpp in Sources */,
-                               CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */,
                                84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */,
                                84730D801248F0B300D3A9C9 /* FELighting.cpp in Sources */,
                                84730D821248F0B300D3A9C9 /* FEMerge.cpp in Sources */,
                                93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */,
                                F55B3DCF1251F12D003EF269 /* ResetInputType.cpp in Sources */,
                                514BC842161CF05C004D52F4 /* ResourceBuffer.cpp in Sources */,
-                               CD54DE4717468B6F005E5B36 /* AudioSessionManagerMac.cpp in Sources */,
                                514BC83F161CF04A004D52F4 /* ResourceBuffer.mm in Sources */,
                                934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
                                7EE6846B12D26E3800E79415 /* ResourceErrorCF.cpp in Sources */,
                                376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */,
                                B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */,
                                9759E93F14EF1CF80026A2DD /* TextTrack.cpp in Sources */,
-                               CDAE8C091746B95700532D78 /* AudioSessionManager.cpp in Sources */,
                                9759E94214EF1CF80026A2DD /* TextTrackCue.cpp in Sources */,
                                071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */,
                                9759E94514EF1CF80026A2DD /* TextTrackCueList.cpp in Sources */,
index ac2b72a..a1d4b0a 100644 (file)
 #include "PlatformTextTrack.h"
 #endif
 
-#if USE(AUDIO_SESSION)
-#include "AudioSessionManager.h"
-#endif
-
 using namespace std;
 
 namespace WebCore {
@@ -320,9 +316,6 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
 #if ENABLE(WEB_AUDIO)
     , m_audioSourceNode(0)
 #endif
-#if USE(AUDIO_SESSION)
-    , m_audioSessionManagerToken(AudioSessionManagerToken::create(tagName == videoTag ? AudioSessionManager::Video : AudioSessionManager::Audio))
-#endif
 {
     LOG(Media, "HTMLMediaElement::HTMLMediaElement");
     document->registerForMediaVolumeCallbacks(this);
index c5721f1..30dc124 100644 (file)
@@ -49,9 +49,6 @@
 
 namespace WebCore {
 
-#if USE(AUDIO_SESSION)
-class AudioSessionManagerToken;
-#endif
 #if ENABLE(WEB_AUDIO)
 class AudioSourceProvider;
 class MediaElementAudioSourceNode;
@@ -768,10 +765,6 @@ private:
 #if USE(PLATFORM_TEXT_TRACK_MENU)
     RefPtr<PlatformTextTrackMenuInterface> m_platformMenu;
 #endif
-
-#if USE(AUDIO_SESSION)
-    OwnPtr<AudioSessionManagerToken> m_audioSessionManagerToken;
-#endif
 };
 
 #if ENABLE(VIDEO_TRACK)
index 7529a1b..cdf8337 100644 (file)
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "AudioSession.h"
 
-#if USE(AUDIO_SESSION)
-
 #include "AudioSessionListener.h"
 #include "NotImplemented.h"
 
@@ -61,12 +59,12 @@ void AudioSession::endedAudioInterruption()
         (*i)->endedAudioInterruption();
 }
 
-#if !PLATFORM(IOS) && !PLATFORM(MAC)
+#if !PLATFORM(IOS)
 class AudioSessionPrivate {
 };
 
 AudioSession::AudioSession()
-    : m_private(nullptr)
+    : m_private(0)
 {
     notImplemented();
 }
@@ -114,18 +112,16 @@ void AudioSession::setActive(bool)
     notImplemented();
 }
 
-size_t AudioSession::preferredBufferSize() const
+float AudioSession::preferredBufferDuration() const
 {
     notImplemented();
     return 0;
 }
 
-void AudioSession::setPreferredBufferSize(size_t)
+void AudioSession::setPreferredBufferDuration(float)
 {
     notImplemented();
 }
 #endif // !PLATFORM(IOS)
 
 }
-
-#endif // USE(AUDIO_SESSION)
index 0ea664c..7c202eb 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef AudioSession_h
 #define AudioSession_h
 
-#if USE(AUDIO_SESSION)
-
 #include <wtf/HashSet.h>
 #include <wtf/OwnPtr.h>
 
@@ -64,8 +62,8 @@ public:
 
     void setActive(bool);
 
-    size_t preferredBufferSize() const;
-    void setPreferredBufferSize(size_t);
+    float preferredBufferDuration() const;
+    void setPreferredBufferDuration(float seconds);
 
     void beganAudioInterruption();
     void endedAudioInterruption();
@@ -80,6 +78,4 @@ private:
 
 }
 
-#endif // USE(AUDIO_SESSION)
-
 #endif // AudioSession_h
index d8b82e7..62c5b11 100644 (file)
 #ifndef AudioSessionListener_h
 #define AudioSessionListener_h
 
-#if USE(AUDIO_SESSION)
-
 namespace WebCore {
 
 class AudioSessionListener {
-    WTF_MAKE_NONCOPYABLE(AudioSessionListener);
+    WTF_MAKE_NONCOPYABLE(AudioSessionListener)
 public:
     virtual void beganAudioInterruption() = 0;
     virtual void endedAudioInterruption() = 0;
@@ -42,6 +40,4 @@ protected:
 
 }
 
-#endif // USE(AUDIO_SESSION)
-
 #endif // AudioSessionListener_h
diff --git a/Source/WebCore/platform/audio/AudioSessionManager.cpp b/Source/WebCore/platform/audio/AudioSessionManager.cpp
deleted file mode 100644 (file)
index 12a1b95..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "AudioSessionManager.h"
-
-#if USE(AUDIO_SESSION)
-
-using namespace WebCore;
-
-PassOwnPtr<AudioSessionManagerToken> AudioSessionManagerToken::create(AudioSessionManager::AudioType type)
-{
-    return adoptPtr(new AudioSessionManagerToken(type));
-}
-
-AudioSessionManagerToken::AudioSessionManagerToken(AudioSessionManager::AudioType type)
-    : m_type(type)
-{
-    AudioSessionManager::sharedManager().incrementCount(type);
-}
-
-AudioSessionManagerToken::~AudioSessionManagerToken()
-{
-    AudioSessionManager::sharedManager().decrementCount(m_type);
-}
-
-AudioSessionManager& AudioSessionManager::sharedManager()
-{
-    DEFINE_STATIC_LOCAL(AudioSessionManager, manager, ());
-    return manager;
-}
-
-AudioSessionManager::AudioSessionManager()
-{
-}
-
-bool AudioSessionManager::has(AudioSessionManager::AudioType type)
-{
-    ASSERT(type >= 0);
-    return m_typeCount.contains(type);
-}
-
-void AudioSessionManager::incrementCount(AudioSessionManager::AudioType type)
-{
-    ASSERT(type >= 0);
-    m_typeCount.add(type);
-    updateSessionState();
-}
-
-void AudioSessionManager::decrementCount(AudioSessionManager::AudioType type)
-{
-    ASSERT(type >= 0);
-    m_typeCount.remove(type);
-    updateSessionState();
-}
-
-#if !PLATFORM(MAC)
-void AudioSessionManager::updateSessionState()
-{
-}
-#endif
-
-#endif // USE(AUDIO_SESSION)
diff --git a/Source/WebCore/platform/audio/AudioSessionManager.h b/Source/WebCore/platform/audio/AudioSessionManager.h
deleted file mode 100644 (file)
index 28a5c6a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AudioSessionManager_h
-#define AudioSessionManager_h
-
-#if USE(AUDIO_SESSION)
-
-#include "AudioSession.h"
-#include <wtf/HashCountedSet.h>
-#include <wtf/PassOwnPtr.h>
-
-namespace WebCore {
-
-class AudioSessionManager {
-public:
-    static AudioSessionManager& sharedManager();
-
-    enum AudioType {
-        None,
-        Video,
-        Audio,
-        WebAudio,
-    };
-
-    bool has(AudioType);
-
-protected:
-    friend class AudioSessionManagerToken;
-    void incrementCount(AudioType);
-    void decrementCount(AudioType);
-    
-private:
-    AudioSessionManager();
-
-    void updateSessionState();
-
-    HashCountedSet<size_t> m_typeCount;
-};
-
-class AudioSessionManagerToken {
-public:
-    static PassOwnPtr<AudioSessionManagerToken> create(AudioSessionManager::AudioType);
-    ~AudioSessionManagerToken();
-
-private:
-    AudioSessionManagerToken(AudioSessionManager::AudioType);
-
-    AudioSessionManager::AudioType m_type;
-};
-}
-
-#endif // USE(AUDIO_SESSION)
-
-#endif // AudioSessionManager_h
index 95e8a45..34b288c 100644 (file)
@@ -188,7 +188,7 @@ void AudioDestinationIOS::configure()
     result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, (void*)&streamFormat, sizeof(AudioStreamBasicDescription));
     ASSERT(!result);
 
-    AudioSession::sharedSession().setPreferredBufferSize(kPreferredBufferSize);
+    AudioSession::sharedSession().setPreferredBufferDuration(narrowPrecisionToFloat(kPreferredBufferSize / m_sampleRate));
 }
 
 void AudioDestinationIOS::start()
index 79e261a..9fa8e3b 100644 (file)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "AudioSession.h"
 
-#if USE(AUDIO_SESSION) && PLATFORM(IOS)
+#if PLATFORM(IOS)
 
 #import "SoftLinking.h"
 #import <AVFoundation/AVAudioSession.h>
@@ -201,19 +201,18 @@ void AudioSession::setActive(bool active)
     ASSERT(!error);
 }
 
-size_t AudioSession::preferredBufferSize() const
+float AudioSession::preferredBufferDuration() const
 {
-    return [[AVAudioSession sharedInstance] preferredIOBufferDuration] * sampleRate();
+    return [[AVAudioSession sharedInstance] preferredIOBufferDuration];
 }
 
-void AudioSession::setPreferredBufferSize(size_t bufferSize)
+void AudioSession::setPreferredBufferDuration(float duration)
 {
     NSError *error = nil;
-    float duration = bufferSize / sampleRate();
     [[AVAudioSession sharedInstance] setPreferredIOBufferDuration:duration error:&error];
     ASSERT(!error);
 }
 
 }
 
-#endif // USE(AUDIO_SESSION) && PLATFORM(IOS)
+#endif // PLATFORM(IOS)
index ae4b33b..a1a54c3 100644 (file)
@@ -33,7 +33,6 @@
 #include "AudioDestinationMac.h"
 
 #include "AudioIOCallback.h"
-#include "AudioSessionManager.h"
 #include "FloatConversion.h"
 #include "Logging.h"
 #include "VectorMath.h"
@@ -64,7 +63,23 @@ PassOwnPtr<AudioDestination> AudioDestination::create(AudioIOCallback& callback,
 float AudioDestination::hardwareSampleRate()
 {
     // Determine the default output device's sample-rate.
-    return AudioSession::sharedSession().sampleRate();
+    AudioDeviceID deviceID = kAudioDeviceUnknown;
+    UInt32 infoSize = sizeof(deviceID);
+
+    AudioObjectPropertyAddress defaultOutputDeviceAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+    OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &defaultOutputDeviceAddress, 0, 0, &infoSize, (void*)&deviceID);
+    if (result)
+        return 0; // error
+
+    Float64 nominalSampleRate;
+    infoSize = sizeof(Float64);
+
+    AudioObjectPropertyAddress nominalSampleRateAddress = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+    result = AudioObjectGetPropertyData(deviceID, &nominalSampleRateAddress, 0, 0, &infoSize, (void*)&nominalSampleRate);
+    if (result)
+        return 0; // error
+
+    return narrowPrecisionToFloat(nominalSampleRate);
 }
 
 unsigned long AudioDestination::maxChannelCount()
@@ -82,7 +97,6 @@ AudioDestinationMac::AudioDestinationMac(AudioIOCallback& callback, float sample
     , m_renderBus(AudioBus::create(2, kBufferSize, false))
     , m_sampleRate(sampleRate)
     , m_isPlaying(false)
-    , m_audioSessionManagerToken(AudioSessionManagerToken::create(AudioSessionManager::WebAudio))
 {
     // Open and initialize DefaultOutputUnit
     AudioComponent comp;
@@ -134,6 +148,11 @@ void AudioDestinationMac::configure()
 
     result = AudioUnitSetProperty(m_outputUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, (void*)&streamFormat, sizeof(AudioStreamBasicDescription));
     ASSERT(!result);
+
+    // Set the buffer frame size.
+    UInt32 bufferSize = kBufferSize;
+    result = AudioUnitSetProperty(m_outputUnit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Output, 0, (void*)&bufferSize, sizeof(bufferSize));
+    ASSERT(!result);
 }
 
 void AudioDestinationMac::start()
index 928aac0..062c969 100644 (file)
 #include "AudioBus.h"
 #include "AudioDestination.h"
 #include <AudioUnit/AudioUnit.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-class AudioSessionManagerToken;
-
 // An AudioDestination using CoreAudio's default output AudioUnit
 
 class AudioDestinationMac : public AudioDestination {
@@ -66,10 +63,6 @@ private:
 
     float m_sampleRate;
     bool m_isPlaying;
-
-#if USE(AUDIO_SESSION)
-    OwnPtr<AudioSessionManagerToken> m_audioSessionManagerToken;
-#endif
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp b/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp
deleted file mode 100644 (file)
index 7788472..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "AudioSession.h"
-
-#if USE(AUDIO_SESSION) && PLATFORM(MAC)
-
-#include "FloatConversion.h"
-#include "Logging.h"
-#include "NotImplemented.h"
-#include <CoreAudio/AudioHardware.h>
-#include <wtf/PassOwnPtr.h>
-
-namespace WebCore {
-
-static AudioDeviceID defaultDevice()
-{
-    AudioDeviceID deviceID = kAudioDeviceUnknown;
-    UInt32 infoSize = sizeof(deviceID);
-
-    AudioObjectPropertyAddress defaultOutputDeviceAddress = {
-        kAudioHardwarePropertyDefaultOutputDevice,
-        kAudioObjectPropertyScopeGlobal,
-        kAudioObjectPropertyElementMaster };
-    OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &defaultOutputDeviceAddress, 0, 0, &infoSize, (void*)&deviceID);
-    if (result)
-        return 0; // error
-    return deviceID;
-}
-
-class AudioSessionPrivate {
-public:    
-};
-
-AudioSession::AudioSession()
-    : m_private(adoptPtr(new AudioSessionPrivate()))
-{
-}
-
-AudioSession::~AudioSession()
-{
-}
-
-AudioSession::CategoryType AudioSession::category() const
-{
-    notImplemented();
-    return None;
-}
-
-void AudioSession::setCategory(CategoryType)
-{
-    notImplemented();
-}
-
-AudioSession::CategoryType AudioSession::categoryOverride() const
-{
-    notImplemented();
-    return None;
-}
-
-void AudioSession::setCategoryOverride(CategoryType)
-{
-    notImplemented();
-}
-
-float AudioSession::sampleRate() const
-{
-    Float64 nominalSampleRate;
-    UInt32 nominalSampleRateSize = sizeof(Float64);
-
-    AudioObjectPropertyAddress nominalSampleRateAddress = {
-        kAudioDevicePropertyNominalSampleRate,
-        kAudioObjectPropertyScopeGlobal,
-        kAudioObjectPropertyElementMaster };
-    OSStatus result = AudioObjectGetPropertyData(defaultDevice(), &nominalSampleRateAddress, 0, 0, &nominalSampleRateSize, (void*)&nominalSampleRate);
-    if (result)
-        return 0;
-
-    return narrowPrecisionToFloat(nominalSampleRate);
-}
-
-size_t AudioSession::numberOfOutputChannels() const
-{
-    notImplemented();
-    return 0;
-}
-
-void AudioSession::setActive(bool)
-{
-    notImplemented();
-}
-
-size_t AudioSession::preferredBufferSize() const
-{
-    UInt32 bufferSize;
-    UInt32 bufferSizeSize = sizeof(bufferSize);
-
-    AudioObjectPropertyAddress preferredBufferSizeAddress = {
-        kAudioDevicePropertyBufferFrameSizeRange,
-        kAudioObjectPropertyScopeGlobal,
-        kAudioObjectPropertyElementMaster };
-    OSStatus result = AudioObjectGetPropertyData(defaultDevice(), &preferredBufferSizeAddress, 0, 0, &bufferSizeSize, &bufferSize);
-
-    if (result)
-        return 0;
-    return bufferSize;
-}
-
-void AudioSession::setPreferredBufferSize(size_t bufferSize)
-{
-    AudioValueRange bufferSizeRange = {0, 0};
-    UInt32 bufferSizeRangeSize = sizeof(AudioValueRange);
-    AudioObjectPropertyAddress bufferSizeRangeAddress = {
-        kAudioDevicePropertyBufferFrameSizeRange,
-        kAudioObjectPropertyScopeGlobal,
-        kAudioObjectPropertyElementMaster
-    };
-    OSStatus result = AudioObjectGetPropertyData(defaultDevice(), &bufferSizeRangeAddress, 0, 0, &bufferSizeRangeSize, &bufferSizeRange);
-    if (result)
-        return;
-
-    size_t minBufferSize = static_cast<size_t>(bufferSizeRange.mMinimum);
-    size_t maxBufferSize = static_cast<size_t>(bufferSizeRange.mMaximum);
-    UInt32 bufferSizeOut = std::min(maxBufferSize, std::max(minBufferSize, bufferSize));
-
-    AudioObjectPropertyAddress preferredBufferSizeAddress = {
-        kAudioDevicePropertyBufferFrameSize,
-        kAudioObjectPropertyScopeGlobal,
-        kAudioObjectPropertyElementMaster };
-
-    result = AudioObjectSetPropertyData(defaultDevice(), &preferredBufferSizeAddress, 0, 0, sizeof(bufferSizeOut), (void*)&bufferSizeOut);
-
-#if LOG_DISABLED
-    UNUSED_PARAM(result);
-#else
-    if (result)
-        LOG(Media, "AudioSession::setPreferredBufferSize(%zu) - failed with error %d", bufferSize, static_cast<int>(result));
-    else
-        LOG(Media, "AudioSession::setPreferredBufferSize(%zu)", bufferSize);
-#endif
-}
-
-}
-
-#endif // USE(AUDIO_SESSION) && PLATFORM(MAC)
diff --git a/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp b/Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp
deleted file mode 100644 (file)
index 3a3eb3d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "AudioSessionManager.h"
-
-#if USE(AUDIO_SESSION) && PLATFORM(MAC)
-
-#include "Logging.h"
-
-using namespace WebCore;
-
-static const size_t kWebAudioBufferSize = 128;
-static const size_t kLowPowerVideoBufferSize = 4096;
-
-void AudioSessionManager::updateSessionState()
-{
-    LOG(Media, "AudioSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", m_typeCount.count(Video), m_typeCount.count(Audio), m_typeCount.count(WebAudio));
-
-    if (has(WebAudio))
-        AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
-    else if (has(Video) || has(Audio))
-        AudioSession::sharedSession().setPreferredBufferSize(kLowPowerVideoBufferSize);
-}
-
-#endif // USE(AUDIO_SESSION) && PLATFORM(MAC)