RESOLVED FIXED Bug 209417
MediaDevices::refreshDevices should take device type into account
https://bugs.webkit.org/show_bug.cgi?id=209417
Summary MediaDevices::refreshDevices should take device type into account
youenn fablet
Reported 2020-03-23 03:44:42 PDT
MediaDevices::refreshDevices should take device type into account
Attachments
Patch (4.86 KB, patch)
2020-03-23 03:46 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2020-03-23 03:44:55 PDT
youenn fablet
Comment 2 2020-03-23 03:46:44 PDT
Eric Carlson
Comment 3 2020-03-23 06:58:41 PDT
Comment on attachment 394251 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394251&action=review > Source/WebCore/Modules/mediastream/MediaDevices.cpp:186 > + auto deviceKind = newDevice.type() == CaptureDevice::DeviceType::Microphone ? MediaDeviceInfo::Kind::Audioinput : MediaDeviceInfo::Kind::Videoinput; > + auto index = m_devices.findMatching([deviceKind, &newDevice](auto& oldDevice) { > + return oldDevice->deviceId() == newDevice.persistentId() && oldDevice->kind() == deviceKind; How does this help the case where there is more than one device of a given type? Or is that not an issue because we have device IDs if `newDevices` has more than one device of any type?
youenn fablet
Comment 4 2020-03-23 07:21:34 PDT
(In reply to Eric Carlson from comment #3) > Comment on attachment 394251 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=394251&action=review > > > Source/WebCore/Modules/mediastream/MediaDevices.cpp:186 > > + auto deviceKind = newDevice.type() == CaptureDevice::DeviceType::Microphone ? MediaDeviceInfo::Kind::Audioinput : MediaDeviceInfo::Kind::Videoinput; > > + auto index = m_devices.findMatching([deviceKind, &newDevice](auto& oldDevice) { > > + return oldDevice->deviceId() == newDevice.persistentId() && oldDevice->kind() == deviceKind; > > How does this help the case where there is more than one device of a given > type? Or is that not an issue because we have device IDs if `newDevices` has > more than one device of any type? UIProcess is filtering if needed to only expose 1 device of each type. The issue is that we will have two devices of two different type but with the same ID (the empty string). In that case, when calling enumerateDevices again, we will confuse the audioinput device with the videoinput device, which will lead to expose two audio input devices instead of 1 audio input and 1 video input.
EWS
Comment 5 2020-03-23 07:24:24 PDT
Committed r258837: <https://trac.webkit.org/changeset/258837> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394251 [details].
youenn fablet
Comment 6 2020-03-26 00:13:34 PDT
*** Bug 209580 has been marked as a duplicate of this bug. ***
youenn fablet
Comment 7 2020-03-30 07:26:41 PDT
*** Bug 209739 has been marked as a duplicate of this bug. ***
youenn fablet
Comment 8 2020-04-01 09:59:44 PDT
*** Bug 209708 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.