Title: [241366] branches/safari-608.1.5.1-branch/Source/WebCore
Revision
241366
Author
[email protected]
Date
2019-02-13 01:02:56 -0800 (Wed, 13 Feb 2019)

Log Message

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

    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-608.1.5.1-branch/Source/WebCore/ChangeLog (241365 => 241366)


--- branches/safari-608.1.5.1-branch/Source/WebCore/ChangeLog	2019-02-13 09:02:53 UTC (rev 241365)
+++ branches/safari-608.1.5.1-branch/Source/WebCore/ChangeLog	2019-02-13 09:02:56 UTC (rev 241366)
@@ -1,5 +1,46 @@
 2019-02-13  Babak Shafiei  <[email protected]>
 
+        Cherry-pick r241022. rdar://problem/47833940
+
+    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-13  Babak Shafiei  <[email protected]>
+
         Cherry-pick r241021. rdar://problem/45354090
 
     Disable audio ducking at Audio Unit setup time

Modified: branches/safari-608.1.5.1-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (241365 => 241366)


--- branches/safari-608.1.5.1-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2019-02-13 09:02:53 UTC (rev 241365)
+++ branches/safari-608.1.5.1-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2019-02-13 09:02:56 UTC (rev 241366)
@@ -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-608.1.5.1-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h (241365 => 241366)


--- branches/safari-608.1.5.1-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h	2019-02-13 09:02:53 UTC (rev 241365)
+++ branches/safari-608.1.5.1-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h	2019-02-13 09:02:56 UTC (rev 241366)
@@ -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