The same reason as P1. ShutdownState::Enter() disconnects callbacks to prevent
DecodeError() from being called during shutdown.
MozReview-Commit-ID: EFZiE2zkcUZ
While MDSM calls MFR::Seek(), MFR tries to do video seek first and then the audio seek.
Video-seek and audio-seek are applied sequentially, and if something wrong in video-seek,
MFR discards the whole seek operation without applying audio-seek.
video | audio |
waiting | waiting | What MDSM receives
-----------------------------------------------------------------------------
X | X | resove mSeekRequest
-----------------------------------------------------------------------------
O | X | reject mSeekRequest with type=VIDEO, error=WAITING
-----------------------------------------------------------------------------
X | O | reject mSeekRequest with type=AUDIO, error=WAITING
-----------------------------------------------------------------------------
O | O | reject mSeekRequest with type=VIDEO, error=WAITING
-----------------------------------------------------------------------------
So, here, AccurateSeekingState::OnSeekRejected() has a unified code to handle
WAITING_FOR_DATA error for both video and audio type, and it uses the
aReject.mType variable to distinguish different types.
But, it mixes the assertions. We should also apply assertions according to the
type that is in concern.
MozReview-Commit-ID: F7RpnFghcKk
On Android, the life cycle of graphic buffer is equal to Android's codec, and
it would be released immediately if we shutdown the decoder.
Since the buffer has been release, the memory we access is totally meaningless.
The result is we would render the black image on the screen.
In addition, I suspect this issue might be one of the root cause which results
in lots of timeout for media mochitest, so I would like to land this patch first,
and then do the follow-up in bug1367983.
MozReview-Commit-ID: 5eZph6MItZs
When coming out of dormant mode, we first perform an accurate seek, that will ensure the MediaDecoderReader has been reinitialised correctly.
MozReview-Commit-ID: 2rWgu9AGAcY
We try to make the definition in the same order as the base class and with the same access.
We make DoSeek protected as we'll need it in the next change.
MozReview-Commit-ID: KAn1Jj3mAB7
The current call flow ensures decoding metadata only happens at most once
and therefore EnqueueLoadedMetadataEvent() will only be called at most once.
We don't need the mSentLoadedMetadataEvent flag.
MozReview-Commit-ID: E95jtRrKupw
Since RefPtr<T>&& can't be converted to T* implicitly, we need to change
T* to RefPtr<T> in resolve/reject callbacks to make it compile again.
We should review the changes later to look for the opportunity to
optimize away unnecessary AddRef/Release pairs.
MozReview-Commit-ID: 22rHQ8dhxJv
Resetting decoders somehow cause the WebM demuxer to seek and initiate
network download which is blocked by the site for invisible media elements.
See comment 5 for how this blocks playback.
We work around this issue by not resetting decoders when entering dormant
since we will reset them anyway during seeking when exiting dormant.
This change is a workaround for this bug though. However it is also an
improvement for the dormant state in general since it removes unnecessary
works to improve performance.
MozReview-Commit-ID: KtbpQlrO8J
StoreCopyPassByRRef<> ensures a copy is stored in the runnable.
We don't have to worry about the concern of bug 1300476.
MozReview-Commit-ID: DHqlzlVLBFV
We want to replace the use of int64_t for microseconds by TimeUnit
whenever possible since int64_t is ambiguous which could be microseconds
or milliseconds.
MozReview-Commit-ID: LRz9d4yKBYJ
(EnterVideoSuspend/ExitVideoSuspend) event pair and (VideoOnlySeekBegin/VideoOnlySeekCompleted) event pair should not interleave each other.
MozReview-Commit-ID: HehMIls11nc