Title: [241022] trunk/Source/WebCore
- Revision
- 241022
- Author
- you...@apple.com
- Date
- 2019-02-06 08:59:41 -0800 (Wed, 06 Feb 2019)
Log Message
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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (241021 => 241022)
--- trunk/Source/WebCore/ChangeLog 2019-02-06 16:58:46 UTC (rev 241021)
+++ trunk/Source/WebCore/ChangeLog 2019-02-06 16:59:41 UTC (rev 241022)
@@ -1,5 +1,23 @@
2019-02-06 Youenn Fablet <you...@apple.com>
+ 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-06 Youenn Fablet <you...@apple.com>
+
Disable audio ducking at Audio Unit setup time
https://bugs.webkit.org/show_bug.cgi?id=194303
Modified: trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (241021 => 241022)
--- trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp 2019-02-06 16:58:46 UTC (rev 241021)
+++ trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp 2019-02-06 16:59:41 UTC (rev 241022)
@@ -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: trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h (241021 => 241022)
--- trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h 2019-02-06 16:58:46 UTC (rev 241021)
+++ trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h 2019-02-06 16:59:41 UTC (rev 241022)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes