Bug 1272232. Part 5 - remove use of FlushableTaskQueue. r=jya.
MozReview-Commit-ID: F3gzwztV03k
--- a/dom/media/platforms/apple/AppleVDADecoder.cpp
+++ b/dom/media/platforms/apple/AppleVDADecoder.cpp
@@ -46,27 +46,27 @@ static uint32_t ComputeMaxRefFrames(cons
// non compliant videos.
maxRefFrames =
std::min(std::max(maxRefFrames, spsdata.max_num_ref_frames + 1), 16u);
}
return maxRefFrames;
}
AppleVDADecoder::AppleVDADecoder(const VideoInfo& aConfig,
- FlushableTaskQueue* aVideoTaskQueue,
- MediaDataDecoderCallback* aCallback,
- layers::ImageContainer* aImageContainer)
+ TaskQueue* aTaskQueue,
+ MediaDataDecoderCallback* aCallback,
+ layers::ImageContainer* aImageContainer)
: mExtraData(aConfig.mExtraData)
, mCallback(aCallback)
, mPictureWidth(aConfig.mImage.width)
, mPictureHeight(aConfig.mImage.height)
, mDisplayWidth(aConfig.mDisplay.width)
, mDisplayHeight(aConfig.mDisplay.height)
, mQueuedSamples(0)
- , mTaskQueue(aVideoTaskQueue)
+ , mTaskQueue(aTaskQueue)
, mDecoder(nullptr)
, mMaxRefFrames(ComputeMaxRefFrames(aConfig.mExtraData))
, mImageContainer(aImageContainer)
, mInputIncoming(0)
, mIsShutDown(false)
#ifdef MOZ_WIDGET_UIKIT
, mUseSoftwareImages(true)
, mIs106(false)
@@ -666,27 +666,27 @@ AppleVDADecoder::CreateOutputConfigurati
MOZ_ASSERT_UNREACHABLE("No MacIOSurface on iOS");
#endif
}
/* static */
already_AddRefed<AppleVDADecoder>
AppleVDADecoder::CreateVDADecoder(
const VideoInfo& aConfig,
- FlushableTaskQueue* aVideoTaskQueue,
+ TaskQueue* aTaskQueue,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer)
{
if (!AppleDecoderModule::sCanUseHardwareVideoDecoder) {
// This GPU is blacklisted for hardware decoding.
return nullptr;
}
RefPtr<AppleVDADecoder> decoder =
- new AppleVDADecoder(aConfig, aVideoTaskQueue, aCallback, aImageContainer);
+ new AppleVDADecoder(aConfig, aTaskQueue, aCallback, aImageContainer);
if (NS_FAILED(decoder->InitializeSession())) {
return nullptr;
}
return decoder.forget();
}
--- a/dom/media/platforms/apple/AppleVDADecoder.h
+++ b/dom/media/platforms/apple/AppleVDADecoder.h
@@ -14,17 +14,17 @@
#include "nsIThread.h"
#include "ReorderQueue.h"
#include "TimeUnits.h"
#include "VideoDecodeAcceleration/VDADecoder.h"
namespace mozilla {
-class FlushableTaskQueue;
+class TaskQueue;
class MediaDataDecoderCallback;
namespace layers {
class ImageContainer;
} // namespace layers
class AppleVDADecoder : public MediaDataDecoder {
public:
class AppleFrameRef {
@@ -57,17 +57,17 @@ public:
{
}
};
// Return a new created AppleVDADecoder or nullptr if media or hardware is
// not supported by current configuration.
static already_AddRefed<AppleVDADecoder> CreateVDADecoder(
const VideoInfo& aConfig,
- FlushableTaskQueue* aVideoTaskQueue,
+ TaskQueue* aTaskQueue,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer);
// Access from the taskqueue and the decoder's thread.
// OutputFrame is thread-safe.
nsresult OutputFrame(CVPixelBufferRef aImage,
AppleFrameRef aFrameRef);
@@ -84,17 +84,17 @@ private:
const char* GetDescriptionName() const override
{
return "apple VDA decoder";
}
protected:
AppleVDADecoder(const VideoInfo& aConfig,
- FlushableTaskQueue* aVideoTaskQueue,
+ TaskQueue* aTaskQueue,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer);
virtual ~AppleVDADecoder();
void AssertOnTaskQueueThread()
{
MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
}
@@ -117,17 +117,17 @@ protected:
Atomic<uint32_t> mQueuedSamples;
private:
// Flush and Drain operation, always run
virtual void ProcessFlush();
virtual void ProcessDrain();
virtual void ProcessShutdown();
- const RefPtr<FlushableTaskQueue> mTaskQueue;
+ const RefPtr<TaskQueue> mTaskQueue;
VDADecoder mDecoder;
const uint32_t mMaxRefFrames;
const RefPtr<layers::ImageContainer> mImageContainer;
// Increased when Input is called, and decreased when ProcessFrame runs.
// Reaching 0 indicates that there's no pending Input.
Atomic<uint32_t> mInputIncoming;
Atomic<bool> mIsShutDown;
const bool mUseSoftwareImages;
--- a/dom/media/platforms/apple/AppleVTDecoder.cpp
+++ b/dom/media/platforms/apple/AppleVTDecoder.cpp
@@ -21,20 +21,20 @@
#include "gfxPlatform.h"
extern mozilla::LogModule* GetPDMLog();
#define LOG(...) MOZ_LOG(GetPDMLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
namespace mozilla {
AppleVTDecoder::AppleVTDecoder(const VideoInfo& aConfig,
- FlushableTaskQueue* aVideoTaskQueue,
+ TaskQueue* aTaskQueue,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer)
- : AppleVDADecoder(aConfig, aVideoTaskQueue, aCallback, aImageContainer)
+ : AppleVDADecoder(aConfig, aTaskQueue, aCallback, aImageContainer)
, mFormat(nullptr)
, mSession(nullptr)
, mIsHardwareAccelerated(false)
{
MOZ_COUNT_CTOR(AppleVTDecoder);
// TODO: Verify aConfig.mime_type.
LOG("Creating AppleVTDecoder for %dx%d h.264 video",
mDisplayWidth,
--- a/dom/media/platforms/apple/AppleVTDecoder.h
+++ b/dom/media/platforms/apple/AppleVTDecoder.h
@@ -11,17 +11,17 @@
#include "VideoToolbox/VideoToolbox.h"
namespace mozilla {
class AppleVTDecoder : public AppleVDADecoder {
public:
AppleVTDecoder(const VideoInfo& aConfig,
- FlushableTaskQueue* aVideoTaskQueue,
+ TaskQueue* aTaskQueue,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer);
private:
virtual ~AppleVTDecoder();
RefPtr<InitPromise> Init() override;
bool IsHardwareAccelerated(nsACString& aFailureReason) const override
{