From nobody Tue Apr 26 08:48:59 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1F12B199A948; Tue, 26 Apr 2022 08:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KnbCJ0JqMz3p7K; Tue, 26 Apr 2022 08:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650962940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HqbtM8GGzmb/l+NJlBlugeifCBoO2jim9NAjLMngALA=; b=Bricztnx2E1DVQtUODd8TdLV4bHamteTvYdjKEqCN1TVnkO2K4UBc1Tmsg7Nv+/WTBSzAZ G5P7PhYEBdZgCEnnx8Bov4+eZcWhDErdgtx6MfH12pczB7L/gtjA4k+j9NK4Gb483R6Y9R 0sTX10vJyVCw6OccCwMo7bRG+q5yQDMW5xZXOSg6yRGcZNZJDXx/5YkWrqulvodVhIqG/V mb2hxqiTjprU+TvNKul8sTmEassNH0HqvXKMm5TNUKCh1HWfTgTXgHeRfHE0s3Rp2zSfLT f9fR+OF1Xu873+3tzBPXEXYCePC19VXfVR/bE46R3nY/Bt/Pt4048qS0qQIY8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE9603F58; Tue, 26 Apr 2022 08:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23Q8mxSd022729; Tue, 26 Apr 2022 08:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23Q8mx2c022728; Tue, 26 Apr 2022 08:48:59 GMT (envelope-from git) Date: Tue, 26 Apr 2022 08:48:59 GMT Message-Id: <202204260848.23Q8mx2c022728@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: c4e707ffec2f - main - www/firefox: update to 100.0 (rc1) List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4e707ffec2f82836b79e7312da5a5228edbb6dd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650962940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HqbtM8GGzmb/l+NJlBlugeifCBoO2jim9NAjLMngALA=; b=eIyp64iU3p5QG1UQxTmbSFauKmu4RcO5nuLrOPU+K1WTPpfg2SHeqmOie8Pm/Y1ZXw0w8I o++v2NvunJzpkepS3cx9sNWp/GGyFi1t20ufrhuRKlrDnYduMZUtdIhzvbuhLli+tNH7Nm l4NnhgEUQ1l+JLwgqC+9t7buznT2cy1uYJdXgjo2hu2T0aDGjgdIuswDIt8gqzky/ePvFq nfKrOvGaJqgpP4Sontfb8ubevboQlN9oWGZSDuR271WJ/abP4+a6XCrEdDn+rbrHUscdIy ReCmVOlnm84XwGbAP8gVMzbLTgPUeoMc9OSv5lZ06YE4N2aq+Q/RAOMqN+DuEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650962940; a=rsa-sha256; cv=none; b=m/TPep7rO4Y02f9BeCuLQ4ihmDV42sXYhITY0igPYYa++Ar9iYF+1N/7NOCdLfUdMPqpM/ GjMTdPnK4O1/l+G0K9c1O42K7Vr0Th+KQYczeGiUWHgEe57AOeHLK9FVqsvQhQbzDcFs3h yIdKRZwPtPjvK6HomELehX2pwksQxBe14hDSWasAK0gO5n9OGySSXovpZzVmQK7raYmsTd tYxB7oyoxbd6vEK/fCSQcBHi0HatenhJWZ5RjzSqLpL/Kg+uS+bBmMwrvGJ0wHOHfmWYr3 9ec7q4klBzoCbe5DlpZ06z11eKsORJtW3o/Sfkfx7ORRV9ATSvhmKAbpN5JApg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=c4e707ffec2f82836b79e7312da5a5228edbb6dd commit c4e707ffec2f82836b79e7312da5a5228edbb6dd Author: Christoph Moench-Tegeder AuthorDate: 2022-04-26 08:48:18 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2022-04-26 08:48:18 +0000 www/firefox: update to 100.0 (rc1) Release Notes (soon): https://www.mozilla.org/en-US/firefox/100.0/releasenotes/ --- www/firefox/Makefile | 7 +- www/firefox/distinfo | 6 +- www/firefox/files/patch-bug1664115 | 24 +-- www/firefox/files/patch-bug1758610 | 365 ------------------------------------- 4 files changed, 18 insertions(+), 384 deletions(-) diff --git a/www/firefox/Makefile b/www/firefox/Makefile index debea780dcfa..fcbe0e76efe8 100644 --- a/www/firefox/Makefile +++ b/www/firefox/Makefile @@ -1,12 +1,11 @@ # Created by: Alan Eldridge PORTNAME= firefox -DISTVERSION= 99.0.1 -PORTREVISION= 2 +DISTVERSION= 100.0 PORTEPOCH= 2 CATEGORIES= www MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ - MOZILLA/${PORTNAME}/candidates/${DISTVERSION}${DISTVERSIONSUFFIX}-candidates/build2/source + MOZILLA/${PORTNAME}/candidates/${DISTVERSION}${DISTVERSIONSUFFIX}-candidates/build1/source DISTFILES= ${DISTNAME}.source${EXTRACT_SUFX} MAINTAINER= gecko@FreeBSD.org @@ -16,7 +15,7 @@ BUILD_DEPENDS= nspr>=4.32:devel/nspr \ nss>=3.76:security/nss \ icu>=70.1:devel/icu \ libevent>=2.1.8:devel/libevent \ - harfbuzz>=3.4.0:print/harfbuzz \ + harfbuzz>=4.1.0:print/harfbuzz \ graphite2>=1.3.14:graphics/graphite2 \ png>=1.6.37:graphics/png \ dav1d>=1.0.0:multimedia/dav1d \ diff --git a/www/firefox/distinfo b/www/firefox/distinfo index f16ba01741f6..851ed830f08c 100644 --- a/www/firefox/distinfo +++ b/www/firefox/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1649763203 -SHA256 (firefox-99.0.1.source.tar.xz) = 76d22279ce99588a728bb2d034064be0d5918b5900631f2148d4565b8a72e00b -SIZE (firefox-99.0.1.source.tar.xz) = 483537764 +TIMESTAMP = 1650958415 +SHA256 (firefox-100.0.source.tar.xz) = fba937a55a177916c6121f82f79e0d46c10bf175d4effc10d9095d0c297711fa +SIZE (firefox-100.0.source.tar.xz) = 482628448 diff --git a/www/firefox/files/patch-bug1664115 b/www/firefox/files/patch-bug1664115 index dce342a44b40..3be934a8c04e 100644 --- a/www/firefox/files/patch-bug1664115 +++ b/www/firefox/files/patch-bug1664115 @@ -3,8 +3,8 @@ using any cubeb backends other than pulse-rust to play media. The loss of such change will be that users will not be able to do profiling on threads created by libcubeb. ---- dom/media/AudioStream.cpp.orig 2022-02-25 16:27:47.676236000 +0100 -+++ dom/media/AudioStream.cpp 2022-02-25 16:54:21.223904000 +0100 +--- dom/media/AudioStream.cpp.orig 2022-04-19 19:43:36.505544000 +0200 ++++ dom/media/AudioStream.cpp 2022-04-19 19:47:53.111474000 +0200 @@ -27,7 +27,6 @@ #endif #include "Tracing.h" @@ -14,7 +14,7 @@ created by libcubeb. // Use abort() instead of exception in SoundTouch. @@ -144,8 +143,6 @@ - mAudioClock(aInRate), + mOutChannels(aOutputChannels), mState(INITIALIZED), mDataSource(aSource), - mAudioThreadId(ProfilerThreadId{}), @@ -22,7 +22,7 @@ created by libcubeb. mPlaybackComplete(false), mPlaybackRate(1.0f), mPreservesPitch(true) {} -@@ -551,17 +548,6 @@ +@@ -552,17 +549,6 @@ aWriter.Available()); } @@ -40,7 +40,7 @@ created by libcubeb. void AudioStream::AssertIsOnAudioThread() const { // This can be called right after CheckThreadIdChanged, because the audio // thread can change when not sandboxed. -@@ -590,9 +576,6 @@ +@@ -591,9 +577,6 @@ } long AudioStream::DataCallback(void* aBuffer, long aFrames) { @@ -50,7 +50,7 @@ created by libcubeb. WebCore::DenormalDisabler disabler; TRACE_AUDIO_CALLBACK_BUDGET(aFrames, mAudioClock.GetInputRate()); -@@ -647,9 +630,6 @@ +@@ -648,9 +631,6 @@ mDumpFile.Write(static_cast(aBuffer), aFrames * mOutChannels); @@ -60,17 +60,17 @@ created by libcubeb. return aFrames - writer.Available(); } ---- dom/media/AudioStream.h.orig 2022-02-25 16:27:53.316210000 +0100 -+++ dom/media/AudioStream.h 2022-02-25 16:55:18.967535000 +0100 -@@ -323,7 +323,6 @@ +--- dom/media/AudioStream.h.orig 2022-04-19 19:43:45.457171000 +0200 ++++ dom/media/AudioStream.h 2022-04-19 19:45:30.463633000 +0200 +@@ -329,7 +329,6 @@ template - int InvokeCubeb(Function aFunction, Args&&... aArgs); + int InvokeCubeb(Function aFunction, Args&&... aArgs) REQUIRES(mMonitor); - bool CheckThreadIdChanged(); void AssertIsOnAudioThread() const; soundtouch::SoundTouch* mTimeStretcher; -@@ -357,9 +356,6 @@ +@@ -368,9 +367,6 @@ // the default device is used. It is set // during the Init() in decoder thread. RefPtr mSinkInfo; @@ -78,5 +78,5 @@ created by libcubeb. - std::atomic mAudioThreadId; - const bool mSandboxed = false; - MozPromiseHolder mEndedPromise; + MozPromiseHolder mEndedPromise GUARDED_BY(mMonitor); std::atomic mPlaybackComplete; diff --git a/www/firefox/files/patch-bug1758610 b/www/firefox/files/patch-bug1758610 deleted file mode 100644 index f83eb4ea2004..000000000000 --- a/www/firefox/files/patch-bug1758610 +++ /dev/null @@ -1,365 +0,0 @@ ---- dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.orig 2022-03-30 23:24:44 UTC -+++ dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp -@@ -814,7 +814,7 @@ MediaResult FFmpegVideoDecoder::DoDecode( - # ifdef MOZ_WAYLAND_USE_VAAPI - // Create VideoFramePool in case we need it. - if (!mVideoFramePool && mEnableHardwareDecoding) { -- mVideoFramePool = MakeUnique(); -+ mVideoFramePool = MakeUnique>(); - } - - // Release unused VA-API surfaces before avcodec_receive_frame() as ---- dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h.orig 2022-03-30 23:24:44 UTC -+++ dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -@@ -16,6 +16,9 @@ - #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 - # include "mozilla/layers/TextureClient.h" - #endif -+#ifdef MOZ_WAYLAND_USE_VAAPI -+# include "FFmpegVideoFramePool.h" -+#endif - - struct _VADRMPRIMESurfaceDescriptor; - typedef struct _VADRMPRIMESurfaceDescriptor VADRMPRIMESurfaceDescriptor; -@@ -23,7 +26,6 @@ typedef struct _VADRMPRIMESurfaceDescriptor VADRMPRIME - namespace mozilla { - - class ImageBufferWrapper; --class VideoFramePool; - - template - class FFmpegVideoDecoder : public FFmpegDataDecoder {}; -@@ -138,7 +140,7 @@ class FFmpegVideoDecoder - AVBufferRef* mVAAPIDeviceContext; - bool mEnableHardwareDecoding; - VADisplay mDisplay; -- UniquePtr mVideoFramePool; -+ UniquePtr> mVideoFramePool; - static nsTArray mAcceleratedFormats; - #endif - RefPtr mImageAllocator; ---- dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.orig 2022-03-31 01:24:44.000000000 +0200 -+++ dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-04-05 00:06:31.002795000 +0200 -@@ -5,6 +5,7 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #include "FFmpegVideoFramePool.h" -+#include "PlatformDecoderModule.h" - #include "FFmpegLog.h" - #include "mozilla/widget/DMABufLibWrapper.h" - #include "libavutil/pixfmt.h" -@@ -15,14 +16,14 @@ - - namespace mozilla { - --RefPtr VideoFrameSurfaceVAAPI::GetAsImage() { -+RefPtr VideoFrameSurface::GetAsImage() { - return new layers::DMABUFSurfaceImage(mSurface); - } - --VideoFrameSurfaceVAAPI::VideoFrameSurfaceVAAPI(DMABufSurface* aSurface) -+VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) - : mSurface(aSurface), - mLib(nullptr), -- mAVHWFramesContext(nullptr), -+ mAVHWDeviceContext(nullptr), - mHWAVBuffer(nullptr) { - // Create global refcount object to track mSurface usage over - // gects rendering engine. We can't release it until it's used -@@ -30,22 +31,22 @@ - MOZ_ASSERT(mSurface); - MOZ_RELEASE_ASSERT(mSurface->GetAsDMABufSurfaceYUV()); - mSurface->GlobalRefCountCreate(); -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: creating surface UID = %d", -+ FFMPEG_LOG("VideoFrameSurface: creating surface UID = %d", - mSurface->GetUID()); - } - --void VideoFrameSurfaceVAAPI::LockVAAPIData(AVCodecContext* aAVCodecContext, -- AVFrame* aAVFrame, -- FFmpegLibWrapper* aLib) { -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: VAAPI locking dmabuf surface UID = %d", -+void VideoFrameSurface::LockVAAPIData( -+ AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, -+ FFmpegLibWrapper* aLib) { -+ FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d", - mSurface->GetUID()); - mLib = aLib; -- mAVHWFramesContext = aLib->av_buffer_ref(aAVCodecContext->hw_frames_ctx); -+ mAVHWDeviceContext = aLib->av_buffer_ref(aAVCodecContext->hw_device_ctx); - mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]); - } - --void VideoFrameSurfaceVAAPI::ReleaseVAAPIData(bool aForFrameRecycle) { -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: VAAPI releasing dmabuf surface UID = %d", -+void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { -+ FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d", - mSurface->GetUID()); - - // It's possible to unref GPU data while IsUsed() is still set. -@@ -56,7 +57,7 @@ - // is closed. - if (mLib) { - mLib->av_buffer_unref(&mHWAVBuffer); -- mLib->av_buffer_unref(&mAVHWFramesContext); -+ mLib->av_buffer_unref(&mAVHWDeviceContext); - } - - // If we want to recycle the frame, make sure it's not used -@@ -67,43 +68,44 @@ - } - } - --VideoFrameSurfaceVAAPI::~VideoFrameSurfaceVAAPI() { -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: deleting dmabuf surface UID = %d", -+VideoFrameSurface::~VideoFrameSurface() { -+ FFMPEG_LOG("VideoFrameSurface: deleting dmabuf surface UID = %d", - mSurface->GetUID()); - // We're about to quit, no need to recycle the frames. - ReleaseVAAPIData(/* aForFrameRecycle */ false); - } - --VideoFramePool::VideoFramePool() : mSurfaceLock("VideoFramePoolSurfaceLock") {} -+VideoFramePool::VideoFramePool() -+ : mSurfaceLock("VideoFramePoolSurfaceLock") {} - --VideoFramePool::~VideoFramePool() { -+VideoFramePool::~VideoFramePool() { - MutexAutoLock lock(mSurfaceLock); - mDMABufSurfaces.Clear(); - } - --void VideoFramePool::ReleaseUnusedVAAPIFrames() { -+void VideoFramePool::ReleaseUnusedVAAPIFrames() { - MutexAutoLock lock(mSurfaceLock); - for (const auto& surface : mDMABufSurfaces) { -- auto* vaapiSurface = surface->AsVideoFrameSurfaceVAAPI(); -- if (!vaapiSurface->IsUsed()) { -- vaapiSurface->ReleaseVAAPIData(); -+ if (!surface->IsUsed()) { -+ surface->ReleaseVAAPIData(); - } - } - } - --RefPtr VideoFramePool::GetFreeVideoFrameSurface() { -+RefPtr> -+VideoFramePool::GetFreeVideoFrameSurface() { - for (auto& surface : mDMABufSurfaces) { - if (surface->IsUsed()) { - continue; - } -- auto* vaapiSurface = surface->AsVideoFrameSurfaceVAAPI(); -- vaapiSurface->ReleaseVAAPIData(); -+ surface->ReleaseVAAPIData(); - return surface; - } - return nullptr; - } - --RefPtr VideoFramePool::GetVideoFrameSurface( -+RefPtr> -+VideoFramePool::GetVideoFrameSurface( - VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, - AVFrame* aAVFrame, FFmpegLibWrapper* aLib) { - if (aVaDesc.fourcc != VA_FOURCC_NV12 && aVaDesc.fourcc != VA_FOURCC_YV12 && -@@ -113,7 +115,8 @@ - } - - MutexAutoLock lock(mSurfaceLock); -- RefPtr videoSurface = GetFreeVideoFrameSurface(); -+ RefPtr> videoSurface = -+ GetFreeVideoFrameSurface(); - if (!videoSurface) { - RefPtr surface = - DMABufSurfaceYUV::CreateYUVSurface(aVaDesc); -@@ -121,7 +124,8 @@ - return nullptr; - } - FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); -- RefPtr surf = new VideoFrameSurfaceVAAPI(surface); -+ RefPtr> surf = -+ new VideoFrameSurface(surface); - if (!mTextureCreationWorks) { - mTextureCreationWorks = Some(surface->VerifyTextureCreation()); - } -@@ -138,11 +142,8 @@ - } - FFMPEG_LOG("Reusing VA-API DMABufSurface UID = %d", surface->GetUID()); - } -- -- auto* vaapiSurface = videoSurface->AsVideoFrameSurfaceVAAPI(); -- vaapiSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); -- vaapiSurface->MarkAsUsed(); -- -+ videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); -+ videoSurface->MarkAsUsed(); - return videoSurface; - } - ---- dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.orig 2022-03-31 01:24:44.000000000 +0200 -+++ dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-04-05 00:23:32.421765000 +0200 -@@ -7,8 +7,9 @@ - #ifndef __FFmpegVideoFramePool_h__ - #define __FFmpegVideoFramePool_h__ - --#include "FFmpegVideoDecoder.h" - #include "FFmpegLibWrapper.h" -+#include "FFmpegLibs.h" -+#include "FFmpegLog.h" - - #include "mozilla/layers/DMABUFSurfaceImage.h" - #include "mozilla/widget/DMABufLibWrapper.h" -@@ -16,43 +17,16 @@ - - namespace mozilla { - --class VideoFramePool; --class VideoFrameSurfaceVAAPI; -- --class VideoFrameSurface { -- public: -- NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) -- -- VideoFrameSurface() = default; -- -- virtual VideoFrameSurfaceVAAPI* AsVideoFrameSurfaceVAAPI() { return nullptr; } -- -- virtual void SetYUVColorSpace(gfx::YUVColorSpace aColorSpace) = 0; -- virtual void SetColorRange(gfx::ColorRange aColorRange) = 0; -- -- virtual RefPtr GetDMABufSurface() { return nullptr; }; -- virtual RefPtr GetAsImage() = 0; -- -- // Don't allow VideoFrameSurface plain copy as it leads to -- // unexpected DMABufSurface/HW buffer releases and we don't want to -- // deep copy them. -- VideoFrameSurface(const VideoFrameSurface&) = delete; -- const VideoFrameSurface& operator=(VideoFrameSurface const&) = delete; -- -- protected: -- virtual ~VideoFrameSurface(){}; --}; -- --// VideoFrameSurfaceVAAPI holds a reference to GPU data with a video frame. -+// VideoFrameSurface holds a reference to GPU data with a video frame. - // - // Actual GPU pixel data are stored at DMABufSurface and - // DMABufSurface is passed to gecko GL rendering pipeline via. - // DMABUFSurfaceImage. - // --// VideoFrameSurfaceVAAPI can optionally hold VA-API ffmpeg related data to keep -+// VideoFrameSurface can optionally hold VA-API ffmpeg related data to keep - // GPU data locked untill we need them. - // --// VideoFrameSurfaceVAAPI is used for both HW accelerated video decoding -+// VideoFrameSurface is used for both HW accelerated video decoding - // (VA-API) and ffmpeg SW decoding. - // - // VA-API scenario -@@ -72,13 +46,24 @@ - // Unfortunately there isn't any obvious way how to mark particular VASurface - // as used. The best we can do is to hold a reference to particular AVBuffer - // from decoded AVFrame and AVHWFramesContext which owns the AVBuffer. --class VideoFrameSurfaceVAAPI final : public VideoFrameSurface { -- friend class VideoFramePool; -+template -+class VideoFrameSurface {}; -+template <> -+class VideoFrameSurface; - -+template -+class VideoFramePool {}; -+template <> -+class VideoFramePool; -+ -+template <> -+class VideoFrameSurface { -+ friend class VideoFramePool; -+ - public: -- explicit VideoFrameSurfaceVAAPI(DMABufSurface* aSurface); -+ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) - -- VideoFrameSurfaceVAAPI* AsVideoFrameSurfaceVAAPI() final { return this; } -+ explicit VideoFrameSurface(DMABufSurface* aSurface); - - void SetYUVColorSpace(mozilla::gfx::YUVColorSpace aColorSpace) { - mSurface->GetAsDMABufSurfaceYUV()->SetYUVColorSpace(aColorSpace); -@@ -93,6 +78,12 @@ - - RefPtr GetAsImage(); - -+ // Don't allow VideoFrameSurface plain copy as it leads to -+ // unexpected DMABufSurface/HW buffer releases and we don't want to -+ // deep copy them. -+ VideoFrameSurface(const VideoFrameSurface&) = delete; -+ const VideoFrameSurface& operator=(VideoFrameSurface const&) = delete; -+ - protected: - // Lock VAAPI related data - void LockVAAPIData(AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, -@@ -107,32 +98,33 @@ - void MarkAsUsed() { mSurface->GlobalRefAdd(); } - - private: -- virtual ~VideoFrameSurfaceVAAPI(); -+ virtual ~VideoFrameSurface(); - - const RefPtr mSurface; - const FFmpegLibWrapper* mLib; -- AVBufferRef* mAVHWFramesContext; -+ AVBufferRef* mAVHWDeviceContext; - AVBufferRef* mHWAVBuffer; - }; - - // VideoFramePool class is thread-safe. --class VideoFramePool final { -+template <> -+class VideoFramePool { - public: - VideoFramePool(); - ~VideoFramePool(); - -- RefPtr GetVideoFrameSurface( -+ RefPtr> GetVideoFrameSurface( - VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, - AVFrame* aAVFrame, FFmpegLibWrapper* aLib); - void ReleaseUnusedVAAPIFrames(); - - private: -- RefPtr GetFreeVideoFrameSurface(); -+ RefPtr> GetFreeVideoFrameSurface(); - - private: - // Protect mDMABufSurfaces pool access - Mutex mSurfaceLock; -- nsTArray> mDMABufSurfaces; -+ nsTArray>> mDMABufSurfaces; - // We may fail to create texture over DMABuf memory due to driver bugs so - // check that before we export first DMABuf video frame. - Maybe mTextureCreationWorks; ---- dom/media/platforms/ffmpeg/ffmpeg58/moz.build.orig 2022-03-30 23:24:44 UTC -+++ dom/media/platforms/ffmpeg/ffmpeg58/moz.build -@@ -30,6 +30,9 @@ if CONFIG['MOZ_WAYLAND']: - CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] - DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1 - USE_LIBS += ['mozva'] -+ UNIFIED_SOURCES += [ -+ '../FFmpegVideoFramePool.cpp', -+ ] - - include("/ipc/chromium/chromium-config.mozbuild") - ---- dom/media/platforms/ffmpeg/ffmpeg59/moz.build.orig 2022-03-30 23:24:44 UTC -+++ dom/media/platforms/ffmpeg/ffmpeg59/moz.build -@@ -30,6 +30,9 @@ if CONFIG["MOZ_WAYLAND"]: - CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] - DEFINES["MOZ_WAYLAND_USE_VAAPI"] = 1 - USE_LIBS += ["mozva"] -+ UNIFIED_SOURCES += [ -+ "../FFmpegVideoFramePool.cpp", -+ ] - - include("/ipc/chromium/chromium-config.mozbuild") -