Commit 72aef1a4 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Adds a test for basic WebRTC video codec conformance.

This tests that the browser conforms to RFC 7742, "WebRTC Video
Processing and Codec Requrements".

It establishes a new subdirectory for protocol-related WebRTC tests.

Bug: chromium:839753
Change-Id: Ia4795c4532fb74ae76e6a47329a41807479113c5
Reviewed-on: https://chromium-review.googlesource.com/1043886
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556454}
parent ca488acb
This directory contains files that test for behavior relevant to webrtc,
but which is specified in protocol specifications from the IETF, not in
API recommendations from the W3C.
The main specifications are given in the following internet-drafts:
- draft-ietf-rtcweb-overview
- draft-ietf-rtcweb-transports
- draft-ietf-rtcweb-security-arch
- draft-ietf-rtcweb-security
- draft-ietf-rtcweb-rtp-usage
- draft-ietf-rtcweb-jsep
- draft-ietf-rtcweb-ip-handling
- draft-ietf-rtcweb-fec
- draft-ietf-rtcweb-data-protocol
- draft-ietf-rtcweb-data-channel
- RFC 7742, "WebRTC Video Processing and Codec Requirements"
- RFC 7874, "WebRTC Audio Codec and Processing Requirements"
An overview of the dependencies involved is in draft-jennings-rtcweb-deps
<!doctype html>
<meta charset=utf-8>
<title>RTCPeerConnection.prototype.createOffer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webrtc/RTCPeerConnection-helper.js"></script>
<script>
'use strict';
// Tests for conformance to RFC 7742,
// "WebRTC Video Processing and Codec Requirements"
// The document was formerly known as draft-ietf-rtcweb-video-codecs.
//
// This tests that the browser is a WebRTC Browser as defined there.
// TODO: Section 3.2: screen capture video MUST be prepared
// to handle resolution changes.
// TODO: Section 4: MUST support generating CVO (orientation)
// Section 5: Browsers MUST implement VP8 and H.264 Constrained Baseline
promise_test(async t => {
const pc = new RTCPeerConnection();
const offer = await pc.createOffer({offerToReceiveVideo: true});
let video_section_found = false;
for (let section of offer.sdp.split(/\r\nm=/)) {
if (section.search('video') != 0) {
continue;
}
video_section_found = true;
// RTPMAP lines have the format a=rtpmap:<pt> <codec>/<clock rate>
let rtpmap_regex = /\r\na=rtpmap:(\d+) (\S+)\/\d+\r\n/g;
let match = rtpmap_regex.exec(offer.sdp);
let payload_type_map = new Array();
while (match) {
payload_type_map[match[1]] = match[2];
match = rtpmap_regex.exec(offer.sdp);
}
assert_true(payload_type_map.indexOf('VP8') > -1,
'VP8 is supported');
assert_true(payload_type_map.indexOf('H264') > -1,
'H.264 is supported');
// TODO: Verify that one of the H.264 PTs supports constrained baseline
}
assert_true(video_section_found);
}, 'H.264 and VP8 should be supported in initial offer');
// TODO: Section 6: Recipients MUST be able to decode 320x240@20 fps
// TODO: Section 6.1: VP8 MUST support RFC 7741 payload formats
// TODO: Section 6.1: VP8 MUST respect max-fr/max-fs
// TODO: Section 6.1: VP8 MUST encode and decode square pixels
// TODO: Section 6.2: H.264 MUST support RFC 6184 payload formats
// TODO: Section 6.2: MUST support Constrained Baseline level 1.2
// TODO: Section 6.2: SHOULD support Constrained High level 1.3
// TODO: Section 6.2: MUST support packetization mode 1.
// TODO: Section 6.2: MUST include profile-level-id
// TODO: Section 6.2: SHOULD interpret max-mbps, max-smbps, max-fs et al
// TODO: Section 6.2: MUST NOT include sprop-parameter-sets
// TODO: Section 6.2: MUST support SEI "filler payload"
// TODO: Section 6.2: MUST support SEI "full frame freeze"
// TODO: Section 6.2: MUST be prepared to receive User Data messages
// TODO: Section 6.2: MUST encode and decode square pixels unless signaled
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment