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
659022b636
Give WatchManager an owner thread and make sure everything happens there
2018-07-25 07:07:12 +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
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
02e984bce2
Initialize the state machine task queue in the initializer list
2018-07-25 07:07:01 +08:00
trav90
e640efcded
Redesign state watching to use a manager
2018-07-25 07:05:53 +08:00
trav90
d77ea08468
Eliminate initial notifies
...
Not really needed or helpful for our use.
2018-07-25 07:05:51 +08:00
trav90
a5b5468889
Use state-watching machinery for UpdateNextFrameStatus
2018-07-25 07:05:45 +08:00
trav90
b415ed83c6
Be more disciplined about where we call UpdateNextFrameStatus
...
This value depends on mState and the audio/video queue states. Given that, we can just stick these calls in a few choke points.
2018-07-25 07:05:43 +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
422ce43cbb
Invoke SeekCompleted synchronously
...
The current behavior is a holdover from when this some of this stuff was happening on the decode thread. It's problematic because nothing guarantees that we don't call CheckIfSeekComplete twice, and queue up two SeekCompleted events.
2018-07-25 07:03:28 +08:00
trav90
8b8219a3c1
Make it impossible for the MDSM frame calculation to overflow
2018-07-25 07:02:05 +08:00
trav90
dc0c3e6be3
Remove a couple more instances of manually passing TaskDispatchers
...
Followup to 8446234.
2018-07-25 06:58:15 +08:00
trav90
b11500bddd
Stop manually passing TaskDispatchers everywhere
2018-07-25 06:57:56 +08:00
trav90
dfc7504069
Remove MaybeTailDispatch
...
This is now the default behavior.
2018-07-25 06:57:53 +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
135695cd07
Add missing ,
2018-07-25 06:53:14 +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
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
fe42099872
Don't unnecessarily call GetBuffered() in MDSM
2018-07-25 01:28:12 +08:00
trav90
b20b8dadab
Replace dom::TimeRanges with TimeIntervals object
2018-07-25 01:27:34 +08:00
trav90
92235ac152
Rename and make AsyncReadMetadata virtual
2018-07-25 01:24:24 +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
7c9a6dbbb9
Assert state machine thread for SetState
...
We assert in CheckInDecodeComplete as well for good measure, since that's the last caller of SetState that doesn't already assert it.
2018-07-25 01:05:48 +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
4979a99ce9
Add missing string to decoder state list
2018-07-25 01:05:16 +08:00
trav90
48e4be08d6
Create one unified thread pool for media code and run the MDSM task queues on it
...
This allows for parallel MDSM execution.
2018-07-25 01:05:04 +08:00
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