States that expect this event should override the function.
MozReview-Commit-ID: AmqktrDyVH5
--HG--
extra : rebase_source : 610dec3def2944c6234fd18cf71d9ee02998ad4d
extra : intermediate-source : 28ed7fa9991588b4ba131856cab0ff239f0b24e5
extra : source : 6e5d3a1d32985b6eba449f76e99538b0589bd200
States that expect this event should override the function.
MozReview-Commit-ID: 5Zhcu1m2MMm
--HG--
extra : rebase_source : 4462e34f5c063fdfc201f0f27e2caa8ba8d2fdc2
extra : intermediate-source : a91db7dd4a3d832f8c7b32ac87f8a8d5e518bec3
extra : source : 4499e663ce6821b98057454c8d6f06fe2cb762e0
If the wait promise is rejected, we probably won't be able to finish
decoding after seeking. So we should just raise an error immediately.
MozReview-Commit-ID: GKXo9ZooBfV
--HG--
extra : rebase_source : 257a2724d1d2f3266e17b2de3f7d80fa385a2782
extra : intermediate-source : 150ce8e05dc887b7ed2b71cdc5ab77fb117775d2
extra : source : 6ff0dea0afabd57ea53ea3571020cdea3d4b0eca
States that expect this event should override the function.
MozReview-Commit-ID: IjmR7F1UOiU
--HG--
extra : rebase_source : a83f4a96838e7358df8d0579163002ade53b5cc7
extra : intermediate-source : 2db95ef2473440ad2ec9130cf24f959291b18bef
extra : source : 78ae9269f4f09986a14e498843a7638f81dbc440
States expect this event should override this function.
MozReview-Commit-ID: 8Y4ngn4X7MS
--HG--
extra : rebase_source : 705affda97d3ee919f560a76c3858fa3564bfbe4
extra : intermediate-source : 9139df5e241af72bc75544ae3d1df27a7cc514aa
extra : source : b7c803ea73a1b1af0ee40a64d7710c52186c3c25
1. States (DecodeMetadataState and WaitForCDMState) happen before
DecodingFirstFrameState should never receive this event because they don't
decode at all.
2. DormantState and ShutdownState shouldn't receive this event because
they call ResetDecode() in the entry action.
3. CompletedState should never receive this event because it happens after
HandleEndOf{Audio,Video} which happens before Handle{Audio,Video}Canceled.
MozReview-Commit-ID: LdwpWlFHtRp
--HG--
extra : rebase_source : d48b8c7b2347fa745de006fcd1aff640cb474aa1
extra : intermediate-source : 981305f87ff796060666227cf89a23b51e607b54
extra : source : ee5e78f761568bea438c51b9e70eef9b83e14626
This is done by storing the object pointer based on the exact pointee type,
instead of as hinted by the method-pointer, which could be a non-refcounted
base class.
The stored pointer type is statically-checked to be derived from (or the same
as) the class type from the method-pointer, to prevent misuses.
One change had to be done in TrackBuffersManager, as it was passing another
type and relying on implicit pointer conversions. A simple `.get()` to pass
the raw pointer type (to be stored in a RefPtr) fixed that one issue.
MozReview-Commit-ID: 4kH0XdjB5Rk
--HG--
extra : rebase_source : 40ad68820cfce469ecda272f430062f05dfcd09f
When we want to decode with DXVA2 aPI directly instead of using it by MFT, we need to take responsibility for
creating a decoder and handle the related decoding operations by ourself. So implement a method to create and
hold a ref to DXVA2 decoder for DXVA2Manager.
MozReview-Commit-ID: 4EyrsjzEyYK
--HG--
extra : rebase_source : 6719bfe15243395711984d66919baca2bb74699e
The same reason as P6. We would like to avoid virtual functions calls
inside a virtual function.
MozReview-Commit-ID: EYCk6tKPYSs
--HG--
extra : rebase_source : 8482799473e4cf856238b9fa7897e432b4e3a674
extra : source : 17769cff12ccc2157adc91c4fce7e4030f303b00
Since DecodingState is the only one that overrides the function, we will let it
just override HandleWaitingFor{Audio,Video}. We also reduce the code complexity
because it is hard to trace the code when one virtual function calls another
virtual function.
MozReview-Commit-ID: AdLXpDgvOyx
--HG--
extra : rebase_source : a8c2aef15537044d904f576976e08264524c26e4
extra : source : 60c230cff746f91653922223dc1f56e48c0d6120
For mSentFirstFrameLoadedEvent is true in DecodingState.
MozReview-Commit-ID: 8zpsMAME8p6
--HG--
extra : rebase_source : fea2a795481628b5bd7eaf841fcf6a8bc377fbbc
extra : source : d54b4f06b497408a0225d708bc749101d778ca4f
1. mSentFirstFrameLoadedEvent is true in BufferingState.
2. mMinimizePreroll is false in BufferingState for buffering happens after playback starts and we reset mMinimizePreroll once playback starts.
MozReview-Commit-ID: ABE7TvNEetD
--HG--
extra : rebase_source : 53c507ff9cd8ea028c5ff7f8b5b8c049cb8a7ebf
extra : source : e87a70953f6eb8d4a9e31ab06ac73afcc90da923
mMinimizePreroll is false in BufferingState because we enter buffering only
after playback starts.
MozReview-Commit-ID: 9vRuogzvV7x
--HG--
extra : rebase_source : f43eb5af15d6ae969a6269c7adf68780d9b3b659
extra : intermediate-source : 0dd36842a3ae6ad9b5421bbd277e9ee05ec2e110
extra : source : eae56fe516563a2675f0492c56c6a01b6f38149f
Then and ThenPromise can now be given only one function object, which takes a
`const MozPromise::ResolveOrRejectValue&`.
MozReview-Commit-ID: BEtc3spK9Yh
--HG--
extra : rebase_source : 1b16ad15ebfcdfb653d8d98073adee0f8b27b46e
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS,
and except for the Shutdown Watchdog thread in nsTerminator.cpp and the
CacheIO thread. The Shutdown Watchdog thread stays alive past leak detection
during shutdown (by design), so we'd report leaks if we profiled it. The
CacheIO thread seems to stay alive past shutdown leak detection sometimes as
well.
This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.
MozReview-Commit-ID: 3vwhS55Yzt
--HG--
extra : rebase_source : 56dd27282e7bd09a7e7dc7ca09ccfe3a0198e7af
When mState is SEEKING, DispatchDecodeTasksIfNeeded() is a no-op.
MozReview-Commit-ID: 3sV6RdUwFBV
--HG--
extra : rebase_source : 12f01ab491b5f4326b08b44dd0789139db174d99
extra : source : 89cccddea7603912e264405040071ba0a98bf8de
1. |mState != DECODER_STATE_SEEKING| is true in DecodingState.
2. mSentFirstFrameLoadedEvent is true in DecodingState.
3. mMinimizePreroll is false because pop events fire only after MDSM starts playing.
MozReview-Commit-ID: FTkXmtEnzY5
--HG--
extra : rebase_source : 30392be881ebdb96469189a584a57b89d60cc2b4