Commit Graph

702 Commits

Author SHA1 Message Date
Alastor Wu
d2b3782047 Bug 1351087 - part1 : don't register agent for audio without audio track. r=baku
Since we don't want to show media control for media without audio track (eg. GIFV),
it's no need to register audio agent for them.

MozReview-Commit-ID: 22YrMkpNrcP
2017-05-09 14:10:43 +08:00
Alastor Wu
341c403406 Bug 1357633 - part1 : request audio focus again when resume media from page. r=baku
Should also update audio playing changed after resumed from page.

MozReview-Commit-ID: 66vuJJFeWN3
2017-05-10 23:43:11 +08:00
Carsten "Tomcat" Book
c807d58426 merge mozilla-inbound to mozilla-central a=merge 2017-05-10 15:07:28 +02:00
Bill McCloskey
c402a046c2 Bug 1363560 - Name more runnables (r=mccr8)
MozReview-Commit-ID: 3hxZDA4JlTV
2017-05-09 21:53:25 -07:00
Tom Tung
5b84b76520 Bug 1348050 - Part 4: Mark channel as urgent-start for loading media. r=baku
The part is mainly to set urgent-start for loading media when it's initiated by
user interaction. For the HTMLMedia element, it has its algorithm to pre-load
the media and users will get feedback once they play the media. Thus, I only
set urgent-start when the media element has autoplay attribute since the sooner
enough resource is loaded the sooner the media will be played.

MozReview-Commit-ID: 7nu3PUt8iYo
2017-04-28 15:27:10 +08:00
Iris Hsiao
52ff06b763 Backed out changeset 763cc804a25d (bug 1361944) for causing crashtest perma failure on Android 2017-05-05 15:12:51 +08:00
JW Wang
d2cf59049a Bug 1361944. P2 - be sure to shut down the existing decoder before loading the next source child. r=cpearce
Otherwise we will fail the assertion (!mDecoder, "Shouldn't have a decoder")
in HTMLMediaElement::InitializeDecoderForChannel().

MozReview-Commit-ID: 1zShp0th3Uv
2017-05-04 13:28:17 +08:00
JW Wang
fcfcc3c80c Bug 1361944. P1 - add a crash test. r=cpearce
The crash happens when:
1. there are multiple <source> children.
2. decode error happens on the 1st child.

MozReview-Commit-ID: 60UXaQ475Nh
2017-05-04 14:23:23 +08:00
Kirk Steuber
9386a2f3e1 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI
2017-04-20 12:57:48 -07: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
Kaku Kuo
310c951228 Bug 1360123 P1 - don't bother creating a new track list in HTMLMediaElement::RemoveMediaTracks() r=jwwang
MozReview-Commit-ID: 6lmSxmKMrDK
2017-04-10 18:09:35 +08:00
Alastor Wu
c2ee741d03 Bug 1358061 - remove moz-audiochannel codes for media element and web audio. r=baku
MozReview-Commit-ID: KPuhxCVezOZ
2017-04-26 12:02:32 +08:00
Phil Ringnalda
9a4f26dd07 Backed out changeset 6e7efb9115fd (bug 1358061) for build bustage
CLOSED TREE

MozReview-Commit-ID: F9FSciVgynw
2017-04-25 20:55:30 -07:00
Alastor Wu
347fbb9c2e Bug 1358061 - remove moz-audiochannel codes for media element and web audio. r=baku
MozReview-Commit-ID: BwZ6vHUPnSB
2017-04-25 12:19:28 +08:00
JW Wang
03dd9cb628 Bug 1356514 - remove the usage of nsContentUtils::IsInPrivateBrowsing() in HTMLMediaElement.cpp. r=Ehsan
Per bug 1194891 comment 35, use |NodePrincipal()->GetPrivateBrowsingId() > 0| instead.

MozReview-Commit-ID: Cu6geuTWhGz
2017-04-18 14:26:32 +08:00
JW Wang
07dec81aea Bug 1348053 - add the UrgentStart flag to the channel when the loading is initiated by a user interaction for quicker network response. r=cpearce
MozReview-Commit-ID: 1tk9k8u1zTu
2017-04-10 15:23:11 +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
9cd84a4a9b Bug 1344357 P2 - put HTMLMediaElement::mSeekDOMPromise into cycle collector; r=jwwang
MozReview-Commit-ID: 5NOyAz02vTj
2017-04-17 18:40:17 +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
Gerald Squelart
e580efdd51 Bug 1343437 - HTMLMediaElement::DecodeWarning() should store a warning instead of an error - r=jya
MozReview-Commit-ID: 47hURppxH5H
2017-03-14 01:12:20 +11:00
JW Wang
4a9179873b Bug 1194891. P1 - plumb 'isPrivateBrowsing' down to MediaCacheStream. r=cpearce
MozReview-Commit-ID: EBKkOfK7K1p
2017-04-06 16:20:00 +08:00
Alastor Wu
1a502c9cfa Bug 1247433 - don't set error for unsupported type media. r=JamesCheng,jwwang,kaku
On Fennec, we use external video player to play unsupported type media.

In this bug, we can't execute play() successfully because the spec said that
we should abort the play if the value of media element's error is
MEDIA_ERR_SRC_NOT_SUPPORTED [1].

Therefore, we do a hack for unsupported type media, we don't set its error, but
we would still remember the src is unsupported type. When media element starts
playing, we would use an external video player to play that src.

[1] https://goo.gl/GlLbeA

MozReview-Commit-ID: 42HxQtXdWDe
2017-03-29 11:55:50 +08:00
Alastor Wu
504895e099 Bug 1347648 - part4 : notify audible change after finishing set suspend and pause state. r=jwwang
Since the audible state would depend on pause and suspend state, we should do
the check after finishing play() or pause().

MozReview-Commit-ID: 1yhxuQDw067
2017-03-27 10:59:44 +08:00
Alastor Wu
0e9eb786f9 Bug 1347648 - part2 : paused media element is non-audible. r=jwwang
If the media element is paused, it should be non-audible.

MozReview-Commit-ID: 2HjV9gNNcnV
2017-03-27 10:59:07 +08:00
Alastor Wu
2c14c57520 Bug 1347758 - part4 : add audio channel log. r=Ehsan
MozReview-Commit-ID: 3zVYtD86O82
2017-03-24 14:44:18 +08:00
Alastor Wu
8f4b05a9b5 Bug 1347758 - part2 : remove add/removeMediaContent() and related codes. r=Ehsan
Since the window would know when need to resume the media, we don't need the
add/removeMediaContent() anymore.

MozReview-Commit-ID: F9MSiqqnOiV
2017-03-24 14:43:40 +08:00
Iris Hsiao
a501d530f1 Backed out 6 changesets (bug 1347758) for eslint failure
Backed out changeset 9becd55242c1 (bug 1347758)
Backed out changeset 2abce19f5001 (bug 1347758)
Backed out changeset 80232d4c85d5 (bug 1347758)
Backed out changeset 1fd084ec34d4 (bug 1347758)
Backed out changeset cafb3c12027b (bug 1347758)
Backed out changeset 85846edfe957 (bug 1347758)
2017-03-24 16:58:08 +08:00
Alastor Wu
45a0c2c35f Bug 1347758 - part4 : add audio channel log. r=Ehsan
MozReview-Commit-ID: LNXzRZx2rC2
2017-03-24 12:04:15 +08:00
Alastor Wu
30b1724816 Bug 1347758 - part2 : remove add/removeMediaContent() and related codes. r=Ehsan
Since the window would know when need to resume the media, we don't need the
add/removeMediaContent() anymore.

MozReview-Commit-ID: F9MSiqqnOiV
2017-03-24 12:01:46 +08:00
Kaku Kuo
a3f27b5b0d Bug 1349456 part 2 - mark elemet as tainted while captured via MozCaptureStream(); r=jwwang
MozReview-Commit-ID: 1V776bLuH43
2017-03-22 14:46:09 +08:00
Kaku Kuo
4fc101bd6a Bug 1349456 part 1 - correct indentation; r=jwwang
MozReview-Commit-ID: 4i8sQaotJpO
2017-03-22 14:33:11 +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
Alastor Wu
c6a4a31236 Bug 1329122 - should unregister agent when media element becomes inactive. r=baku
We should remove the media control interface immediately when the document is inacitve, even it was paused by media control before.

MozReview-Commit-ID: GBDhzEFOTXE
2017-03-22 00:04:24 +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
80b5f843b7 Bug 1347892 part 1 - initialize a media element's mVisibilityState to be UNTRACKED; r=jwwang
MozReview-Commit-ID: Bkkh6hvCNu4
2017-03-16 19:26:49 +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
c81c694536 Bug 1347402 part 2 - open a GetOwnerDoc() interface at the MediaDecoderOwner; r=jwwang
Open a GetOwnerDoc() method to the MediaDecoderOwner interface and then we can get the
owner document via a pointer to MediaDecoderOwner in MediaDecoder.

MozReview-Commit-ID: JCzQDLx1MsU
2017-03-15 11:40:37 +08:00
Kaku Kuo
9fd6745d5d Bug 1347836 part 2 - make HTMLMediaElement::GetCurrentImage() return an already_AddRefed<layers::Image>; r=jwwang
MozReview-Commit-ID: FZ4JRdbPUry
2017-03-16 17:07:04 +08:00
Kaku Kuo
2eef5173be Bug 1347836 part 1 - fix comment; r=jwwang
MozReview-Commit-ID: 61ElwSsArw1
2017-03-16 17:05:10 +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
dc37a0043c Bug 1346498 part 8 - extract the HTMLMediaElement::NotifyDecoderActivityChanges() method; r=jwwang
Move all the policy rules into this method now, will then move the policies into MediaDecoder at next patch.

MozReview-Commit-ID: ILAYLrTwCJy
2017-03-11 18:25:41 +08:00
Kaku Kuo
419eeaab31 Bug 1346498 part 7 - remove outdated comments in HTMLMediaElement.cpp; r=jwwang
MDSM's dormant mechanism has nothing to do with the HTMLMediaElement's states now.

MozReview-Commit-ID: 4RSHsexy7fi
2017-03-11 16:33:50 +08:00
Kaku Kuo
534d42fb9c Bug 1345403 part 3 - Test element becomes tainted by DrawImage; r=jwwang,smaug
MozReview-Commit-ID: 9Txz4FbFtPe
2017-03-08 20:22:05 +08:00
Kaku Kuo
7802474ab9 Bug 1345403 part 2 - Mark element tainted when DrawImage is used; r=jwwang,mattwoodrow
Mark video element as tainted (stored on the decoder owned by video element) when the video is used as source to drawImage() on canvas.

MozReview-Commit-ID: HdciVwhqPu3
2017-03-08 19:41:08 +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
d0e1629ba0 Bug 1345403 part 3 - Test element becomes tainted by DrawImage; r=jwwang,smaug
MozReview-Commit-ID: 9Txz4FbFtPe
2017-03-08 20:22:05 +08:00
Kaku Kuo
32a89952db Bug 1345403 part 2 - Mark element tainted when DrawImage is used; r=jwwang,mattwoodrow
Mark video element as tainted (stored on the decoder owned by video element) when the video is used as source to drawImage() on canvas.

MozReview-Commit-ID: HdciVwhqPu3
2017-03-08 19:41:08 +08:00