forked from mirrors/gecko-dev
Automatic update from web-platform-tests Add setMetadata() support for VP8. This covers everything in the WebIDL except for the RTP related metadata because that is not (yet?) part of the webrtc::VideoFrameMetadata. Let's focus on one thing at a time and deal with that separately. For now, the WPT still passes because we're using clone() instead of an empty constructor. Today the clone() method takes care of copying the RTP related metadata for us, but it does not take care of the encoder specifics. In a separate CL we should refactor clone() as "constructor + set bytes + setMetadata" so that we don't get any free rides from it. The goal is that "what you see is what you get". Bug: webrtc:14709 Change-Id: I9da91a68cd6c7bd2b3a8a5a4ac62d6b70a95858c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4164979 Commit-Queue: Henrik Boström <hbos@chromium.org> Auto-Submit: Henrik Boström <hbos@chromium.org> Reviewed-by: Markus Handell <handellm@google.com> Cr-Commit-Position: refs/heads/main@{#1093088} -- wpt-commits: b534656422903e8a458dfea8aef9695bf746d6cc wpt-pr: 37940
26 lines
1,009 B
JavaScript
26 lines
1,009 B
JavaScript
"use strict";
|
|
|
|
async function setupLoopbackWithCodecAndGetReader(t, codec) {
|
|
const caller = new RTCPeerConnection({encodedInsertableStreams:true});
|
|
t.add_cleanup(() => caller.close());
|
|
const callee = new RTCPeerConnection();
|
|
t.add_cleanup(() => callee.close());
|
|
|
|
await setMediaPermission("granted", ["camera"]);
|
|
const stream = await navigator.mediaDevices.getUserMedia({video:true});
|
|
const videoTrack = stream.getVideoTracks()[0];
|
|
t.add_cleanup(() => videoTrack.stop());
|
|
|
|
const transceiver = caller.addTransceiver(videoTrack);
|
|
const codecCapability =
|
|
RTCRtpSender.getCapabilities('video').codecs.find(capability => {
|
|
return capability.mimeType.includes(codec);
|
|
});
|
|
assert_not_equals(codecCapability, undefined);
|
|
transceiver.setCodecPreferences([codecCapability]);
|
|
|
|
const senderStreams = transceiver.sender.createEncodedStreams();
|
|
exchangeIceCandidates(caller, callee);
|
|
await exchangeOfferAnswer(caller, callee);
|
|
return senderStreams.readable.getReader();
|
|
}
|