media icon indicating copy to clipboard operation
media copied to clipboard

getUserMedia() mocking

Open Manishearth opened this issue 6 years ago • 4 comments

It would be nice if Servo could request the backend to mock getUserMedia().

A simple enable_mediadevices_mocking() function that basically makes the mediadevices code proxy to https://github.com/servo/media/blob/121f943462b0b5e54fdd7a7546e1b8ffd19a87c9/servo-media/lib.rs#L32-L33 would be nice

Alternatively, we can do this entirely on the Servo side. I'm worried this would impact the fidelity of the tests: for example, we currently have a bug where one of the tests requests an impossible constraint which we pass down to gstreamer, and gstreamer asserts.

Overall making this still work with the constraint stuff might be tricky. It might just be a matter of testing against caps, though.

cc @jdm

Manishearth avatar May 15 '19 18:05 Manishearth

For mocking you could use audiotestsrc and videotestsrc :)

philn avatar May 15 '19 18:05 philn

Yep, that's what create_audiostream and create_videostream do for gstreamer :)

However we'd need to internally capsfilter them.

Manishearth avatar May 15 '19 18:05 Manishearth

Indeed :)

philn avatar May 15 '19 18:05 philn

https://github.com/servo/media/pull/262 added some mocking support, however it doesn't take the capsfilter into account (yet)

Manishearth avatar May 15 '19 22:05 Manishearth