pion / mediadevices

Go implementation of the MediaDevices API.
https://pion.ly/
MIT License
535 stars 122 forks source link

Expose name of devices along with UID for macOS #488

Closed martha-johnston closed 1 year ago

martha-johnston commented 1 year ago

Description

As it is currently implemented, the only way to identify a device plugged into a Darwin system is by UID even though many other forms of identification exist for each device, as explained in this Identifying a Device section of the AVFoundation documentation. This change exposes the localizedName and adds it as Name to the avfoundation.Device type struct. Additionally, the name is added to the driver.Info type struct so that it is included when registering a device.

Reasoning

While the UID that is currently registered for each device is helpful, it is not human readable, unlike localizedName. For example, when discovering the devices on a MacBook, the built in webcam's UID is a string of numbers, letters, and dashes, but it's localizedName is "FaceTime HD Camera". Exposing this name would be helpful for any human interactive use cases, but UID will also remain available for any other use cases in which it is better suited.

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (b9ce5bb) 58.83% compared to head (00b05ed) 58.83%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #488 +/- ## ======================================= Coverage 58.83% 58.83% ======================================= Files 62 62 Lines 3741 3741 ======================================= Hits 2201 2201 Misses 1413 1413 Partials 127 127 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.