enumerateDevices() is currently implemented by UserMediaClientImpl and basically depends on MediaDevicesDispatcherHost, which is already mojified.
Migrating this to Blink should be relatively straightforward.
First, it would be necessary to make MediaDevicesDispatcherHost accessible from Blink, which requires migrating some types from being mapped content types to full Blink types.
Once this is done, implementing enumerateDevices should be as simple as just calling MediaDevicesDispatcherHost::EnumerateDevices directly from Blink.
enumerateDevices() is currently implemented by UserMediaClientImpl and basically depends on MediaDevicesDispatcherHost, which is already mojified.
Migrating this to Blink should be relatively straightforward.
First, it would be necessary to make MediaDevicesDispatcherHost accessible from Blink, which requires migrating some types from being mapped content types to full Mojo types.
Once this is done, implementing enumerateDevices should be as simple as just calling MediaDevicesDispatcherHost::EnumerateDevices directly from Blink.
Sure. I can take this up. Before I proceed, I would like to skim through the related code.
Also, if you could point out the code that refers to "some types from being mapped content types to full Mojo types"?
media_devices.mojom uses some types mapped from content/media types.
enumerateDevices() in particular uses content::MediaDeviceInfo, which cannot be used in Mojo.
It would be good to check with Mojo people on what's the right approach for this.
Hi Guido,
Now that MediaStream IPC migration is done, I would like to proceed with this task.
At the first look, I think we can setup a mojo connection with browser by creating a MediaDevicesDispatcherHost(MDDH) service in MediaDevices(MediaDevices.cpp) and call MDDH::EnumerateDevices directly.
Since the number of fields in the deviceinfo struct is less, we can manually do the conversion between content types and mojo types for now. Later, we can add the required typemapping using StructTraits.
WDYT? Please correct me if I am wrong.
guidou@: With https://crrev.com/c/808128 ready for landing, is there anything else to be done w.r.t this bug? If not, I am looking forward to some more interesting contributions in this area. Please let me know.
The obvious next step is handling of the devicechange event.
Similar to this, but moving the MediaDevicesListener object from content to Blink, and sending Subscribe/UnsubscribeDeviceNotifications directly from Blink.
We can file a separate bug for that.
I added it, just to keep track of all the bugs that are blocking bug 787254.
We can close this now. I filed bug 793297 to track the work for the devicechange event.
Comment 1 by guidou@chromium.org
, Sep 13 2017