Commit Graph

808 Commits

Author SHA1 Message Date
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
Gerald Squelart
e4e286e64e Bug 1383984 - Enable debugging HTMLMediaElement APIs with 'tabs' permission - r=jya,smaug
While "debugger" is not available yet, we can enable these debugging APIs for
extensions that have the "tabs" privilege, which includes the Media Panel
Devtools extension, so we/webdev will get better media-playback information.

MozReview-Commit-ID: I0MAZH9g0HU
2017-07-25 15:53:01 +12:00
Jean-Yves Avenard
9b3aa49302 Bug 1382303 - P2. Do not activate autoplay early. r=jwwang
Per spec, autoplay should only gets triggered once readyState is equal to HAVE_ENOUGH_DATA

MozReview-Commit-ID: 6nW1U6G1qme
2017-07-20 19:11:44 +02:00
JW Wang
7ba3b7eab7 Bug 1380569. P3 - remove AbstractMediaDecoder::NotifyWaitingForKey() and its callers. r=gerald
MozReview-Commit-ID: 3fHDr0xw92P
2017-07-13 14:52:05 +08:00
JW Wang
6e89499aaf Bug 1380569. P1 - rename CannotDecryptWaitingForKey() to NotifyWaitingForKey() and add the function to MediaDecoderOwner. r=gerald
We will use MediaEventSource to plumb the event from MFR to the media element.

MozReview-Commit-ID: 4gaEx7vYybE
2017-07-13 14:41:09 +08:00
JW Wang
f7b934bab5 Bug 1376004. P1 - include http response code in the error.message field so the UI has more details to display a proper error message. r=cpearce
MozReview-Commit-ID: CHBXZZxfPc0
2017-07-14 15:17:32 +08:00
Bevis Tseng
0e843ba44f Bug 1341540 - Label runnables in dom/html/HTMLMediaElement.cpp. r=jwwang
MozReview-Commit-ID: 7i0MhGWoNPb
2017-07-07 10:36:13 +08:00
Olli Pettay
36c7177e03 Bug 1378196, Make IsEventAttributeName non-virtual in common case, r=ehsan 2017-07-04 23:54:30 +03:00
Paul Adenot
aadd3c3a24 Bug 1341555 - Consolidate use of the MSG's AbstractMainThread, and stop having AbstractMainThread on MediaStreams. r=pehrsons
MozReview-Commit-ID: 5hGDQcfpH6a
2017-06-29 11:30:57 -07:00
Paul Adenot
b501ebc61e Bug 1330360 - Create new MSGs for each nsPIDOMWindow. r=jesup
MozReview-Commit-ID: 5m1MGcLmT7J
2017-06-23 16:18:34 -07:00
Paul Adenot
0a1b1a9c7b Bug 1371719 - Don't create a MediaStreamGraph without doing anything with it. r=jesup
The MediaStreamGraph relies on having at least one message sent to its message
queue on creation, or it will just sit there and do nothing, and block shutdown
because its not running its rendering loop, so it's not progressing in the
MediaStreamGraph life cycle state machine.

This patch makes sure the `captureStream` will succeed before creating an MSG.

MozReview-Commit-ID: CN1arWydmxC
2017-06-28 15:19:39 -07:00
JW Wang
464e6d7a38 Bug 1376363. P1 - store container type in MediaDecoder. r=gerald
So we can remove MediaResource::GetContentType() in the future.

MozReview-Commit-ID: zWUNF2uGpf
2017-06-26 17:10:47 +08:00
Chris Pearce
ccdba556af Bug 1376509 - Bump supported playack rates to [1/16,16]. r=padenot
Chrome supports playback rates in the ranges of [1/16,16], so we may as well
support the same.

MozReview-Commit-ID: 7mMXQfPiv9d
2017-06-28 10:00:58 -07:00
Bill McCloskey
ce42826bdf Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
JW Wang
9b94d757aa Bug 1376227. P5 - merge CreateResource() and Load() for they are highly coupled. r=gerald
MozReview-Commit-ID: EH9NROdQfmd
2017-06-23 15:39:57 +08:00
JW Wang
0064b6f13e Bug 1376227. P4 - remove the unused parameter from FinishDecoderSetup(). r=gerald
MozReview-Commit-ID: 7Ux811oMq9y
2017-06-23 15:25:40 +08:00
JW Wang
e61275e384 Bug 1376227. P3 - move Load() down the class hierarchy. r=gerald
So we won't pass an unused |nsIStreamListener**| to MediaSourceDecoder::Load().

MozReview-Commit-ID: 2TCby8m8K5H
2017-06-23 14:12:41 +08:00
JW Wang
d6e01cebbe Bug 1376227. P2 - remove unused code following P1. r=gerald
MozReview-Commit-ID: JbwY1Owtk7H
2017-06-21 17:34:22 +08:00
JW Wang
f55b75dc89 Bug 1376227. P1 - let MediaDecoder sub-classes have the knowledge how to create a MediaResource. r=gerald
MozReview-Commit-ID: 2fHEkU46MUr
2017-06-21 17:30:56 +08:00
Mats Palmgren
ad8f480b5c Bug 1375075 - Remove a FlushPendingNotifications that we don't need anymore. r=cpearce
The code that needed it was removed in bug 1325053.

MozReview-Commit-ID: 8P60SOpqyPq
2017-06-23 02:03:09 +02:00
Mats Palmgren
a37c7c4e08 Bug 1374875 - Use simpler mutation observer than nsRange for media elements. r=cpearce
MozReview-Commit-ID: FVPdHC6tBXg
2017-06-23 02:03:08 +02:00
JW Wang
f17989ec1b Bug 1374930. P3 - move Clone() down to ChannelMediaDecoder for clone is possible only for those use channel-based resource. r=cpearce
MozReview-Commit-ID: Ci2kbts2pkQ
2017-06-20 18:10:27 +08:00
JW Wang
e1ce375b5d Bug 1374930. P2 - add an entry only after FinishDecoderSetup() succeeds. r=cpearce
MozReview-Commit-ID: 6MKRhVIZ4Z6
2017-06-20 15:27:45 +08:00
JW Wang
e11983b26f Bug 1371202. P1 - plumb the 'loop' attribute into MDSM. r=jya
MozReview-Commit-ID: DtsaXmtQw76
2017-06-08 12:03:10 +08:00
JW Wang
6f518a53ad Bug 1371200. P2 - add more fields to MediaDecoderInit. r=cpearce
Now we can init some members in the constructor and remove the setters
that are called only once.

MozReview-Commit-ID: 2hkrIA6pFlh
2017-06-07 14:10:26 +08:00
JW Wang
87f0f44500 Bug 1371200. P1 - add MediaDecoderInit and fix MediaDecoder constructor and its friends. r=cpearce
We will add more fields to MediaDecoderInit and be able to remove some setters.

MozReview-Commit-ID: BVx935IHQHf
2017-06-07 12:14:11 +08:00
Kirk Steuber
6684b17554 Bug 1365092 - Move side effects of SetAttr, UnsetAttr, and ParseAttribute functions to BeforeSetAttr and AfterSetAttr r=bz
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.

MozReview-Commit-ID: Gyd1tD6ldly
2017-06-07 10:28:20 -07:00