зеркало из https://github.com/mozilla/gecko-dev.git
Bug 816949 - Remove IsSeekableInBufferedRange() methods as they are not needed anymore. r=cpearce
This commit is contained in:
Родитель
2f3183fde3
Коммит
37399b1143
|
@ -1240,13 +1240,8 @@ nsresult MediaDecoder::GetSeekable(nsTimeRanges* aSeekable)
|
|||
// server supports range requests, etc.)
|
||||
if (!IsMediaSeekable()) {
|
||||
return NS_OK;
|
||||
} else if (!IsTransportSeekable()){
|
||||
if (mDecoderStateMachine &&
|
||||
mDecoderStateMachine->IsSeekableInBufferedRanges()) {
|
||||
return GetBuffered(aSeekable);
|
||||
} else {
|
||||
return NS_OK;
|
||||
}
|
||||
} else if (!IsTransportSeekable()) {
|
||||
return GetBuffered(aSeekable);
|
||||
} else {
|
||||
double end = IsInfinite() ? std::numeric_limits<double>::infinity()
|
||||
: initialTime + GetDuration();
|
||||
|
|
|
@ -422,9 +422,6 @@ public:
|
|||
virtual nsresult GetBuffered(nsTimeRanges* aBuffered,
|
||||
int64_t aStartTime) = 0;
|
||||
|
||||
// True if we can seek using only buffered ranges. This is backend dependant.
|
||||
virtual bool IsSeekableInBufferedRanges() = 0;
|
||||
|
||||
class VideoQueueMemoryFunctor : public nsDequeFunctor {
|
||||
public:
|
||||
VideoQueueMemoryFunctor() : mResult(0) {}
|
||||
|
|
|
@ -273,14 +273,6 @@ public:
|
|||
return mMediaSeekable;
|
||||
}
|
||||
|
||||
// Return true if the media is seekable using only buffered ranges.
|
||||
bool IsSeekableInBufferedRanges() {
|
||||
if (mReader) {
|
||||
return mReader->IsSeekableInBufferedRanges();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sets the current frame buffer length for the MozAudioAvailable event.
|
||||
// Accessed on the main and state machine threads.
|
||||
void SetFrameBufferLength(uint32_t aLength);
|
||||
|
|
|
@ -367,17 +367,6 @@ DASHReader::VideoQueue()
|
|||
return mVideoQueue;
|
||||
}
|
||||
|
||||
bool
|
||||
DASHReader::IsSeekableInBufferedRanges()
|
||||
{
|
||||
ReentrantMonitorConditionallyEnter mon(!mDecoder->OnDecodeThread(),
|
||||
mDecoder->GetReentrantMonitor());
|
||||
// At least one subreader must exist, and all subreaders must return true.
|
||||
return (mVideoReader || mAudioReader) &&
|
||||
!((mVideoReader && !mVideoReader->IsSeekableInBufferedRanges()) ||
|
||||
(mAudioReader && !mAudioReader->IsSeekableInBufferedRanges()));
|
||||
}
|
||||
|
||||
void
|
||||
DASHReader::RequestVideoReaderSwitch(uint32_t aFromReaderIdx,
|
||||
uint32_t aToReaderIdx,
|
||||
|
|
|
@ -115,9 +115,6 @@ public:
|
|||
// Called on the state machine or decode threads.
|
||||
VideoData* FindStartTime(int64_t& aOutStartTime);
|
||||
|
||||
// Call by state machine on multiple threads.
|
||||
bool IsSeekableInBufferedRanges();
|
||||
|
||||
// Prepares for an upcoming switch of video readers. Called by
|
||||
// |DASHDecoder| when it has switched download streams. Sets the index of
|
||||
// the reader to switch TO and the index of the subsegment to switch AT
|
||||
|
|
|
@ -36,10 +36,6 @@ public:
|
|||
int64_t aCurrentTime);
|
||||
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
|
||||
|
||||
virtual bool IsSeekableInBufferedRanges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool HasAudio() {
|
||||
return mInfo.mHasAudio;
|
||||
}
|
||||
|
|
|
@ -51,12 +51,6 @@ public:
|
|||
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
||||
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
|
||||
|
||||
// We use bisection to seek in buffered range, but we don't allow seeking in a
|
||||
// chained ogg file.
|
||||
virtual bool IsSeekableInBufferedRanges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
// This monitor should be taken when reading or writing to mIsChained.
|
||||
ReentrantMonitor mMonitor;
|
||||
|
|
|
@ -54,10 +54,6 @@ public:
|
|||
MetadataTags** aTags);
|
||||
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
||||
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
|
||||
virtual bool IsSeekableInBufferedRanges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -54,10 +54,6 @@ public:
|
|||
MetadataTags** aTags);
|
||||
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
||||
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
|
||||
virtual bool IsSeekableInBufferedRanges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -39,11 +39,6 @@ public:
|
|||
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
||||
virtual nsresult GetBuffered(nsTimeRanges* aBuffered, int64_t aStartTime);
|
||||
|
||||
// By seeking in the media resource, it is possible to seek.
|
||||
bool IsSeekableInBufferedRanges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
bool ReadFromResource(MediaResource *aResource, uint8_t *aBuf, uint32_t aLength);
|
||||
|
||||
|
|
|
@ -406,6 +406,12 @@ nsresult WebMReader::ReadMetadata(VideoInfo* aInfo,
|
|||
}
|
||||
#endif
|
||||
|
||||
// We can't seek in buffered regions if we have no cues.
|
||||
bool haveCues;
|
||||
int64_t dummy = -1;
|
||||
haveCues = nestegg_get_cue_point(mContext, 0, -1, &dummy, &dummy) == 0;
|
||||
mDecoder->SetMediaSeekable(haveCues);
|
||||
|
||||
*aInfo = mInfo;
|
||||
|
||||
*aTags = nullptr;
|
||||
|
|
|
@ -133,11 +133,6 @@ public:
|
|||
return mHasVideo;
|
||||
}
|
||||
|
||||
// Bug 575140, cannot seek in webm if no cue is present.
|
||||
bool IsSeekableInBufferedRanges() {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual nsresult ReadMetadata(VideoInfo* aInfo,
|
||||
MetadataTags** aTags);
|
||||
virtual nsresult Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
||||
|
|
Загрузка…
Ссылка в новой задаче