Auto merge of #23342 - Manishearth:webrtc-streams, r=ferjm

Receive streams in WebRTC (and MediaStreamTrack support)

This adds the `ontrack` event handler to webrtc, and all the `MediaStreamTrack` stuff necessary to make it work.

WebRTC has the ability to group media tracks into streams using MSIDs, but I haven't yet figured out how to do this. For now, `ontrack` should work.

This _should_ be complete, but it hasn't yet been tested (hence the WIP)

r? @ferjm or @jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23342)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-05-09 00:26:02 -04:00 committed by GitHub
commit 17590fd48f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 390 additions and 47 deletions

View file

@ -839,9 +839,13 @@ impl HTMLMediaElement {
self.fetch_request(None);
},
SrcObject::MediaStream(ref stream) => {
for stream in stream.get_tracks() {
if let Err(_) =
self.player.borrow().as_ref().unwrap().set_stream(&stream)
for stream in &*stream.get_tracks() {
if let Err(_) = self
.player
.borrow()
.as_ref()
.unwrap()
.set_stream(&stream.id())
{
self.queue_dedicated_media_source_failure_steps();
}