mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 02:47:31 +09:00
Rename The Non-MFT VP9 Implementation to DXVA2
This commit is contained in:
parent
040fea8947
commit
58450bb3f1
4 changed files with 19 additions and 19 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
#include "WMF.h"
|
#include "WMF.h"
|
||||||
#include "WMFDecoderModule.h"
|
#include "WMFDecoderModule.h"
|
||||||
#include "WMFVideoMFTManager.h"
|
#include "WMFVideoMFTManager.h"
|
||||||
#include "WMFVP9MFTManager.h"
|
#include "WMFVP9DXVA2Manager.h"
|
||||||
#include "WMFAudioMFTManager.h"
|
#include "WMFAudioMFTManager.h"
|
||||||
#include "MFTDecoder.h"
|
#include "MFTDecoder.h"
|
||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
|
|
@ -108,8 +108,8 @@ WMFDecoderModule::CreateVP9Decoder(const CreateDecoderParams& aParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dxva2Allowed) {
|
if (dxva2Allowed) {
|
||||||
nsAutoPtr<WMFVP9MFTManager> vp9(
|
nsAutoPtr<WMFVP9DXVA2Manager> vp9(
|
||||||
new WMFVP9MFTManager(aParams.VideoConfig(),
|
new WMFVP9DXVA2Manager(aParams.VideoConfig(),
|
||||||
aParams.mKnowsCompositor,
|
aParams.mKnowsCompositor,
|
||||||
aParams.mImageContainer));
|
aParams.mImageContainer));
|
||||||
if (vp9->Init()) {
|
if (vp9->Init()) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "WMFVP9MFTManager.h"
|
#include "WMFVP9DXVA2Manager.h"
|
||||||
#include "WMFVideoMFTManager.h"
|
#include "WMFVideoMFTManager.h"
|
||||||
#include "ImageContainer.h"
|
#include "ImageContainer.h"
|
||||||
#include "Layers.h"
|
#include "Layers.h"
|
||||||
|
|
@ -22,12 +22,12 @@ struct VP9ShownFrame {
|
||||||
bool mKeyframe;
|
bool mKeyframe;
|
||||||
};
|
};
|
||||||
|
|
||||||
WMFVP9MFTManager::WMFVP9MFTManager(const VideoInfo& aConfig,
|
WMFVP9DXVA2Manager::WMFVP9DXVA2Manager(const VideoInfo& aConfig,
|
||||||
layers::KnowsCompositor* aCompositor, layers::ImageContainer* aContainer)
|
layers::KnowsCompositor* aCompositor, layers::ImageContainer* aContainer)
|
||||||
: mVideoInfo(aConfig), mKnowsCompositor(aCompositor), mImageContainer(aContainer), mIsValid(false)
|
: mVideoInfo(aConfig), mKnowsCompositor(aCompositor), mImageContainer(aContainer), mIsValid(false)
|
||||||
{}
|
{}
|
||||||
WMFVP9MFTManager::~WMFVP9MFTManager() { Shutdown(); }
|
WMFVP9DXVA2Manager::~WMFVP9DXVA2Manager() { Shutdown(); }
|
||||||
bool WMFVP9MFTManager::Init()
|
bool WMFVP9DXVA2Manager::Init()
|
||||||
{
|
{
|
||||||
if (!IsVistaOrLater()) {
|
if (!IsVistaOrLater()) {
|
||||||
mFailureReason.AssignLiteral("VP9 DXVA2 requires Windows Vista or later");
|
mFailureReason.AssignLiteral("VP9 DXVA2 requires Windows Vista or later");
|
||||||
|
|
@ -79,7 +79,7 @@ bool WMFVP9MFTManager::Init()
|
||||||
mFailureReason.AssignLiteral("Using VP9 DXVA2 profile 0");
|
mFailureReason.AssignLiteral("Using VP9 DXVA2 profile 0");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
HRESULT WMFVP9MFTManager::Input(MediaRawData* aSample)
|
HRESULT WMFVP9DXVA2Manager::Input(MediaRawData* aSample)
|
||||||
{
|
{
|
||||||
if (!mIsValid) { return E_UNEXPECTED; }
|
if (!mIsValid) { return E_UNEXPECTED; }
|
||||||
if (!aSample || aSample->Size() > UINT32_MAX) { return E_INVALIDARG; }
|
if (!aSample || aSample->Size() > UINT32_MAX) { return E_INVALIDARG; }
|
||||||
|
|
@ -129,7 +129,7 @@ HRESULT WMFVP9MFTManager::Input(MediaRawData* aSample)
|
||||||
}
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
HRESULT WMFVP9MFTManager::Output(int64_t, RefPtr<MediaData>& aOutput)
|
HRESULT WMFVP9DXVA2Manager::Output(int64_t, RefPtr<MediaData>& aOutput)
|
||||||
{
|
{
|
||||||
aOutput = nullptr;
|
aOutput = nullptr;
|
||||||
if (mPendingFrames.IsEmpty()) { return MF_E_TRANSFORM_NEED_MORE_INPUT; }
|
if (mPendingFrames.IsEmpty()) { return MF_E_TRANSFORM_NEED_MORE_INPUT; }
|
||||||
|
|
@ -137,20 +137,20 @@ HRESULT WMFVP9MFTManager::Output(int64_t, RefPtr<MediaData>& aOutput)
|
||||||
mPendingFrames.RemoveElementAt(0);
|
mPendingFrames.RemoveElementAt(0);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
void WMFVP9MFTManager::Flush()
|
void WMFVP9DXVA2Manager::Flush()
|
||||||
{
|
{
|
||||||
mPendingFrames.Clear();
|
mPendingFrames.Clear();
|
||||||
mSeekTargetThreshold.reset();
|
mSeekTargetThreshold.reset();
|
||||||
if (mVP9Decoder) { mVP9Decoder->Flush(); }
|
if (mVP9Decoder) { mVP9Decoder->Flush(); }
|
||||||
}
|
}
|
||||||
void WMFVP9MFTManager::Shutdown()
|
void WMFVP9DXVA2Manager::Shutdown()
|
||||||
{
|
{
|
||||||
mPendingFrames.Clear();
|
mPendingFrames.Clear();
|
||||||
mVP9Decoder = nullptr;
|
mVP9Decoder = nullptr;
|
||||||
if (mDXVA2Manager) { DeleteOnMainThread(mDXVA2Manager); }
|
if (mDXVA2Manager) { DeleteOnMainThread(mDXVA2Manager); }
|
||||||
mIsValid = false;
|
mIsValid = false;
|
||||||
}
|
}
|
||||||
bool WMFVP9MFTManager::IsHardwareAccelerated(nsACString& aReason) const
|
bool WMFVP9DXVA2Manager::IsHardwareAccelerated(nsACString& aReason) const
|
||||||
{
|
{
|
||||||
aReason = mFailureReason;
|
aReason = mFailureReason;
|
||||||
return mIsValid;
|
return mIsValid;
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#ifndef WMFVP9MFTManager_h_
|
#ifndef WMFVP9DXVA2Manager_h_
|
||||||
#define WMFVP9MFTManager_h_
|
#define WMFVP9DXVA2Manager_h_
|
||||||
#include "WMF.h"
|
#include "WMF.h"
|
||||||
#include "WMFMediaDataDecoder.h"
|
#include "WMFMediaDataDecoder.h"
|
||||||
#include "DXVA2Manager.h"
|
#include "DXVA2Manager.h"
|
||||||
|
|
@ -12,10 +12,10 @@
|
||||||
#include "MediaInfo.h"
|
#include "MediaInfo.h"
|
||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
class WMFVP9MFTManager : public MFTManager {
|
class WMFVP9DXVA2Manager : public MFTManager {
|
||||||
public:
|
public:
|
||||||
WMFVP9MFTManager(const VideoInfo&, layers::KnowsCompositor*, layers::ImageContainer*);
|
WMFVP9DXVA2Manager(const VideoInfo&, layers::KnowsCompositor*, layers::ImageContainer*);
|
||||||
~WMFVP9MFTManager();
|
~WMFVP9DXVA2Manager();
|
||||||
bool Init();
|
bool Init();
|
||||||
HRESULT Input(MediaRawData*) override;
|
HRESULT Input(MediaRawData*) override;
|
||||||
HRESULT Output(int64_t, RefPtr<MediaData>&) override;
|
HRESULT Output(int64_t, RefPtr<MediaData>&) override;
|
||||||
|
|
@ -15,7 +15,7 @@ EXPORTS += [
|
||||||
'WMFMediaDataDecoder.h',
|
'WMFMediaDataDecoder.h',
|
||||||
'WMFUtils.h',
|
'WMFUtils.h',
|
||||||
'WMFVideoMFTManager.h',
|
'WMFVideoMFTManager.h',
|
||||||
'WMFVP9MFTManager.h',
|
'WMFVP9DXVA2Manager.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
UNIFIED_SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
|
|
@ -31,7 +31,7 @@ SOURCES += [
|
||||||
'DXVAVP9Manager.cpp',
|
'DXVAVP9Manager.cpp',
|
||||||
'VP9HeaderParser.cpp',
|
'VP9HeaderParser.cpp',
|
||||||
'WMFUtils.cpp',
|
'WMFUtils.cpp',
|
||||||
'WMFVP9MFTManager.cpp',
|
'WMFVP9DXVA2Manager.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
include('/ipc/chromium/chromium-config.mozbuild')
|
include('/ipc/chromium/chromium-config.mozbuild')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue