Bug 1351574. P2 - let MediaDecoderReader::DecodeVideoFrame() take TimeUnit instead of int64_t. r=jya

MozReview-Commit-ID: 84z2yir8sfX

--HG--
extra : rebase_source : 9eda512734dfd7d72b107ee5c6e2c2bac9553b44
extra : source : 5c9d90e876ced6d35dd269e10c817de4f30288b3
This commit is contained in:
JW Wang 2017-03-30 18:07:53 +08:00
Родитель 8944536d62
Коммит 555e36e1d0
6 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

@ -164,7 +164,7 @@ MediaDecoderReader::DecodeToFirstVideoData()
MOZ_ASSERT(self->OnTaskQueue());
NS_ENSURE_TRUE(!self->mShutdown, false);
bool skip = false;
if (!self->DecodeVideoFrame(skip, 0)) {
if (!self->DecodeVideoFrame(skip, media::TimeUnit::Zero())) {
self->VideoQueue().Finish();
return !!self->VideoQueue().PeekFront();
}
@ -293,7 +293,7 @@ MediaDecoderReader::RequestVideoData(bool aSkipToNextKeyframe,
bool skip = aSkipToNextKeyframe;
while (VideoQueue().GetSize() == 0 &&
!VideoQueue().IsFinished()) {
if (!DecodeVideoFrame(skip, aTimeThreshold.ToMicroseconds())) {
if (!DecodeVideoFrame(skip, aTimeThreshold)) {
VideoQueue().Finish();
} else if (skip) {
// We still need to decode more data in order to skip to the next

Просмотреть файл

@ -366,7 +366,8 @@ private:
// (unless they're not keyframes and aKeyframeSkip is true), but will
// not be added to the queue. This function blocks until the decode
// is complete.
virtual bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold)
virtual bool DecodeVideoFrame(bool& aKeyframeSkip,
const media::TimeUnit& aTimeThreshold)
{
return false;
}

Просмотреть файл

@ -116,8 +116,8 @@ nsresult AndroidMediaReader::ResetDecode(TrackSet aTracks)
return MediaDecoderReader::ResetDecode(aTracks);
}
bool AndroidMediaReader::DecodeVideoFrame(bool &aKeyframeSkip,
int64_t aTimeThreshold)
bool AndroidMediaReader::DecodeVideoFrame(bool& aKeyframeSkip,
const media::TimeUnit& aTimeThreshold)
{
// Record number of frames decoded and parsed. Automatically update the
// stats counters using the AutoNotifyDecoded stack-based class.
@ -253,7 +253,7 @@ bool AndroidMediaReader::DecodeVideoFrame(bool &aKeyframeSkip,
// We have the start time of the next frame, so we can push the previous
// frame into the queue, except if the end time is below the threshold,
// in which case it wouldn't be displayed anyway.
if (mLastVideoFrame->GetEndTime() < aTimeThreshold) {
if (mLastVideoFrame->GetEndTime() < aTimeThreshold.ToMicroseconds()) {
mLastVideoFrame = nullptr;
continue;
}

Просмотреть файл

@ -44,7 +44,8 @@ public:
TrackInfo::kVideoTrack)) override;
bool DecodeAudioData() override;
bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override;
bool DecodeVideoFrame(bool& aKeyframeSkip,
const media::TimeUnit& aTimeThreshold) override;
nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override;
RefPtr<SeekPromise> Seek(const SeekTarget& aTarget) override;

Просмотреть файл

@ -312,8 +312,8 @@ DirectShowReader::DecodeAudioData()
}
bool
DirectShowReader::DecodeVideoFrame(bool &aKeyframeSkip,
int64_t aTimeThreshold)
DirectShowReader::DecodeVideoFrame(bool& aKeyframeSkip,
const media::TimeUnit& aTimeThreshold)
{
MOZ_ASSERT(OnTaskQueue());
return false;

Просмотреть файл

@ -51,8 +51,8 @@ public:
virtual ~DirectShowReader();
bool DecodeAudioData() override;
bool DecodeVideoFrame(bool &aKeyframeSkip,
int64_t aTimeThreshold) override;
bool DecodeVideoFrame(bool& aKeyframeSkip,
const media::TimeUnit& aTimeThreshold) override;
nsresult ReadMetadata(MediaInfo* aInfo,
MetadataTags** aTags) override;