Closed Bug 1307677 Opened 8 years ago Closed 8 years ago

Move some code from MDSM::InitiateSeek to state objects

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(6 files)

      No description provided.
Assignee: nobody → jwwang
Blocks: 1295892
Priority: -- → P3
Attachment #8797905 - Flags: review?(kaku)
Attachment #8797906 - Flags: review?(kaku)
Attachment #8797907 - Flags: review?(kaku)
Attachment #8797908 - Flags: review?(kaku)
Attachment #8797909 - Flags: review?(kaku)
Attachment #8797910 - Flags: review?(kaku)
Comment on attachment 8797905 [details]
Bug 1307677. Part 1 - move some code from Seek() to various state objects.

https://reviewboard.mozilla.org/r/83498/#review82104

::: dom/media/MediaDecoderStateMachine.cpp:487
(Diff revision 1)
>      return true;
>    }
>  
> +  RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override
> +  {
> +    // Should've transitioned to DECODING in Enter().

Could we make this comment more explicit, it took me a while to understand..., such as "If mMaster->mSentFirstFrameLoadedEvent is true, then we should have transitioned to DECODING sate in Enter()"?
Attachment #8797905 - Flags: review?(kaku) → review+
Comment on attachment 8797906 [details]
Bug 1307677. Part 2 - add some assertion to DecodingFirstFrameState::HandleSeek().

https://reviewboard.mozilla.org/r/83500/#review82130
Attachment #8797906 - Flags: review?(kaku) → review+
Comment on attachment 8797907 [details]
Bug 1307677. Part 3 - move |mCurrentSeek.mPromise.Ensure| out of InitiateSeek(). This makes it easier to move more code into SeekingState.

https://reviewboard.mozilla.org/r/83502/#review82132
Attachment #8797907 - Flags: review?(kaku) → review+
Comment on attachment 8797908 [details]
Bug 1307677. Part 4 - prepare to move most code of InitiateSeek() into the entry action of SeekingState.

https://reviewboard.mozilla.org/r/83504/#review82108

::: dom/media/MediaDecoderStateMachine.cpp:2114
(Diff revision 1)
>  void
>  MediaDecoderStateMachine::InitiateSeek(SeekJob aSeekJob)
>  {
>    MOZ_ASSERT(OnTaskQueue());
>  
> -  SetState(DECODER_STATE_SEEKING);
> +  mStateObj->Exit();

I think it's worthy having the comment "Note we can't call SetState() because we might need to seek again in the SEEKING state." here.
Attachment #8797908 - Flags: review?(kaku) → review+
Comment on attachment 8797909 [details]
Bug 1307677. Part 5 - move most code of InitiateSeek() into the entry action of SeekingState.

https://reviewboard.mozilla.org/r/83506/#review82134
Attachment #8797909 - Flags: review?(kaku) → review+
Comment on attachment 8797910 [details]
Bug 1307677. Part 6 - don't access mMaster after InitiateSeek() which will delete the current state object.

https://reviewboard.mozilla.org/r/83508/#review82136
Attachment #8797910 - Flags: review?(kaku) → review+
Thanks for the review!
Pushed by jwwang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aad3743b683e
Part 1 - move some code from Seek() to various state objects. r=kaku
https://hg.mozilla.org/integration/autoland/rev/c873b164dd0b
Part 2 - add some assertion to DecodingFirstFrameState::HandleSeek(). r=kaku
https://hg.mozilla.org/integration/autoland/rev/f7fa85291b36
Part 3 - move |mCurrentSeek.mPromise.Ensure| out of InitiateSeek(). This makes it easier to move more code into SeekingState. r=kaku
https://hg.mozilla.org/integration/autoland/rev/fa6fa05f85fd
Part 4 - prepare to move most code of InitiateSeek() into the entry action of SeekingState. r=kaku
https://hg.mozilla.org/integration/autoland/rev/d8b4fa10a177
Part 5 - move most code of InitiateSeek() into the entry action of SeekingState. r=kaku
https://hg.mozilla.org/integration/autoland/rev/2108248c4021
Part 6 - don't access mMaster after InitiateSeek() which will delete the current state object. r=kaku
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: