Title: [216155] trunk/Source/WebCore
Revision
216155
Author
[email protected]
Date
2017-05-03 16:48:35 -0700 (Wed, 03 May 2017)

Log Message

getUserMedia() fails because devices list is empty / inactive
https://bugs.webkit.org/show_bug.cgi?id=171626

Reviewed by Eric Carlson.

When creating a AVAudioSessionCaptureDevice, set the device's enabled state to true if the port description
has any items in its dataSources property (which is the best analogue to "isActive" we have in AVAudioSession).

Also, when creating the generic list of CaptureDevices, use the copy constructor to ensure the enabled state
gets copied to the new generic device.

* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
(WebCore::AVAudioSessionCaptureDevice::create):
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (216154 => 216155)


--- trunk/Source/WebCore/ChangeLog	2017-05-03 23:21:12 UTC (rev 216154)
+++ trunk/Source/WebCore/ChangeLog	2017-05-03 23:48:35 UTC (rev 216155)
@@ -1,3 +1,21 @@
+2017-05-03  Jer Noble  <[email protected]>
+
+        getUserMedia() fails because devices list is empty / inactive
+        https://bugs.webkit.org/show_bug.cgi?id=171626
+
+        Reviewed by Eric Carlson.
+
+        When creating a AVAudioSessionCaptureDevice, set the device's enabled state to true if the port description
+        has any items in its dataSources property (which is the best analogue to "isActive" we have in AVAudioSession).
+
+        Also, when creating the generic list of CaptureDevices, use the copy constructor to ensure the enabled state
+        gets copied to the new generic device.
+
+        * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
+        (WebCore::AVAudioSessionCaptureDevice::create):
+        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
+        (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
+
 2017-05-03  Said Abou-Hallawa  <[email protected]>
 
         Implement the imageready event to reliably test the async image decoding

Modified: trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm (216154 => 216155)


--- trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm	2017-05-03 23:21:12 UTC (rev 216154)
+++ trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm	2017-05-03 23:48:35 UTC (rev 216155)
@@ -36,7 +36,9 @@
 {
     String persistentID = portDescription.UID;
     String label = portDescription.portName;
-    return AVAudioSessionCaptureDevice(portDescription, persistentID, label);
+    auto device = AVAudioSessionCaptureDevice(portDescription, persistentID, label);
+    device.setEnabled(portDescription.dataSources.count);
+    return device;
 }
 
 AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice(AVAudioSessionPortDescription* portDescription, const String& persistentID, const String& label)

Modified: trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm (216154 => 216155)


--- trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm	2017-05-03 23:21:12 UTC (rev 216154)
+++ trunk/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm	2017-05-03 23:48:35 UTC (rev 216155)
@@ -124,7 +124,7 @@
 
     for (AVAudioSessionPortDescription *portDescription in [AVAudioSession sharedInstance].availableInputs) {
         auto audioDevice = AVAudioSessionCaptureDevice::create(portDescription);
-        newDevices.append({ audioDevice.persistentId(), audioDevice.type(), audioDevice.label(), audioDevice.groupId() });
+        newDevices.append(audioDevice);
         newAudioDevices.append(WTFMove(audioDevice));
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to