[iOS] Do extensive search for microphone devices when trying to capture. Currently, we do an extensive search immediately when enumerateDevices is called. It is better to wait for getUserMedia calls.
Created attachment 416506 [details] Patch
Created attachment 416507 [details] Patch
Created attachment 416509 [details] Patch
Created attachment 416523 [details] Patch
Created attachment 416527 [details] Patch
Comment on attachment 416527 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416527&action=review > Source/WebKit/ChangeLog:10 > + exhaustive audio device query if no other page is needed it. s/is needed/needs/
Comment on attachment 416527 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416527&action=review > Source/WebCore/ChangeLog:8 > + Extensive audio device query needs to enable the AudioSession. s/needs to enable the AudioSession/needs to have an active AudioSession/ > Source/WebCore/ChangeLog:10 > + To work around these side effects, we add an API that allows to control whether activating the audio session or not. s/control whether activating the audio session or not/control whether the AudioSession is active or not/ > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:219 > + RELEASE_LOG_ERROR(WebRTC, "Failed to disactivate audio session with error: %@.", error.localizedDescription); s/disactivate/deactivate/
<rdar://problem/72036034>
Created attachment 416559 [details] Updated patch
Created attachment 416560 [details] Updated patch
Comment on attachment 416560 [details] Updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=416560&action=review > Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h:290 > +#define AVAudioSessionModeVideoRecording PAL::get_AVFoundation_AVAudioSessionModeVideoRecording() Unclear why we want this change. > Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm:216 > +SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAudioSessionModeVideoRecording, NSString *, PAL_EXPORT) Unclear why we want this change. > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:92 > + dispatch_async(m_dispatchQueue, makeBlockPtr([this, locker = holdLock(m_lock)] { Sounds good enough for now. We might want to document this in ChangeLog though. Ideally, we would use a completion handler. > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:104 > + RELEASE_LOG_ERROR(WebRTC, "Failed to set audio session category with error: %@.", error.localizedDescription); In theory, we could release the dispatch queue once we are done there. > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:160 > + auto locker = holdLock(m_lock); We could reduce the time where we hold the lock by doing { auto locker = holdLock(m_lock); } > Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:163 > + do { I do not think we want this do loop here since we are locking above.
Created attachment 416599 [details] Patch
Committed r271049: <https://trac.webkit.org/changeset/271049> All reviewed patches have been landed. Closing bug and clearing flags on attachment 416599 [details].