Commit Graph

60 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 44d5199751 Move post-duration-change seeking into MediaDecoder where it belongs 2018-07-25 07:50:19 +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 30a4725667 Make MediaDecoder::DurationChanged take a duration argument rather than reading it back synchronously from the MDSM 2018-07-25 07:49:36 +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 cbc8595e97 Create and destroy static SharedThreadPool state at startup/shutdown 2018-07-25 07:35:53 +08:00
trav90 75f0a0bd59 Early clean up the MediaDecoder in HTMLMediaElement.cpp 2018-07-25 07:30:27 +08:00
trav90 3cbf3e5e8a Fix indentation
No code changes. Followup to 2c9ac59.
2018-07-25 07:14:05 +08:00
trav90 759486911b Get rid of RefableThen and make Then return an nsRefPtr<Consumer> 2018-07-25 07:13:05 +08:00
trav90 770bc90898 Fix calculation of blockForStateMachineNotPlaying 2018-07-25 07:11:04 +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 659022b636 Give WatchManager an owner thread and make sure everything happens there 2018-07-25 07:07:12 +08:00
trav90 032f6f5dc7 Switch mirror/canonical initialization to happen in the constructor
The goal here is to hoist all meaningful watcher/mirror/canonical manipulation onto the owner thread. But since that must necessarily happen asynchronously, we need to make sure that canonicals are in a sane state immediately upon creation, since otherwise a mirror from another thread may attempt to connect to a not-yet-initialized canonical.
2018-07-25 07:07:05 +08:00
trav90 717aade354 Explicitly initialize logging at the correct time 2018-07-25 07:06:32 +08:00
trav90 e640efcded Redesign state watching to use a manager 2018-07-25 07:05:53 +08:00
trav90 793ff3cd33 Revert change to MediaDecoder::NotifyDataArrived 2018-07-25 07:05:50 +08:00
trav90 0052fbc94e Stop manually notifying MediaDecoder::mReadyStateWatchTarget
If we've got our state graph set up properly, the watch target should be notified automatically whenever anything relevant changes.
2018-07-25 07:05:48 +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 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 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 1e249c36f8 Use state watching machinery for mReadyState updates 2018-07-25 07:03:38 +08:00
trav90 04513e7957 Force state machine setting to go through a setter
This is needed so that we can hook up the state mirroring in a subsequent commit.
2018-07-25 07:03:32 +08:00
trav90 b6bb9afb37 Move the GetCurrent TLS logic into AbstractThread 2018-07-25 06:57:47 +08:00
trav90 533987a47d Implement the ability to get the currently running task queue
This will be useful for asserting things.
2018-07-25 06:55:30 +08:00
trav90 3090135f8e Do static initialization explicitly 2018-07-25 06:55:27 +08:00
trav90 e1caa768c4 Handle playback ended in a consistent way for both file and stream case 2018-07-25 06:53:09 +08:00
trav90 a068fb2b80 Rework and simplify stream clock calculation in MediaDecoderStateMachine 2018-07-25 06:53:05 +08:00
trav90 b6cdd50380 Remove wrapper-style AbstractThreads for MediaTaskQueue and have callers pass an AbstractThread directly to promise APIs 2018-07-25 06:52:28 +08:00
trav90 702d802110 Add a convenience/efficiently routine to get an AbstractThread for the main thread 2018-07-25 06:52:23 +08:00
trav90 7ae60742ff Nuke remaining GStreamer code 2018-07-25 06:45:07 +08:00
trav90 227622835c Rename MediaDecoder::OnDecodeThread to MediaDecoder::OnDecodeTaskQueue 2018-07-25 06:44:59 +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 7e5b4386f2 Combine MediaInfo and mp4_demuxer::TrackConfig 2018-07-25 01:18:31 +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