tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

vp9-scalability-mode.https.html (1794B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>RTCPeerConnection Simulcast Tests</title>
      4 <meta name="timeout" content="long">
      5 <script src="../third_party/sdp/sdp.js"></script>
      6 <script src="simulcast.js"></script>
      7 <script src="../RTCPeerConnection-helper.js"></script>
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="/resources/testdriver.js"></script>
     11 <script src="/resources/testdriver-vendor.js"></script>
     12 <script src="../../mediacapture-streams/permission-helper.js"></script>
     13 <script>
     14 promise_test(async t => {
     15  assert_implements('getCapabilities' in RTCRtpSender, 'RTCRtpSender.getCapabilities not supported');
     16  assert_implements_optional(RTCRtpSender.getCapabilities('video').codecs.find(c => c.mimeType.toLowerCase() === 'video/vp9'), 'VP9 not supported');
     17 
     18  const rids = [0, 1];
     19  const pc1 = new RTCPeerConnection();
     20  t.add_cleanup(() => pc1.close());
     21  const pc2 = new RTCPeerConnection();
     22  t.add_cleanup(() => pc2.close());
     23 
     24  // This is not a scalability mode test (see wpt/webrtc-svc/ for those) but a
     25  // VP9 simulcast test. Setting `scalabilityMode` should not be needed, however
     26  // some browsers interpret multiple VP9 encodings to mean multiple spatial
     27  // layers by default. During a transition period, Chromium-based browsers
     28  // requires explicitly specifying the scalability mode as a way to opt-in to
     29  // spec-compliant simulcast. See also wpt/webrtc/simulcast/vp9.https.html for
     30  // a version of this test that does not set the scalability mode.
     31  const scalabilityMode = 'L1T2';
     32  return negotiateSimulcastAndWaitForVideo(
     33      t, await getCameraStream(t), rids, pc1, pc2, {mimeType: 'video/VP9'},
     34      scalabilityMode);
     35 }, 'VP9 simulcast setup with two streams and L1T2 set');
     36 </script>