Bug 1322801 part 5 - let AccurateSeekingState and NextFrameSeekingState have their own implementation of OnSeekTask{Resolved,Rejected}(); r=jwwang

MozReview-Commit-ID: 4SWeczIdoay

--HG--
extra : rebase_source : 6c0c797a1aeafedc9df934e544cab89fee08f416
This commit is contained in:
Kaku Kuo 2016-12-09 18:47:27 -10:00
Родитель e34f6551e4
Коммит 32aefe5b03
1 изменённых файлов: 86 добавлений и 42 удалений

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

@ -856,48 +856,6 @@ protected:
void SeekCompleted();
void OnSeekTaskResolved(const SeekTaskResolveValue& aValue)
{
mSeekTaskRequest.Complete();
if (aValue.mSeekedAudioData) {
mMaster->Push(aValue.mSeekedAudioData);
mMaster->mDecodedAudioEndTime = std::max(
aValue.mSeekedAudioData->GetEndTime(), mMaster->mDecodedAudioEndTime);
}
if (aValue.mSeekedVideoData) {
mMaster->Push(aValue.mSeekedVideoData);
mMaster->mDecodedVideoEndTime = std::max(
aValue.mSeekedVideoData->GetEndTime(), mMaster->mDecodedVideoEndTime);
}
if (aValue.mIsAudioQueueFinished) {
AudioQueue().Finish();
}
if (aValue.mIsVideoQueueFinished) {
VideoQueue().Finish();
}
SeekCompleted();
}
void OnSeekTaskRejected(const SeekTaskRejectValue& aValue)
{
mSeekTaskRequest.Complete();
if (aValue.mIsAudioQueueFinished) {
AudioQueue().Finish();
}
if (aValue.mIsVideoQueueFinished) {
VideoQueue().Finish();
}
mMaster->DecodeError(aValue.mError);
}
private:
virtual void CreateSeekTask() = 0;
@ -949,6 +907,49 @@ private:
OnSeekTaskRejected(aValue);
}));
}
void OnSeekTaskResolved(const SeekTaskResolveValue& aValue)
{
mSeekTaskRequest.Complete();
if (aValue.mSeekedAudioData) {
mMaster->Push(aValue.mSeekedAudioData);
mMaster->mDecodedAudioEndTime = std::max(
aValue.mSeekedAudioData->GetEndTime(), mMaster->mDecodedAudioEndTime);
}
if (aValue.mSeekedVideoData) {
mMaster->Push(aValue.mSeekedVideoData);
mMaster->mDecodedVideoEndTime = std::max(
aValue.mSeekedVideoData->GetEndTime(), mMaster->mDecodedVideoEndTime);
}
if (aValue.mIsAudioQueueFinished) {
AudioQueue().Finish();
}
if (aValue.mIsVideoQueueFinished) {
VideoQueue().Finish();
}
SeekCompleted();
}
void OnSeekTaskRejected(const SeekTaskRejectValue& aValue)
{
mSeekTaskRequest.Complete();
if (aValue.mIsAudioQueueFinished) {
AudioQueue().Finish();
}
if (aValue.mIsVideoQueueFinished) {
VideoQueue().Finish();
}
mMaster->DecodeError(aValue.mError);
}
};
class MediaDecoderStateMachine::NextFrameSeekingState
@ -991,6 +992,49 @@ private:
OnSeekTaskRejected(aValue);
}));
}
void OnSeekTaskResolved(const SeekTaskResolveValue& aValue)
{
mSeekTaskRequest.Complete();
if (aValue.mSeekedAudioData) {
mMaster->Push(aValue.mSeekedAudioData);
mMaster->mDecodedAudioEndTime = std::max(
aValue.mSeekedAudioData->GetEndTime(), mMaster->mDecodedAudioEndTime);
}
if (aValue.mSeekedVideoData) {
mMaster->Push(aValue.mSeekedVideoData);
mMaster->mDecodedVideoEndTime = std::max(
aValue.mSeekedVideoData->GetEndTime(), mMaster->mDecodedVideoEndTime);
}
if (aValue.mIsAudioQueueFinished) {
AudioQueue().Finish();
}
if (aValue.mIsVideoQueueFinished) {
VideoQueue().Finish();
}
SeekCompleted();
}
void OnSeekTaskRejected(const SeekTaskRejectValue& aValue)
{
mSeekTaskRequest.Complete();
if (aValue.mIsAudioQueueFinished) {
AudioQueue().Finish();
}
if (aValue.mIsVideoQueueFinished) {
VideoQueue().Finish();
}
mMaster->DecodeError(aValue.mError);
}
};
/**