From babdb5befd1d9f97bdef44ea03d6c919efbd54a0 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 20 Oct 2020 23:28:19 +0000 Subject: [PATCH] Bug 1595994 - P15. Enable fast video copy path in AV1 decoder. r=mattwoodrow Depends on D91691 Differential Revision: https://phabricator.services.mozilla.com/D91692 --- dom/media/platforms/agnostic/DAV1DDecoder.cpp | 5 +++-- dom/media/platforms/agnostic/DAV1DDecoder.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/media/platforms/agnostic/DAV1DDecoder.cpp b/dom/media/platforms/agnostic/DAV1DDecoder.cpp index 007195e01eab..1c28617ceacb 100644 --- a/dom/media/platforms/agnostic/DAV1DDecoder.cpp +++ b/dom/media/platforms/agnostic/DAV1DDecoder.cpp @@ -22,7 +22,8 @@ DAV1DDecoder::DAV1DDecoder(const CreateDecoderParams& aParams) mTaskQueue( new TaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER), "Dav1dDecoder")), - mImageContainer(aParams.mImageContainer) {} + mImageContainer(aParams.mImageContainer), + mImageAllocator(aParams.mKnowsCompositor) {} RefPtr DAV1DDecoder::Init() { Dav1dSettings settings; @@ -275,7 +276,7 @@ already_AddRefed DAV1DDecoder::ConstructImage( return VideoData::CreateAndCopyData( mInfo, mImageContainer, offset, timecode, duration, b, keyframe, timecode, - mInfo.ScaledImageRect(aPicture.p.w, aPicture.p.h)); + mInfo.ScaledImageRect(aPicture.p.w, aPicture.p.h), mImageAllocator); } RefPtr DAV1DDecoder::Drain() { diff --git a/dom/media/platforms/agnostic/DAV1DDecoder.h b/dom/media/platforms/agnostic/DAV1DDecoder.h index c136ca6e171a..7b5820c384b0 100644 --- a/dom/media/platforms/agnostic/DAV1DDecoder.h +++ b/dom/media/platforms/agnostic/DAV1DDecoder.h @@ -43,6 +43,7 @@ class DAV1DDecoder : public MediaDataDecoder, const VideoInfo& mInfo; const RefPtr mTaskQueue; const RefPtr mImageContainer; + const RefPtr mImageAllocator; // Keep the buffers alive until dav1d // does not need them any more.