mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1121692 - Remove unnecessary arguments to ::Seek. r=mattwoodrow,sr=cpearce
This commit is contained in:
parent
a500c582a9
commit
e814d359c3
@ -150,12 +150,11 @@ public:
|
||||
// ReadUpdatedMetadata will always be called once ReadMetadata has succeeded.
|
||||
virtual void ReadUpdatedMetadata(MediaInfo* aInfo) { };
|
||||
|
||||
// Moves the decode head to aTime microseconds. aStartTime and aEndTime
|
||||
// denote the start and end times of the media in usecs, and aCurrentTime
|
||||
// is the current playback position in microseconds.
|
||||
// Moves the decode head to aTime microseconds. aEndTime denotes the end
|
||||
// time of the media in usecs. This is only needed for OggReader, and should
|
||||
// probably be removed somehow.
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime,
|
||||
int64_t aEndTime, int64_t aCurrentTime) = 0;
|
||||
Seek(int64_t aTime, int64_t aEndTime) = 0;
|
||||
|
||||
// Called to move the reader into idle state. When the reader is
|
||||
// created it is assumed to be active (i.e. not idle). When the media
|
||||
|
@ -2452,7 +2452,7 @@ void MediaDecoderStateMachine::DecodeSeek()
|
||||
// the reader, since it could do I/O or deadlock some other way.
|
||||
res = mReader->ResetDecode();
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
mReader->Seek(seekTime, mStartTime, GetEndTime(), mCurrentTimeBeforeSeek)
|
||||
mReader->Seek(seekTime, GetEndTime())
|
||||
->Then(DecodeTaskQueue(), __func__, this,
|
||||
&MediaDecoderStateMachine::OnSeekCompleted,
|
||||
&MediaDecoderStateMachine::OnSeekFailed);
|
||||
|
@ -320,7 +320,7 @@ bool AndroidMediaReader::DecodeAudioData()
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
AndroidMediaReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime)
|
||||
AndroidMediaReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags);
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsRefPtr<ShutdownPromise> Shutdown() MOZ_OVERRIDE;
|
||||
|
||||
|
@ -493,14 +493,9 @@ AppleMP3Reader::SetupDecoder()
|
||||
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
AppleMP3Reader::Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
AppleMP3Reader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread");
|
||||
NS_ASSERTION(aStartTime < aEndTime,
|
||||
"Seeking should happen over a positive range");
|
||||
|
||||
// Find the exact frame/packet that contains |aTime|.
|
||||
mCurrentAudioFrame = aTime * mAudioSampleRate / USECS_PER_S;
|
||||
|
@ -34,10 +34,7 @@ public:
|
||||
MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
void AudioSampleCallback(UInt32 aNumBytes,
|
||||
UInt32 aNumPackets,
|
||||
|
@ -368,10 +368,7 @@ DirectShowReader::HasVideo()
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
DirectShowReader::Seek(int64_t aTargetUs,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
DirectShowReader::Seek(int64_t aTargetUs, int64_t aEndTime)
|
||||
{
|
||||
nsresult res = SeekInternal(aTargetUs);
|
||||
if (NS_FAILED(res)) {
|
||||
|
@ -61,10 +61,7 @@ public:
|
||||
MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
|
||||
nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
void NotifyDataArrived(const char* aBuffer,
|
||||
uint32_t aLength,
|
||||
|
@ -898,10 +898,7 @@ MP4Reader::SkipVideoDemuxToNextKeyFrame(int64_t aTimeThreshold, uint32_t& parsed
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
MP4Reader::Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
MP4Reader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
LOG("MP4Reader::Seek(%lld)", aTime);
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
|
@ -59,10 +59,7 @@ public:
|
||||
virtual void ReadUpdatedMetadata(MediaInfo* aInfo) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsMediaSeekable() MOZ_OVERRIDE;
|
||||
|
||||
|
@ -789,10 +789,7 @@ bool GStreamerReader::DecodeVideoFrame(bool &aKeyFrameSkip,
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
GStreamerReader::Seek(int64_t aTarget,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
GStreamerReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
|
||||
|
@ -49,10 +49,7 @@ public:
|
||||
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags);
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered);
|
||||
|
||||
virtual void NotifyDataArrived(const char *aBuffer,
|
||||
|
@ -49,9 +49,7 @@ MediaSourceReader::MediaSourceReader(MediaSourceDecoder* aDecoder)
|
||||
, mLastAudioTime(0)
|
||||
, mLastVideoTime(0)
|
||||
, mPendingSeekTime(-1)
|
||||
, mPendingStartTime(-1)
|
||||
, mPendingEndTime(-1)
|
||||
, mPendingCurrentTime(-1)
|
||||
, mWaitingForSeekData(false)
|
||||
, mTimeThreshold(-1)
|
||||
, mDropAudioBeforeThreshold(false)
|
||||
@ -123,7 +121,7 @@ MediaSourceReader::RequestAudioData()
|
||||
}
|
||||
mAudioIsSeeking = false;
|
||||
if (SwitchAudioReader(mLastAudioTime)) {
|
||||
mAudioReader->Seek(mLastAudioTime, 0, 0, 0)
|
||||
mAudioReader->Seek(mLastAudioTime, 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::RequestAudioDataComplete,
|
||||
&MediaSourceReader::RequestAudioDataFailed);
|
||||
@ -220,7 +218,7 @@ MediaSourceReader::OnAudioNotDecoded(NotDecodedReason aReason)
|
||||
// EOS_FUZZ_US to allow for the fact that our end time can be inaccurate due to bug
|
||||
// 1065207.
|
||||
if (SwitchAudioReader(mLastAudioTime, EOS_FUZZ_US)) {
|
||||
mAudioReader->Seek(mLastAudioTime, 0, 0, 0)
|
||||
mAudioReader->Seek(mLastAudioTime, 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::RequestAudioDataComplete,
|
||||
&MediaSourceReader::RequestAudioDataFailed);
|
||||
@ -257,7 +255,7 @@ MediaSourceReader::RequestVideoData(bool aSkipToNextKeyframe, int64_t aTimeThres
|
||||
}
|
||||
mVideoIsSeeking = false;
|
||||
if (SwitchVideoReader(mLastVideoTime)) {
|
||||
mVideoReader->Seek(mLastVideoTime, 0, 0, 0)
|
||||
mVideoReader->Seek(mLastVideoTime, 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::RequestVideoDataComplete,
|
||||
&MediaSourceReader::RequestVideoDataFailed);
|
||||
@ -331,7 +329,7 @@ MediaSourceReader::OnVideoNotDecoded(NotDecodedReason aReason)
|
||||
// EOS_FUZZ_US to allow for the fact that our end time can be inaccurate due to bug
|
||||
// 1065207.
|
||||
if (SwitchVideoReader(mLastVideoTime, EOS_FUZZ_US)) {
|
||||
mVideoReader->Seek(mLastVideoTime, 0, 0, 0)
|
||||
mVideoReader->Seek(mLastVideoTime, 0)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::RequestVideoDataComplete,
|
||||
&MediaSourceReader::RequestVideoDataFailed);
|
||||
@ -625,11 +623,10 @@ MediaSourceReader::NotifyTimeRangesChanged()
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
MediaSourceReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
MediaSourceReader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
MSE_DEBUG("MediaSourceReader(%p)::Seek(aTime=%lld, aStart=%lld, aEnd=%lld, aCurrent=%lld)",
|
||||
this, aTime, aStartTime, aEndTime, aCurrentTime);
|
||||
this, aTime, aEndTime);
|
||||
|
||||
mSeekPromise.RejectIfExists(NS_OK, __func__);
|
||||
nsRefPtr<SeekPromise> p = mSeekPromise.Ensure(__func__);
|
||||
@ -642,9 +639,7 @@ MediaSourceReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
// Store pending seek target in case the track buffers don't contain
|
||||
// the desired time and we delay doing the seek.
|
||||
mPendingSeekTime = aTime;
|
||||
mPendingStartTime = aStartTime;
|
||||
mPendingEndTime = aEndTime;
|
||||
mPendingCurrentTime = aCurrentTime;
|
||||
|
||||
// Only increment the number of expected OnSeekCompleted
|
||||
// notifications if we weren't already waiting for AttemptSeek
|
||||
@ -665,10 +660,7 @@ MediaSourceReader::OnVideoSeekCompleted(int64_t aTime)
|
||||
if (mAudioTrack) {
|
||||
mAudioIsSeeking = true;
|
||||
SwitchAudioReader(mPendingSeekTime);
|
||||
mAudioReader->Seek(mPendingSeekTime,
|
||||
mPendingStartTime,
|
||||
mPendingEndTime,
|
||||
mPendingCurrentTime)
|
||||
mAudioReader->Seek(mPendingSeekTime, mPendingEndTime)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnAudioSeekCompleted,
|
||||
&MediaSourceReader::OnSeekFailed);
|
||||
@ -719,10 +711,7 @@ MediaSourceReader::AttemptSeek()
|
||||
if (mVideoTrack) {
|
||||
mVideoIsSeeking = true;
|
||||
SwitchVideoReader(mPendingSeekTime);
|
||||
mVideoReader->Seek(mPendingSeekTime,
|
||||
mPendingStartTime,
|
||||
mPendingEndTime,
|
||||
mPendingCurrentTime)
|
||||
mVideoReader->Seek(mPendingSeekTime, mPendingEndTime)
|
||||
->Then(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnVideoSeekCompleted,
|
||||
&MediaSourceReader::OnSeekFailed);
|
||||
|
@ -97,8 +97,7 @@ public:
|
||||
nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
void ReadUpdatedMetadata(MediaInfo* aInfo) MOZ_OVERRIDE;
|
||||
nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
// Acquires the decoder monitor, and is thus callable on any thread.
|
||||
nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
|
||||
@ -192,9 +191,7 @@ private:
|
||||
// to be added to the track buffer.
|
||||
MediaPromiseHolder<SeekPromise> mSeekPromise;
|
||||
int64_t mPendingSeekTime;
|
||||
int64_t mPendingStartTime;
|
||||
int64_t mPendingEndTime;
|
||||
int64_t mPendingCurrentTime;
|
||||
bool mWaitingForSeekData;
|
||||
|
||||
int64_t mTimeThreshold;
|
||||
|
@ -1425,12 +1425,9 @@ nsresult OggReader::SeekInUnbuffered(int64_t aTarget,
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
OggReader::Seek(int64_t aTarget,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
OggReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
nsresult res = SeekInternal(aTarget, aStartTime, aEndTime, aCurrentTime);
|
||||
nsresult res = SeekInternal(aTarget, aEndTime);
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
@ -1438,10 +1435,7 @@ OggReader::Seek(int64_t aTarget,
|
||||
}
|
||||
}
|
||||
|
||||
nsresult OggReader::SeekInternal(int64_t aTarget,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
nsresult OggReader::SeekInternal(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
if (mIsChained)
|
||||
@ -1452,10 +1446,10 @@ nsresult OggReader::SeekInternal(int64_t aTarget,
|
||||
NS_ENSURE_TRUE(resource != nullptr, NS_ERROR_FAILURE);
|
||||
int64_t adjustedTarget = aTarget;
|
||||
if (HasAudio() && mOpusState){
|
||||
adjustedTarget = std::max(aStartTime, aTarget - SEEK_OPUS_PREROLL);
|
||||
adjustedTarget = std::max(mStartTime, aTarget - SEEK_OPUS_PREROLL);
|
||||
}
|
||||
|
||||
if (adjustedTarget == aStartTime) {
|
||||
if (adjustedTarget == mStartTime) {
|
||||
// We've seeked to the media start. Just seek to the offset of the first
|
||||
// content page.
|
||||
res = resource->Seek(nsISeekableStream::NS_SEEK_SET, 0);
|
||||
@ -1464,10 +1458,10 @@ nsresult OggReader::SeekInternal(int64_t aTarget,
|
||||
res = ResetDecode(true);
|
||||
NS_ENSURE_SUCCESS(res,res);
|
||||
|
||||
NS_ASSERTION(aStartTime != -1, "mStartTime should be known");
|
||||
NS_ASSERTION(mStartTime != -1, "mStartTime should be known");
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
mDecoder->UpdatePlaybackPosition(aStartTime);
|
||||
mDecoder->UpdatePlaybackPosition(mStartTime);
|
||||
}
|
||||
} else {
|
||||
// TODO: This may seek back unnecessarily far in the video, but we don't
|
||||
@ -1484,18 +1478,18 @@ nsresult OggReader::SeekInternal(int64_t aTarget,
|
||||
NS_ENSURE_SUCCESS(res,res);
|
||||
|
||||
// Figure out if the seek target lies in a buffered range.
|
||||
SeekRange r = SelectSeekRange(ranges, aTarget, aStartTime, aEndTime, true);
|
||||
SeekRange r = SelectSeekRange(ranges, aTarget, mStartTime, aEndTime, true);
|
||||
|
||||
if (!r.IsNull()) {
|
||||
// We know the buffered range in which the seek target lies, do a
|
||||
// bisection search in that buffered range.
|
||||
res = SeekInBufferedRange(aTarget, adjustedTarget, aStartTime, aEndTime, ranges, r);
|
||||
res = SeekInBufferedRange(aTarget, adjustedTarget, mStartTime, aEndTime, ranges, r);
|
||||
NS_ENSURE_SUCCESS(res,res);
|
||||
} else {
|
||||
// The target doesn't lie in a buffered range. Perform a bisection
|
||||
// search over the whole media, using the known buffered ranges to
|
||||
// reduce the search space.
|
||||
res = SeekInUnbuffered(aTarget, aStartTime, aEndTime, ranges);
|
||||
res = SeekInUnbuffered(aTarget, mStartTime, aEndTime, ranges);
|
||||
NS_ENSURE_SUCCESS(res,res);
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsMediaSeekable() MOZ_OVERRIDE;
|
||||
@ -96,7 +96,7 @@ private:
|
||||
// to the start of the stream.
|
||||
nsresult ResetDecode(bool start);
|
||||
|
||||
nsresult SeekInternal(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime);
|
||||
nsresult SeekInternal(int64_t aTime, int64_t aEndTime);
|
||||
|
||||
bool HasSkeleton() {
|
||||
return mSkeletonState != 0 && mSkeletonState->mActive;
|
||||
|
@ -995,10 +995,7 @@ MediaCodecReader::DecodeVideoFrameSync(int64_t aTimeThreshold)
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
MediaCodecReader::Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
MediaCodecReader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
MOZ_ASSERT(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
|
||||
|
@ -101,10 +101,7 @@ public:
|
||||
// denote the start and end times of the media in usecs, and aCurrentTime
|
||||
// is the current playback position in microseconds.
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsMediaSeekable() MOZ_OVERRIDE;
|
||||
|
||||
|
@ -546,7 +546,7 @@ bool MediaOmxReader::DecodeAudioData()
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
MediaOmxReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime)
|
||||
MediaOmxReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
EnsureActive();
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags);
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsMediaSeekable() MOZ_OVERRIDE;
|
||||
|
||||
|
@ -39,8 +39,7 @@ RtspMediaCodecReader::CreateExtractor()
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
RtspMediaCodecReader::Seek(int64_t aTime, int64_t aStartTime,
|
||||
int64_t aEndTime, int64_t aCurrentTime)
|
||||
RtspMediaCodecReader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
// The seek function of Rtsp is time-based, we call the SeekTime function in
|
||||
// RtspMediaResource. The SeekTime function finally send a seek command to
|
||||
@ -48,7 +47,7 @@ RtspMediaCodecReader::Seek(int64_t aTime, int64_t aStartTime,
|
||||
// RtspMediaResource.
|
||||
mRtspResource->SeekTime(aTime);
|
||||
|
||||
return MediaCodecReader::Seek(aTime, aStartTime, aEndTime, aCurrentTime);
|
||||
return MediaCodecReader::Seek(aTime, aEndTime);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -37,8 +37,7 @@ public:
|
||||
|
||||
// Implement a time-based seek instead of byte-based.
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
// Override GetBuffered() to do nothing for below reasons:
|
||||
// 1. Because the Rtsp stream is a/v separated. The buffered data in a/v
|
||||
|
@ -33,8 +33,7 @@ nsresult RtspOmxReader::InitOmxDecoder()
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
RtspOmxReader::Seek(int64_t aTime, int64_t aStartTime,
|
||||
int64_t aEndTime, int64_t aCurrentTime)
|
||||
RtspOmxReader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
// The seek function of Rtsp is time-based, we call the SeekTime function in
|
||||
// RtspMediaResource. The SeekTime function finally send a seek command to
|
||||
@ -49,7 +48,7 @@ RtspOmxReader::Seek(int64_t aTime, int64_t aStartTime,
|
||||
// seek operation. The function will clear the |mVideoQueue| and |mAudioQueue|
|
||||
// that store the decoded data and also call the |DecodeToTarget| to pass
|
||||
// the seek time to OMX a/v decoders.
|
||||
return MediaOmxReader::Seek(aTime, aStartTime, aEndTime, aCurrentTime);
|
||||
return MediaOmxReader::Seek(aTime, aEndTime);
|
||||
}
|
||||
|
||||
void RtspOmxReader::SetIdle() {
|
||||
|
@ -47,8 +47,7 @@ public:
|
||||
|
||||
// Implement a time-based seek instead of byte-based..
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_FINAL MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_FINAL MOZ_OVERRIDE;
|
||||
|
||||
// Override GetBuffered() to do nothing for below reasons:
|
||||
// 1. Because the Rtsp stream is a/v separated. The buffered data in a/v
|
||||
|
@ -236,7 +236,7 @@ bool RawReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
RawReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime)
|
||||
RawReader::Seek(int64_t aTime, int64_t aEndTime)
|
||||
{
|
||||
nsresult res = SeekInternal(aTime);
|
||||
if (NS_FAILED(res)) {
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -258,7 +258,7 @@ bool WaveReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
WaveReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime)
|
||||
WaveReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
LOG(PR_LOG_DEBUG, ("%p About to seek to %lld", mDecoder, aTarget));
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -952,10 +952,9 @@ void WebMReader::PushVideoPacket(NesteggPacketHolder* aItem)
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
WebMReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
WebMReader::Seek(int64_t aTarget, int64_t aEndTime)
|
||||
{
|
||||
nsresult res = SeekInternal(aTarget, aStartTime);
|
||||
nsresult res = SeekInternal(aTarget);
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
@ -963,7 +962,7 @@ WebMReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime,
|
||||
}
|
||||
}
|
||||
|
||||
nsresult WebMReader::SeekInternal(int64_t aTarget, int64_t aStartTime)
|
||||
nsresult WebMReader::SeekInternal(int64_t aTarget)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
|
||||
if (mVideoDecoder) {
|
||||
@ -980,7 +979,7 @@ nsresult WebMReader::SeekInternal(int64_t aTarget, int64_t aStartTime)
|
||||
uint64_t target = aTarget * NS_PER_USEC;
|
||||
|
||||
if (mSeekPreroll) {
|
||||
target = std::max(uint64_t(aStartTime * NS_PER_USEC),
|
||||
target = std::max(uint64_t(mStartTime * NS_PER_USEC),
|
||||
target - mSeekPreroll);
|
||||
}
|
||||
int r = nestegg_track_seek(mContext, trackToSeek, target);
|
||||
|
@ -156,7 +156,7 @@ public:
|
||||
virtual nsresult ReadMetadata(MediaInfo* aInfo,
|
||||
MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
virtual nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
|
||||
virtual void NotifyDataArrived(const char* aBuffer, uint32_t aLength,
|
||||
@ -210,7 +210,7 @@ protected:
|
||||
// reading metadata or destruction of the reader itself.
|
||||
void Cleanup();
|
||||
|
||||
virtual nsresult SeekInternal(int64_t aTime, int64_t aStartTime);
|
||||
virtual nsresult SeekInternal(int64_t aTime);
|
||||
|
||||
// Initializes mLayersBackendType if possible.
|
||||
void InitLayersBackendType();
|
||||
|
@ -889,10 +889,7 @@ WMFReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::SeekPromise>
|
||||
WMFReader::Seek(int64_t aTargetUs,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime)
|
||||
WMFReader::Seek(int64_t aTargetUs, int64_t aEndTime)
|
||||
{
|
||||
nsresult res = SeekInternal(aTargetUs);
|
||||
if (NS_FAILED(res)) {
|
||||
|
@ -44,10 +44,7 @@ public:
|
||||
MetadataTags** aTags) MOZ_OVERRIDE;
|
||||
|
||||
nsRefPtr<SeekPromise>
|
||||
Seek(int64_t aTime,
|
||||
int64_t aStartTime,
|
||||
int64_t aEndTime,
|
||||
int64_t aCurrentTime) MOZ_OVERRIDE;
|
||||
Seek(int64_t aTime, int64_t aEndTime) MOZ_OVERRIDE;
|
||||
|
||||
bool IsMediaSeekable() MOZ_OVERRIDE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user