mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 00:17:32 +09:00
Issue #2393 - Part 3 - Remove extra copy of YUV buffer on Windows
This commit is contained in:
parent
74a22e5c00
commit
b09b3771c6
9 changed files with 70 additions and 20 deletions
|
|
@ -44,6 +44,7 @@ public:
|
|||
aParams.mTaskQueue,
|
||||
aParams.mCallback,
|
||||
aParams.VideoConfig(),
|
||||
aParams.mKnowsCompositor,
|
||||
aParams.mImageContainer);
|
||||
return decoder.forget();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "MediaInfo.h"
|
||||
#include "VPXDecoder.h"
|
||||
#include "MP4Decoder.h"
|
||||
#include "mozilla/layers/KnowsCompositor.h"
|
||||
|
||||
#include "FFmpegVideoDecoder.h"
|
||||
#include "FFmpegLog.h"
|
||||
|
|
@ -108,8 +109,9 @@ FFmpegVideoDecoder<LIBAV_VER>::PtsCorrectionContext::Reset()
|
|||
FFmpegVideoDecoder<LIBAV_VER>::FFmpegVideoDecoder(FFmpegLibWrapper* aLib,
|
||||
TaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback,
|
||||
const VideoInfo& aConfig,
|
||||
ImageContainer* aImageContainer)
|
||||
KnowsCompositor* aAllocator, ImageContainer* aImageContainer)
|
||||
: FFmpegDataDecoder(aLib, aTaskQueue, aCallback, GetCodecId(aConfig.mMimeType))
|
||||
, mImageAllocator(aAllocator)
|
||||
, mImageContainer(aImageContainer)
|
||||
, mInfo(aConfig)
|
||||
, mCodecParser(nullptr)
|
||||
|
|
@ -395,7 +397,8 @@ FFmpegVideoDecoder<LIBAV_VER>::CreateImage(int64_t aOffset, int64_t aPts,
|
|||
!!mFrame->key_frame,
|
||||
-1,
|
||||
mInfo.ScaledImageRect(mFrame->width,
|
||||
mFrame->height));
|
||||
mFrame->height),
|
||||
mImageAllocator);
|
||||
|
||||
if (!v) {
|
||||
return MediaResult(NS_ERROR_OUT_OF_MEMORY,
|
||||
|
|
|
|||
|
|
@ -24,11 +24,13 @@ class FFmpegVideoDecoder<LIBAV_VER> : public FFmpegDataDecoder<LIBAV_VER>
|
|||
{
|
||||
typedef mozilla::layers::Image Image;
|
||||
typedef mozilla::layers::ImageContainer ImageContainer;
|
||||
typedef mozilla::layers::KnowsCompositor KnowsCompositor;
|
||||
|
||||
public:
|
||||
FFmpegVideoDecoder(FFmpegLibWrapper* aLib, TaskQueue* aTaskQueue,
|
||||
MediaDataDecoderCallback* aCallback,
|
||||
const VideoInfo& aConfig,
|
||||
KnowsCompositor* aAllocator,
|
||||
ImageContainer* aImageContainer);
|
||||
virtual ~FFmpegVideoDecoder();
|
||||
|
||||
|
|
@ -62,6 +64,7 @@ private:
|
|||
int AllocateYUV420PVideoBuffer(AVCodecContext* aCodecContext,
|
||||
AVFrame* aFrame);
|
||||
|
||||
RefPtr<KnowsCompositor> mImageAllocator;
|
||||
RefPtr<ImageContainer> mImageContainer;
|
||||
VideoInfo mInfo;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue