Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (175488a6f00bef03dcbe2999e9f4a56a2b308b90)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (175488a6f00bef03dcbe2999e9f4a56a2b308b90)
  • Date: Thu, 17 Aug 2023 19:05:57 +0000

GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:

http/firefox/HISTORY
| 3
http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
| 48 +-
http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
| 36 -

http/firefox/patches/0036-bmo-1837627-dont-use-YUVColorSpaceIdentity-for-YUV-pixel-formats.patch
| 184 ++++++++++

http/firefox/patches/0037-bmo-1837627-convert-AVColorRange-to-GetColorRange.patch
| 79 ++++
http/firefox/patches/0038-bmo-1843425-enable-vaapi-on-X11-only-build.patch
| 40 ++

http/firefox/patches/0039-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
| 105 +++++
7 files changed, 453 insertions(+), 42 deletions(-)

New commits:
commit 175488a6f00bef03dcbe2999e9f4a56a2b308b90
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>

http/firefox: updated patches for 116.0.x

diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index 5927a10..65a85ff 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,6 @@
+2023-08-17 Pavel Vinogradov <public AT sourcemage.org>
+ * patches/*: updated
+
2023-08-16 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 116.0.3
* patches/*: updated
diff --git
a/http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
b/http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
index 18fb36f..b223c19 100644
--- a/http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
+++ b/http/firefox/patches/0003-bmo-847568-Support-system-harfbuzz.patch
@@ -15,10 +15,10 @@ Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
10 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index ae0c9d6d7c..44d08cf06b 100644
+index d9489c8..9c0ea64 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
-@@ -1237,6 +1237,13 @@ if CONFIG['OS_TARGET'] == 'Android':
+@@ -1235,6 +1235,13 @@ if CONFIG['OS_TARGET'] == 'Android':
'vr/gvr/capi/include/gvr.h',
]

@@ -33,12 +33,12 @@ index ae0c9d6d7c..44d08cf06b 100644
system_headers += [
'jack/jack.h',
diff --git a/dom/base/moz.build b/dom/base/moz.build
-index d390adfc49..4508f19cb6 100644
+index 1479761..610ca80 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
-@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul"
- if CONFIG["MOZ_X11"]:
- CXXFLAGS += CONFIG["TK_CFLAGS"]
+@@ -613,6 +613,9 @@ FINAL_LIBRARY = "xul"
+ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
+ CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]

+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
@@ -47,7 +47,7 @@ index d390adfc49..4508f19cb6 100644
"UseCounterList.h",
script="gen-usecounters.py",
diff --git a/gfx/moz.build b/gfx/moz.build
-index 4d6d63da9d..8222b72333 100644
+index 56ea317..6cc19f8 100644
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -10,6 +10,9 @@ with Files("**"):
@@ -69,10 +69,10 @@ index 4d6d63da9d..8222b72333 100644
"thebes",
"ipc",
diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
-index 5e0fd17d79..860b80af4f 100755
+index 39675ea..6262eec 100755
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
-@@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+@@ -91,6 +91,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
'-Wno-unused-private-field',
]

@@ -83,10 +83,10 @@ index 5e0fd17d79..860b80af4f 100755
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
-index 524bd28dac..615c93b266 100755
+index 1d92936..afef373 100644
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
-@@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
+@@ -601,6 +601,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
'-Wno-unused-private-field',
]

@@ -97,24 +97,24 @@ index 524bd28dac..615c93b266 100755
LOCAL_INCLUDES += [
"/gfx/cairo/cairo/src",
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index baa6f090a9..c51c36e2b4 100644
+index 7190375..8af85a4 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
-@@ -294,6 +294,9 @@
-
+@@ -294,6 +294,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+
DEFINES["GRAPHITE2_STATIC"] = True
-
+
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
+
CXXFLAGS += ["-Werror=switch"]
-
+
include("/tools/fuzzing/libfuzzer-config.mozbuild")
diff --git a/intl/unicharutil/util/moz.build
b/intl/unicharutil/util/moz.build
-index 301eb9a854..7cece5e06c 100644
+index 2bbd004..f66bd37 100644
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
-@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
+@@ -24,6 +24,9 @@ UNIFIED_SOURCES += [
"nsUnicodeProperties.cpp",
]

@@ -125,7 +125,7 @@ index 301eb9a854..7cece5e06c 100644

GeneratedFile(
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
-index f769e270fa..8f64710257 100644
+index 17612ff..d6d5194 100644
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
@@ -109,4 +109,7 @@ LOCAL_INCLUDES += [
@@ -137,10 +137,10 @@ index f769e270fa..8f64710257 100644
+
USE_LIBS += ["icu"]
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index 2c3f86948e..dd6901ba9a 100644
+index 0f9d7e9..a6c079d 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
-@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+@@ -291,6 +291,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
"-lgvr",
]

@@ -151,11 +151,11 @@ index 2c3f86948e..dd6901ba9a 100644
OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]

diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 00698656f6..1843188d11 100644
+index e76c9b2..0e00098 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -460,6 +460,15 @@ add_old_configure_assignment(
- )
+@@ -650,6 +650,15 @@ def freetype2_combined_info(fontconfig_info,
freetype2_info):
+
set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))

+# HarfBuzz
diff --git
a/http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
b/http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
index 74d9b24..5643472 100644
--- a/http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
+++ b/http/firefox/patches/0004-bmo-847568-Support-system-graphite2.patch
@@ -18,12 +18,12 @@ Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
toolkit/moz.configure | 13 +++++++++++++
8 files changed, 79 insertions(+), 3 deletions(-)
create mode 100644 gfx/graphite2/geckoextra/moz.build
-
+
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
-index 44d08cf06b..2f7ae39515 100644
+index 9c0ea64..0f4b24a 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
-@@ -1244,6 +1244,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+@@ -1242,6 +1242,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
'harfbuzz/hb.h',
]

@@ -38,7 +38,7 @@ index 44d08cf06b..2f7ae39515 100644
'jack/jack.h',
diff --git a/gfx/graphite2/geckoextra/moz.build
b/gfx/graphite2/geckoextra/moz.build
new file mode 100644
-index 0000000000..24e8d7a032
+index 0000000..24e8d7a
--- /dev/null
+++ b/gfx/graphite2/geckoextra/moz.build
@@ -0,0 +1,21 @@
@@ -64,7 +64,7 @@ index 0000000000..24e8d7a032
+
+FINAL_LIBRARY = 'gkmedias'
diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
-index b91d9c161c..a97e6eb203 100755
+index b91d9c1..a97e6eb 100755
--- a/gfx/graphite2/moz-gr-update.sh
+++ b/gfx/graphite2/moz-gr-update.sh
@@ -1,6 +1,7 @@
@@ -94,7 +94,7 @@ index b91d9c161c..a97e6eb203 100755
echo
echo If gfx/graphite2/src/files.mk has changed, please make corresponding
diff --git a/gfx/moz.build b/gfx/moz.build
-index 8222b72333..16a2b401db 100644
+index 6cc19f8..14b08db 100644
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -10,6 +10,11 @@ with Files("**"):
@@ -118,10 +118,10 @@ index 8222b72333..16a2b401db 100644
"thebes",
"ipc",
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
-index c51c36e2b4..4f02a9e2a5 100644
+index 8af85a4..239579c 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
-@@ -286,7 +286,10 @@ if CONFIG["MOZ_WAYLAND"]:
+@@ -292,7 +292,10 @@ if CONFIG["MOZ_WAYLAND"]:

LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]

@@ -134,12 +134,12 @@ index c51c36e2b4..4f02a9e2a5 100644
if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
diff --git a/old-configure.in b/old-configure.in
-index f69f5f5456..1c1c8ecef3 100644
+index ada50d1..1fa87df 100644
--- a/old-configure.in
+++ b/old-configure.in
-@@ -2204,6 +2204,27 @@ if test "$USE_FC_FREETYPE"; then
- fi
- fi
+@@ -1162,6 +1162,27 @@ fi
+ AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
+ AC_SUBST(MOZ_MACBUNDLE_ID)

+dnl ========================================================
+dnl Check for graphite2
@@ -163,13 +163,13 @@ index f69f5f5456..1c1c8ecef3 100644
+fi
+
dnl ========================================================
- dnl Check if we need the 32-bit Linux SSE2 error dialog
+ dnl = Child Process Name for IPC
dnl ========================================================
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
-index dd6901ba9a..be73ac4bee 100644
+index a6c079d..32c8208 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
-@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+@@ -291,6 +291,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
"-lgvr",
]

@@ -180,11 +180,11 @@ index dd6901ba9a..be73ac4bee 100644
OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]

diff --git a/toolkit/moz.configure b/toolkit/moz.configure
-index 1843188d11..a68e1b347d 100644
+index 0e00098..a9d3633 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
-@@ -460,6 +460,19 @@ add_old_configure_assignment(
- )
+@@ -650,6 +650,19 @@ def freetype2_combined_info(fontconfig_info,
freetype2_info):
+
set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))

+# Graphite2
diff --git
a/http/firefox/patches/0036-bmo-1837627-dont-use-YUVColorSpaceIdentity-for-YUV-pixel-formats.patch

b/http/firefox/patches/0036-bmo-1837627-dont-use-YUVColorSpaceIdentity-for-YUV-pixel-formats.patch
new file mode 100644
index 0000000..8e18e04
--- /dev/null
+++
b/http/firefox/patches/0036-bmo-1837627-dont-use-YUVColorSpaceIdentity-for-YUV-pixel-formats.patch
@@ -0,0 +1,184 @@
+
+# HG changeset patch
+# User stransky <stransky AT redhat.com>
+# Date 1690447248 0
+# Node ID 0963f5b18821bbcac2c9799552a6d60fc31ae7ae
+# Parent f3abc129a8e8c6554481b7a7c3e63c34df3c9ee3
+Bug 1837627 Don't use YUVColorSpace::Identity for YUV pixel formats r=alwu
+
+Check color space of video frames and use YUVColorSpace::Identity for RGB
frames only. This patch also unifies color space setup for shm and non-shm
video decoding paths.
+
+- Implement TransferAVColorSpaceToColorSpace() to convert color space from
AVColorSpace to gfx::YUVColorSpace.
+ It also check color format and doesn't allow to mix YUV color space and
RGB formats.
+- Use TransferAVColorSpaceToColorSpace() in both shm and non-shm decoding
paths.
+
+Differential Revision: https://phabricator.services.mozilla.com/D184469
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+@@ -607,16 +607,42 @@ static gfx::ColorDepth GetColorDepth(con
+ return gfx::ColorDepth::COLOR_12;
+ #endif
+ default:
+ MOZ_ASSERT_UNREACHABLE("Not supported format?");
+ return gfx::ColorDepth::COLOR_8;
+ }
+ }
+
++static bool IsYUVFormat(const AVPixelFormat& aFormat) {
++ return aFormat != AV_PIX_FMT_GBRP;
++}
++
++static gfx::YUVColorSpace TransferAVColorSpaceToColorSpace(
++ const AVColorSpace aSpace, const AVPixelFormat aFormat,
++ const gfx::IntSize& aSize) {
++ if (!IsYUVFormat(aFormat)) {
++ return gfx::YUVColorSpace::Identity;
++ }
++ switch (aSpace) {
++#if LIBAVCODEC_VERSION_MAJOR >= 55
++ case AVCOL_SPC_BT2020_NCL:
++ case AVCOL_SPC_BT2020_CL:
++ return gfx::YUVColorSpace::BT2020;
++#endif
++ case AVCOL_SPC_BT709:
++ return gfx::YUVColorSpace::BT709;
++ case AVCOL_SPC_SMPTE170M:
++ case AVCOL_SPC_BT470BG:
++ return gfx::YUVColorSpace::BT601;
++ default:
++ return DefaultColorSpace(aSize);
++ }
++}
++
+ #ifdef CUSTOMIZED_BUFFER_ALLOCATION
+ static int GetVideoBufferWrapper(struct AVCodecContext* aCodecContext,
+ AVFrame* aFrame, int aFlags) {
+ auto* decoder =
+ static_cast<FFmpegVideoDecoder<LIBAV_VER>*>(aCodecContext->opaque);
+ int rv = decoder->GetVideoBuffer(aCodecContext, aFrame, aFlags);
+ return rv < 0 ? decoder->GetVideoBufferDefault(aCodecContext, aFrame,
aFlags)
+ : rv;
+@@ -625,32 +651,16 @@ static int GetVideoBufferWrapper(struct
+ static void ReleaseVideoBufferWrapper(void* opaque, uint8_t* data) {
+ if (opaque) {
+ FFMPEG_LOGV("ReleaseVideoBufferWrapper: PlanarYCbCrImage=%p", opaque);
+ RefPtr<ImageBufferWrapper> image =
static_cast<ImageBufferWrapper*>(opaque);
+ image->ReleaseBuffer();
+ }
+ }
+
+-static gfx::YUVColorSpace TransferAVColorSpaceToYUVColorSpace(
+- AVColorSpace aSpace) {
+- switch (aSpace) {
+- case AVCOL_SPC_BT2020_NCL:
+- case AVCOL_SPC_BT2020_CL:
+- return gfx::YUVColorSpace::BT2020;
+- case AVCOL_SPC_BT709:
+- return gfx::YUVColorSpace::BT709;
+- case AVCOL_SPC_SMPTE170M:
+- case AVCOL_SPC_BT470BG:
+- return gfx::YUVColorSpace::BT601;
+- default:
+- return gfx::YUVColorSpace::Default;
+- }
+-}
+-
+ static bool IsColorFormatSupportedForUsingCustomizedBuffer(
+ const AVPixelFormat& aFormat) {
+ # if XP_WIN
+ // Currently the web render doesn't support uploading R16 surface, so we
can't
+ // use the shmem texture for 10 bit+ videos which would be uploaded by the
+ // web render. See Bug 1751498.
+ return aFormat == AV_PIX_FMT_YUV420P || aFormat == AV_PIX_FMT_YUVJ420P ||
+ aFormat == AV_PIX_FMT_YUV444P;
+@@ -723,18 +733,19 @@ FFmpegVideoDecoder<LIBAV_VER>::AllocateT
+
+ // Setting other attributes
+ data.mPictureRect = gfx::IntRect(
+ mInfo.ScaledImageRect(aCodecContext->width, aCodecContext->height)
+ .TopLeft(),
+ gfx::IntSize(aCodecContext->width, aCodecContext->height));
+ data.mStereoMode = mInfo.mStereoMode;
+ if (aCodecContext->colorspace != AVCOL_SPC_UNSPECIFIED) {
+- data.mYUVColorSpace =
+- TransferAVColorSpaceToYUVColorSpace(aCodecContext->colorspace);
++ data.mYUVColorSpace = TransferAVColorSpaceToColorSpace(
++ aCodecContext->colorspace, aCodecContext->pix_fmt,
++ data.mPictureRect.Size());
+ } else {
+ data.mYUVColorSpace = mInfo.mColorSpace
+ ? *mInfo.mColorSpace
+ : DefaultColorSpace(data.mPictureRect.Size());
+ }
+ data.mColorDepth = GetColorDepth(aCodecContext->pix_fmt);
+ data.mColorRange = aCodecContext->color_range == AVCOL_RANGE_JPEG
+ ? gfx::ColorRange::FULL
+@@ -1275,40 +1286,27 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ if (aGotFrame) {
+ *aGotFrame = true;
+ }
+ return rv;
+ #endif
+ }
+
+ gfx::YUVColorSpace FFmpegVideoDecoder<LIBAV_VER>::GetFrameColorSpace()
const {
++ AVColorSpace colorSpace = AVCOL_SPC_UNSPECIFIED;
+ #if LIBAVCODEC_VERSION_MAJOR > 58
+- switch (mFrame->colorspace) {
++ colorSpace = mFrame->colorspace;
+ #else
+- AVColorSpace colorSpace = AVCOL_SPC_UNSPECIFIED;
+ if (mLib->av_frame_get_colorspace) {
+ colorSpace = (AVColorSpace)mLib->av_frame_get_colorspace(mFrame);
+ }
+- switch (colorSpace) {
+ #endif
+-#if LIBAVCODEC_VERSION_MAJOR >= 55
+- case AVCOL_SPC_BT2020_NCL:
+- case AVCOL_SPC_BT2020_CL:
+- return gfx::YUVColorSpace::BT2020;
+-#endif
+- case AVCOL_SPC_BT709:
+- return gfx::YUVColorSpace::BT709;
+- case AVCOL_SPC_SMPTE170M:
+- case AVCOL_SPC_BT470BG:
+- return gfx::YUVColorSpace::BT601;
+- case AVCOL_SPC_RGB:
+- return gfx::YUVColorSpace::Identity;
+- default:
+- return DefaultColorSpace({mFrame->width, mFrame->height});
+- }
++ return TransferAVColorSpaceToColorSpace(
++ colorSpace, (AVPixelFormat)mFrame->format,
++ gfx::IntSize{mFrame->width, mFrame->height});
+ }
+
+ gfx::ColorSpace2 FFmpegVideoDecoder<LIBAV_VER>::GetFrameColorPrimaries()
const {
+ AVColorPrimaries colorPrimaries = AVCOL_PRI_UNSPECIFIED;
+ #if LIBAVCODEC_VERSION_MAJOR > 57
+ colorPrimaries = mFrame->color_primaries;
+ #endif
+ switch (colorPrimaries) {
+@@ -1632,17 +1630,18 @@ bool FFmpegVideoDecoder<LIBAV_VER>::IsFo
+ }
+
+ // See ffmpeg / vaapi_decode.c how CodecID is mapped to VAProfile.
+ static const struct {
+ enum AVCodecID codec_id;
+ VAProfile va_profile;
+ char name[100];
+ } vaapi_profile_map[] = {
+-# define MAP(c, v, n) {AV_CODEC_ID_##c, VAProfile##v, n}
++# define MAP(c, v, n) \
++ { AV_CODEC_ID_##c, VAProfile##v, n }
+ MAP(H264, H264ConstrainedBaseline, "H264ConstrainedBaseline"),
+ MAP(H264, H264Main, "H264Main"),
+ MAP(H264, H264High, "H264High"),
+ MAP(VP8, VP8Version0_3, "VP8Version0_3"),
+ MAP(VP9, VP9Profile0, "VP9Profile0"),
+ MAP(VP9, VP9Profile2, "VP9Profile2"),
+ MAP(AV1, AV1Profile0, "AV1Profile0"),
+ MAP(AV1, AV1Profile1, "AV1Profile1"),
+
diff --git
a/http/firefox/patches/0037-bmo-1837627-convert-AVColorRange-to-GetColorRange.patch

b/http/firefox/patches/0037-bmo-1837627-convert-AVColorRange-to-GetColorRange.patch
new file mode 100644
index 0000000..9aa822d
--- /dev/null
+++
b/http/firefox/patches/0037-bmo-1837627-convert-AVColorRange-to-GetColorRange.patch
@@ -0,0 +1,79 @@
+
+# HG changeset patch
+# User stransky <stransky AT redhat.com>
+# Date 1690447248 0
+# Node ID b42bac6cd95acd03ec2418f6079f886e424081ab
+# Parent 0963f5b18821bbcac2c9799552a6d60fc31ae7ae
+Bug 1837627 Implement GetColorRange() to convert AVColorRange to
gfx::ColorRange r=alwu
+
+Depends on D184469
+
+Differential Revision: https://phabricator.services.mozilla.com/D184472
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+@@ -584,16 +584,21 @@ RefPtr<MediaDataDecoder::InitPromise> FF
+ rv = InitDecoder();
+ if (NS_SUCCEEDED(rv)) {
+ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
+ }
+
+ return InitPromise::CreateAndReject(rv, __func__);
+ }
+
++static gfx::ColorRange GetColorRange(enum AVColorRange& aColorRange) {
++ return aColorRange == AVCOL_RANGE_JPEG ? gfx::ColorRange::FULL
++ : gfx::ColorRange::LIMITED;
++}
++
+ static gfx::ColorDepth GetColorDepth(const AVPixelFormat& aFormat) {
+ switch (aFormat) {
+ case AV_PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUVJ420P:
+ case AV_PIX_FMT_YUV422P:
+ case AV_PIX_FMT_YUV444P:
+ return gfx::ColorDepth::COLOR_8;
+ case AV_PIX_FMT_YUV420P10LE:
+@@ -742,19 +747,17 @@ FFmpegVideoDecoder<LIBAV_VER>::AllocateT
+ aCodecContext->colorspace, aCodecContext->pix_fmt,
+ data.mPictureRect.Size());
+ } else {
+ data.mYUVColorSpace = mInfo.mColorSpace
+ ? *mInfo.mColorSpace
+ : DefaultColorSpace(data.mPictureRect.Size());
+ }
+ data.mColorDepth = GetColorDepth(aCodecContext->pix_fmt);
+- data.mColorRange = aCodecContext->color_range == AVCOL_RANGE_JPEG
+- ? gfx::ColorRange::FULL
+- : gfx::ColorRange::LIMITED;
++ data.mColorRange = GetColorRange(aCodecContext->color_range);
+
+ FFMPEG_LOGV(
+ "Created plane data, YSize=(%d, %d), CbCrSize=(%d, %d), "
+ "CroppedYSize=(%d, %d), CroppedCbCrSize=(%d, %d), ColorDepth=%hhu",
+ paddedYSize.Width(), paddedYSize.Height(), paddedCbCrSize.Width(),
+ paddedCbCrSize.Height(), data.YPictureSize().Width(),
+ data.YPictureSize().Height(), data.CbCrPictureSize().Width(),
+ data.CbCrPictureSize().Height(),
static_cast<uint8_t>(data.mColorDepth));
+@@ -1325,18 +1328,17 @@ gfx::ColorRange FFmpegVideoDecoder<LIBAV
+ AVColorRange range = AVCOL_RANGE_UNSPECIFIED;
+ #if LIBAVCODEC_VERSION_MAJOR > 58
+ range = mFrame->color_range;
+ #else
+ if (mLib->av_frame_get_color_range) {
+ range = (AVColorRange)mLib->av_frame_get_color_range(mFrame);
+ }
+ #endif
+- return range == AVCOL_RANGE_JPEG ? gfx::ColorRange::FULL
+- : gfx::ColorRange::LIMITED;
++ return GetColorRange(range);
+ }
+
+ MediaResult FFmpegVideoDecoder<LIBAV_VER>::CreateImage(
+ int64_t aOffset, int64_t aPts, int64_t aDuration,
+ MediaDataDecoder::DecodedData& aResults) const {
+ FFMPEG_LOG("Got one frame output with pts=%" PRId64 " dts=%" PRId64
+ " duration=%" PRId64 " opaque=%" PRId64,
+ aPts, mFrame->pkt_dts, aDuration,
mCodecContext->reordered_opaque);
+
diff --git
a/http/firefox/patches/0038-bmo-1843425-enable-vaapi-on-X11-only-build.patch
b/http/firefox/patches/0038-bmo-1843425-enable-vaapi-on-X11-only-build.patch
new file mode 100644
index 0000000..27f8cef
--- /dev/null
+++
b/http/firefox/patches/0038-bmo-1843425-enable-vaapi-on-X11-only-build.patch
@@ -0,0 +1,40 @@
+
+# HG changeset patch
+# User stransky <stransky AT redhat.com>
+# Date 1689756118 0
+# Node ID cc17b92d0327a30ffb9a863533c0bfe48e72acdf
+# Parent 570c5180c6544a50abca263132c618e2f9180733
+Bug 1843425 [Linux] Probe HW decoding on X11 too r=emilio
+
+Differential Revision: https://phabricator.services.mozilla.com/D183858
+
+diff --git a/widget/gtk/GfxInfo.cpp b/widget/gtk/GfxInfo.cpp
+--- a/widget/gtk/GfxInfo.cpp
++++ b/widget/gtk/GfxInfo.cpp
+@@ -1284,24 +1284,21 @@ nsresult GfxInfo::GetFeatureStatusImpl(
+ auto ret = GfxInfoBase::GetFeatureStatusImpl(
+ aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId,
&os);
+
+ // Probe VA-API/V4L2 on supported devices only
+ if (aFeature == nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING) {
+ if (!StaticPrefs::media_hardware_video_decoding_enabled_AtStartup()) {
+ return ret;
+ }
+- bool probeHWDecode = false;
+-#ifdef MOZ_WAYLAND
+- probeHWDecode =
++ bool probeHWDecode =
+ mIsAccelerated &&
+ (*aStatus == nsIGfxInfo::FEATURE_STATUS_OK ||
+
StaticPrefs::media_hardware_video_decoding_force_enabled_AtStartup() ||
+ StaticPrefs::media_ffmpeg_vaapi_enabled_AtStartup());
+-#endif
+ if (probeHWDecode) {
+ GetDataVAAPI();
+ GetDataV4L2();
+ } else {
+ mIsVAAPISupported = Some(false);
+ mIsV4L2Supported = Some(false);
+ }
+ if (!mIsVAAPISupported.value() && !mIsV4L2Supported.value()) {
+
diff --git
a/http/firefox/patches/0039-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch

b/http/firefox/patches/0039-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
new file mode 100644
index 0000000..4a61c39
--- /dev/null
+++
b/http/firefox/patches/0039-bmo-1839615-configure-libva-logging-according-to-platform-decoder.patch
@@ -0,0 +1,105 @@
+
+# HG changeset patch
+# User stransky <stransky AT redhat.com>
+# Date 1690834111 0
+# Node ID dd8ef46f522442182dcefcf0b8e1baa1a56d2cd0
+# Parent ed02af11f3cf62eb5935caa7bc132274c8a2cb5e
+Bug 1839615 [Linux] Configure libva logging according to platform decoder
log r=alwu
+
+Differential Revision: https://phabricator.services.mozilla.com/D184948
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+@@ -264,16 +264,27 @@ bool FFmpegVideoDecoder<LIBAV_VER>::Crea
+ return false;
+ }
+
+ mCodecContext->hw_device_ctx = mLib->av_buffer_ref(mVAAPIDeviceContext);
+ releaseVAAPIcontext.release();
+ return true;
+ }
+
++void FFmpegVideoDecoder<LIBAV_VER>::AdjustHWDecodeLogging() {
++ if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) {
++ mLib->av_log_set_level(AV_LOG_DEBUG);
++ setenv("LIBVA_MESSAGING_LEVEL", "1", false);
++ } else if (MOZ_LOG_TEST(sPDMLog, LogLevel::Info)) {
++ setenv("LIBVA_MESSAGING_LEVEL", "2", false);
++ } else {
++ setenv("LIBVA_MESSAGING_LEVEL", "0", false);
++ }
++}
++
+ MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitVAAPIDecoder() {
+ FFMPEG_LOG("Initialising VA-API FFmpeg decoder");
+
+ StaticMutexAutoLock mon(sMutex);
+
+ // mAcceleratedFormats is already configured so check supported
+ // formats before we do anything.
+ if (mAcceleratedFormats.Length()) {
+@@ -340,19 +351,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ mAcceleratedFormats = GetAcceleratedFormats();
+ if (!IsFormatAccelerated(mCodecID)) {
+ FFMPEG_LOG(" Format %s is not accelerated",
+ mLib->avcodec_get_name(mCodecID));
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+ }
+
+- if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) {
+- mLib->av_log_set_level(AV_LOG_DEBUG);
+- }
++ AdjustHWDecodeLogging();
+
+ FFMPEG_LOG(" VA-API FFmpeg init successful");
+ releaseVAAPIdecoder.release();
+ return NS_OK;
+ }
+
+ MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitV4L2Decoder() {
+ FFMPEG_LOG("Initialising V4L2-DRM FFmpeg decoder");
+@@ -420,19 +429,17 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
+ if (mAcceleratedFormats.IsEmpty()) {
+ // FFmpeg does not correctly report that the V4L2 wrapper decoders are
+ // hardware accelerated, but we know they always are. If we've gotten
+ // this far then we know this codec has a V4L2 wrapper decoder and so is
+ // accelerateed.
+ mAcceleratedFormats.AppendElement(mCodecID);
+ }
+
+- if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) {
+- mLib->av_log_set_level(AV_LOG_DEBUG);
+- }
++ AdjustHWDecodeLogging();
+
+ FFMPEG_LOG(" V4L2 FFmpeg init successful");
+ mUsingV4L2 = true;
+ releaseDecoder.release();
+ return NS_OK;
+ }
+ #endif
+
+diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h
+@@ -135,16 +135,17 @@ class FFmpegVideoDecoder<LIBAV_VER>
+ AVCodecID aCodecID, AVVAAPIHWConfig* hwconfig);
+ nsTArray<AVCodecID> GetAcceleratedFormats();
+ bool IsFormatAccelerated(AVCodecID aCodecID) const;
+
+ MediaResult CreateImageVAAPI(int64_t aOffset, int64_t aPts, int64_t
aDuration,
+ MediaDataDecoder::DecodedData& aResults);
+ MediaResult CreateImageV4L2(int64_t aOffset, int64_t aPts, int64_t
aDuration,
+ MediaDataDecoder::DecodedData& aResults);
++ void AdjustHWDecodeLogging();
+ #endif
+
+ #ifdef MOZ_WAYLAND_USE_HWDECODE
+ AVBufferRef* mVAAPIDeviceContext;
+ bool mUsingV4L2;
+ bool mEnableHardwareDecoding;
+ VADisplay mDisplay;
+ UniquePtr<VideoFramePool<LIBAV_VER>> mVideoFramePool;
+



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (175488a6f00bef03dcbe2999e9f4a56a2b308b90), Pavel Vinogradov, 08/17/2023

Archive powered by MHonArc 2.6.24.

Top of Page