зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1391142. P3 - remove IsLiveStream() from MediaResource. r=gerald
MozReview-Commit-ID: DBFrYfj2lGB --HG-- extra : rebase_source : 18532f55f38c5ac54660c11f078741e09273a30a extra : source : 0e45bca0cdc0b2428216e6c9a55f8651e5b21017
This commit is contained in:
Родитель
b8ff3673d9
Коммит
41cd273f4e
|
@ -350,6 +350,13 @@ ChannelMediaDecoder::CanPlayThroughImpl()
|
|||
return GetStatistics().CanPlayThrough();
|
||||
}
|
||||
|
||||
bool
|
||||
ChannelMediaDecoder::IsLiveStream()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return mResource->IsLiveStream();
|
||||
}
|
||||
|
||||
void
|
||||
ChannelMediaDecoder::OnPlaybackEvent(MediaEventType aEvent)
|
||||
{
|
||||
|
|
|
@ -104,6 +104,8 @@ private:
|
|||
|
||||
bool CanPlayThroughImpl() override final;
|
||||
|
||||
bool IsLiveStream() override final;
|
||||
|
||||
// The actual playback rate computation.
|
||||
void ComputePlaybackRate();
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ MediaDecoder::CallSeek(const SeekTarget& aTarget)
|
|||
// Since we don't have a listener for changes in IsLiveStream, our best bet
|
||||
// is to ensure IsLiveStream is uptodate when seek begins. This value will be
|
||||
// checked when seek is completed.
|
||||
mDecoderStateMachine->DispatchIsLiveStream(GetResource()->IsLiveStream());
|
||||
mDecoderStateMachine->DispatchIsLiveStream(IsLiveStream());
|
||||
|
||||
mDecoderStateMachine->InvokeSeek(aTarget)
|
||||
->Then(mAbstractMainThread, __func__, this,
|
||||
|
|
|
@ -510,6 +510,7 @@ private:
|
|||
void DisconnectMirrors();
|
||||
|
||||
virtual bool CanPlayThroughImpl() = 0;
|
||||
virtual bool IsLiveStream() = 0;
|
||||
|
||||
// The state machine object for handling the decoding. It is safe to
|
||||
// call methods of this object from other threads. Its internal data
|
||||
|
|
|
@ -243,12 +243,6 @@ public:
|
|||
*/
|
||||
virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) = 0;
|
||||
|
||||
// Returns true if the resource is a live stream.
|
||||
virtual bool IsLiveStream()
|
||||
{
|
||||
return GetLength() == -1;
|
||||
}
|
||||
|
||||
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
|
||||
return 0;
|
||||
}
|
||||
|
@ -335,6 +329,9 @@ public:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// Returns true if the resource is a live stream.
|
||||
bool IsLiveStream() { return GetLength() == -1; }
|
||||
|
||||
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
|
||||
{
|
||||
// Might be useful to track in the future:
|
||||
|
|
|
@ -52,6 +52,8 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
bool IsLiveStream() override final { return false; }
|
||||
|
||||
RefPtr<HLSResource> mResource;
|
||||
};
|
||||
|
||||
|
|
|
@ -81,11 +81,6 @@ public:
|
|||
|
||||
bool IsTransportSeekable() override { return true; }
|
||||
|
||||
bool IsLiveStream() override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
java::GeckoHLSResourceWrapper::GlobalRef GetResourceWrapper() {
|
||||
return mHLSResourceWrapper;
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ private:
|
|||
void DoSetMediaSourceDuration(double aDuration);
|
||||
media::TimeInterval ClampIntervalToEnd(const media::TimeInterval& aInterval);
|
||||
bool CanPlayThroughImpl() override;
|
||||
bool IsLiveStream() override final { return !mEnded; }
|
||||
|
||||
RefPtr<MediaSourceResource> mResource;
|
||||
|
||||
|
|
|
@ -59,11 +59,6 @@ public:
|
|||
|
||||
bool IsTransportSeekable() override { return true; }
|
||||
|
||||
bool IsLiveStream() override
|
||||
{
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
return !mEnded;
|
||||
}
|
||||
void SetEnded(bool aEnded)
|
||||
{
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
|
|
Загрузка…
Ссылка в новой задаче