зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1388228. P4 - move the implementation of MediaDecoder::CanPlayThroughImpl() down to ChannelMediaDecoder. r=gerald
Because GetStatistics() only makes sense for ChannelMediaResource. MozReview-Commit-ID: HkEpb4frUx1 --HG-- extra : rebase_source : 7086721f47b381b692a165302ff3bdc13caa8b41
This commit is contained in:
Родитель
303f74001a
Коммит
e5f016de87
|
@ -333,6 +333,14 @@ ChannelMediaDecoder::SeekingChanged()
|
|||
mIgnoreProgressData = mLogicallySeeking;
|
||||
}
|
||||
|
||||
bool
|
||||
ChannelMediaDecoder::CanPlayThroughImpl()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
NS_ENSURE_TRUE(GetStateMachine(), false);
|
||||
return GetStatistics().CanPlayThrough();
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
// avoid redefined macro in unified build
|
||||
|
|
|
@ -91,6 +91,8 @@ private:
|
|||
|
||||
void SeekingChanged();
|
||||
|
||||
bool CanPlayThroughImpl() override final;
|
||||
|
||||
WatchManager<ChannelMediaDecoder> mWatchManager;
|
||||
|
||||
// True when seeking or otherwise moving the play position around in
|
||||
|
|
|
@ -1571,14 +1571,6 @@ MediaDecoder::UnpinForSeek()
|
|||
resource->Unpin();
|
||||
}
|
||||
|
||||
bool
|
||||
MediaDecoder::CanPlayThroughImpl()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
NS_ENSURE_TRUE(mDecoderStateMachine, false);
|
||||
return GetStatistics().CanPlayThrough();
|
||||
}
|
||||
|
||||
bool
|
||||
MediaDecoder::CanPlayThrough()
|
||||
{
|
||||
|
|
|
@ -532,7 +532,7 @@ private:
|
|||
void ConnectMirrors(MediaDecoderStateMachine* aObject);
|
||||
void DisconnectMirrors();
|
||||
|
||||
virtual bool CanPlayThroughImpl();
|
||||
virtual bool CanPlayThroughImpl() = 0;
|
||||
|
||||
// The state machine object for handling the decoding. It is safe to
|
||||
// call methods of this object from other threads. Its internal data
|
||||
|
|
|
@ -42,6 +42,13 @@ public:
|
|||
void Pause() override;
|
||||
|
||||
private:
|
||||
bool CanPlayThroughImpl() override final
|
||||
{
|
||||
// TODO: We don't know how to estimate 'canplaythrough' for this decoder.
|
||||
// For now we just return true for 'autoplay' can work.
|
||||
return true;
|
||||
}
|
||||
|
||||
RefPtr<HLSResource> mResource;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче