Commit Graph

1084 Commits

Author SHA1 Message Date
Andreas Pehrson
c855651483 Bug 1296531 - Remove MediaStream blocking logic from HTMLMediaElement. r=jesup
MediaStreamGraph only implements the blocking notifications for SourceMediaStreams,
but the MediaStream that gets attached as srcObject on a media element is always
a TrackUnionStream. Hence, this code is unused and can be removed.

MozReview-Commit-ID: 6DKtCGNsZec
2017-05-08 18:41:28 +02:00
JW Wang
e154ae23d6 Bug 1399358 - call mDecoder->CanPlayThrough() so MDSM has a chance to exit buffering quickly. r=gerald
MozReview-Commit-ID: A5e3A8HV2ih
2017-09-13 12:43:33 +08:00
James Cheng
3ab48a191f Bug 1398102 - [Part1] canPlayType should return 'maybe' if the codec parameter is empty. r=gerald
MozReview-Commit-ID: BmzIUOuaTj9
2017-09-11 17:17:55 +08:00
Sebastian Hengst
2725784918 Backed out changeset 939ecf1b80cb (bug 1398102) for failing mda's dom/media/test/test_can_play_type_wave.html. r=backout 2017-09-12 11:03:50 +02:00
James Cheng
20581f0abd Bug 1398102 - canPlayType should return 'maybe' if the codec parameter is empty. r=gerald
MozReview-Commit-ID: BmzIUOuaTj9
2017-09-11 17:17:55 +08:00
Catalin Badea
fd46c72e33 Bug 1380621 - Change the order of member variables in HTMLMediaElement. r=cpearce
This reduces the size of the object by avoiding memory alignment padding.
2017-09-06 11:20:00 +01:00
Catalin Badea
48c8fdd05c Bug 1380621 - Use node pointer for HTMLMediaElement::mSourcePointer. r=cpearce
Using a pointer instead of an index helps us avoid some costly
operations such as IndexOf and GetChildAt with the upcoming changes from
bug 651120.
2017-09-06 11:16:23 +01:00
Kris Maglione
fd54e6524a Bug 1396449: Part 2 - Use atoms to test WebExtension permissions. r=krizsa
The extension policy services uses atoms internally for permission names, so
using them directly rather than strings is considerably cheaper.

MozReview-Commit-ID: Io8EuOXHKVy
2017-09-03 18:51:02 -07:00
Alastor Wu
4d86f7d153 Bug 1395359 - make sure all references value are set before we use them. r=cpearce
1. since setVolume would trigger updateWakelock(), we should set |mOuter| before that.
2. move outer as required parameter in its constructor.
3. should init all member varaibles which would be referenced by wakeLockWrapper before its initialization.

MozReview-Commit-ID: H9A3aCKp6eT
2017-09-04 11:05:15 +08:00
JW Wang
a2e1bd0943 Bug 1394705 - let HTMLMediaElement::MediaLoadListener implement nsIThreadRetargetableStreamListener. r=cpearce
This is required to use nsIThreadRetargetableRequest::RetargetDeliveryTo().

MozReview-Commit-ID: GFuAjovabpY
2017-08-29 14:28:13 +08:00
Andrew McCreight
84ee98de3c Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1
2017-08-29 16:02:48 -07:00
Alastor Wu
73da3fd7fb Bug 1373888 - part5 : only request audio wake lock when it's audible. r=cpearce
No need to prevent sleeping for non-audible audio.

MozReview-Commit-ID: 6p3azSUWTU2
2017-08-29 15:25:44 +08:00
Alastor Wu
625653c168 Bug 1373888 - part3 : rename the topic of the wake lock. r=cpearce
For knowing the wake lock usage more clearly, we should use more specific topic name.

In OSX, you can use "$ pmset -g assertions" to check all the wakelock.
In Windows, using "$ powser -energy" to generate the energy report.

MozReview-Commit-ID: rAXnkxTvLc
2017-08-29 10:54:28 +08:00
Alastor Wu
07f2b0f9cf Bug 1373888 - part2 : remove the timer which was used for b2g. r=cpearce
The timer was added for the b2g issue, now we can remove it.

MozReview-Commit-ID: BNjIghImCzC
2017-08-29 10:54:25 +08:00
Alastor Wu
2bc6bce6d1 Bug 1373888 - part1 : remove useless function. r=cpearce,smaug
These functions didn't be used by anyone, remove them.

MozReview-Commit-ID: BLj8GsVp1gR
2017-08-29 10:54:18 +08:00
JW Wang
276f246c61 Bug 1394313 - replace use of nsAutoPtr with UniquePtr in MediaDecoderOwner.h. r=cpearce
MozReview-Commit-ID: 49lyvMzg7oY
2017-08-28 14:10:35 +08:00
Tom Ritter
2b3e28fd30 Bug 1393535 Fix unused variable warnings in dom/ r=cpearce
MozReview-Commit-ID: 1Ql20AHx1Jz
2017-08-24 11:52:36 -05:00
Chris Pearce
64be5ea877 Bug 1392498 - Move TimeIntervals to dom::TimeRanges conversion into TimeRanges class. r=jya
If TimeUnits.h includes mozilla/dom/TimeRanges.h, then the build ends up
pulling in the Gecko DOM bindings, which pulls in a whole lot of JavaScript and
DOM bindings code. That makes it trickier to import GeckoMedia into Servo, and
makes Gecko's build slower, so move the code to convert TimeIntervals into
dom::TimeRanges.

Also remove an extraneous "virtual" and add "const" to some functions in TimeRanges.

MozReview-Commit-ID: BLeehaf9gCE
2017-08-21 15:08:25 +12:00
JW Wang
7f2e81ee65 Bug 1392919. P3 - remove unused code and fix naming. r=gerald
MozReview-Commit-ID: 36PqGtOpAbf
2017-08-23 14:42:25 +08:00
Alastor Wu
349a85c77a Bug 1382780 - part2 : separate the value of actual playback rate and media element's attribute. r=cpearce
According to [1], we should separate the value of actual playback rate and media elemenet's attribute.
But still keep a MAX and MIN threshold to control the highest and lowser playback rate for decoder.

[1] http://w3c-test.org/html/semantics/embedded-content/media-elements/playing-the-media-resource/playbackRate.html

MozReview-Commit-ID: EGCa4yrNXO6
2017-08-24 16:58:45 +08:00
Alastor Wu
bc4dc2c169 Bug 1382780 - part1 : return NS_ERROR_DOM_NOT_SUPPORTED_ERR for the negative playback rate. r=cpearce
According to [1], we should return NotSupportedError for the negative playback rate.

[1] https://github.com/w3c/web-platform-tests/pull/6522

MozReview-Commit-ID: KoqDkBmP3h9
2017-08-24 16:58:42 +08:00
JW Wang
60a242f989 Bug 1391170 - lessen the assertion in AddMediaElementToURITable() so we can move MediaDecoder::GetResource() to private. r=gerald
If AddMediaElementToURITable() is called after the decoder Load failed, mDecoder
will be reset and it is sufficient to assert mDecoder only.

MozReview-Commit-ID: 58WT8zFeiFj
2017-08-17 15:41:22 +08:00
JW Wang
20146f8f76 Bug 1390443. P3 - rewrite the logic about mWaitingForKey. r=cpearce
This fixes the bug where mWaitingForKey is reset only when mPaused is false.
We should reset mWaitingForKey to NOT_WAITING_FOR_KEY when the key is
available and decoding can continue.

http://w3c.github.io/encrypted-media/#resume-playback

MozReview-Commit-ID: LjIhe9cTsdg
2017-08-17 10:47:07 +08:00
JW Wang
17359e65e5 Bug 1390443. P1 - don't change nextFrameStatus when MDSM reaches the end of playback. r=cpearce
Instead, MediaDecoder::NextFrameStatus() checks IsEnded() and returns
NEXT_FRAME_UNAVAILABLE to ensure we have HAVE_CURRENT_DATA when playback
is ended on the main thread.

This will fix the timing issue (comment 0) which causes 'waiting' to fire.

MozReview-Commit-ID: 7O21x2q0lb8
2017-08-16 15:33:58 +08:00
Sebastian Hengst
0e5c19642e Backed out changeset 4f8ac9b281da (bug 1390443) for failing web-platform-tests, e.g. /encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.html. r=backout 2017-08-21 10:20:24 +02:00
Sebastian Hengst
d31003366c Backed out changeset 5bcf66374df8 (bug 1390443) 2017-08-21 10:19:34 +02:00
JW Wang
815710d721 Bug 1390443. P3 - rewrite the logic about mWaitingForKey. r=cpearce
This fixes the bug where mWaitingForKey is reset only when mPaused is false.
We should reset mWaitingForKey to NOT_WAITING_FOR_KEY when the key is
available and decoding can continue.

http://w3c.github.io/encrypted-media/#resume-playback

MozReview-Commit-ID: LjIhe9cTsdg
2017-08-17 10:47:07 +08:00
JW Wang
61ff4ad6e1 Bug 1390443. P1 - don't change nextFrameStatus when MDSM reaches the end of playback. r=cpearce
Instead, MediaDecoder::NextFrameStatus() checks IsEnded() and returns
NEXT_FRAME_UNAVAILABLE to ensure we have HAVE_CURRENT_DATA when playback
is ended on the main thread.

This will fix the timing issue (comment 0) which causes 'waiting' to fire.

MozReview-Commit-ID: 7O21x2q0lb8
2017-08-16 15:33:58 +08:00
Jean-Yves Avenard
c377660932 Bug 1391666 - P3. Change to HAVE_ENOUGH_DATA when possible. r=cpearce
In bug 1312886, we made sure that readyState would never become HAVE_ENOUGH_DATA if we were waiting for a key.
However, this is in effect useless as the next call to ChangeReadyState would have reset mWaitingForKey.

In practice, it only meant that we delayed the change from HAVE_FUTURE_DATA to HAVE_ENOUGH_DATA until the next call to UpdateReadyState.

MozReview-Commit-ID: 2wnMeN8xxCS
2017-08-18 21:00:08 +02:00
Jean-Yves Avenard
459d4b6a28 Bug 1391666 - P2. Reset mWaitingForKey when we have data and autoplay attribute is set r=cpearce
By default, a media element that has never played is in paused mode. As such, we need to reset mWaitingForKey to NOT_WAITING_FOR_KEY otherwise, readyState will never become HAVE_ENOUGH_DATA.

MozReview-Commit-ID: EIi3Crt4zHl
2017-08-18 19:20:48 +02:00
Chris Pearce
b09f61f76c Bug 1390748 - Pre-declare MediaDecoder in HTMLMediaElement. r=jwwang
I noticed that touching MediaDecoder rebuilds a lot of seemingly unrelated
code. This is because HTMLMediaElement includes MediaDecoder.h, and
HTMLMediaElement is included in a number of places. Having HTMLMediaElement.h
predeclare rather than include fixes it.

MozReview-Commit-ID: I0vrPgqvvge
2017-08-15 17:09:06 +12:00
Carsten "Tomcat" Book
900a6c3b92 Backed out changeset 4a31e4302e03 (bug 1390748) 2017-08-17 08:35:30 +02:00
Chris Pearce
a90b42435d Bug 1390748 - Pre-declare MediaDecoder in HTMLMediaElement. r=jwwang
I noticed that touching MediaDecoder rebuilds a lot of seemingly unrelated
code. This is because HTMLMediaElement includes MediaDecoder.h, and
HTMLMediaElement is included in a number of places. Having HTMLMediaElement.h
predeclare rather than include fixes it.

MozReview-Commit-ID: I0vrPgqvvge
2017-08-15 17:09:06 +12:00
Phil Ringnalda
34d25d405e Backed out 10 changesets (bug 1390748) for build bustage
Backed out changeset 02b36ee5fb17 (bug 1390748)
Backed out changeset 84e8bf01c856 (bug 1390748)
Backed out changeset fc8989be30f3 (bug 1390748)
Backed out changeset 14d421ace6cc (bug 1390748)
Backed out changeset 7dadac869038 (bug 1390748)
Backed out changeset 0e77809e7bc2 (bug 1390748)
Backed out changeset bf78a8dce9c5 (bug 1390748)
Backed out changeset 5fa77990472e (bug 1390748)
Backed out changeset 5d3b637d2485 (bug 1390748)
Backed out changeset 634fe076d134 (bug 1390748)

MozReview-Commit-ID: Dxio8vXDCHg
2017-08-16 21:33:10 -07:00
Chris Pearce
c4c0db8c23 Bug 1390748 - Pre-declare MediaDecoder in HTMLMediaElement. r=jwwang
I noticed that touching MediaDecoder rebuilds a lot of seemingly unrelated
code. This is because HTMLMediaElement includes MediaDecoder.h, and
HTMLMediaElement is included in a number of places. Having HTMLMediaElement.h
predeclare rather than include fixes it.

MozReview-Commit-ID: I0vrPgqvvge
2017-08-15 17:09:06 +12:00
Chris Pearce
5f60cd2ec7 Bug 1390406 - Remove unnecessary includes in dom/media/mediasource. r=jya
MozReview-Commit-ID: 1aTncGfBicu
2017-08-15 16:13:00 +12:00
Matthew Gregan
c16f73903c Bug 1388236 - Remove B2G-only AudioChannel code from dom/audiochannel. r=alwu 2017-08-10 13:00:09 +12:00
Matthew Gregan
1a48118e9a Bug 1388236 - Remove B2G-only AudioChannel code from HTMLMediaElement. r=jwwang 2017-08-10 13:00:08 +12:00
Matthew Gregan
732e0cc4ee Bug 1388236 - Remove B2G-only AudioChannel code from MSG. r=padenot 2017-08-10 13:00:08 +12:00
Matthew Gregan
2a28c36ef9 Bug 1388236 - Remove B2G-only AudioChannel code from media playback. r=jwwang 2017-08-10 13:00:07 +12:00
Honza Bambas
2fb8e43c7d Bug 1377206 - Explicitly disable throttling of media HTTP responses, r=cpearce 2017-08-04 04:38:00 +02:00
JW Wang
5df0f2fb77 Bug 1383628. P5 - move CanClone() from MediaResource to BaseMediaResource. r=gerald
1. we move clone related methods to BaseMediaResource which is the only cloneable sub-class of MediaResource.
2. add CanClone() to ChannelMediaDecoder to reduce the dependency on MediaResource for HTMLMediaElement.
   MediaResource should be internal details to MediaDecoder.

MozReview-Commit-ID: Hl2nAiuyTO0
2017-08-04 15:29:55 +08:00
JW Wang
16a9ff0929 Bug 1383628. P2 - move the call to Load() into Clone(). r=gerald
MozReview-Commit-ID: 9k8BXLwAepI
2017-08-03 17:47:23 +08:00
Sebastian Hengst
a8245ca35f merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: JhesEg4Bxjy
2017-08-04 19:28:27 +02:00
Bill McCloskey
969eb187fa Bug 1364821 - Introduce AbstractThread::AutoEnter and remove main thread's AbstractThread::GetCurrent() (r=jwwang)
MozReview-Commit-ID: FSLVn7xe3sq
2017-08-03 14:19:02 -07:00
JW Wang
c3c7fb0a44 Bug 1384831. P5 - remove unused arguments from HLSDecoder::Load(). r=gerald
MozReview-Commit-ID: JsULuDcMiNa
2017-07-27 02:54:53 +08:00
JW Wang
0424576da8 Bug 1384831. P2 - rewrite HTMLMediaElement::InitializeDecoderForChannel() and move HLSDecoder creation code to it. r=gerald
Since we will remove ChannelMediaDecoder from HLSDecoder's base class, we can't
create HLSDecoder in InstantiateDecoder which returns a ChannelMediaDecoder.

MozReview-Commit-ID: 9wcrIVIOZFp
2017-07-26 15:49:03 +08:00
Paul Adenot
fe1e6433f6 Bug 1385305 - Change CanBeCaptured and friends so that they use explicit and self-explaining constants. r=jya
MozReview-Commit-ID: Hpuxlc8Ib5j
2017-07-28 17:53:12 +02:00
JW Wang
07f6b2ed41 Bug 1385699. P3 - remove MediaDecoder::SetInfinite() and related code. r=cpearce
Since inf can be encoded in MDSM::mDuration, we don't need an additional flag
in MediaDecoder to indicate 'infinite' anymore. Note duration change from infinite
to finite is handled by MDSM, so we can remove the explicit calls to SetInfinite(false).

MozReview-Commit-ID: EoxwZJzPAJl
2017-08-01 14:15:29 +08:00
Paul Adenot
e68762886b Bug 1384247 - Check if an HTMLMediaElement can be capture before doing it. r=dminor
MozReview-Commit-ID: EWpf2qA2Yce
2017-07-27 16:02:28 +02:00