Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/media/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 3 kB image not shown  

Quelle  test_hevc_playback.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/media/test/test_hevc_playback.html


<!DOCTYPE HTML>
<html>
<head>
<title>Test HEVC video playback</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="manifest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">

/**
 * This test is used to check whether non-MSE HEVC video can be played on the
 * platform. HEVC can only be played if we have platform decoder supports
 * hardware decoding. Currently we can only do that on Windows.
 */
add_task(async function testHEVCPlayback() {
  let video = document.createElement('video');
  info(`try to play HEVC video`);
  video.src = "hevc_white_frame.mp4";
  video.controls = true;
  document.body.appendChild(video);
  ok(await video.play().then(_=>true, _=>false), "video started playing");
  ok(await new Promise(r => video.onended = r).then(_=>true, _=>false),
     "video played to end");
  removeNodeAndSource(video);
});


// This test video contains an inband SPS that is different from the SPS in the
// extradata, so we would recreate a new decoder.
add_task(async function testHEVCInbandConfigChange() {
  let video = document.createElement('video');
  info(`try to play HEVC video`);
  video.src = "hevc_white_red_frames.mp4";
  video.playbackRate = 2.0; // speed up the test.
  video.controls = true;
  document.body.appendChild(video);
  ok(await video.play().then(_=>true, _=>false), "video started playing");
  // This video contains two resolutions, so we should expect to receive a
  // resize event during the playback.
  await Promise.all([
      new Promise(r => video.onended = r),
      new Promise(r => video.onresize = r)
  ]);
  ok(true, "video played to end and got a resize");
  removeNodeAndSource(video);
});

add_task(async function test8BitAnd10BitHEVC() {
  const files = ['gizmo_hevc_8bit_420.mp4''gizmo_hevc_10bit_420.mp4'];
  for (let file of files) {
    let video = document.createElement('video');
    info(`try to play ${file}`);
    video.src = file;
    video.controls = true;
    document.body.appendChild(video);
    ok(await video.play().then(_=>true, _=>false), "video started playing");
    ok(await new Promise(r => video.onended = r).then(_=>true, _=>false),
       "video played to end");
    removeNodeAndSource(video);
  }
});

add_task(async function testHEVCAspectRatio() {
  // The video resolution is 1440x1080, but its Display Aspect Ratio (DAR) is
  // influenced by different Sample Aspect Ratios (SARs), which adjust how the
  // image is stretched when displayed.
  const tests = [
    { file: 'aspect_ratio_4_3_hevc.mp4',
      expectedWidth: 1920,
      expectedHeight: 1080,
    }, {
      file: 'aspect_ratio_5_2_hevc.mp4',
      expectedWidth: 3600,
      expectedHeight: 1080,
    }];
  for (let test of tests) {
    let video = document.createElement('video');
    info(`try to play ${test.file}`);
    video.src = test.file;
    video.controls = true;
    document.body.appendChild(video);
    ok(await video.play().then(_=>true, _=>false), "video started playing");
    is(video.videoWidth, test.expectedWidth, `expect width ${test.expectedWidth}, actual width ${video.videoWidth}`);
    is(video.videoHeight, test.expectedHeight, `expect height ${test.expectedHeight}, actual height ${video.videoHeight}`);
    ok(await new Promise(r => video.onended = r).then(_=>true, _=>false),
       "video played to end");
    removeNodeAndSource(video);
  }
});

</script>
</head>
<body>
</body>
</html>

Messung V0.5
C=93 H=96 G=94

¤ Dauer der Verarbeitung: 0.21 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.