Its return value is never used, and most implementations return nullptr anyway.
MozReview-Commit-ID: 8rxC053mmE8
--HG--
extra : rebase_source : 61a0b8b1373396182efd27d3c01b96e5e5541364
This allows us to remove the dependency on MediaResource from MDSM in P2.
MozReview-Commit-ID: I46fWXfnGQK
--HG--
extra : rebase_source : 4808c7218d8c48c7425da16fadf4fd748cb2932f
extra : source : 10ac012e4c252438db1f64bb57dff181aff42a65
Instead, MediaDecoder::NextFrameStatus() checks IsEnded() and returns
NEXT_FRAME_UNAVAILABLE to ensure we have HAVE_CURRENT_DATA when playback
is ended on the main thread.
This will fix the timing issue (comment 0) which causes 'waiting' to fire.
MozReview-Commit-ID: 7O21x2q0lb8
--HG--
extra : rebase_source : bbd898edfb5f4a47a5062dd2bc916c911caf0c8e
extra : intermediate-source : 2b3e413db02a7aad00d13fdf274b346bccafc414
extra : source : 6f60fad11b65e75b456e128f8414fe2ea545455f
Instead, MediaDecoder::NextFrameStatus() checks IsEnded() and returns
NEXT_FRAME_UNAVAILABLE to ensure we have HAVE_CURRENT_DATA when playback
is ended on the main thread.
This will fix the timing issue (comment 0) which causes 'waiting' to fire.
MozReview-Commit-ID: 7O21x2q0lb8
--HG--
extra : rebase_source : 0a676ef7278214a707c97687311a73da8bcd983e
extra : intermediate-source : 2b3e413db02a7aad00d13fdf274b346bccafc414
extra : source : 6f60fad11b65e75b456e128f8414fe2ea545455f
For the same reason as P1, we check mCanPlayThrough instead of IsExpectingMoreData().
MozReview-Commit-ID: FZAcWyJmaK6
--HG--
extra : rebase_source : 41e0918fea8d0fad8d3709701f5d39199a42db47
extra : intermediate-source : 89042ba53de0ca4694ef5b201d50ffb643ab6d1a
extra : source : c747849a17e84e9c9fcf01604633e85364aa824a
Note we don't check MediaResource::IsLiveStream/IsExpectingMoreData()
for they should be included in the CanPlayThrough condition. This allows
us to remove some methods from MediaResource.
MozReview-Commit-ID: JtmRg9VeqGv
--HG--
extra : rebase_source : 5bd77047e6413af1b88776fea74eca6bc6f1c3cf
extra : intermediate-source : 9557cc7e094367075bd262e4eac8454e610c8f8b
extra : source : 514014bfc85a79590bbc2bd5a8101162637708cc
We will dispatch decoding tasks in Handle{Audio,Video}Decoded() instead.
See comment 0 for the rationale.
MozReview-Commit-ID: 9trJYoMfzJH
--HG--
extra : rebase_source : 0fae6eda31571d34268f2dba58a8e5f6cf0dadc9
extra : source : 275964a63b741e4ac0258e714f54f43d5cc6ae0b
It would be less accurate to call SetReadMode(MediaCacheStream::MODE_PLAYBACK)
in ChannelMediaDecoder::MetadataLoaded() instead of DecodeMetadataState::OnMetadataRead()
because MDSM might have started decoding by the time 'metadata loaded' event arrives
in the main thread. However this little inaccuracy should be fine since it only
affects a small amount of data concerning the eviction algorithm.
MozReview-Commit-ID: JoQMGr5Fvge
--HG--
extra : rebase_source : 3663a028522cc8b973964f62e59d7568a5eba10a
extra : source : 359b4454633432d3334a106aedb267a2451afb45
Note we remove the log in BufferingState::Enter() which prevents us from
removing ChannelMediaResource related code from MDSM. We can add it back
in the future after the refactoring.
MozReview-Commit-ID: B94iOI0bTXC
--HG--
extra : rebase_source : 857b7420ab9b52c07dc8a917c1f9344096ed20e6
extra : source : 2c350a4f3cbdf6f446b5e1cc8d6e0892722866d0
So we don't duplicate the code of calculating CanPlayThrough from
download rate and playback rate in MediaDecoder.
MozReview-Commit-ID: 7M5JAuUxFFc
--HG--
extra : rebase_source : cb216a1af59b9d8207e3056a5d3ae05e93d85e74
extra : source : a183c089760e329508fac44239fee42c1f047b80
We still need to keep the resource on Android, otherwise the frame we render would be wrong.
MozReview-Commit-ID: 2d6sfIuhfWY
--HG--
extra : rebase_source : f509027bd8d225de2d65c59510650a178038a2ff
AudioEndTime() returns 0 if the media sink is not started. This is wrong
because the audio/video end time should be at least the current position
to ensure playback won't go backwards.
http://searchfox.org/mozilla-central/rev/bbc1c59e460a27b20929b56489e2e55438de81fa/dom/media/MediaDecoderStateMachine.cpp#2009-2012
This fix the case where we wrongly set playback position to 0 after seeking
to the end of resource.
MozReview-Commit-ID: 2VnTcqyIvoJ
--HG--
extra : rebase_source : 3abb59053952c018b1bff8c442450e98845a4947
extra : source : 3dc1a61d32e5be587f5f6892217fe9fe25ca533b
We pretty much rewrite the whole logic of duration calculation of MDSM.
The new logic is much simpler for we have only one duration to manage
which is mDuration. Below is the details of the code changes:
1. remove the mExplicitDuration mirror since it should be handled in MediaDecoder.
2. remove mObservedDuration and mDuration will take its place.
3. mDuration is updated from:
a. metadata
b. playback position as playback progresses.
c. buffer ranges.
4. change mDuration to be finite when playback reaches the end.
MozReview-Commit-ID: 1EmlWvmw1R2
--HG--
extra : rebase_source : 54110160af6e167cdb59b24e1c6be7901bf56269
extra : source : 6325e6ae2319cae62e4c08cfc38706c9ac056842
We will let MediaDecoder do the final adjustment.
MozReview-Commit-ID: NmPD3Cgsta
--HG--
extra : rebase_source : 97f15f7ec330706edb7651c52e2eef128ac427f6
extra : source : 45e94e9edc423de6d53776b70c9c25cc9f40ce30
Following P1, mNextPlayState is no longer used.
MozReview-Commit-ID: 5ABEYMQ5G9l
--HG--
extra : rebase_source : f4cfb050ae19625bc8f6e54f33bb4f0f4e53d059
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.
MozReview-Commit-ID: 6s78RvPFMzv
--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
In bug1371202, it has already implemented what I want to do, so remove the
change in bug1367980.
MozReview-Commit-ID: LoH51bBDTqr
--HG--
extra : rebase_source : 9fd77acae81f94e45f0f840775c81509e85c4ad0
We will remove MediaDecoderReader in the future.
MozReview-Commit-ID: BaCRXleKK5a
--HG--
extra : rebase_source : dc14a593d6291136f02b1deb910cd6dcd01c0355
extra : source : 8f71b7dae0a541562c7c3829b5a873e9f9fd2674
Only suspend decoding when the pref is on, but resuming could be done when the
pref is off.
MozReview-Commit-ID: JDh1pRXNhc8
--HG--
extra : rebase_source : 1a075c9eff5abe0eae7bd929d9c632d5b49a63be
So we can remove AbstractMediaDecoder::CanonicalDurationOrNull() later.
MozReview-Commit-ID: 6zJCFDsCZPC
--HG--
extra : rebase_source : 66af1674651667a2ab9e82b85e5c730f8eb5c227
extra : intermediate-source : 6c5eccd5fc68bf663e1ffa9d5b57c5a2a2721b14
extra : source : 4b30670e2d75260b21fa953f9c7219e3e485c396