tor-browser

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

videoDecoder-h264-sei.https.any.js (792B)


      1 // META: global=window,dedicatedworker
      2 // META: script=videoDecoder-codec-specific-setup.js
      3 // META: variant=?h264_sei_avc
      4 // META: variant=?h264_sei_annexb
      5 
      6 promise_test(async t => {
      7  await checkImplements();
      8  const callbacks = {};
      9  const decoder = createVideoDecoder(t, callbacks);
     10  decoder.configure(CONFIG);
     11 
     12  // Frame 0 is IDR, frame 5 is SEI recovery point.
     13  decoder.decode(CHUNKS[5]);
     14 
     15  // First decode the IDR frame to
     16  let outputs = 0;
     17  callbacks.output = frame => {
     18    outputs++;
     19    assert_equals(frame.timestamp, CHUNKS[5].timestamp, 'timestamp');
     20    assert_equals(frame.duration, CHUNKS[5].duration, 'duration');
     21    frame.close();
     22  };
     23 
     24  await decoder.flush();
     25  assert_equals(outputs, 1, 'outputs');
     26 }, 'H.264 SEI recovery point frames are treated as keyframes.');