diff options
author | Martin Stransky <stransky@redhat.com> | 2022-06-07 11:19:41 +0200 |
---|---|---|
committer | Martin Stransky <stransky@redhat.com> | 2022-06-07 11:19:41 +0200 |
commit | 61879d2c53a0473a24b4a9a69fcedd1af8f74fdf (patch) | |
tree | d12a4530b17d4c7e0cde6ecb74aa5e47e5120477 /D146086.diff | |
parent | Updated cbindgen to 0.23.0 (diff) | |
download | librewolf-fedora-ff-61879d2c53a0473a24b4a9a69fcedd1af8f74fdf.tar.gz librewolf-fedora-ff-61879d2c53a0473a24b4a9a69fcedd1af8f74fdf.tar.bz2 librewolf-fedora-ff-61879d2c53a0473a24b4a9a69fcedd1af8f74fdf.zip |
Enabled VA-API by default (+ added VA-API fixes from upstream), Fixed WebGL performance on NVIDIA drivers (mzbz#1735929)
Diffstat (limited to 'D146086.diff')
-rw-r--r-- | D146086.diff | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/D146086.diff b/D146086.diff new file mode 100644 index 0000000..c6790ad --- /dev/null +++ b/D146086.diff @@ -0,0 +1,65 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +--- a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +@@ -112,12 +112,13 @@ + public: + VideoFramePool(); + ~VideoFramePool(); + + RefPtr<VideoFrameSurface<LIBAV_VER>> GetVideoFrameSurface( +- VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, +- AVFrame* aAVFrame, FFmpegLibWrapper* aLib); ++ VADRMPRIMESurfaceDescriptor& aVaDesc, int aWidth, int aHeight, ++ AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, ++ FFmpegLibWrapper* aLib); + void ReleaseUnusedVAAPIFrames(); + + private: + RefPtr<VideoFrameSurface<LIBAV_VER>> GetFreeVideoFrameSurface(); + +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +--- a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +@@ -111,12 +111,13 @@ + return nullptr; + } + + RefPtr<VideoFrameSurface<LIBAV_VER>> + VideoFramePool<LIBAV_VER>::GetVideoFrameSurface( +- VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, +- AVFrame* aAVFrame, FFmpegLibWrapper* aLib) { ++ VADRMPRIMESurfaceDescriptor& aVaDesc, int aWidth, int aHeight, ++ AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, ++ FFmpegLibWrapper* aLib) { + if (aVaDesc.fourcc != VA_FOURCC_NV12 && aVaDesc.fourcc != VA_FOURCC_YV12 && + aVaDesc.fourcc != VA_FOURCC_P010) { + FFMPEG_LOG("Unsupported VA-API surface format %d", aVaDesc.fourcc); + return nullptr; + } +@@ -124,11 +125,11 @@ + MutexAutoLock lock(mSurfaceLock); + RefPtr<VideoFrameSurface<LIBAV_VER>> videoSurface = + GetFreeVideoFrameSurface(); + if (!videoSurface) { + RefPtr<DMABufSurfaceYUV> surface = +- DMABufSurfaceYUV::CreateYUVSurface(aVaDesc); ++ DMABufSurfaceYUV::CreateYUVSurface(aVaDesc, aWidth, aHeight); + if (!surface) { + return nullptr; + } + FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); + RefPtr<VideoFrameSurface<LIBAV_VER>> surf = +@@ -142,11 +143,11 @@ + } + videoSurface = surf; + mDMABufSurfaces.AppendElement(std::move(surf)); + } else { + RefPtr<DMABufSurfaceYUV> surface = videoSurface->GetDMABufSurface(); +- if (!surface->UpdateYUVData(aVaDesc)) { ++ if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight)) { + return nullptr; + } + FFMPEG_LOG("Reusing VA-API DMABufSurface UID = %d", surface->GetUID()); + } + videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); + |