Commit Graph

62 Commits

Author SHA1 Message Date
trav90 43875b6b1f Drop Support for Content-Duration
This code is racey, extremely difficult to debug, and there is nothing that says its use must be enforced. The few sites that care about getting a duration without seeking to the end of the stream can index their Ogg files.
2018-07-25 07:50:34 +08:00
trav90 f319e95fd1 Clean up SetDuration and remove negative duration case 2018-07-25 07:50:05 +08:00
trav90 f3666a1dc9 Track observed duration separately 2018-07-25 07:49:57 +08:00
trav90 10f8792a37 Track demuxer-estimated duration separately 2018-07-25 07:49:50 +08:00
trav90 cf3312970e Track explicit (MSE) duration separately 2018-07-25 07:49:43 +08:00
trav90 4db9fb1d37 Track "metadata duration" separately and mirror it to MediaDecoderReader 2018-07-25 07:49:21 +08:00
trav90 2fbf35f99a Track "network duration" separately and mirror it to the MDSM 2018-07-25 07:49:14 +08:00
trav90 e8a4024fa7 Remove ApplyStateToStateMachine and PLAY_STATE_SEEKING 2018-07-25 07:48:53 +08:00
trav90 a18f275a4d Replace MDSM::Play with a state-watcher on mPlayState and eliminate ApplyStateToStateMachine 2018-07-25 07:48:46 +08:00
trav90 67d488872c Use StateMirroring for playback position 2018-07-25 07:48:31 +08:00
trav90 e1cffc8281 Rename mCurrentFrameTime to mCurrentPosition to better match the naming in the spec
This field corresponds to the "current playback position" in HTML5.
2018-07-25 07:48:24 +08:00
trav90 96a8014257 Replace 'Consumer' with 'Request' in MediaPromise naming
Not usually a fan of Mozilla renaming, but doing this now will save me some headaches with new code later.
2018-07-25 07:13:20 +08:00
trav90 759486911b Get rid of RefableThen and make Then return an nsRefPtr<Consumer> 2018-07-25 07:13:05 +08:00
trav90 6c19defcd4 Use lambdas for Seek 2018-07-25 07:12:14 +08:00
trav90 805023876f Use lambdas for WaitForData 2018-07-25 07:12:10 +08:00
trav90 2cae9fb888 Dispatch SetMinimizePrerollUntilPlabackStarts 2018-07-25 07:07:32 +08:00
trav90 fa32ae47df Dispatch SetAudioCaptured 2018-07-25 07:07:28 +08:00
trav90 7d4520f94f Mirror mPreservesPitch 2018-07-25 07:07:26 +08:00
trav90 05d14bdb99 Mirror mPlaybackRate 2018-07-25 07:07:23 +08:00
trav90 1aefd63963 Mirror mVolume 2018-07-25 07:07:20 +08:00
trav90 49424b811e Assert that we're on the state machine thread for most remaining MDSM methods 2018-07-25 07:07:15 +08:00
trav90 d54dbfa0b9 Do watching/mirroring initialization on the state machine task queue
We take this as an opportunity to remove connect-during-initialization.
2018-07-25 07:07:08 +08:00
trav90 4a23fa7b3c Let consumers declare Mirror<T> rather than Mirror<T>::Holder
The current mechanism is slightly more pure from an implementation-perspective, but a lot more confusing for consumers.
2018-07-25 07:06:21 +08:00
trav90 3b652a54ff Let consumers declare Canonical<T> rather than Canonical<T>::Holder
The current mechanism is slightly more pure from an implementation-perspective, but a lot more confusing for consumers.
2018-07-25 07:06:18 +08:00
trav90 e640efcded Redesign state watching to use a manager 2018-07-25 07:05:53 +08:00
trav90 a5b5468889 Use state-watching machinery for UpdateNextFrameStatus 2018-07-25 07:05:45 +08:00
trav90 41c67a91d8 Mirror mPlayState and mNextState to the state machine task queue and eliminate cross-thread access 2018-07-25 07:05:41 +08:00
trav90 8a37064578 Add a cancelable runnable for OnAudioEndTimeUpdate 2018-07-25 07:04:52 +08:00
trav90 6fa240db4e Re-land "Dispatch AudioSink notifications asynchronously"
Turns out that this is needed after all.
2018-07-25 07:04:46 +08:00
Moonchild 54c849b63d Revert "Re-land "Dispatch AudioSink notifications asynchronously" + fixes" 2018-07-25 07:04:08 +08:00
trav90 dddc38b2eb Add a cancelable runnable for OnAudioEndTimeUpdate 2018-07-25 07:04:02 +08:00
trav90 1a2fea0658 Re-land "Dispatch AudioSink notifications asynchronously"
This is needed by some new code that I am working on.
2018-07-25 07:03:56 +08:00
trav90 df074df1ee Use state mirroring for NextFrameStatus 2018-07-25 07:03:42 +08:00
trav90 b11500bddd Stop manually passing TaskDispatchers everywhere 2018-07-25 06:57:56 +08:00
trav90 87a4cf6376 Use TailDispatch for the MDSM's task queue 2018-07-25 06:55:39 +08:00
trav90 7dd99b6694 Stop doing sync dispatch of PlaybackEnded 2018-07-25 06:54:58 +08:00
trav90 ba4e0eb433 Add additional assertions to the MDSM 2018-07-25 06:54:28 +08:00
trav90 a068fb2b80 Rework and simplify stream clock calculation in MediaDecoderStateMachine 2018-07-25 06:53:05 +08:00
trav90 2d35bde18f Rename MDSM::OnDecodeThread to MDSM::OnDecodeTaskQueue 2018-07-25 06:44:53 +08:00
trav90 19e0f7aa42 Rename OnStateMachineThread-like functions to reflect the fact that it's a task queue 2018-07-25 06:44:51 +08:00
trav90 17e6d71294 Revert "Dispatch AudioSink notifications asynchronously" 2018-07-25 06:36:53 +08:00
trav90 b20b8dadab Replace dom::TimeRanges with TimeIntervals object 2018-07-25 01:27:34 +08:00
trav90 6e7293c92f Fix build bustage 2018-07-25 01:05:54 +08:00
trav90 d5e2cf7abc Dispatch AudioSink notifications asynchronously 2018-07-25 01:05:51 +08:00
trav90 5155516c96 Make MDSM::StartBuffering happen on the state machine thread 2018-07-25 01:05:46 +08:00
trav90 90904cb897 Make MDSM::Shutdown happen on the state machine thread 2018-07-25 01:05:42 +08:00
trav90 de7d6e349b Unify FlushDecoding, ResetDecode, and ResetPlayback into a single Reset() method 2018-07-25 01:04:00 +08:00
trav90 44785a00d9 Fix build bustage: Undo some Mozilla renaming 2018-07-25 01:03:49 +08:00
trav90 07ffc3fc1e Deliver NotifyWaitingForResourcesStatusChanged asynchronously on the state machine task queue
The previous setup is wacky, and can cause the notification to reach the state machine before the promise rejection, which causes us to stall intermittently. We also take the opportunity to be a bit less trigger happy when we fire it in MediaSourceReader.cpp.
2018-07-25 01:03:45 +08:00
trav90 74eb7093f6 Use promises for metadata decoding 2018-07-25 01:03:43 +08:00