mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1320466 part 2 - implement media data decoded/not-decoded handlers in SeekTask; r=jwwang
MozReview-Commit-ID: ImzEoZQUOtT --HG-- extra : rebase_source : 937a3c5f9512866966980e944c5aac51de001fdf
This commit is contained in:
parent
011ca5f67b
commit
ce421c2f78
@ -112,6 +112,27 @@ AccurateSeekTask::CalculateNewCurrentTime() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
AccurateSeekTask::HandleAudioDecoded(MediaData* aAudio)
|
||||
{
|
||||
AssertOwnerThread();
|
||||
OnAudioDecoded(aAudio);
|
||||
}
|
||||
|
||||
void
|
||||
AccurateSeekTask::HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart)
|
||||
{
|
||||
AssertOwnerThread();
|
||||
OnVideoDecoded(aVideo);
|
||||
}
|
||||
|
||||
void
|
||||
AccurateSeekTask::HandleNotDecoded(MediaData::Type aType, const MediaResult& aError)
|
||||
{
|
||||
AssertOwnerThread();
|
||||
OnNotDecoded(aType, aError);
|
||||
}
|
||||
|
||||
RefPtr<AccurateSeekTask::SeekTaskPromise>
|
||||
AccurateSeekTask::Seek(const media::TimeUnit& aDuration)
|
||||
{
|
||||
|
@ -31,6 +31,12 @@ public:
|
||||
|
||||
int64_t CalculateNewCurrentTime() const override;
|
||||
|
||||
void HandleAudioDecoded(MediaData* aAudio) override;
|
||||
|
||||
void HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override;
|
||||
|
||||
void HandleNotDecoded(MediaData::Type aType, const MediaResult& aError) override;
|
||||
|
||||
private:
|
||||
~AccurateSeekTask();
|
||||
|
||||
|
@ -78,6 +78,36 @@ NextFrameSeekTask::CalculateNewCurrentTime() const
|
||||
return mTarget.GetTime().ToMicroseconds();
|
||||
}
|
||||
|
||||
void
|
||||
NextFrameSeekTask::HandleAudioDecoded(MediaData* aAudio)
|
||||
{
|
||||
AssertOwnerThread();
|
||||
OnAudioDecoded(aAudio);
|
||||
}
|
||||
|
||||
void
|
||||
NextFrameSeekTask::HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart)
|
||||
{
|
||||
AssertOwnerThread();
|
||||
OnVideoDecoded(aVideo);
|
||||
}
|
||||
|
||||
void
|
||||
NextFrameSeekTask::HandleNotDecoded(MediaData::Type aType, const MediaResult& aError)
|
||||
{
|
||||
AssertOwnerThread();
|
||||
switch (aType) {
|
||||
case MediaData::AUDIO_DATA:
|
||||
OnAudioNotDecoded(aError);
|
||||
break;
|
||||
case MediaData::VIDEO_DATA:
|
||||
OnVideoNotDecoded(aError);
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("We cannot handle RAW_DATA or NULL_DATA here.");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove samples from the queue until aCompare() returns false.
|
||||
* aCompare A function object with the signature bool(int64_t) which returns
|
||||
|
@ -42,6 +42,12 @@ public:
|
||||
|
||||
int64_t CalculateNewCurrentTime() const override;
|
||||
|
||||
void HandleAudioDecoded(MediaData* aAudio) override;
|
||||
|
||||
void HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override;
|
||||
|
||||
void HandleNotDecoded(MediaData::Type aType, const MediaResult& aError) override;
|
||||
|
||||
private:
|
||||
~NextFrameSeekTask();
|
||||
|
||||
|
@ -62,6 +62,12 @@ public:
|
||||
|
||||
const SeekTarget& GetSeekTarget();
|
||||
|
||||
virtual void HandleAudioDecoded(MediaData* aAudio) = 0;
|
||||
|
||||
virtual void HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) = 0;
|
||||
|
||||
virtual void HandleNotDecoded(MediaData::Type aType, const MediaResult& aError) = 0;
|
||||
|
||||
protected:
|
||||
SeekTask(const void* aDecoderID,
|
||||
AbstractThread* aThread,
|
||||
|
Loading…
Reference in New Issue
Block a user