Commit Graph

25 Commits

Author SHA1 Message Date
trav90 2fc84fbc8e Fix build bustage: Add missing } 2018-07-25 01:04:02 +08:00
trav90 de7d6e349b Unify FlushDecoding, ResetDecode, and ResetPlayback into a single Reset() method 2018-07-25 01:04:00 +08:00
trav90 7c704f00af Remove the AwaitIdle call in FlushDecoding
There are two callers of FlushDecoding - One is shutdown (where we already use promises to wait for the queue to go idle via BeginShutdown), and the other is dormant.
2018-07-25 01:03:58 +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
trav90 3ef89dda87 Fire loadedmetadata before encrypted event 2018-07-25 01:03:42 +08:00
trav90 b944f99a23 Stop synchronously dispatching MediaDecoder::DecodeError from MDSM::DecodeError
MediaDecoder::DecodeError invokes MediaDecoder::Shutdown, which shuts down the state machine. Given the sync dispatch, this means that this is basically already what's happening.
2018-07-25 01:03:40 +08:00
trav90 770ada6bb1 Run MDSM disposal off the MediaPromise returned by initiating shutdown on the task queue 2018-07-25 01:03:36 +08:00
trav90 b265ff9e74 Switch the MDSM to a task queue 2018-07-25 01:03:34 +08:00
trav90 2d0902db6e Make the MediaDecoder-to-MediaDecoderStateMachine interface Promise-based 2018-07-25 01:03:21 +08:00
trav90 32f141833f Move the RenderVideoFrame call to the end of SeekCompleted
This means that we can get rid of the code to recheck state after dropping the monitor. We'll remove the other monitor drop from this method in a future commit.
2018-07-25 01:03:10 +08:00
trav90 8acc4e725d Move some work from MDSM::Seek to MDSM::InitiateSeek
This has two implications:
1. We no longer need to pipe mQueuedSeekTarget through MDSM::Seek to get the appropriate clamping.
2. MDSM::Seek doesn't _need_ to be called on the main thread anymore.
2018-07-25 01:03:08 +08:00
trav90 3738ea58fc Cleanup some comments and assertions that are no longer needed 2018-07-25 01:03:06 +08:00
trav90 1d38e973bb Streamline seek initiation logic and abolish manual seek cancels and retries
The model we're moving towards is one where the MDSM can just disconnect all of its promises, send a ResetDecode down the pipe, and start doing something unrelated.
2018-07-25 01:03:03 +08:00
trav90 a4dcd6ac96 Stop doing sync dispatch for SeekingStarted 2018-07-25 01:03:01 +08:00
trav90 2ef67ac717 Remove silly special case for seeking to exactly the current time 2018-07-25 01:02:59 +08:00
trav90 b7524cc78e Route queued seeks back through MDSM::Seek and eliminate MDSM::StartSeek 2018-07-25 01:02:56 +08:00
trav90 dea504a3f4 Stop proxying DecodeError to the decode thread 2018-07-25 01:02:49 +08:00
trav90 64948a50d8 Call OnAudioSinkError on state machine thread 2018-07-25 01:02:47 +08:00
trav90 738916d084 Hoist some work onto the state machine thread and tighten down some assertions 2018-07-25 01:02:43 +08:00
trav90 2eb1095b46 Stop manually resetting mCurrentSeekTarget in MDSM::SeekCompleted and rely on the AutoSetOnScopeExit instead 2018-07-25 01:02:42 +08:00
trav90 14ca485df4 Stop invoking StopPlayback in SetDormant 2018-07-25 01:02:40 +08:00
trav90 62337b35dc Return samples on the state machine thread
This is necessary because we're going to want to start disconnecting sample and seek requests directly from the state machine thread, and the machinery asserts that disconnection happens on the same thread as resolution.
2018-07-25 01:02:38 +08:00
trav90 1c975390e6 Make DecodeError safe to run on any thread
This is necessary so that we can make On{Audio,Video}{,Not}Decoded run on the state machine thread in a future commit.
2018-07-25 01:02:36 +08:00
Moonchild baf46a6bf1 Merge pull request #1 from mozilla/esr38: Esr38 upstream pull 2018-07-24 23:04:07 +08:00