commit e35b0c17ca115986a1f15d2fef9325eb52fbef77
parent cbb0a6f59e080a6dd2a66d81ebc8e1e818badc24
Author: Narcis Beleuzu <nbeleuzu@mozilla.com>
Date: Tue, 11 Nov 2025 02:47:10 +0200
Revert "Bug 1997997 - add test for 10/12-bit VP9 video. r=media-playback-reviewers,alwu" for causing mda failure on test_non_8bit_video.html
This reverts commit 1a24cc95a2574d8297929a84634e27a9990d0f75.
This reverts commit 392dd465ebf109f7284a1c6d6f93cf238efffa66.
Diffstat:
7 files changed, 34 insertions(+), 49 deletions(-)
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -649,11 +649,6 @@ void FFmpegVideoDecoder<LIBAV_VER>::InitHWDecoderIfAllowed() {
}
#endif // MOZ_USE_HWDECODE
-static bool ShouldEnable8BitConversion(const struct AVCodec* aCodec) {
- return 0 == strncmp(aCodec->name, "libdav1d", 8) ||
- 0 == strncmp(aCodec->name, "vp9", 3);
-}
-
RefPtr<MediaDataDecoder::InitPromise> FFmpegVideoDecoder<LIBAV_VER>::Init() {
AUTO_PROFILER_LABEL("FFmpegVideoDecoder::Init", MEDIA_PLAYBACK);
FFMPEG_LOG("FFmpegVideoDecoder, init, IsHardwareAccelerated=%d\n",
@@ -666,9 +661,11 @@ RefPtr<MediaDataDecoder::InitPromise> FFmpegVideoDecoder<LIBAV_VER>::Init() {
if (NS_FAILED(rv)) {
return InitPromise::CreateAndReject(rv, __func__);
}
- m8BitOutput = m8BitOutput && ShouldEnable8BitConversion(mCodecContext->codec);
+ // Enable 8-bit conversion only for dav1d.
+ m8BitOutput =
+ m8BitOutput && 0 == strncmp(mCodecContext->codec->name, "libdav1d", 8);
if (m8BitOutput) {
- FFMPEG_LOG("Enable 8-bit output for %s", mCodecContext->codec->name);
+ FFMPEG_LOG("Enable 8-bit output for dav1d");
m8BitRecycleBin = MakeRefPtr<BufferRecycleBin>();
}
return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
@@ -1690,11 +1687,6 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER>::CreateImage(
// MacIOSurfaceImage, then we could use it for HDR.
requiresCopy = (b.mColorDepth != gfx::ColorDepth::COLOR_8);
# endif
-# ifdef MOZ_WIDGET_ANDROID
- // Some Android devices can only render 8-bit images and cannot use high
- // bit-depth decoded data directly.
- requiresCopy = m8BitOutput && b.mColorDepth != gfx::ColorDepth::COLOR_8;
-# endif
if (mIsUsingShmemBufferForDecode && *mIsUsingShmemBufferForDecode &&
!requiresCopy) {
RefPtr<ImageBufferWrapper> wrapper = static_cast<ImageBufferWrapper*>(
diff --git a/dom/media/test/mochitest_compat.toml b/dom/media/test/mochitest_compat.toml
@@ -694,10 +694,6 @@ support-files = [
"video-overhang.ogg^headers^",
"vp9-superframes.webm",
"vp9-superframes.webm^headers^",
- "vp9-yuv420p10.webm",
- "vp9-yuv420p10.webm^headers^",
- "vp9-yuv420p12.webm",
- "vp9-yuv420p12.webm^headers^",
"vp9.webm",
"vp9.webm^headers^",
"vp9-short.webm",
@@ -770,6 +766,8 @@ support-files = [
["test_audioDocumentTitle.html"]
skip-if = ["true"] # bug 475110 - disabled since we don't play Wave files standalone
+["test_av1_high_professional_profiles.html"]
+
["test_buffered.html"]
["test_bug1431810_opus_downmix_to_mono.html"]
@@ -898,8 +896,6 @@ skip-if = ["os == 'win' && os_version == '11.26100' && arch == 'x86_64' && debug
["test_no_load_event.html"]
-["test_non_8bit_video.html"]
-
["test_not_reset_playbackRate_when_removing_nonloaded_media_from_document.html"]
["test_paused.html"]
diff --git a/dom/media/test/test_av1_high_professional_profiles.html b/dom/media/test/test_av1_high_professional_profiles.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test High and Professional profile AV1 video files</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+<script type="application/javascript">
+
+/** This test checks if 10- and 12-bit AV1 video plays. */
+const av1Files = ["av1-yuv444p10.webm", "av1-yuv422p10.webm", "av1-yuv444p12.webm"];
+add_task(async function testPlayAll() {
+ await Promise.all(av1Files.map(
+ (f) => {
+ let v = document.createElement("video");
+ document.body.appendChild(v);
+ v.src = f;
+ return v;
+ }).map(
+ (v) => v.play())).then(
+ () => ok(true, "All AV1 video played."),
+ (e) => ok(false, "Play AV1 video error: " + e));
+});
+
+</script>
+</head>
+<body>
+</body>
+</html>
diff --git a/dom/media/test/test_non_8bit_video.html b/dom/media/test/test_non_8bit_video.html
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Test 10/12-bit video files</title>
-<script src="/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-<script type="application/javascript">
-
-/** This test checks if 10- and 12-bit video plays. */
-const videos = ["av1-yuv444p10.webm", "av1-yuv422p10.webm", "av1-yuv444p12.webm",
- "vp9-yuv420p10.webm", "vp9-yuv420p12.webm"];
-add_task(async function testPlayAll() {
- await Promise.all(videos.map(
- (f) => {
- let v = document.createElement("video");
- document.body.appendChild(v);
- v.src = f;
- return v;
- }).map(
- (v) => v.play())).then(
- () => ok(true, "All video played."),
- (e) => ok(false, "Play video error: " + e));
-});
-
-</script>
-</head>
-<body>
-</body>
-</html>
diff --git a/dom/media/test/vp9-yuv420p10.webm^headers^ b/dom/media/test/vp9-yuv420p10.webm^headers^
@@ -1 +0,0 @@
-Cache-Control: no-store
diff --git a/dom/media/test/vp9-yuv420p12.webm b/dom/media/test/vp9-yuv420p12.webm
Binary files differ.
diff --git a/dom/media/test/vp9-yuv420p12.webm^headers^ b/dom/media/test/vp9-yuv420p12.webm^headers^
@@ -1 +0,0 @@
-Cache-Control: no-store