Filter some capture device names
<rdar://problem/59141886>
Created attachment 395327 [details] Patch
Comment on attachment 395327 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395327&action=review > Source/WebCore/platform/mediastream/CaptureDevice.h:50 > + static NeverDestroyed<String> airPods(MAKE_STATIC_STRING_IMPL("AirPods")); This seems ok to special case AirPods name, I would restrict this to Microphone DeviceType. Maybe we should move that method to a CPP file as well. Also we do not protect other device names. We could sanitize all bluetooth microphone devices, by checking kAudioDevicePropertyTransportType in CoreAudioCaptureDevice.cpp. We would then continue special casing AirPods but would rename other BT microphones to "Bluetooth Microphone" or "Bluetooth Microphone: xxx" with the first letters of the real names.
Created attachment 395393 [details] Patch for landing
Comment on attachment 395327 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395327&action=review >> Source/WebCore/platform/mediastream/CaptureDevice.h:50 >> + static NeverDestroyed<String> airPods(MAKE_STATIC_STRING_IMPL("AirPods")); > > This seems ok to special case AirPods name, I would restrict this to Microphone DeviceType. > Maybe we should move that method to a CPP file as well. > > Also we do not protect other device names. > We could sanitize all bluetooth microphone devices, by checking kAudioDevicePropertyTransportType in CoreAudioCaptureDevice.cpp. > We would then continue special casing AirPods but would rename other BT microphones to "Bluetooth Microphone" or "Bluetooth Microphone: xxx" with the first letters of the real names. I agree that we should look at sanitizing other device names. I'll land this after updating to only change the name if the device is a microphone, and we can figure out a more cohesive strategy for the future.
Committed r259477: <https://trac.webkit.org/changeset/259477> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395393 [details].