Commit Graph
1098 Commits
Author SHA1 Message Date
JW Wang 330cebcda4 Bug 1300479. Part 1 - remove the aState parameter from EnterState()/ExitState() for we always pass mState. r=kaku
MozReview-Commit-ID: 8YLxMpevEJS
2016-09-05 15:28:37 +08:00
JW Wang 35463e03a2 Bug 1297590. Part 10 - remove some mSentFirstFrameLoadedEvent checks for it is surely true when mState is DECODING. r=kaku
MozReview-Commit-ID: 5wwCc33KTHF
2016-09-01 16:34:24 +08:00
JW Wang 2b531b4283 Bug 1297590. Part 9 - fix MaybeFinishDecodeFirstFrame(). r=kaku
1. The return value is not used.
2. It should be called only when mSentFirstFrameLoadedEvent is false.
3. Transition to SEEK if there is any pending seek or DECODER_STATE_DECODING otherwise.

MozReview-Commit-ID: LIO0MPGzhsX
2016-09-01 13:01:48 +08:00
JW Wang 85e31abb38 Bug 1297590. Part 8 - add an entry action for DECODER_STATE_DECODING_FIRSTFRAME. r=kaku
We move the handling of pending seek from the entry action of DECODING to that of DECODING_FIRSTFRAME.

MozReview-Commit-ID: qMnJ0ON2cK
2016-09-01 12:54:43 +08:00
JW Wang d8f76b1fb3 Bug 1297590. Part 7 - remove the call to MaybeFinishDecodeFirstFrame() from OnNotDecoded(). r=kaku
It is impossible to finish decoding first frames while waiting for data.

MozReview-Commit-ID: 8eR8Rf9TuD8
2016-09-01 12:02:49 +08:00
JW Wang dc5472ff5d Bug 1297590. Part 6 - Move MaybeFinishDecodeFirstFrame() from case DECODER_STATE_DECODING to case DECODER_STATE_DECODING_FIRSTFRAME. r=kaku
MozReview-Commit-ID: aylNzLhwaT
2016-09-01 12:00:44 +08:00
JW Wang 3e0de9b2b0 Bug 1297590. Part 5 - change some SetState(DECODER_STATE_DECODING) to SetState(DECODER_STATE_DECODING_FIRSTFRAME). r=kaku
MDSM used to transition to DECODING in the following places:
1. BUFFERING
2. OnMetadataRead()
3. WAIT_FOR_CDM
4. SeekCompleted()

We will transition to DECODING_FIRSTFRAME in case 2 and 3.

For case 1, BUFFERING makes sense only after decoding first frames. So BUFFERING
should never transition to DECODING_FIRSTFRAME.

For case 4, we always finish decoding first frames before completing seek. So
It should not transition to DECODING_FIRSTFRAME either.

MozReview-Commit-ID: 7VnK82wjgZv
2016-09-01 11:55:43 +08:00
JW Wang 18c551beb2 Bug 1297590. Part 4 - change test mState >= DECODER_STATE_DECODING to mState >= DECODER_STATE_DECODING_FIRSTFRAME. r=kaku
MozReview-Commit-ID: ImqqLCyp2Yc
2016-09-01 11:48:16 +08:00
JW Wang 720238ec7e Bug 1297590. Part 3 - change test mState >= DECODER_STATE_DECODING && mSentFirstFrameLoadedEvent to mState >= DECODER_STATE_DECODING. r=kaku
MozReview-Commit-ID: ASWBi7D7DOK
2016-09-01 11:47:17 +08:00
JW Wang dedbb752ac Bug 1297590. Part 2 - change test mState != DECODER_STATE_DECODING to mState != DECODER_STATE_DECODING && mState != DECODER_STATE_DECODING_FIRSTFRAME. r=kaku
MozReview-Commit-ID: F62HdoctGpD
2016-09-01 11:45:56 +08:00
JW Wang 7fd372da71 Bug 1297590. Part 1 - add DECODER_STATE_DECODING_FIRSTFRAME to MDSM. r=kaku
When separating decoding frist frames from the DECODING state, we need
to change the test `mState == DECODER_STATE_DECODING` to
`mState == DECODER_STATE_DECODING || mState == DECODER_STATE_DECODING_FIRSTFRAME`.
However, we don't make changes for those where mSentFirstFrameLoadedEvent is
proven to be true. Because there is no way for mState to be DECODING_FIRSTFRAME
when mSentFirstFrameLoadedEvent is true.

MozReview-Commit-ID: 7jv3SDlmBBG
2016-09-01 14:28:45 +08:00
JW Wang dcb2604b4a Bug 1299393. Part 1 - make some functions return void and fix the comments. r=kaku
MozReview-Commit-ID: 3wAjgxcMLhX
2016-08-31 15:46:59 +08:00
JW Wang d5ecd9cdf8 Bug 1299387 - check the duration instead of mState to match the comment. r=kaku
MozReview-Commit-ID: E1MgKHDIRAq
2016-08-31 14:54:24 +08:00
JW Wang 60085430b4 Bug 1299369. Part 4 - remove the check for mSentFirstFrameLoadedEvent from RequestVideoData() because NeedToSkipToNextKeyframe() already checks it. r=kaku
MozReview-Commit-ID: 4iUgyeKKNlD
2016-08-31 13:12:51 +08:00
JW Wang b410d9875a Bug 1299369. Part 2 - except for BUFFERING or SEEKING, HaveNextFrameData() should be able to tell us whether next frames are available. r=kaku
MozReview-Commit-ID: HtVP2ncyxjv
2016-08-31 13:06:19 +08:00
JW Wang 331a8f5cf8 Bug 1299369. Part 1 - assert !mSentFirstFrameLoadedEvent in FinishDecodeFirstFrame(). r=kaku
FinishDecodeFirstFrame() is called from:
1. MaybeFinishDecodeFirstFrame() when mSentFirstFrameLoadedEvent is false.
2. SeekCompleted() when mSentFirstFrameLoadedEvent is false.

MozReview-Commit-ID: HOV3ZeS2qB0
2016-08-31 12:54:50 +08:00
JW Wang 6d40da2508 Bug 1299074. Part 5 - remove unused members. r=kaku
MozReview-Commit-ID: DPDPuMKUNPv
2016-08-30 16:48:09 +08:00
JW Wang 239707b1be Bug 1299074. Part 4 - replace checks for IsDecodingFirstFrame() with !mSentFirstFrameLoadedEvent. r=kaku
MozReview-Commit-ID: 4ouQAdn4hbZ
2016-08-30 16:45:26 +08:00
JW Wang 5545aaa066 Bug 1299074. Part 3 - check |mSentFirstFrameLoadedEvent| to know whether we can finish decoding first frames. r=kaku
MozReview-Commit-ID: 10VNH3rhPpy
2016-08-30 16:32:36 +08:00
JW Wang a573d0f9f2 Bug 1299074. Part 2 - simplify the handling of pending seek in StartDecoding(). r=kaku
mSentFirstFrameLoadedEvent is sufficient to tell us whether we can handle the pending seek now or later.

MozReview-Commit-ID: KzDd2brvKPA
2016-08-30 16:21:43 +08:00
JW Wang 3222f32cfd Bug 1299064. Part 3 - remove the calls to ScheduleStateMachine() following |SetState(DECODER_STATE_DECODING)|. r=kaku
Note nextState is either DECODER_STATE_COMPLETED or DECODER_STATE_DECODING in SeekCompleted().
Their entry actions call ScheduleStateMachine() directly or indirectly.

MozReview-Commit-ID: DpDW7qtlogV
2016-08-30 15:11:15 +08:00
JW Wang 0b5a1ffa95 Bug 1299064. Part 2 - remove the if/else statement at the end of SeekCompleted(). r=kaku
|SetState(nextState)| is the equivalent of the if/else.

MozReview-Commit-ID: 51ab4BBdd4T
2016-08-30 15:06:56 +08:00
JW Wang bdaad21780 Bug 1299064. Part 1 - move |SetState(nextState)| and ScheduleStateMachine() to the bottom of SeekCompleted(). r=kaku
UpdatePlaybackPositionInternal(), |mQuickBuffering = false| and |mMediaSink->Redraw| should belong to
the exit action of SEEKING. By change the order of the statements, we have a better definition/scope
for the jobs of each state.

MozReview-Commit-ID: 6WESdwaD8Ba
2016-08-30 15:04:43 +08:00
JW Wang 21050bb072 Bug 1298297 - Remove DECODER_STATE_ERROR from MDSM. r=kaku
MozReview-Commit-ID: BWpPoXDDlux
2016-08-26 17:41:45 +12:00
JW Wang 350d12fb28 Bug 1298217. Part 11 - Move some code to the entry action of DECODER_STATE_BUFFERING. r=kaku
MozReview-Commit-ID: BCtmXQi2zNg
2016-08-29 11:50:10 +08:00
JW Wang 2f0989b5ce Bug 1298217. Part 10 - Assert |mState == DECODER_STATE_DECODING| in StartBuffering() which is only called by MaybeStartBuffering() which also asserts that. r=kaku
MozReview-Commit-ID: BhcNiiQZX3I
2016-08-26 06:34:06 +12:00
JW Wang e236988541 Bug 1298217. Part 9 - Assert |mState == DECODER_STATE_DECODING| in MaybeStartBuffering() which is only called in the DECODER_STATE_DECODING case of RunStateMachine(). r=kaku
MozReview-Commit-ID: KLz8CpxDz71
2016-08-26 06:31:57 +12:00
JW Wang a6ff19c799 Bug 1298217. Part 8 - Move some code to the entry action of DECODER_STATE_DECODING. r=kaku
MozReview-Commit-ID: 1gzwIX566i
2016-08-29 11:46:08 +08:00
JW Wang cbe6e6d968 Bug 1298217. Part 7 - Assert |mState != DECODER_STATE_DECODING| in StartDecoding(). r=kaku
StartDecoding() is called from several places where mState is proven to be not DECODER_STATE_DECODING:
1. Called by PlayStateChanged() when mState is BUFFERING.
2. Called by OnMetadataRead() where mState is DECODING_METADATA.
3. Called by SeekCompleted() where mState is SEEKING.
4. Called by RunStateMachine() when the case is BUFFERING.
5. Called by OnCDMProxyReady() when mState is WAIT_FOR_CDM.

MozReview-Commit-ID: 53LWipLzdRo
2016-08-29 11:36:26 +08:00
JW Wang d3f4e4eacd Bug 1298217. Part 6 - Move some code to the entry action of DECODER_STATE_COMPLETED. r=kaku
MozReview-Commit-ID: 5hf3NV5uLvS
2016-08-26 06:25:15 +12:00
JW Wang c214fb397a Bug 1298217. Part 5 - Move the call to |SetState(DECODER_STATE_COMPLETED)| out of CheckIfDecodeComplete() to make it easier to move more code to entry actions. r=kaku
MozReview-Commit-ID: 7nJTIGwPyCs
2016-08-26 06:18:53 +12:00
JW Wang f4601d5ce9 Bug 1298217. Part 4 - Remove the call to DispatchDecodeTasksIfNeeded() from CheckIfDecodeComplete() because we've decoded all samples. r=kaku
MozReview-Commit-ID: 22qa8K8j5zb
2016-08-26 06:08:54 +12:00
JW Wang b5e722f81e Bug 1298217. Part 3 - Remove the check for IsShutdown() from CheckIfDecodeComplete() because it is called only when mState is DECODING or BUFFERING. r=kaku
MozReview-Commit-ID: 80eWIjZnLAO
2016-08-26 06:06:20 +12:00
JW Wang 5b83b82171 Bug 1298217. Part 2 - Move some code to the entry action of DECODER_STATE_DORMANT. r=kaku
MozReview-Commit-ID: 9q35AhxS5IP
2016-08-26 05:58:12 +12:00
JW Wang e04d588416 Bug 1298217. Part 1 - Move the code about decoding metadata to the entry action of DECODER_STATE_DECODING_METADATA. r=kaku
MozReview-Commit-ID: Dyb0HnMTLpQ
2016-08-26 10:52:52 +12:00
Kaku Kuo e7bcd99310 Bug 1286454 part 1 - remove MediaData::mDiscontinuity; r=jwwang
This member is only assigned but never used now.

MozReview-Commit-ID: IbuAbRaXzc4
2016-08-25 20:30:02 +08:00
Jean-Yves Avenard cb4fa6ce47 Bug 1298594: P3. Ensure currentTime is updated prior changing readyState. r=jwwang
Otherwise we get intermittent in mochitests checking the value of currenTime when events are fired

MozReview-Commit-ID: AVktWrXochp
2016-08-28 21:20:52 +10:00
JW Wang 99f7663e3f Bug 1297553 - Dump more debugging messages for MDSM and MediaSink. r=kaku
MozReview-Commit-ID: ILcF1hT2hVN
2016-08-24 11:45:58 +12:00
JW Wang 57b9674077 Bug 1295073 - Remove the aRealTime parameter from the MediaDecoderStateMachine constructor. r=cpearce
MozReview-Commit-ID: BXMVAV1R3gx
2016-08-15 14:54:10 +08:00
Iris Hsiao 4e08022dc4 Backed out changeset d6d2cc94bb92 (bug 1295906) for M-e10s crashes on Windows 7 debug 2016-08-23 15:39:20 +08:00
JW Wang 396bb064df Bug 1295906 - Move |mVideoFrameContainer->ClearCurrentFrame()| out of MediaFormatReader::ReleaseResources(). r=jya
MozReview-Commit-ID: E0bm0zNoaZ7
2016-08-17 17:11:19 +08:00
JW Wang ca516381df Bug 1295893 - Add entry/exit actions to state transitions of MDSM. r=kaku
MozReview-Commit-ID: Ak17K7kEigC
2016-08-12 16:06:30 +08:00
JW Wang 618ad0db0d Bug 1295901 - Change the semantics/naming of MediaDecoderReader::ReleaseMediaResources(). r=jya
MozReview-Commit-ID: DyOwNcC2JK5
2016-08-17 15:03:30 +08:00
Gerald Squelart 88a4afa051 Bug 1294349 - Report VIDEO_SUSPEND_RECOVERY_TIME_MS - r=kaku
MozReview-Commit-ID: EipANZqUhBh
2016-08-11 15:05:22 +08:00
JW Wang 9b8725809b Bug 1294615. Part 2 - Refactor MDSM::SetDormant() to remove unnecessary checks for mQueuedSeek.Exists() and mCurrentSeek.Exists(). r=kaku
We've proven that when seek is in action, mQueuedSeek.Exists() is always false and mCurrentSeek.Exists() is always true.

MozReview-Commit-ID: CxNU45NXG88
2016-08-11 17:33:07 +08:00
JW Wang 6cc2957dd5 Bug 1294615. Part 1 - Assert mQueuedSeek.Exists() is false in InitiateSeek(). r=kaku
InitiateSeek() is called from several places where we can prove mQueuedSeek.Exists() is false:
1. MaybeFinishDecodeFirstFrame(): mQueuedSeek is moved when calling InitiateSeek().
2. Seek() rejects mQueuedSeek before calling InitiateSeek().
3. StartDecoding(): mQueuedSeek is moved when calling InitiateSeek().
4. VisibilityChanged(): it doesn't call InitiateSeek() when mQueuedSeek.Exists() is true.

MozReview-Commit-ID: BriPw0VID5O
2016-08-11 16:07:45 +08:00
Kaku Kuo e26892fad5 Bug 1294656 - apply FastSeek to video files without audio track; r=jwwang
MozReview-Commit-ID: 8r4Ghd9RXbq
2016-08-12 17:37:02 +08:00
JW Wang 53a68a4a1b Bug 1294634 - Use a switch statement to convert State to string. r=bechen
MozReview-Commit-ID: 513zK0G0Pvi
2016-08-12 14:54:12 +08:00
JW Wang a58e45da36 Bug 1294629 - Simplify the code of ReaderSuspendedChanged(). r=kaku
SetDormant() checks IsShutdown() and |mState == DECODER_STATE_DORMANT|.
So ReaderSuspendedChanged() can just call SetDormant(mIsReaderSuspended) to do the work.

MozReview-Commit-ID: J7Dzsm8IhIS
2016-08-11 17:35:51 +08:00
Kaku Kuo b3c1441eb6 Bug 1294384 - make video-only attribute orthogonal to the seek type; r=jwwang
MozReview-Commit-ID: 2oBjuiN7pLn
2016-08-12 11:45:02 +08:00