Title: [241157] branches/safari-607-branch/Source/WebCore
Revision
241157
Author
[email protected]
Date
2019-02-07 15:36:44 -0800 (Thu, 07 Feb 2019)

Log Message

Cherry-pick r241022. rdar://problem/47893580

    CoreAudioCaptureSource should not configure its audio unit until it starts producing data
    https://bugs.webkit.org/show_bug.cgi?id=194310

    Reviewed by Eric Carlson.

    Delay the configuration of the audio unit until the source is instructed to start producing data.
    This allows the UIProcess to not start changing the audio unit when
    checking for constraints during getUserMedia call before the prompt.
    Covered by manual testing.

    * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
    (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
    (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
    (WebCore::CoreAudioCaptureSource::startProducingData):
    * platform/mediastream/mac/CoreAudioCaptureSource.h:

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

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (241156 => 241157)


--- branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-07 23:36:41 UTC (rev 241156)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-07 23:36:44 UTC (rev 241157)
@@ -1,5 +1,46 @@
 2019-02-07  Alan Coon  <[email protected]>
 
+        Cherry-pick r241022. rdar://problem/47893580
+
+    CoreAudioCaptureSource should not configure its audio unit until it starts producing data
+    https://bugs.webkit.org/show_bug.cgi?id=194310
+    
+    Reviewed by Eric Carlson.
+    
+    Delay the configuration of the audio unit until the source is instructed to start producing data.
+    This allows the UIProcess to not start changing the audio unit when
+    checking for constraints during getUserMedia call before the prompt.
+    Covered by manual testing.
+    
+    * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+    (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
+    (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
+    (WebCore::CoreAudioCaptureSource::startProducingData):
+    * platform/mediastream/mac/CoreAudioCaptureSource.h:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-02-06  Youenn Fablet  <[email protected]>
+
+            CoreAudioCaptureSource should not configure its audio unit until it starts producing data
+            https://bugs.webkit.org/show_bug.cgi?id=194310
+
+            Reviewed by Eric Carlson.
+
+            Delay the configuration of the audio unit until the source is instructed to start producing data.
+            This allows the UIProcess to not start changing the audio unit when
+            checking for constraints during getUserMedia call before the prompt.
+            Covered by manual testing.
+
+            * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+            (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
+            (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
+            (WebCore::CoreAudioCaptureSource::startProducingData):
+            * platform/mediastream/mac/CoreAudioCaptureSource.h:
+
+2019-02-07  Alan Coon  <[email protected]>
+
         Cherry-pick r241021. rdar://problem/47893607
 
     Disable audio ducking at Audio Unit setup time

Modified: branches/safari-607-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (241156 => 241157)


--- branches/safari-607-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2019-02-07 23:36:41 UTC (rev 241156)
+++ branches/safari-607-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2019-02-07 23:36:44 UTC (rev 241157)
@@ -830,6 +830,15 @@
     : RealtimeMediaSource(RealtimeMediaSource::Type::Audio, WTFMove(label), WTFMove(deviceID), WTFMove(hashSalt))
     , m_captureDeviceID(captureDeviceID)
 {
+}
+
+void CoreAudioCaptureSource::initializeToStartProducingData()
+{
+    if (m_isReadyToStart)
+        return;
+
+    m_isReadyToStart = true;
+
     auto& unit = CoreAudioSharedUnit::singleton();
     unit.setCaptureDevice(String { persistentID() }, m_captureDeviceID);
 
@@ -878,6 +887,7 @@
         return;
     }
 
+    initializeToStartProducingData();
     unit.startProducingData();
 }
 

Modified: branches/safari-607-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h (241156 => 241157)


--- branches/safari-607-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h	2019-02-07 23:36:41 UTC (rev 241156)
+++ branches/safari-607-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h	2019-02-07 23:36:44 UTC (rev 241157)
@@ -93,6 +93,8 @@
 
     bool interrupted() const final;
 
+    void initializeToStartProducingData();
+
     uint32_t m_captureDeviceID { 0 };
 
     Optional<RealtimeMediaSourceCapabilities> m_capabilities;
@@ -107,6 +109,7 @@
     bool m_reconfigurationRequired { false };
     bool m_suspendPending { false };
     bool m_resumePending { false };
+    bool m_isReadyToStart { false };
 };
 
 class CoreAudioCaptureSourceFactory : public AudioCaptureFactory {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to