Skip to content

Commit

Permalink
webrtc: add wpt for setCodecPreferences + rtx
Browse files Browse the repository at this point in the history
BUG=chromium:387077342

Change-Id: I3289327d21e22a6c42edb56d3a9699a0a7cf8d06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6186273
Reviewed-by: Harald Alvestrand <[email protected]>
Reviewed-by: Henrik Boström <[email protected]>
Commit-Queue: Philipp Hancke <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1409660}
  • Loading branch information
fippo authored and chromium-wpt-export-bot committed Jan 22, 2025
1 parent 1a0a995 commit 8d6d3ba
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions webrtc/RTCRtpTransceiver-setCodecPreferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,25 @@
assert_equals(rtpParameters.codecs[0].name, firstCodec);
}, `setCodecPreferences() modifies the order of video codecs in createOffer`);

['rtx', 'red', 'ulpfec'].forEach(resiliencyMechanism => {
promise_test(async (t) => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const transceiver = pc.addTransceiver('video');
const {codecs} = RTCRtpReceiver.getCapabilities('video');
const filteredCodecs = codecs.
filter(codec => codec.mimeType !== 'video/' + resiliencyMechanism);
assert_not_equals(codecs.length, filteredCodecs.length);
transceiver.setCodecPreferences(filteredCodecs);

const offer = await pc.createOffer();
const mediaSection = SDPUtils.getMediaSections(offer.sdp)[0];
const rtpParameters = SDPUtils.parseRtpParameters(mediaSection);
assert_equals(rtpParameters.codecs.find(codec => codec.name === resiliencyMechanism),
undefined);
}, `setCodecPreferences() can remove ${resiliencyMechanism}`);
});

// Tests the note removed as result of discussion in
// https://github.com/w3c/webrtc-pc/issues/2933
promise_test(async (t) => {
Expand Down

0 comments on commit 8d6d3ba

Please sign in to comment.