pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/x11/qt5-qtwebengine
Module Name: pkgsrc
Committed By: markd
Date: Sun Feb 23 18:59:28 UTC 2025
Modified Files:
pkgsrc/x11/qt5-qtwebengine: Makefile distinfo
pkgsrc/x11/qt5-qtwebengine/patches:
patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc
patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc
patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc
patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc
Added Files:
pkgsrc/x11/qt5-qtwebengine/patches:
patch-src_3rdparty_chromium_media_cdm_library__cdm_clear__key__cdm_ffmpeg__cdm__audio__decoder.cc
patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.cc
patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__regression__tests.cc
patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter.cc
patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter__unittest.cc
patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.h
Log Message:
qt5-qtwebengine: support ffmpeg7 - from ArchLinux
To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 pkgsrc/x11/qt5-qtwebengine/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/x11/qt5-qtwebengine/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_cdm_library__cdm_clear__key__cdm_ffmpeg__cdm__audio__decoder.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__regression__tests.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter__unittest.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.h
cvs rdiff -u -r1.1 -r1.2 \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc \
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/x11/qt5-qtwebengine/Makefile
diff -u pkgsrc/x11/qt5-qtwebengine/Makefile:1.83 pkgsrc/x11/qt5-qtwebengine/Makefile:1.84
--- pkgsrc/x11/qt5-qtwebengine/Makefile:1.83 Sun Feb 23 18:50:08 2025
+++ pkgsrc/x11/qt5-qtwebengine/Makefile Sun Feb 23 18:59:28 2025
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.83 2025/02/23 18:50:08 markd Exp $
+# $NetBSD: Makefile,v 1.84 2025/02/23 18:59:28 markd Exp $
# FIXME: build fails when protobuf and abseil packages are installed.
DISTNAME= qtwebengine-everywhere-opensource-src-${QTVERSION}
PKGNAME= qt5-qtwebengine-${QTVERSION}
-PKGREVISION= 2
+PKGREVISION= 3
COMMENT= Chromium-based web engine for Qt5
MAKE_ENV+= QTDIR=${QTDIR}
@@ -102,7 +102,7 @@ MAKE_ENV+= OSX_VERSION=${OSX_VERSION}
PYTHON_FOR_BUILD_ONLY= tool
.include "../../lang/python/batteries-included.mk"
.include "../../lang/python/tool.mk"
-.include "../../multimedia/ffmpeg5/buildlink3.mk"
+.include "../../multimedia/ffmpeg7/buildlink3.mk"
.include "../../multimedia/libvpx/buildlink3.mk"
.include "../../print/libcups/buildlink3.mk"
.include "../../print/poppler-cpp/buildlink3.mk"
Index: pkgsrc/x11/qt5-qtwebengine/distinfo
diff -u pkgsrc/x11/qt5-qtwebengine/distinfo:1.28 pkgsrc/x11/qt5-qtwebengine/distinfo:1.29
--- pkgsrc/x11/qt5-qtwebengine/distinfo:1.28 Tue Nov 19 22:46:14 2024
+++ pkgsrc/x11/qt5-qtwebengine/distinfo Sun Feb 23 18:59:28 2025
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.28 2024/11/19 22:46:14 adam Exp $
+$NetBSD: distinfo,v 1.29 2025/02/23 18:59:28 markd Exp $
BLAKE2s (qtwebengine-everywhere-opensource-src-5.15.16.tar.xz) = b64cfef3ee62226cbdfb22e3c584075aef0689cbb7aabe62f5de5bd545158985
SHA512 (qtwebengine-everywhere-opensource-src-5.15.16.tar.xz) = 6bfa7aba34cd5537e6a9e69f03504da1414625315565f053c1ce1fa2875f9b327b5a73e7e9bc8f69c706732f8917ecb6c88bc958ddd4e5848c225b4129cda404
@@ -398,12 +398,18 @@ SHA1 (patch-src_3rdparty_chromium_media_
SHA1 (patch-src_3rdparty_chromium_media_capture_video_video__capture__device__client.cc) = b6aeb47b19207e1ed5acea98f48b542ebb9e8a90
SHA1 (patch-src_3rdparty_chromium_media_cast_BUILD.gn) = 7bc23c70873b33a0448d21e9d6cbdb1c10f50e3b
SHA1 (patch-src_3rdparty_chromium_media_cdm_library__cdm_cdm__paths.gni) = e31702cd5c0683995223ff31e160349653a18089
+SHA1 (patch-src_3rdparty_chromium_media_cdm_library__cdm_clear__key__cdm_ffmpeg__cdm__audio__decoder.cc) = fddf34415fa00deec8762969c3bf74235c65c2ef
+SHA1 (patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.cc) = 3a779690ee5df5b6bbb3338e97b7f70525261869
SHA1 (patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.h) = 4b1c536d5dea0372495b5d489eee99e8d9a80997
-SHA1 (patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc) = b82c03c7c47dec2635d504defe66dbaeb9fa73e8
-SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc) = 0565703006b19a4cf18ac4ae90cbc9056fcab985
+SHA1 (patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__regression__tests.cc) = 92456d36e96bdd44f01daba703f0f3dca5a0879b
+SHA1 (patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc) = b2d9f3a12e5fd6ced30f95bb10e9347bbadffc05
+SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter.cc) = 42e602d77cc258c95c4b6fe07fe99d6d4ef7062b
+SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter__unittest.cc) = 3bbd1172d2997b6e7ffad9a05b33a7b1abeeed3a
+SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc) = fe47384ad15ce2e9f36c263d85f6584be1102823
SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__demuxer.cc) = 8e6d4d820422b9c7485aa78ca0b1b79dd17e8be5
SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__glue.cc) = 54070c3ffdc17760771d2ed14634260316fb561f
-SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc) = 1dd6826b2688dabeefc2df1e3453c9d5dccfcdd8
+SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc) = 96a18e1842fa0cf6fe3070f33a6bd5381e52b993
+SHA1 (patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.h) = c5f3070a307f2819062c437dea4ccf750d6fa149
SHA1 (patch-src_3rdparty_chromium_media_filters_media__file__checker.cc) = d11695a3fc7ac17c6312f78217742aa897dfe95b
SHA1 (patch-src_3rdparty_chromium_media_filters_vp9__parser.h) = 2be757561e22dd701e6a54d39c0749f7208c1203
SHA1 (patch-src_3rdparty_chromium_media_gpu_buffer__validation.cc) = 722d0ef90c6373d78b42fa14077fb14118c96e4b
@@ -779,7 +785,7 @@ SHA1 (patch-src_3rdparty_chromium_third_
SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_modules_include_module__common__types__public.h) = b6f32d281d6e605568472d88d2d974e74c0178b1
SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_modules_rtp__rtcp_source_forward__error__correction.cc) = a3adc166fbb005dd9030be0458c514bcd49c725e
SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_modules_video__capture_BUILD.gn) = ae808be5a1aff1c990ab2c5de876e5b422193dd5
-SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc) = 6249c1c0162a23bc7a24f2be5154c7ca5bbd780f
+SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc) = 8b37b5e1226a8d6776f449c685d6aaf94038a37d
SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_BUILD.gn) = 81639ce5decddaf57e07a000c6d71d3b40ac494c
SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_ifaddrs__converter.h) = 8d58afd2f8f932b302950cc5e36336afc34f076a
SHA1 (patch-src_3rdparty_chromium_third__party_webrtc_rtc__base_ip__address.cc) = 9f0559d1f02a2c59b2e3ff5f9e9722d401770a35
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc
diff -u pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc:1.1
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc:1.2
--- pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc:1.1 Thu Jun 8 20:38:06 2023
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc Sun Feb 23 18:59:28 2025
@@ -1,8 +1,9 @@
-$NetBSD: patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc,v 1.1 2023/06/08 20:38:06 markd Exp $
+$NetBSD: patch-src_3rdparty_chromium_media_filters_audio__file__reader.cc,v 1.2 2025/02/23 18:59:28 markd Exp $
build with ffmpeg5 - from archlinux
+also ffmeg7 - from ArchLinux
---- src/3rdparty/chromium/media/filters/audio_file_reader.cc.orig 2022-03-30 09:48:18.000000000 +0000
+--- src/3rdparty/chromium/media/filters/audio_file_reader.cc.orig 2023-11-09 12:02:51.000000000 +0000
+++ src/3rdparty/chromium/media/filters/audio_file_reader.cc
@@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() {
}
@@ -13,3 +14,44 @@ build with ffmpeg5 - from archlinux
if (codec) {
// MP3 decodes to S16P which we don't support, tell it to use S16 instead.
if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P)
+@@ -112,14 +112,15 @@ bool AudioFileReader::OpenDecoder() {
+
+ // Verify the channel layout is supported by Chrome. Acts as a sanity check
+ // against invalid files. See http://crbug.com/171962
+- if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout,
+- codec_context_->channels) ==
++ if (ChannelLayoutToChromeChannelLayout(
++ codec_context_->ch_layout.u.mask,
++ codec_context_->ch_layout.nb_channels) ==
+ CHANNEL_LAYOUT_UNSUPPORTED) {
+ return false;
+ }
+
+ // Store initial values to guard against midstream configuration changes.
+- channels_ = codec_context_->channels;
++ channels_ = codec_context_->ch_layout.nb_channels;
+ audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id);
+ sample_rate_ = codec_context_->sample_rate;
+ av_sample_format_ = codec_context_->sample_fmt;
+@@ -222,7 +223,7 @@ bool AudioFileReader::OnNewFrame(
+ if (frames_read < 0)
+ return false;
+
+- const int channels = frame->channels;
++ const int channels = frame->ch_layout.nb_channels;
+ if (frame->sample_rate != sample_rate_ || channels != channels_ ||
+ frame->format != av_sample_format_) {
+ DLOG(ERROR) << "Unsupported midstream configuration change!"
+@@ -241,10 +242,10 @@ bool AudioFileReader::OnNewFrame(
+ // silence from being output. In the case where we are also discarding some
+ // portion of the packet (as indicated by a negative pts), we further want to
+ // adjust the duration downward by however much exists before zero.
+- if (audio_codec_ == kCodecAAC && frame->pkt_duration) {
++ if (audio_codec_ == kCodecAAC && frame->duration) {
+ const base::TimeDelta pkt_duration = ConvertFromTimeBase(
+ glue_->format_context()->streams[stream_index_]->time_base,
+- frame->pkt_duration + std::min(static_cast<int64_t>(0), frame->pts));
++ frame->duration + std::min(static_cast<int64_t>(0), frame->pts));
+ const base::TimeDelta frame_duration = base::TimeDelta::FromSecondsD(
+ frames_read / static_cast<double>(sample_rate_));
+
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc
diff -u pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc:1.1
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc:1.2
--- pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc:1.1 Thu Jun 8 20:38:06 2023
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc Sun Feb 23 18:59:28 2025
@@ -1,9 +1,28 @@
-$NetBSD: patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc,v 1.1 2023/06/08 20:38:06 markd Exp $
+$NetBSD: patch-src_3rdparty_chromium_media_filters_ffmpeg__audio__decoder.cc,v 1.2 2025/02/23 18:59:28 markd Exp $
build with ffmpeg5 - from archlinux
+and with ffmpeg7 - from ArchLinux
---- src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc.orig 2022-03-30 09:48:18.000000000 +0000
+--- src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc.orig 2023-11-09 12:02:51.000000000 +0000
+++ src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc
+@@ -27,7 +27,7 @@ namespace media {
+
+ // Return the number of channels from the data in |frame|.
+ static inline int DetermineChannels(AVFrame* frame) {
+- return frame->channels;
++ return frame->ch_layout.nb_channels;
+ }
+
+ // Called by FFmpeg's allocation routine to allocate a buffer. Uses
+@@ -227,7 +227,7 @@ bool FFmpegAudioDecoder::OnNewFrame(cons
+ // Translate unsupported into discrete layouts for discrete configurations;
+ // ffmpeg does not have a labeled discrete configuration internally.
+ ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout(
+- codec_context_->channel_layout, codec_context_->channels);
++ codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels);
+ if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED &&
+ config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) {
+ channel_layout = CHANNEL_LAYOUT_DISCRETE;
@@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecode
}
}
@@ -13,3 +32,36 @@ build with ffmpeg5 - from archlinux
if (!codec ||
avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) {
DLOG(ERROR) << "Could not initialize audio decoder: "
+@@ -344,11 +344,11 @@ bool FFmpegAudioDecoder::ConfigureDecode
+ // Success!
+ av_sample_format_ = codec_context_->sample_fmt;
+
+- if (codec_context_->channels != config.channels()) {
++ if (codec_context_->ch_layout.nb_channels != config.channels()) {
+ MEDIA_LOG(ERROR, media_log_)
+ << "Audio configuration specified " << config.channels()
+ << " channels, but FFmpeg thinks the file contains "
+- << codec_context_->channels << " channels";
++ << codec_context_->ch_layout.nb_channels << " channels";
+ ReleaseFFmpegResources();
+ state_ = kUninitialized;
+ return false;
+@@ -398,7 +398,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(s
+ if (frame->nb_samples <= 0)
+ return AVERROR(EINVAL);
+
+- if (s->channels != channels) {
++ if (s->ch_layout.nb_channels != channels) {
+ DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count.";
+ return AVERROR(EINVAL);
+ }
+@@ -431,7 +431,8 @@ int FFmpegAudioDecoder::GetAudioBuffer(s
+ ChannelLayout channel_layout =
+ config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE
+ ? CHANNEL_LAYOUT_DISCRETE
+- : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels);
++ : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask,
++ s->ch_layout.nb_channels);
+
+ if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) {
+ DLOG(ERROR) << "Unsupported channel layout.";
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc
diff -u pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc:1.1
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc:1.2
--- pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc:1.1 Thu Jun 8 20:38:06 2023
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc Sun Feb 23 18:59:28 2025
@@ -1,10 +1,64 @@
-$NetBSD: patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc,v 1.1 2023/06/08 20:38:06 markd Exp $
+$NetBSD: patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.cc,v 1.2 2025/02/23 18:59:28 markd Exp $
build with ffmpeg5 from archlinux
+also ffmpeg7 - from ArchLinux
---- src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc.orig 2022-03-30 09:48:18.000000000 +0000
+--- src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc.orig 2023-11-09 12:02:51.000000000 +0000
+++ src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc
-@@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecode
+@@ -86,7 +86,7 @@ bool FFmpegVideoDecoder::IsCodecSupporte
+ }
+
+ FFmpegVideoDecoder::FFmpegVideoDecoder(MediaLog* media_log)
+- : media_log_(media_log), state_(kUninitialized), decode_nalus_(false) {
++ : media_log_(media_log), state_(kUninitialized), decode_nalus_(false), timestamp_map_(128) {
+ DVLOG(1) << __func__;
+ thread_checker_.DetachFromThread();
+ }
+@@ -183,7 +183,6 @@ int FFmpegVideoDecoder::GetVideoBuffer(s
+ frame->width = coded_size.width();
+ frame->height = coded_size.height();
+ frame->format = codec_context->pix_fmt;
+- frame->reordered_opaque = codec_context->reordered_opaque;
+
+ // Now create an AVBufferRef for the data just allocated. It will own the
+ // reference to the VideoFrame object.
+@@ -318,8 +317,10 @@ bool FFmpegVideoDecoder::FFmpegDecode(co
+ DCHECK(packet.data);
+ DCHECK_GT(packet.size, 0);
+
+- // Let FFmpeg handle presentation timestamp reordering.
+- codec_context_->reordered_opaque = buffer.timestamp().InMicroseconds();
++ const int64_t timestamp = buffer.timestamp().InMicroseconds();
++ const TimestampId timestamp_id = timestamp_id_generator_.GenerateNextId();
++ timestamp_map_.Put(timestamp_id, timestamp);
++ packet.opaque = reinterpret_cast<void*>(timestamp_id.GetUnsafeValue());
+ }
+
+ switch (decoding_loop_->DecodePacket(
+@@ -358,8 +359,13 @@ bool FFmpegVideoDecoder::OnNewFrame(AVFr
+
+ scoped_refptr<VideoFrame> video_frame =
+ reinterpret_cast<VideoFrame*>(av_buffer_get_opaque(frame->buf[0]));
++ const auto ts_id = TimestampId(reinterpret_cast<size_t>(frame->opaque));
++ const auto ts_lookup = timestamp_map_.Get(ts_id);
++ if (ts_lookup == timestamp_map_.end()) {
++ return false;
++ }
+ video_frame->set_timestamp(
+- base::TimeDelta::FromMicroseconds(frame->reordered_opaque));
++ base::TimeDelta::FromMicroseconds(std::get<1>(*ts_lookup)));
+ video_frame->metadata()->power_efficient = false;
+ output_cb_.Run(video_frame);
+ return true;
+@@ -385,13 +391,15 @@ bool FFmpegVideoDecoder::ConfigureDecode
+ codec_context_->thread_count = GetFFmpegVideoDecoderThreadCount(config);
+ codec_context_->thread_type =
+ FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME);
++
+ codec_context_->opaque = this;
+ codec_context_->get_buffer2 = GetVideoBufferImpl;
++ codec_context_->flags |= AV_CODEC_FLAG_COPY_OPAQUE;
+
if (decode_nalus_)
codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc
diff -u pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc:1.1
pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc:1.2
--- pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc:1.1 Thu Jun 8 20:38:06 2023
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc Sun Feb 23 18:59:28 2025
@@ -1,10 +1,19 @@
-$NetBSD: patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc,v 1.1 2023/06/08 20:38:06 markd Exp $
+$NetBSD: patch-src_3rdparty_chromium_third__party_webrtc_modules_video__coding_codecs_h264_h264__decoder__impl.cc,v 1.2 2025/02/23 18:59:28 markd Exp $
build with ffmpeg5 from archlinux
+and ffmpeg7 from ArchLinux
---- src/3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc.orig 2022-03-30 09:48:18.000000000 +0000
+--- src/3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc.orig 2023-11-09 12:02:51.000000000 +0000
+++ src/3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
-@@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(cons
+@@ -114,7 +114,6 @@ int H264DecoderImpl::AVGetBuffer2(AVCode
+ int total_size = y_size + 2 * uv_size;
+
+ av_frame->format = context->pix_fmt;
+- av_frame->reordered_opaque = context->reordered_opaque;
+
+ // Set |av_frame| members as required by FFmpeg.
+ av_frame->data[kYPlaneIndex] = frame_buffer->MutableDataY();
+@@ -203,7 +202,7 @@ int32_t H264DecoderImpl::InitDecode(cons
// a pointer |this|.
av_context_->opaque = this;
@@ -13,3 +22,23 @@ build with ffmpeg5 from archlinux
if (!codec) {
// This is an indication that FFmpeg has not been initialized or it has not
// been compiled/initialized with the correct set of codecs.
+@@ -273,8 +272,6 @@ int32_t H264DecoderImpl::Decode(const En
+ return WEBRTC_VIDEO_CODEC_ERROR;
+ }
+ packet.size = static_cast<int>(input_image.size());
+- int64_t frame_timestamp_us = input_image.ntp_time_ms_ * 1000; // ms -> μs
+- av_context_->reordered_opaque = frame_timestamp_us;
+
+ int result = avcodec_send_packet(av_context_.get(), &packet);
+ if (result < 0) {
+@@ -290,10 +287,6 @@ int32_t H264DecoderImpl::Decode(const En
+ return WEBRTC_VIDEO_CODEC_ERROR;
+ }
+
+- // We don't expect reordering. Decoded frame tamestamp should match
+- // the input one.
+- RTC_DCHECK_EQ(av_frame_->reordered_opaque, frame_timestamp_us);
+-
+ absl::optional<uint8_t> qp;
+ // TODO(sakal): Maybe it is possible to get QP directly from FFmpeg.
+ h264_bitstream_parser_.ParseBitstream(input_image.data(), input_image.size());
Added files:
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_cdm_library__cdm_clear__key__cdm_ffmpeg__cdm__audio__decoder.cc
diff -u /dev/null pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_cdm_library__cdm_clear__key__cdm_ffmpeg__cdm__audio__decoder.cc:1.1
--- /dev/null Sun Feb 23 18:59:28 2025
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_cdm_library__cdm_clear__key__cdm_ffmpeg__cdm__audio__decoder.cc Sun Feb 23 18:59:28 2025
@@ -0,0 +1,74 @@
+$NetBSD: patch-src_3rdparty_chromium_media_cdm_library__cdm_clear__key__cdm_ffmpeg__cdm__audio__decoder.cc,v 1.1 2025/02/23 18:59:28 markd Exp $
+
+support ffmpeg7 - from ArchLinux
+
+--- src/3rdparty/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc.orig 2023-11-09 12:02:51.000000000 +0000
++++ src/3rdparty/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc
+@@ -73,7 +73,7 @@ void CdmAudioDecoderConfigToAVCodecConte
+ codec_context->sample_fmt = AV_SAMPLE_FMT_NONE;
+ }
+
+- codec_context->channels = config.channel_count;
++ codec_context->ch_layout.nb_channels = config.channel_count;
+ codec_context->sample_rate = config.samples_per_second;
+
+ if (config.extra_data) {
+@@ -123,8 +123,8 @@ void CopySamples(cdm::AudioFormat cdm_fo
+ case cdm::kAudioFormatPlanarS16:
+ case cdm::kAudioFormatPlanarF32: {
+ const int decoded_size_per_channel =
+- decoded_audio_size / av_frame.channels;
+- for (int i = 0; i < av_frame.channels; ++i) {
++ decoded_audio_size / av_frame.ch_layout.nb_channels;
++ for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) {
+ memcpy(output_buffer, av_frame.extended_data[i],
+ decoded_size_per_channel);
+ output_buffer += decoded_size_per_channel;
+@@ -184,13 +184,14 @@ bool FFmpegCdmAudioDecoder::Initialize(
+ // Success!
+ decoding_loop_.reset(new FFmpegDecodingLoop(codec_context_.get()));
+ samples_per_second_ = config.samples_per_second;
+- bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8;
++ bytes_per_frame_ =
++ codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8;
+ output_timestamp_helper_.reset(
+ new AudioTimestampHelper(config.samples_per_second));
+ is_initialized_ = true;
+
+ // Store initial values to guard against midstream configuration changes.
+- channels_ = codec_context_->channels;
++ channels_ = codec_context_->ch_layout.nb_channels;
+ av_sample_format_ = codec_context_->sample_fmt;
+
+ return true;
+@@ -290,17 +291,18 @@ cdm::Status FFmpegCdmAudioDecoder::Decod
+ for (auto& frame : audio_frames) {
+ int decoded_audio_size = 0;
+ if (frame->sample_rate != samples_per_second_ ||
+- frame->channels != channels_ || frame->format != av_sample_format_) {
++ frame->ch_layout.nb_channels != channels_ ||
++ frame->format != av_sample_format_) {
+ DLOG(ERROR) << "Unsupported midstream configuration change!"
+ << " Sample Rate: " << frame->sample_rate << " vs "
+- << samples_per_second_ << ", Channels: " << frame->channels
++ << samples_per_second_ << ", Channels: " << frame->ch_layout.nb_channels
+ << " vs " << channels_ << ", Sample Format: " << frame->format
+ << " vs " << av_sample_format_;
+ return cdm::kDecodeError;
+ }
+
+ decoded_audio_size = av_samples_get_buffer_size(
+- nullptr, codec_context_->channels, frame->nb_samples,
++ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples,
+ codec_context_->sample_fmt, 1);
+ if (!decoded_audio_size)
+ continue;
+@@ -319,7 +321,7 @@ bool FFmpegCdmAudioDecoder::OnNewFrame(
+ size_t* total_size,
+ std::vector<std::unique_ptr<AVFrame, ScopedPtrAVFreeFrame>>* audio_frames,
+ AVFrame* frame) {
+- *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels,
++ *total_size += av_samples_get_buffer_size(nullptr, codec_context_->ch_layout.nb_channels,
+ frame->nb_samples,
+ codec_context_->sample_fmt, 1);
+ audio_frames->emplace_back(av_frame_clone(frame));
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.cc
diff -u /dev/null pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.cc:1.1
--- /dev/null Sun Feb 23 18:59:28 2025
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.cc Sun Feb 23 18:59:28 2025
@@ -0,0 +1,50 @@
+$NetBSD: patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__common.cc,v 1.1 2025/02/23 18:59:28 markd Exp $
+
+fix for ffmpeg7 - from ArchLinux
+
+--- src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc.orig 2023-11-09 12:02:51.000000000 +0000
++++ src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
+@@ -341,10 +341,11 @@ bool AVCodecContextToAudioDecoderConfig(
+ codec_context->sample_fmt, codec_context->codec_id);
+
+ ChannelLayout channel_layout =
+- codec_context->channels > 8
++ codec_context->ch_layout.nb_channels > 8
+ ? CHANNEL_LAYOUT_DISCRETE
+- : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout,
+- codec_context->channels);
++ : ChannelLayoutToChromeChannelLayout(
++ codec_context->ch_layout.u.mask,
++ codec_context->ch_layout.nb_channels);
+
+ int sample_rate = codec_context->sample_rate;
+ switch (codec) {
+@@ -397,7 +398,7 @@ bool AVCodecContextToAudioDecoderConfig(
+ extra_data, encryption_scheme, seek_preroll,
+ codec_context->delay);
+ if (channel_layout == CHANNEL_LAYOUT_DISCRETE)
+- config->SetChannelsForDiscrete(codec_context->channels);
++ config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels);
+
+ #if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO)
+ // These are bitstream formats unknown to ffmpeg, so they don't have
+@@ -413,7 +414,9 @@ bool AVCodecContextToAudioDecoderConfig(
+ #if BUILDFLAG(USE_PROPRIETARY_CODECS)
+ // TODO(dalecurtis): Just use the profile from the codec context if ffmpeg
+ // ever starts supporting xHE-AAC.
+- if (codec == kCodecAAC && codec_context->profile == FF_PROFILE_UNKNOWN) {
++ constexpr uint8_t kXHEAAc = 41;
++ if (codec == kCodecAAC && codec_context->profile == FF_PROFILE_UNKNOWN ||
++ codec_context->profile == kXHEAAc) {
+ // Errors aren't fatal here, so just drop any MediaLog messages.
+ NullMediaLog media_log;
+ mp4::AAC aac_parser;
+@@ -462,7 +465,7 @@ void AudioDecoderConfigToAVCodecContext(
+
+ // TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses
+ // said information to decode.
+- codec_context->channels = config.channels();
++ codec_context->ch_layout.nb_channels = config.channels();
+ codec_context->sample_rate = config.samples_per_second();
+
+ if (config.extra_data().empty()) {
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__regression__tests.cc
diff -u /dev/null pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__regression__tests.cc:1.1
--- /dev/null Sun Feb 23 18:59:28 2025
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__regression__tests.cc Sun Feb 23 18:59:28 2025
@@ -0,0 +1,51 @@
+$NetBSD: patch-src_3rdparty_chromium_media_ffmpeg_ffmpeg__regression__tests.cc,v 1.1 2025/02/23 18:59:28 markd Exp $
+
+fix for ffmpeg7 - from ArchLinux
+
+--- src/3rdparty/chromium/media/ffmpeg/ffmpeg_regression_tests.cc.orig 2023-11-09 12:02:51.000000000 +0000
++++ src/3rdparty/chromium/media/ffmpeg/ffmpeg_regression_tests.cc
+@@ -86,16 +86,16 @@ FFMPEG_TEST_CASE(Cr47761, "crbug47761.og
+ FFMPEG_TEST_CASE(Cr50045, "crbug50045.mp4", PIPELINE_OK, PIPELINE_OK);
+ FFMPEG_TEST_CASE(Cr62127, "crbug62127.webm", PIPELINE_OK, PIPELINE_OK);
+ FFMPEG_TEST_CASE(Cr93620, "security/93620.ogg", PIPELINE_OK, PIPELINE_OK);
+-FFMPEG_TEST_CASE(Cr100492,
+- "security/100492.webm",
+- DECODER_ERROR_NOT_SUPPORTED,
+- DECODER_ERROR_NOT_SUPPORTED);
++FFMPEG_TEST_CASE(Cr100492, "security/100492.webm", PIPELINE_OK, PIPELINE_OK);
+ FFMPEG_TEST_CASE(Cr100543, "security/100543.webm", PIPELINE_OK, PIPELINE_OK);
+ FFMPEG_TEST_CASE(Cr101458,
+ "security/101458.webm",
+ PIPELINE_ERROR_DECODE,
+ PIPELINE_ERROR_DECODE);
+-FFMPEG_TEST_CASE(Cr108416, "security/108416.webm", PIPELINE_OK, PIPELINE_OK);
++FFMPEG_TEST_CASE(Cr108416,
++ "security/108416.webm",
++ PIPELINE_ERROR_DECODE,
++ PIPELINE_ERROR_DECODE);
+ FFMPEG_TEST_CASE(Cr110849,
+ "security/110849.mkv",
+ DEMUXER_ERROR_COULD_NOT_OPEN,
+@@ -150,7 +150,10 @@ FFMPEG_TEST_CASE(Cr234630b,
+ "security/234630b.mov",
+ DEMUXER_ERROR_NO_SUPPORTED_STREAMS,
+ DEMUXER_ERROR_NO_SUPPORTED_STREAMS);
+-FFMPEG_TEST_CASE(Cr242786, "security/242786.webm", PIPELINE_OK, PIPELINE_OK);
++FFMPEG_TEST_CASE(Cr242786,
++ "security/242786.webm",
++ PIPELINE_OK,
++ PIPELINE_ERROR_DECODE);
+ // Test for out-of-bounds access with slightly corrupt file (detection logic
+ // thinks it's a MONO file, but actually contains STEREO audio).
+ FFMPEG_TEST_CASE(Cr275590,
+@@ -371,8 +374,8 @@ FFMPEG_TEST_CASE(WEBM_2,
+ DEMUXER_ERROR_NO_SUPPORTED_STREAMS);
+ FFMPEG_TEST_CASE(WEBM_4,
+ "security/out.webm.68798.1929",
+- DECODER_ERROR_NOT_SUPPORTED,
+- DECODER_ERROR_NOT_SUPPORTED);
++ PIPELINE_OK,
++ PIPELINE_OK);
+ FFMPEG_TEST_CASE(WEBM_5, "frame_size_change.webm", PIPELINE_OK, PIPELINE_OK);
+
+ // General MKV test cases.
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter.cc
diff -u /dev/null pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter.cc:1.1
--- /dev/null Sun Feb 23 18:59:28 2025
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter.cc Sun Feb 23 18:59:28 2025
@@ -0,0 +1,33 @@
+$NetBSD: patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter.cc,v 1.1 2025/02/23 18:59:28 markd Exp $
+
+build with ffmpeg7 - from ArchLinux
+
+--- src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter.cc.orig 2023-11-09 12:02:51.000000000 +0000
++++ src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter.cc
+@@ -195,14 +195,15 @@ bool FFmpegAACBitstreamConverter::Conver
+ if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id ||
+ audio_profile_ != stream_codec_parameters_->profile ||
+ sample_rate_index_ != sample_rate_index ||
+- channel_configuration_ != stream_codec_parameters_->channels ||
++ channel_configuration_ !=
++ stream_codec_parameters_->ch_layout.nb_channels ||
+ frame_length_ != header_plus_packet_size) {
+ header_generated_ =
+ GenerateAdtsHeader(stream_codec_parameters_->codec_id,
+ 0, // layer
+ stream_codec_parameters_->profile, sample_rate_index,
+ 0, // private stream
+- stream_codec_parameters_->channels,
++ stream_codec_parameters_->ch_layout.nb_channels,
+ 0, // originality
+ 0, // home
+ 0, // copyrighted_stream
+@@ -214,7 +215,7 @@ bool FFmpegAACBitstreamConverter::Conver
+ codec_ = stream_codec_parameters_->codec_id;
+ audio_profile_ = stream_codec_parameters_->profile;
+ sample_rate_index_ = sample_rate_index;
+- channel_configuration_ = stream_codec_parameters_->channels;
++ channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels;
+ frame_length_ = header_plus_packet_size;
+ }
+
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter__unittest.cc
diff -u /dev/null pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter__unittest.cc:1.1
--- /dev/null Sun Feb 23 18:59:28 2025
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter__unittest.cc Sun Feb 23 18:59:28 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_3rdparty_chromium_media_filters_ffmpeg__aac__bitstream__converter__unittest.cc,v 1.1 2025/02/23 18:59:28 markd Exp $
+
+build with ffmpeg7 - from ArchLinux
+
+--- src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc.orig 2023-11-09 12:02:51.000000000 +0000
++++ src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc
+@@ -29,7 +29,7 @@ class FFmpegAACBitstreamConverterTest :
+ memset(&test_parameters_, 0, sizeof(AVCodecParameters));
+ test_parameters_.codec_id = AV_CODEC_ID_AAC;
+ test_parameters_.profile = FF_PROFILE_AAC_MAIN;
+- test_parameters_.channels = 2;
++ test_parameters_.ch_layout.nb_channels = 2;
+ test_parameters_.extradata = extradata_header_;
+ test_parameters_.extradata_size = sizeof(extradata_header_);
+ }
Index: pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.h
diff -u /dev/null pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.h:1.1
--- /dev/null Sun Feb 23 18:59:28 2025
+++ pkgsrc/x11/qt5-qtwebengine/patches/patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.h Sun Feb 23 18:59:28 2025
@@ -0,0 +1,36 @@
+$NetBSD: patch-src_3rdparty_chromium_media_filters_ffmpeg__video__decoder.h,v 1.1 2025/02/23 18:59:28 markd Exp $
+
+fix for ffmpeg7 - from ArchLinux
+
+--- src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.h.orig 2023-11-09 12:02:51.000000000 +0000
++++ src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.h
+@@ -8,6 +8,8 @@
+ #include <list>
+ #include <memory>
+
++#include "base/containers/mru_cache.h"
++#include "base/util/type_safety/id_type.h"
+ #include "base/callback.h"
+ #include "base/macros.h"
+ #include "base/memory/ref_counted.h"
+@@ -85,6 +87,20 @@ class MEDIA_EXPORT FFmpegVideoDecoder :
+ // FFmpeg structures owned by this object.
+ std::unique_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_;
+
++ // The gist here is that timestamps need to be 64 bits to store microsecond
++ // precision. A 32 bit integer would overflow at ~35 minutes at this level of
++ // precision. We can't cast the timestamp to the void ptr object used by the
++ // opaque field in ffmpeg then, because it would lose data on a 32 bit build.
++ // However, we don't actually have 2^31 timestamped frames in a single
++ // playback, so it's fine to use the 32 bit value as a key in a map which
++ // contains the actual timestamps. Additionally, we've in the past set 128
++ // outstanding frames for re-ordering as a limit for cross-thread decoding
++ // tasks, so we'll do that here too with the LRU cache.
++ using TimestampId = util::IdType<int64_t, size_t, 0>;
++
++ TimestampId::Generator timestamp_id_generator_;
++ base::MRUCache<TimestampId, int64_t> timestamp_map_;
++
+ VideoDecoderConfig config_;
+
+ VideoFramePool frame_pool_;
Home |
Main Index |
Thread Index |
Old Index