Add VP9 Hardware Decoding with DXVA (Non-MFT), Vista+

Thanks to Maggie (imjustsomeoneiguess) on discord for helping with a lot of this VP9 media code.
This is the first browser so far to support VP9 Non MFT
This commit is contained in:
EAZYBLACK 2026-09-15 18:34:43 +03:00
commit 1414824320
18 changed files with 1747 additions and 34 deletions

View file

@ -0,0 +1,39 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef WMFVP9MFTManager_h_
#define WMFVP9MFTManager_h_
#include "WMF.h"
#include "WMFMediaDataDecoder.h"
#include "DXVA2Manager.h"
#include "DXVAVP9Manager.h"
#include "MediaInfo.h"
#include "nsTArray.h"
namespace mozilla {
class WMFVP9MFTManager : public MFTManager {
public:
WMFVP9MFTManager(const VideoInfo&, layers::KnowsCompositor*, layers::ImageContainer*);
~WMFVP9MFTManager();
bool Init();
HRESULT Input(MediaRawData*) override;
HRESULT Output(int64_t, RefPtr<MediaData>&) override;
void Flush() override;
void Drain() override {}
void Shutdown() override;
bool IsHardwareAccelerated(nsACString&) const override;
TrackInfo::TrackType GetType() override { return TrackInfo::kVideoTrack; }
const char* GetDescriptionName() const override { return "VP9 DXVA2 profile 0 hardware decoder"; }
private:
VideoInfo mVideoInfo;
RefPtr<layers::KnowsCompositor> mKnowsCompositor;
RefPtr<layers::ImageContainer> mImageContainer;
nsAutoPtr<DXVA2Manager> mDXVA2Manager;
nsAutoPtr<DXVAVP9Manager> mVP9Decoder;
nsTArray<RefPtr<MediaData>> mPendingFrames;
nsCString mFailureReason;
bool mIsValid;
};
}
#endif