Commit Graph
464 Commits
Author SHA1 Message Date
James Willcox 87d07a70c9 Bug 1322650 - Don't use AndroidBridge to get API version in media stack r=jolin
AndroidBridge is not available in child processes.

MozReview-Commit-ID: KlBs8F1Bu1O
2017-05-15 09:37:57 -05:00
JW Wang f55a863750 Bug 1364001. P2 - throttle download when we can play through. r=cpearce
MozReview-Commit-ID: HqRtwCAr7k3
2017-05-11 17:26:20 +08:00
Iris Hsiao 3cea13a680 Backed out 11 changesets (bug 1322650) for media test failures on android. a=backout
Backed out changeset 31bd912fba54 (bug 1322650)
Backed out changeset 4d486c7469eb (bug 1322650)
Backed out changeset 4cf8f4d5064c (bug 1322650)
Backed out changeset 3cb108f7492f (bug 1322650)
Backed out changeset bd53533c108e (bug 1322650)
Backed out changeset 3522917d8f10 (bug 1322650)
Backed out changeset 2c2c1e33eccc (bug 1322650)
Backed out changeset 2f19977cd6ab (bug 1322650)
Backed out changeset 4519296a323e (bug 1322650)
Backed out changeset e56e5e1c8786 (bug 1322650)
Backed out changeset 96fe52231b57 (bug 1322650)
2017-05-12 10:21:14 +08:00
James Willcox 22cf57191f Bug 1322650 - Don't use AndroidBridge to get API version in media stack r=jolin
AndroidBridge is not available in child processes.

MozReview-Commit-ID: KlBs8F1Bu1O
2017-05-11 15:42:45 -05:00
Kaku Kuo 79607de641 Bug 1360123 P3 - while shutting down a MediaDecoder, ask its owner to remove all media tracks; r=jwwang
MozReview-Commit-ID: 6s84iyXJQ9k
2017-04-18 15:46:05 +08:00
Kaku Kuo 494800117b Bug 1360123 P2 - move ConstructMediaTracks/RemoveMediaTracks to HTMLMediaElemnt; r=jwwang
MozReview-Commit-ID: 3S63JeXAX2w
2017-04-18 15:43:55 +08:00
JW Wang c4ccd10c57 Bug 1358972. P2 - remove MediaDecoder::mEstimatedDuration and its friends which is never modified. r=kaku
MozReview-Commit-ID: 7W331tookXV
2017-04-17 17:20:06 +08:00
JW Wang fc9498a129 Bug 1358972. P1 - remove unused code. r=kaku
We can remove AbstractMediaDecoder::UpdateEstimatedMediaDuration() which
has no callers at all.

MozReview-Commit-ID: Eub12jQ25KK
2017-04-17 17:10:09 +08:00
JW Wang 8ff67e8fba Bug 1358969 - let MediaDecoder::CurrentPosition() return a TimeUnit. r=kikuo
We want to replace the use of int64_t for microseconds by TimeUnit
whenever possible since int64_t is ambiguous which could be microseconds
or milliseconds.

MozReview-Commit-ID: K3Bz3uEXLDK
2017-04-17 17:04:39 +08:00
JW Wang 9e8d794403 Bug 1357987 - make MediaDecoder::DEFAULT_NEXT_FRAME_AVAILABLE_BUFFERED a TimeUnit to avoid ambiguous int64_t for microseconds. r=kaku
MozReview-Commit-ID: 9JC4zPEc6or
2017-04-17 16:58:44 +08:00
JW Wang 68670a77ff Bug 1357986 - Use helper functions of TimeUnit to make code more readable. r=kaku
1. using media::TimeUnit to save some typing.
2. replace TimeUnit() with TimeUnit::Zero().
3. replace TimeUnit::FromXXX(0) with TimeUnit::Zero().
4. replace TimeUnit::FromMicroseconds(std::numeric_limits<int64_t>::max()) with TimeUnit::FromInfinity().
5. replace some uses of int64_t with TimeUnit.
6. replace t > TimeUnit() with t.IsPositive().

MozReview-Commit-ID: 6hC94PXx86i
2017-04-17 16:35:04 +08:00
Kaku Kuo ce1acb3b09 Bug 1344357 P3 - dont' pass dom::Promise into MediaDecoder anymore; r=jwwang
MozReview-Commit-ID: 5RUNauRRajP
2017-04-17 18:49:55 +08:00
Kaku Kuo c3d28c22e8 Bug 1344357 P1 - move the MediaDecoder::mSeekDOMPromise to HTMLMediaElement; r=jwwang
There was a cycle amoung a window object -> a HTMLMediaElement -> a MediaDecoder -> a Promise (-> back to the window object).
And we have no way to break the cycle since the MediaDecoder does not participate into the collection.

By moving the Promise form MediaDecoder to HTMLMediaElement, we will be able to break the cycle since the HTMLMediaElement is in the collection.

We'll implement the cycle collection in the next patch.

MozReview-Commit-ID: CyVXBl6IMI3
2017-04-17 18:25:26 +08:00
Kaku Kuo 96351de5ff Bug 1354465 P1 - dispatch a mozvideoonlyseekbegin event while starting a video-only seek; r=jwwang
MozReview-Commit-ID: 6PjQs88vUV2
2017-04-07 16:11:34 +08:00
JW Wang d8efb886ee Bug 1353607. P9 - change the underlying type of mCurrentPosition to TimeUnit. r=kikuo
MozReview-Commit-ID: ffquOIFlp3
2017-03-28 18:13:22 +08:00
JW Wang bcfe2a159b Bug 1353607. P8 - use TimeUnit in DispatchSetFragmentEndTime(). r=kikuo
MozReview-Commit-ID: IBLT0j7yMLK
2017-03-28 18:01:23 +08:00
Kaku Kuo 58e1827365 Bug 1349097 P3 - don't dispatch another ended event while resuming the video decoder of an already-ended playback; r=jwwang
If the play state is already PLAY_STATE_ENDED, make MediaDecoder::PlaybackEnded() return early to prevent dispatching multiple ended event.

MozReview-Commit-ID: G5OU7WLYuMm
2017-04-05 22:57:25 +08:00
Eric Rahm f3ea7b060a Bug 1353143 - Part 2: Remove usage of PR_LOGGING. r=froydnj
Remove ifdefs that handle if logging is disabled, we always force enable it.
2017-04-04 14:36:16 -07:00
JW Wang e228515096 Bug 1351553 - fix divide-by-zero. r=gerald
MozReview-Commit-ID: BZVCVOOLx1L
2017-03-29 16:15:13 +08:00
Kaku Kuo 94ee914d02 Bug 1350852 P1 - add a mozvideoonlyseekcompleted event; r=jwwang
MozReview-Commit-ID: wLMawR9Coz
2017-03-27 18:12:58 +08:00
JW Wang 83ba36a828 Bug 1350203. P5 - replace SAMPLE_LOG with LOGV. r=kaku
We often need to turn on both MediaSample and MediaDecoder logs when debugging sample activities.
So it is convenient to merge them into a single log module.

Use `MOZ_LOG=MediaDecoder:4` to show decoder logs.
use `MOZ_LOG=MediaDecoder:5` to show both decoder and sample logs.

MozReview-Commit-ID: JQtyoyrNRmV
2017-03-24 11:58:37 +08:00
JW Wang 7c60790ce9 Bug 1350202 - use shorter names for logging macros in MediaDecoder.cpp. r=kaku
MozReview-Commit-ID: E2OnbXb82Zb
2017-03-24 11:17:17 +08:00
Kaku Kuo e9a80160e4 Bug 1348432 - move the mMediaTracksConstructed flag back to MediaDecoder; r=jwwang
This mMediaTracksConstructed flag should belong to a MediaDecoder,
every time a HTMLMediaElement switches its MediaDecoder, the flag should be reset to false again.

So, we move the mMediaTracksConstructed flag back to MediaDecoder, by this way,
HTMLMediaElement provides only the mechanism to construct and remove media tracks,
and MediaDecoder uses the flag, mMediaTracksConstructed, to provide policy.

MozReview-Commit-ID: L7mMAmLjQCy
2017-03-18 22:34:01 +08:00
Kaku Kuo 62a46f502f Bug 1347892 part 3 - dont change video decode mode if a media element is in-tree with UNTRACKED visibility state; r=jwwang
If a media element is in-tree with UNTRACKED visibility state, the information is incomplete, just ignore it.

MozReview-Commit-ID: FcKybQZqF6c
2017-03-17 13:06:12 +08:00
Kaku Kuo 928c735b49 Bug 1347892 part 2 - pass the visibility state of media element to media decoder as a Visibility variable; r=jwwang
MozReview-Commit-ID: AbkJeIpYZlN
2017-03-17 12:51:11 +08:00
Kaku Kuo d5368389b1 Bug 1347402 part 5 - create MediaElementGMPCrashHelper in HTMLMediaElement.cpp; r=cpearce,jwwang
Move the creation of MediaElementGMPCrashHelper out from MediaDecoder.cpp
which reduces the dependency of MediaDecoder to HTMLMediaElement.

MozReview-Commit-ID: E60aMfcFr7V
2017-03-16 11:16:15 +08:00
Kaku Kuo 40b2bd78f3 Bug 1347402 part 4 - move ConstructMediaTracks/RemoveMediaTracks to HTMLMediaElemnt; r=jwwang
ConstructMediaTracks and RemoveMediaTracks are actually HTMLMediaElement's responsibilities.

MozReview-Commit-ID: 8lOdzD4pN7N
2017-03-15 17:33:21 +08:00
Kaku Kuo 852393533f Bug 1347402 part 3 - get owner document via polymorphism; r=jwwang
MozReview-Commit-ID: GCr2xQyST4X
2017-03-15 14:56:05 +08:00
Kaku Kuo 7048cf28cd Bug 1347402 part 1 - call DownloadSuspended() via polymorphism; r=jwwang
Instead of calling DownloadSuspended() via a pointer to a HTMLMediaElement,
we should call DownloadSuspended() via a pointer to a MediaDecoderOwner.

MozReview-Commit-ID: BvExQuchsWb
2017-03-15 11:20:57 +08:00
Kaku Kuo f1bd791cd7 Bug 1346116 part 2 - consider a video is in-tree or not in the suspend-video-decoding policy; r=jwwang
We never suspend videos that is NOT in-tree because we found that, according to the Telemetry data, most (>70%) videos
which are used as the argument of drawImage() are not in-tree. So, by preventing suspending not-in-tree videos, we should
be able to alleviate the pain of not able to resume video decoders synchronously.

MozReview-Commit-ID: 8eqs0pHZLIt
2017-03-12 14:02:04 +08:00
Kaku Kuo 9bfc0d89fd Bug 1346116 part 1 - initialize MediaDecoder::mIsDocumentVisible and MediaDecoder::mIsElementVisible at HTMLMediaElement::FinishDecoderSetup(); r=jwwang
Initialize the MediaDecoder::mIsElementVisible to be "!aOwner->IsHidden()" at the MediaDecoder's constructor is wrong.
Insted, we initialize both MediaDecoder::mIsDocumentVisible and MediaDecoder::mIsElementVisible to be false at the construtor,
and then assign the HTMLMediaElement's real values to them at HTMLMediaElement::FinishDecoderSetup() via the the MediaDecoder::SetActiviyChangesToDecoder().

The initialization values of MediaDecoder::mIsDocumentVisible and MediaDecoder::mIsElementVisible (in the constructor) do not matter because the valuse are
not read untile the first MediaDecoder::SetActiviyChangesToDecoder() method call.

MozReview-Commit-ID: Cdovq5pG9Nv
2017-03-12 13:56:43 +08:00
Kaku Kuo 601e6d627a Bug 1346498 part 9 - move all policy codes into MediaDecoder::UpdateVideoDecodeMode(); r=jwwang
Make HTMLMediaElement no longer has logic of deciding visibility, it just passes all information into MediaDecoder.

MozReview-Commit-ID: ApVcEQfboO
2017-03-11 19:56:17 +08:00
Kaku Kuo 490dcc2e7f Bug 1346498 part 6 - remove mHasSuspendTaint cannonical-mirror pair; r=jwwang
MozReview-Commit-ID: BqAfv9CSsv3
2017-03-11 15:12:38 +08:00
Kaku Kuo c4cc6a9357 Bug 1346498 part 4 - remove mIsVisible cannonical-mirror pair; r=jwwang
The role of MDSM::mIsVisible and MDSM::VisibilityChanged() have been replaced by
the MDSM::mVideoDecodeMode and MDSM::VideoDecodeModeChanged() completely.

MozReview-Commit-ID: 8sW0s8ilF1E
2017-03-11 14:06:09 +08:00
Kaku Kuo ddb1ab9f9e Bug 1346498 part 3 - implement the UpdateVideoDecodeMode() policy in MediaDecoder; r=jwwang
So, the MediaDecoder is the one who rules out the policy of suspending video decoder.
We also extract all the policy rules into one single method, MediaDecoder::UpdateVideoDecodeMode().

MozReview-Commit-ID: IOQq6kFfkIs
2017-03-10 16:52:03 +08:00
Kaku Kuo 2e1c7a3659 Bug 1346498 part 1 - extract the MediaDecoder::NotifyCompositor() method; r=jwwang
MozReview-Commit-ID: Hfw3FJUSVVe
2017-03-10 16:29:59 +08:00
Kaku Kuo 23e79910a1 Bug 1345403 part 4 - Clean up suspend timer canceling; r=jwwang
MozReview-Commit-ID: LuNmrtDl4BR
2017-03-08 21:28:01 +08:00
Kaku Kuo 8df8c0f4ad Bug 1345403 part 1 - Track decoder tainting; r=jwwang
Some uses of media elements should 'taint' the element so that the video doesn't participate in video decode suspending.
Add the infrastructure to track the taint status on MediaDecoder and mirror the status to MediaDecoderStateMachine.

MozReview-Commit-ID: Ik6aDIzrZaO
2017-03-08 19:28:13 +08:00
Iris Hsiao 7f2d7798aa Backed out 5 changesets (bug 1345403) for permanent failure in autophone Mdm tests
Backed out changeset f6415ae0ba89 (bug 1345403)
Backed out changeset ac12e246a808 (bug 1345403)
Backed out changeset a3e4ce12194f (bug 1345403)
Backed out changeset ba072186c917 (bug 1345403)
Backed out changeset 7a7d6e9b8329 (bug 1345403)
2017-03-13 15:28:14 +08:00
Kaku Kuo ced129bc9e Bug 1345403 part 4 - Clean up suspend timer canceling; r=jwwang
MozReview-Commit-ID: LuNmrtDl4BR
2017-03-08 21:28:01 +08:00
Kaku Kuo c5fa09b963 Bug 1345403 part 1 - Track decoder tainting; r=jwwang
Some uses of media elements should 'taint' the element so that the video doesn't participate in video decode suspending.
Add the infrastructure to track the taint status on MediaDecoder and mirror the status to MediaDecoderStateMachine.

MozReview-Commit-ID: Ik6aDIzrZaO
2017-03-08 19:28:13 +08:00
Jean-Yves Avenard b918d4a7a1 Bug 1345363: Don't truncate debugging information. r=jwwang
NS_DebugBreak truncate all output to 500 characters.

MozReview-Commit-ID: 1gEyJNge7gk
2017-03-10 11:21:41 +01:00
karo 9dfa510df6 Bug 1344073 - Adding consistent formatting to HTMLMediaElement::MozRequestDebugInfo debugInfo dump string. r=cpearce
MozReview-Commit-ID: GfRrLQcebbt
2017-03-01 16:03:01 +13:00
JW Wang ea32323ea8 Bug 1343787. Part 2 - move the Register() calls to Load(). r=gerald
MozReview-Commit-ID: 2jjZujE1qH8
2017-03-02 18:03:20 +08:00
JW Wang 00e1f7739b Bug 1343428 - Label runnables in dom/media/MediaDecoder.cpp. r=gerald
MozReview-Commit-ID: Jv6iXO9ZxZH
2017-03-01 11:36:17 +08:00
Michael Layzell ed843263df Bug 1336510 - Part 4: Capture a strong reference to this in dom/media, r=jwwang
MozReview-Commit-ID: 4lVGrGzhVXh
2017-02-24 14:34:23 -05:00
Wes Kocher 4f2e3a1877 Backed out 8 changesets (bug 1336510) for windows debug mn-e10s failures a=backout
Backed out changeset 419ada2f9e81 (bug 1336510)
Backed out changeset 19239f566a93 (bug 1336510)
Backed out changeset c8aeead6fe83 (bug 1336510)
Backed out changeset 422e63b872b5 (bug 1336510)
Backed out changeset 21869174dfd3 (bug 1336510)
Backed out changeset 57476b9f342d (bug 1336510)
Backed out changeset e842cdaaa7e5 (bug 1336510)
Backed out changeset bd943b368ff7 (bug 1336510)

MozReview-Commit-ID: 2z3Wa9QFkX4
2017-02-23 16:07:41 -08:00
Michael Layzell de7ee53299 Bug 1336510 - Part 4: Capture a strong reference to this in dom/media, r=jwwang
MozReview-Commit-ID: 4lVGrGzhVXh
2017-02-23 12:24:12 -05:00
Wes Kocher 64ccd9559b Merge inbound to m-c a=merge
MozReview-Commit-ID: DCUf7VEDrTt
2017-02-17 13:38:51 -08:00
Vedant Sareen a85a2ad339 Bug 1330907 - Rename Telemetry::ID to Telemetry::HistogramID. r=dexter
Changed |print("enum ID : uint32_t {", file=output)| to |print("enum HistogramID : uint32_t {", file=output)| at line 53 of the file |toolkit/components/telemetry/gen-histogram-enum.py|, and then replaced all the textual occurrences of |Telemetry::ID| to |Telemetry::HistogramID| and |ID| to |HistogramID| in 43 other files.
2017-02-16 00:45:15 +05:30