Bug 1316211. P5 - remove IsAsync() and its callers.
MozReview-Commit-ID: CT2gyEak2Qz
--- a/dom/media/MediaDecoderReader.h
+++ b/dom/media/MediaDecoderReader.h
@@ -218,22 +218,16 @@ public:
return &mBuffered;
}
TaskQueue* OwnerThread() const
{
return mTaskQueue;
}
- // Returns true if the reader implements RequestAudioData()
- // and RequestVideoData() asynchronously, rather than using the
- // implementation in this class to adapt the old synchronous to
- // the newer async model.
- virtual bool IsAsync() const = 0;
-
// Returns true if this decoder reader uses hardware accelerated video
// decoding.
virtual bool VideoIsHardwareAccelerated() const = 0;
TimedMetadataEventSource& TimedMetadataEvent()
{
return mTimedMetadataEvent;
}
--- a/dom/media/MediaDecoderReaderWrapper.h
+++ b/dom/media/MediaDecoderReaderWrapper.h
@@ -48,17 +48,16 @@ public:
RefPtr<SeekPromise> Seek(const SeekTarget& aTarget);
RefPtr<ShutdownPromise> Shutdown();
void ReleaseResources();
void ResetDecode(TrackSet aTracks);
nsresult Init() { return mReader->Init(); }
- bool IsAsync() const { return mReader->IsAsync(); }
bool UseBufferingHeuristics() const { return mReader->UseBufferingHeuristics(); }
bool VideoIsHardwareAccelerated() const {
return mReader->VideoIsHardwareAccelerated();
}
TimedMetadataEventSource& TimedMetadataEvent() {
return mReader->TimedMetadataEvent();
}
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2250,18 +2250,17 @@ DecodeMetadataState::OnMetadataRead(Meta
}
// If we don't know the duration by this point, we assume infinity, per spec.
if (mMaster->mDuration.Ref().isNothing()) {
mMaster->mDuration = Some(TimeUnit::FromInfinity());
}
if (mMaster->HasVideo()) {
- SLOG("Video decode isAsync=%d HWAccel=%d videoQueueSize=%d",
- Reader()->IsAsync(),
+ SLOG("Video decode HWAccel=%d videoQueueSize=%d",
Reader()->VideoIsHardwareAccelerated(),
mMaster->GetAmpleVideoFrames());
}
MOZ_ASSERT(mMaster->mDuration.Ref().isSome());
mMaster->mMetadataLoadedEvent.Notify(
Move(aMetadata.mInfo),
@@ -3913,17 +3912,17 @@ MediaDecoderStateMachine::SetAudioCaptur
? detail::AMPLE_AUDIO_THRESHOLD / 2 : detail::AMPLE_AUDIO_THRESHOLD;
mStateObj->HandleAudioCaptured();
}
uint32_t MediaDecoderStateMachine::GetAmpleVideoFrames() const
{
MOZ_ASSERT(OnTaskQueue());
- return (mReader->IsAsync() && mReader->VideoIsHardwareAccelerated())
+ return mReader->VideoIsHardwareAccelerated()
? std::max<uint32_t>(sVideoQueueHWAccelSize, MIN_VIDEO_QUEUE_SIZE)
: std::max<uint32_t>(sVideoQueueDefaultSize, MIN_VIDEO_QUEUE_SIZE);
}
nsCString
MediaDecoderStateMachine::GetDebugInfo()
{
MOZ_ASSERT(OnTaskQueue());
--- a/dom/media/MediaFormatReader.h
+++ b/dom/media/MediaFormatReader.h
@@ -54,18 +54,16 @@ protected:
public:
// For Media Resource Management
void ReleaseResources() override;
nsresult ResetDecode(TrackSet aTracks) override;
RefPtr<ShutdownPromise> Shutdown() override;
- bool IsAsync() const override { return true; }
-
bool VideoIsHardwareAccelerated() const override;
bool IsWaitForDataSupported() const override { return true; }
RefPtr<WaitForDataPromise> WaitForData(MediaData::Type aType) override;
bool UseBufferingHeuristics() const override
{
return mTrackDemuxersMayBlock;