Bug 1650696 - P3. Add missing methods to AllocationPolicy. r=jolin

Differential Revision: https://phabricator.services.mozilla.com/D86930
This commit is contained in:
Jean-Yves Avenard 2020-08-14 21:16:19 +00:00
parent 8638f5b3f5
commit 0dbb1ed812

View file

@ -8,6 +8,7 @@
#define AllocationPolicy_h_
#include <queue>
#include "MediaInfo.h"
#include "PlatformDecoderModule.h"
#include "TimeUnits.h"
@ -131,6 +132,11 @@ class AllocationWrapper : public MediaDataDecoder {
RefPtr<DecodePromise> Decode(MediaRawData* aSample) override {
return mDecoder->Decode(aSample);
}
bool CanDecodeBatch() const override { return mDecoder->CanDecodeBatch(); }
RefPtr<DecodePromise> DecodeBatch(
nsTArray<RefPtr<MediaRawData>>&& aSamples) override {
return mDecoder->DecodeBatch(std::move(aSamples));
}
RefPtr<DecodePromise> Drain() override { return mDecoder->Drain(); }
RefPtr<FlushPromise> Flush() override { return mDecoder->Flush(); }
bool IsHardwareAccelerated(nsACString& aFailureReason) const override {
@ -146,6 +152,9 @@ class AllocationWrapper : public MediaDataDecoder {
return mDecoder->SupportDecoderRecycling();
}
RefPtr<ShutdownPromise> Shutdown() override;
ConversionRequired NeedsConversion() const override {
return mDecoder->NeedsConversion();
}
typedef MozPromise<RefPtr<MediaDataDecoder>, MediaResult,
/* IsExclusive = */ true>