Title: [268292] trunk/Source/WebKit
Revision
268292
Author
[email protected]
Date
2020-10-09 15:15:07 -0700 (Fri, 09 Oct 2020)

Log Message

[Media in GPU Process] Enable audio routing arbitration on Mac
https://bugs.webkit.org/show_bug.cgi?id=217528

Reviewed by Eric Carlson.

Use the audio routing arbitration implementation in the Web process and UI process
before moving AudioSessionRoutingArbitratorProxy to the GPU process (which will
require some sandbox changes).

* WebProcess/GPU/media/RemoteAudioSession.cpp:
(WebKit::RemoteAudioSession::setCategory):
(WebKit::RemoteAudioSession::category const):
* WebProcess/GPU/media/RemoteAudioSession.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (268291 => 268292)


--- trunk/Source/WebKit/ChangeLog	2020-10-09 21:48:59 UTC (rev 268291)
+++ trunk/Source/WebKit/ChangeLog	2020-10-09 22:15:07 UTC (rev 268292)
@@ -1,3 +1,19 @@
+2020-10-09  Peng Liu  <[email protected]>
+
+        [Media in GPU Process] Enable audio routing arbitration on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=217528
+
+        Reviewed by Eric Carlson.
+
+        Use the audio routing arbitration implementation in the Web process and UI process
+        before moving AudioSessionRoutingArbitratorProxy to the GPU process (which will
+        require some sandbox changes).
+
+        * WebProcess/GPU/media/RemoteAudioSession.cpp:
+        (WebKit::RemoteAudioSession::setCategory):
+        (WebKit::RemoteAudioSession::category const):
+        * WebProcess/GPU/media/RemoteAudioSession.h:
+
 2020-10-09  Ryan Haddad  <[email protected]>
 
         Promote WKWebView media playback SPI to API

Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp (268291 => 268292)


--- trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp	2020-10-09 21:48:59 UTC (rev 268291)
+++ trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp	2020-10-09 22:15:07 UTC (rev 268292)
@@ -65,6 +65,7 @@
 
 void RemoteAudioSession::setCategory(CategoryType type, RouteSharingPolicy policy)
 {
+#if PLATFORM(IOS_FAMILY)
     if (type == m_configuration.category && policy == m_configuration.routeSharingPolicy)
         return;
 
@@ -72,6 +73,13 @@
     m_configuration.routeSharingPolicy = policy;
 
     connection().send(Messages::RemoteAudioSessionProxy::SetCategory(type, policy), { });
+#elif PLATFORM(MAC)
+    // FIXME: Move AudioSessionRoutingArbitratorProxy to the GPU process (webkit.org/b/217535)
+    AudioSession::setCategory(type, policy);
+#else
+    UNUSED_PARAM(type);
+    UNUSED_PARAM(policy);
+#endif
 }
 
 void RemoteAudioSession::setPreferredBufferSize(size_t size)
@@ -88,6 +96,17 @@
     return succeeded;
 }
 
+AudioSession::CategoryType RemoteAudioSession::category() const
+{
+#if PLATFORM(IOS_FAMILY)
+    return m_configuration.category;
+#elif PLATFORM(MAC)
+    return AudioSession::category();
+#else
+    return None;
+#endif
+}
+
 void RemoteAudioSession::configurationChanged(RemoteAudioSessionConfiguration&& configuration)
 {
     bool mutedStateChanged = configuration.isMuted != m_configuration.isMuted;

Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.h (268291 => 268292)


--- trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.h	2020-10-09 21:48:59 UTC (rev 268291)
+++ trunk/Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.h	2020-10-09 22:15:07 UTC (rev 268292)
@@ -64,7 +64,7 @@
     void setPreferredBufferSize(size_t) final;
     bool tryToSetActiveInternal(bool) final;
 
-    CategoryType category() const final { return m_configuration.category; }
+    CategoryType category() const final;
     WebCore::RouteSharingPolicy routeSharingPolicy() const final { return m_configuration.routeSharingPolicy; }
     String routingContextUID() const final { return m_configuration.routingContextUID; }
     float sampleRate() const final { return m_configuration.sampleRate; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to