Commit Graph

9407 Commits

Author SHA1 Message Date
JW Wang
a7b9a8665e Bug 1329891. Part 6 - default HandleWaitingFor{Audio,Video} to crash. r=kikuo
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
2017-01-09 19:43:55 +08:00
JW Wang
9357fc0732 Bug 1329891. Part 5 - default HandleEndOf{Audio,Video} to crash. r=kikuo
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
2017-01-09 19:38:10 +08:00
JW Wang
fedda3a0b4 Bug 1329891. Part 4 - remove StateObject::HandleNotWaited(). r=kikuo
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
2017-01-09 19:34:12 +08:00
JW Wang
c5599e5087 Bug 1329891. Part 3 - default Handle{Audio,Video}Waited to crash. r=kikuo
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
2017-01-09 15:53:12 +08:00
JW Wang
703766cdd0 Bug 1329891. Part 2 - default Handle{Audio,Video}Decoded to crash. r=kikuo
States expect this event should override this function.

MozReview-Commit-ID: 8Y4ngn4X7MS

--HG--
extra : rebase_source : 705affda97d3ee919f560a76c3858fa3564bfbe4
extra : intermediate-source : 9139df5e241af72bc75544ae3d1df27a7cc514aa
extra : source : b7c803ea73a1b1af0ee40a64d7710c52186c3c25
2017-01-09 15:48:00 +08:00
JW Wang
982fb8390e Bug 1329891. Part 1 - default Handle{Audio,Video}Canceled() to crash. r=kikuo
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
2017-01-09 15:44:18 +08:00
Jan-Ivar Bruaroey
0fb5c6dc68 Bug 1329193: Use es6 classes in PeerConnection.js. r=mt
MozReview-Commit-ID: FtVZXPA9ckJ

--HG--
extra : rebase_source : 0c5d1ba14a83b553cc9cb4473035811173f9c9c8
2017-01-05 22:47:25 -05:00
Carsten "Tomcat" Book
47628ca590 Merge mozilla-central to autoland 2017-01-10 12:24:10 +01:00
Carsten "Tomcat" Book
89882dc5f4 merge mozilla-inbound to mozilla-central a=merge 2017-01-10 12:11:31 +01:00
Wes Kocher
105aea2522 Merge m-c to inbound a=merge
MozReview-Commit-ID: G24aq5fbYNd
2017-01-09 16:44:58 -08:00
Geoff Brown
4499383617 Bug 1326005 - Skip test_peerConnection_renderAfterRenegotiation on android emulator, for frequent timeouts; r=me 2017-01-09 16:15:11 -07:00
Gerald Squelart
1cc4e2c254 Bug 1329319 - Allow NewRunnableMethod to method of a non-refcounted base class - r=froydnj
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
2017-01-10 10:49:08 +11:00
Alastor Wu
3bfd999bfd Bug 1323703 - implement a method to create DXVA2 decoder. r=mattwoodrow
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
2016-12-15 18:26:17 +08:00
JW Wang
063d3eaeb0 Bug 1329110. Part 7 - remove StateObject::HandleEndOfStream(). r=kaku
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
2017-01-09 13:18:37 +08:00
JW Wang
ce97bad770 Bug 1329110. Part 6 - remove StateObject::HandleWaitingForData(). r=kaku
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
2017-01-09 13:06:55 +08:00
JW Wang
b338772d2a Bug 1329110. Part 5 - split Split StateObject::HandleVideoNotDecoded into small functions. r=kaku
MozReview-Commit-ID: Bfyekr4I6OX

--HG--
extra : rebase_source : 43579faa96eba1e2fae2db98a7336aa928006661
extra : source : ea122d8b79c7cb87ec3671cc849d1358cf97976d
2017-01-09 12:59:32 +08:00
JW Wang
c981850d84 Bug 1329110. Part 4 - remove StateObject::HandleAudioNotDecoded(). r=kaku
MozReview-Commit-ID: 53iQ46klPMr

--HG--
extra : rebase_source : 279e78eacfb63a94b729c19b9f4473a6999c1e11
extra : source : adac40b710796c1ec9b9af420cade911bff3cc48
2017-01-09 12:45:43 +08:00
JW Wang
5bcdb2f65e Bug 1329110. Part 3 - add HandleEndOfAudio(). r=kaku
MozReview-Commit-ID: KGiWU8t79pv

--HG--
extra : rebase_source : 3809783134481a31135776a0bf0d5218afff6ba8
extra : intermediate-source : 4396f620afc3752a06005f79ed4721fa8ab2b584
extra : source : e12ce512f9153bf263150eeab3717671a2a01543
2017-01-06 17:54:59 +08:00
JW Wang
49a2f5c842 Bug 1329110. Part 2 - add HandleAudioCanceled(). r=kaku
MozReview-Commit-ID: IlzcucZOHpo

--HG--
extra : rebase_source : 7ee390235f6813117c7400bcbec13b376e7ef72a
extra : intermediate-source : 4ac81f01d3804c3e41b18ce3dcb5f19ab9cda69d
extra : source : 48a4f61f58bca7e48ac970494f0749417d8d5c4e
2017-01-06 17:49:11 +08:00
JW Wang
849a835855 Bug 1329110. Part 1 - add HandleWaitingForAudio(). r=kaku
MozReview-Commit-ID: B2ElMMYKt7m

--HG--
extra : rebase_source : da07871951b787e8c101a490ea78107e11ad80e8
extra : intermediate-source : da16ca5f7b522b191b183a4923722b3e4141117f
extra : source : 558d053ca2f80d9ed52bb72d2f822ec2ae36dfb6
2017-01-06 17:43:05 +08:00
Carsten "Tomcat" Book
c9889851e8 Merge mozilla-central to autoland 2017-01-09 10:45:10 +01:00
Randell Jesup
3fa45d2f9b Bug 1326311: Avoid races in destroying MediaRecorder sessions - destroy on MainThread r=jib
MozReview-Commit-ID: 3DA4HxUuzje
2017-01-08 22:08:09 -05:00
pierre.brochard.1982@m4x.org
f3a18dbce1 Bug 1326311: Fix thread and Track listener leaks starting and stopping MediaRecorder r=jesup
MozReview-Commit-ID: 3q6RgA4Ehtc
2017-01-08 22:06:28 -05:00
JW Wang
61f01c2630 Bug 1329098. Part 5 - remove unnecessary checks and temps. r=kaku
For mSentFirstFrameLoadedEvent is true in DecodingState.

MozReview-Commit-ID: 8zpsMAME8p6

--HG--
extra : rebase_source : fea2a795481628b5bd7eaf841fcf6a8bc377fbbc
extra : source : d54b4f06b497408a0225d708bc749101d778ca4f
2017-01-06 15:49:02 +08:00
JW Wang
5c3ba7d181 Bug 1329098. Part 4 - move DispatchDecodeTasksIfNeeded into DecodingState. r=kaku
MozReview-Commit-ID: LT9xNdTAtOW

--HG--
extra : rebase_source : faf2d7dac84374d47a6d2e210881d0355cbd86f5
extra : source : f681710dc58aac1053d06adaeb1865fceeabde23
2017-01-06 15:43:31 +08:00
JW Wang
75547a6b1d Bug 1329098. Part 3 - remove some temp vairables. r=kaku
MozReview-Commit-ID: 3gz79Tzidtf

--HG--
extra : rebase_source : 76ebb3752e71883cbdc7df916453792bff6a0bb0
extra : source : a63557c857d9ca8cfd1280c986a5d2f99f4e7668
2017-01-06 15:36:38 +08:00
JW Wang
d683161210 Bug 1329098. Part 2 - remove unnecessary checks. r=kaku
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
2017-01-06 15:22:52 +08:00
JW Wang
664dfb82d2 Bug 1329098. Part 1 - copy DispatchDecodeTasksIfNeeded() into BufferingState. r=kaku
MozReview-Commit-ID: 2q8FhTFTJ6g

--HG--
extra : rebase_source : 989fb40a86b0358c8843082abc9ef2dea20e3a2d
extra : source : 13d0e5e6e1ddf5fff6a0b8a0da7a85e5694c5be7
2017-01-06 15:00:36 +08:00
JW Wang
1f9deb245d Bug 1329554. Part 2 - remove |mMaster->mMinimizePreroll| checks from BufferingState::Step(). r=kikuo
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
2017-01-05 18:13:54 +08:00
JW Wang
84f38029d4 Bug 1329554. Part 1 - let DecodingState decide whether to dispatch decoding tasks when mMinimizePreroll changes. r=kikuo
MozReview-Commit-ID: 6QnH2vOHid1

--HG--
extra : rebase_source : 2b5485539a22a8157fc826761199092ab099d0b8
extra : intermediate-source : 329b13f1aa7025f35450417c658bcacd2b42996a
extra : source : 160616eaabf48efac98868c767f704b98415d3b9
2017-01-05 18:12:06 +08:00
JW Wang
f4605f76d9 Bug 1328836 - Remove MDSM::DispatchMinimizePrerollUntilPlaybackStarts. r=kaku
MozReview-Commit-ID: 1EGHVhZqUTA

--HG--
extra : rebase_source : c90c245683c50364d869566540f47927e0f64d04
extra : intermediate-source : ceb0660e9f35a0dbbd361a4dc4eb6bcef8add385
extra : source : e1dfbdac70feedc99a950c00aeda683e38919247
2017-01-05 17:59:19 +08:00
Gerald Squelart
b3e89a3af9 Bug 1322964 - MozPromise.Then() taking only one resolve+reject function - r=jwwang
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
2017-01-03 16:15:14 +11:00
JW Wang
a2f0f971ab Bug 1328782. part 3 - remove the |VideoQueue().GetSize() > 0| check. r=kikuo
Since |GetAmpleVideoFrames() * mPlaybackRate + 1| is positive,
|VideoQueue().GetSize() >= GetAmpleVideoFrames() * mPlaybackRate + 1| must imply
|VideoQueue().GetSize() > 0|

MozReview-Commit-ID: 6cZ2XfUrmj

--HG--
extra : rebase_source : fc77e2cdebc4621fa68f94c6c3db81d4d921b851
2017-01-05 12:09:55 +08:00
JW Wang
e6bb1d40a3 Bug 1328782. part 2 - some more tweaks to the expression. r=kikuo
MozReview-Commit-ID: I1IcV88amob

--HG--
extra : rebase_source : a1be8f5496582c2117b3e30cd8010b769d970db7
2017-01-05 12:07:15 +08:00
JW Wang
dbaf1d1389 Bug 1328782. part 1 - some tweaks to the expression. r=kikuo
MozReview-Commit-ID: 3Mt1c7TrSYy

--HG--
extra : rebase_source : 75cc57e6b0fec9698e874846ad1670f31124685f
2017-01-04 17:37:34 +08:00
Markus Stange
4bdc4ca0fb Bug 1323100 - Register most of the remaining threadfunc threads with the profiler. r=froydnj
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
2017-01-05 16:34:26 +01:00
Markus Stange
927eee33e9 Bug 1323100 - Stop double-registering the Media_Encoder thread with the profiler. r=froydnj
MozReview-Commit-ID: 8TQMVhbw13s

--HG--
extra : rebase_source : b2a55afe65d9a68d1d20d08806cb016ce040d044
2016-12-21 23:06:56 +01:00
Markus Stange
942cdc08a8 Bug 1323100 - Stop double-registering the MediaStreamGraph thread with the profiler. r=froydnj
MozReview-Commit-ID: 7WxNLZpBWL4

--HG--
extra : rebase_source : 6dee759440f94e63a82c43ec295b9a6e9c020d21
2016-12-21 23:06:45 +01:00
Markus Stange
692210bd80 Bug 1323100 - Assign names to all remaining threads that are created through NS_NewThread and create them using NS_NewNamedThread instead. r=froydnj
MozReview-Commit-ID: 7W1dt2BBKJZ

--HG--
extra : rebase_source : c7e335dac2e0f02782f0eb229a7181c8d01317a2
2016-12-21 11:43:50 +01:00
JW Wang
a9218bbb8e Bug 1328811. Part 4 - remove the |mState != DECODER_STATE_SEEKING| check. r=kaku
When mState is SEEKING, DispatchDecodeTasksIfNeeded() is a no-op.

MozReview-Commit-ID: 3sV6RdUwFBV

--HG--
extra : rebase_source : 12f01ab491b5f4326b08b44dd0789139db174d99
extra : source : 89cccddea7603912e264405040071ba0a98bf8de
2017-01-05 14:48:42 +08:00
JW Wang
0a36f808bc Bug 1328811. Part 3 - inline NeedToDecode{Audio,Video} for DispatchDecodeTasksIfNeeded is the only caller. r=kaku
MozReview-Commit-ID: H1K6LJCjk4B

--HG--
extra : rebase_source : 382293f2aa91a134b895458866cc590798d36edd
extra : source : c0971794c58515b498d93caeccf8d8932f48614f
2017-01-05 14:44:45 +08:00
JW Wang
38ceee4499 Bug 1328811. Part 2 - remove the comment that is not valid anymore. r=kaku
MozReview-Commit-ID: JxrBRtKPAau

--HG--
extra : rebase_source : d62438f5546a67bac9004c9dea74580e23b4dd62
extra : source : d0e189f19de690e1244ab22b922ff0b70fd55e60
2017-01-05 14:39:35 +08:00
JW Wang
ba927c6dfe Bug 1328811. Part 1 - remove the assertion. r=kaku
http://searchfox.org/mozilla-central/rev/82ebc0c5ea45477ef4a4bfb3bbff35069bd18cee/dom/media/MediaDecoderStateMachine.cpp#2980
The if statement ensures |mState != DECODER_STATE_COMPLETED|.

MozReview-Commit-ID: CyvfXj94E8s

--HG--
extra : rebase_source : 10007fda9e4c09647a7142b77415c332a69001b3
extra : source : 5936c72d33e155a2a942602b610e6d6407f9bef6
2017-01-05 14:38:52 +08:00
JW Wang
da1657f4f3 Bug 1328810 - Remove the call to DispatchDecodeTasksIfNeeded() from MDSM::StopPlayback(). r=kaku
MozReview-Commit-ID: mZL1FJmea3

--HG--
extra : rebase_source : f1c22d86d60c4078e8c9bef389d0c6f3247154f0
extra : source : ab2eb5c6f2ba7de8be8e21b1a09a2c43efeffc62
2017-01-05 14:32:53 +08:00
Wes Kocher
0f254a30d6 Merge inbound to central, a=merge
MozReview-Commit-ID: 1ij6nLf8f8s
2017-01-05 17:30:35 -08:00
JW Wang
f6c88fe5f9 Bug 1328831 - Remove MDSM::DispatchAudioOffloading. r=jolin
MozReview-Commit-ID: JVJOpmUHNp6

--HG--
extra : rebase_source : 7bcca5c52938b9e429c1e1833500bd85b64dc229
2017-01-05 17:38:17 +08:00
JW Wang
12437440a3 Bug 1328547. part 3 - inline NeedToDecode{Audio,Video} and remove some checks. r=kaku
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
2017-01-04 17:23:28 +08:00
JW Wang
55f78f10f6 Bug 1328547. part 2 - remove checks for IsShutdown() which is false in DecodingState. r=kaku
MozReview-Commit-ID: CmU79bt4XoR

--HG--
extra : rebase_source : 4580449f41a23924d887ff4f1d28cecf0ed77ee9
2017-01-04 17:13:49 +08:00
JW Wang
7bbc498596 Bug 1328547. part 1 - Move MDSM::Dispatch{Audio,Video}DecodeTaskIfNeeded into DecodingState. r=kaku
MozReview-Commit-ID: I2gT77VHutm

--HG--
extra : rebase_source : 39daa2eb03b780cd44e8e461d90ea38c5f163394
2017-01-04 17:10:37 +08:00
JW Wang
7e82a51137 Bug 1328781. part 2 - don't convert a double to an int64_t to avoid rounding errors. r=kikuo
MozReview-Commit-ID: 83Zxqr4aiMa

--HG--
extra : rebase_source : baadaff80de366e2ed6a88b2a8bbfaaf54b66c9d
2017-01-05 11:50:20 +08:00