Commit Graph

1284 Commits

Author SHA1 Message Date
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Andreas Pehrson
378c51c9f8 Bug 1177793 - Pass principal instead of forcing black when capturing cross-origin media resource. r=jya,jib
Differential Revision: https://phabricator.services.mozilla.com/D36896

--HG--
extra : moz-landing-system : lando
2019-07-08 21:15:10 +00:00
Nicholas Nethercote
d839ef58db Bug 1562331 - Make media.* static prefs follow the naming convention. r=KrisWright
This also removes the following prefs, because they're unused:
- media.autoplay.allow-muted pref
- media.autoplay.blackList-override-default

Differential Revision: https://phabricator.services.mozilla.com/D36396

--HG--
extra : rebase_source : 0570540496302b3efedadf4d5115ee5422d5c279
2019-06-28 14:09:05 +10:00
Chris Pearce
f428ea02a7 Bug 1554075 - Move MediaDecoderStateMachine to its own thread pool. r=jya
The MDSM currently uses the "MediaPlayback" thread pool. This is the same
thread pool used by the demuxers. If all the threads in the pool are in
use demuxing, we can end up not being able to run the A/V sync logic in
the MDSM's VideoSink. This means we end up not presenting frames we could
have potentially presented.

So move the MDSM's TaskQueue to its own SharedThreadPool of size 1. This
should allow the state transition tasks to run more independently from
the demuxing tasks.

Differential Revision: https://phabricator.services.mozilla.com/D33869

--HG--
extra : moz-landing-system : lando
2019-06-11 07:36:29 +00:00
Oana Pop Rus
9fdfa8a955 Backed out 9 changesets (bug 1554075) for reftest failures in Intervals.h and MP4Interval.h on a CLOSED TREE
Backed out changeset d5543a60f833 (bug 1554075)
Backed out changeset 1ea15f85c789 (bug 1554075)
Backed out changeset a76688ee5b8a (bug 1554075)
Backed out changeset 85482315a53c (bug 1554075)
Backed out changeset c3f3e9e00279 (bug 1554075)
Backed out changeset ac24ec2e0349 (bug 1554075)
Backed out changeset b04fc8b0c07a (bug 1554075)
Backed out changeset 2cce329d894d (bug 1554075)
Backed out changeset 347b7b4eaab1 (bug 1554075)
2019-06-11 09:52:43 +03:00
Chris Pearce
c8602db996 Bug 1554075 - Move MediaDecoderStateMachine to its own thread pool. r=jya
The MDSM currently uses the "MediaPlayback" thread pool. This is the same
thread pool used by the demuxers. If all the threads in the pool are in
use demuxing, we can end up not being able to run the A/V sync logic in
the MDSM's VideoSink. This means we end up not presenting frames we could
have potentially presented.

So move the MDSM's TaskQueue to its own SharedThreadPool of size 1. This
should allow the state transition tasks to run more independently from
the demuxing tasks.

Differential Revision: https://phabricator.services.mozilla.com/D33869

--HG--
extra : moz-landing-system : lando
2019-06-11 05:08:36 +00:00
Tarek Ziadé
c48befbb9c Bug 1542674 - Make Media debug info machine parsable r=padenot,smaug,jya
This patch structurizes the media debug information via webidl dictionaries
that are returned by HTMLMediaElement::GetMozRequestDebugInfo() and
MediaSource::GetMozDebugReaderData().

Differential Revision: https://phabricator.services.mozilla.com/D27893

--HG--
extra : moz-landing-system : lando
2019-05-27 16:15:33 +00:00
alwu
4fea1ece94 Bug 1532495 - part1 : only skip the 'completed' state during seamless looping mode. r=jya
The normal looping process is that, goes to `completed` state first, notify playback ended, and finally media element would call seek to the start position in order to start looping again.

However, if we're in the seamless looping mode, we can stay in `loopingDecoding` state and repeating the looping without going to other states. Otherwise, we should go to `completed` state if decoding has ended.

Differential Revision: https://phabricator.services.mozilla.com/D30307

--HG--
extra : moz-landing-system : lando
2019-05-09 17:47:52 +00:00
Chris Pearce
7402ebd65e Bug 1538023 - Change MDSM::HasLowBufferedData() to consider data buffered after end of decoded data rather than start. r=jya
When under pressure, the MediaCache evicts data before the last read on a
stream.  We typically have two demuxers reading from different offsets in a
stream. So if the MediaCache is under pressure, it may end up evicting data
between the two demuxers.

The MediaDecoderStateMachine currently goes into buffering state if there's
insufficient data available beginning at the start of its queue of decoded
samples. However since the MediaCache evicts data behind the streams read
cursor, the data after the beginning of the sample queue may have already been
evicted by the media cache. This will cause the MediaDecoderStateMachine to
enter a buffering state, and if its sample queues are full, there will be no
demuxers reading to cause the MediaCache to download the data between the two
demuxers, and we'll get stuck in buffering state indefinitely.

So change the MediaDecoderStateMachine to instead check whether there's
insufficient data available at the end of the decoded sample queues. This means
we won't get stuck in buffering state. Note the MediaCache may still evict data
which the other demuxer needed, causing us to re-request it, but at least we
won't get stuck in buffering state.

Differential Revision: https://phabricator.services.mozilla.com/D30310

--HG--
extra : moz-landing-system : lando
2019-05-08 04:35:32 +00:00
shindli
9134ad98fa Backed out changeset c386ebfd9c6b (bug 1542674) as per tarek's request on IRC 2019-05-07 15:07:27 +03:00
Tarek Ziadé
446d5cdff7 Bug 1542674 - Make Media debug info machine parsable r=padenot,smaug
This patch structurizes the media debug information via webidl dictionaries
that are returned by HTMLMediaElement::GetMozRequestDebugInfo() and
MediaSource::GetMozDebugReaderData().

Differential Revision: https://phabricator.services.mozilla.com/D27893

--HG--
extra : moz-landing-system : lando
2019-05-06 16:39:58 +00:00
Alastor Wu
1df4ea356e Bug 1546324 - use TimeUnit version modular. r=bryce
The value of `mAudioDecodedDuration` can be larger than `int32`, so we should use the modular function which accepts `TimeUnit`as a input.

Differential Revision: https://phabricator.services.mozilla.com/D28536

--HG--
extra : moz-landing-system : lando
2019-04-24 17:21:01 +00:00
Andreas Pehrson
1e4382f9fb Bug 1544650 - Always pre-create MediaStreamTracks for DecodedStream in MediaDecoder. r=padenot
This moves the responsibility for creating MediaStreamTracks from
DecodedStream::Start to MediaDecoder. This let's MediaDecoder create them as
soon as metadata is known. This gives the application guarantees on when tracks
can be expected to exist, and aligns with the spec that says they should be
created when metadata is known.

Differential Revision: https://phabricator.services.mozilla.com/D28473

--HG--
extra : moz-landing-system : lando
2019-04-23 16:46:30 +00:00
Sylvestre Ledru
03c8e8c2dd Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-05 21:41:42 +00:00
Csoregi Natalia
ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru
d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu
24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru
399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Mike Conley
38db7d8e61 Bug 1521964 - Allow VideoSink to have a secondary VideoFrameContainer assigned to it. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D20022

--HG--
extra : moz-landing-system : lando
2019-03-01 22:36:33 +00:00
Jean-Yves Avenard
500e9b73ae Bug 1530322 - P2. Remove redundant code, and simplify. r!gerald r=gerald
The assertions were unneeded as the test above covered the case.

Differential Revision: https://phabricator.services.mozilla.com/D21172

--HG--
extra : moz-landing-system : lando
2019-02-26 09:09:54 +00:00
Narcis Beleuzu
06e372323d Backed out 3 changesets (bug 1530322) for bustages on Assertions.h . CLOSED TREE
Backed out changeset 65870fec6eea (bug 1530322)
Backed out changeset d5159dfc6d86 (bug 1530322)
Backed out changeset 68fd0947b767 (bug 1530322)
2019-02-26 09:39:14 +02:00
Jean-Yves Avenard
842cb08843 Bug 1530322 - P2. Remove redundant code, and simplify. r!gerald r=gerald
The assertions were unneeded as the test above covered the case.

Depends on D21171

Differential Revision: https://phabricator.services.mozilla.com/D21172

--HG--
extra : moz-landing-system : lando
2019-02-26 06:45:32 +00:00
Jean-Yves Avenard
ca21a59533 Bug 1524890 - P10. Add AudioData::SetTrimWindow. r=bryce
Don't re-create a new trimmed AudioData when we want to remove some content. This remove the need for some copies.

Differential Revision: https://phabricator.services.mozilla.com/D20168

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:32 +00:00
Jean-Yves Avenard
7f3801ebd7 Bug 1524890 - P8. Rely on buffer length to calculate the number of frames. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D20166

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:00 +00:00
Jean-Yves Avenard
3cf8c6d0df Bug 1524890 - P7. No longer access AudioData::mFrames directly. r=bryce
This will allow to remove mFrames member and calculate from the size of the content, which will dynamically change depending on a cropping filter.

Differential Revision: https://phabricator.services.mozilla.com/D20165

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:47 +00:00
Jean-Yves Avenard
964cc95e13 Bug 1524890 - P5. Make MediaData::Type an enum class. r=bryce
Make its use more explicit and less likely to be incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D20163

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:18 +00:00
Jean-Yves Avenard
afe04d2952 Bug 1524890 - P3. Add AudioData::Data method that returns a Span. r=bryce
So that we never access the underlying buffer directly.

Differential Revision: https://phabricator.services.mozilla.com/D20161

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:04 +00:00
alwu
8d172019f3 Bug 1519317 - handle non decoding errors when we seek back to the start position. r=jya
'NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA' and 'NS_ERROR_DOM_MEDIA_CANCELED' are not decoding errors, so we should
 treat them differently like what we did for 'NS_ERROR_DOM_MEDIA_END_OF_STREAM'.

Differential Revision: https://phabricator.services.mozilla.com/D16722

--HG--
extra : moz-landing-system : lando
2019-01-22 23:18:54 +00:00
alwu
c0ee00e2c3 Bug 1505250 - change state to 'completedState' if we can't get any sample anymore. r=jya
If we can't get any sample anymore, the resource might have been closed, so we should change state to 'completedState'.

Differential Revision: https://phabricator.services.mozilla.com/D15029

--HG--
extra : moz-landing-system : lando
2018-12-21 21:06:42 +00:00
alwu
dd8abd37d5 Bug 1512506 - Prevent MDSM from dispatching lots of audio decoding tasks when seeking directly to EOS during looping. r=jya
To make sure media sink starts from the correct position, otherwise, we would incorrectly estimate the decoded audio
duration when we directly seek looping audio to EOS. That would results in MDSM continually dispatching decoding tasks
even if we've enough data.

Differential Revision: https://phabricator.services.mozilla.com/D13949

--HG--
extra : moz-landing-system : lando
2018-12-12 01:52:06 +00:00
Jean-Yves Avenard
cf0ff88211 Bug 1512456 - P1. Don't use GenericPromise with MediaSink. r=alwu
The VideoSink shares the AudioSink's own EndedPromise to notify its user that it has ended. As such, the MozPromise used must be non-exclusive.
Using the GenericPromise for such purpose only hid that requirement.

We also remove the MediaSink from the media namespace, and clarify the naming of some arguments and class members to accurately describe what they do.

Differential Revision: https://phabricator.services.mozilla.com/D14024

--HG--
extra : moz-landing-system : lando
2018-12-11 10:44:51 +00:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
alwu
682f483866 Bug 1509956 - Remove incorrect rebasing result in MSDM::loopingDecoding r=jya
Differential Revision: https://phabricator.services.mozilla.com/D12965

--HG--
extra : moz-landing-system : lando
2018-11-27 16:00:22 +00:00
Andreas Pehrson
58233bef5c Bug 1423241 - Add logging for a captured MediaDecoder. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D12286

--HG--
extra : moz-landing-system : lando
2018-11-23 15:03:21 +00:00
Andreas Pehrson
4213b7db86 Bug 1423241 - Refactor DecodedStream. r=jya
This removes DecodedStream's use of MediaStreamListener in favor of
MediaStreamTrackListener. This change has however rippled through to a lot
more cleanup, per below.

This moves the MediaStreamTrack lifetime ownership for captured
HTMLMediaElements from the media element to DecodedStream, where the
MediaStreamGraph-side tracks are already created and ended today.

This makes MediaStreamTrack creation explicit across the entire codebase and
lets us remove the MediaStreamTrackSourceGetter class and the infrastructure
of adding MediaStreamTracks after they've already been created in the graph
from DOMMediaStream.

With track ownership, and thus TrackID allocation ownership, happening
exclusively in DecodedStream for its output tracks, we also stop throwing
away and recreating the SourceMediaStream to which we feed data on seek.
This is one step closer to fixing bug 1172394 and spec compliance of
HTMLMediaElement.captureStream().

Differential Revision: https://phabricator.services.mozilla.com/D12273

--HG--
extra : moz-landing-system : lando
2018-11-23 15:02:03 +00:00
alwu
42c302ff20 Bug 1499903 - part1 : correct the events order when we're in the seamless looping. r=chunmin
When the media which has `loop` attribute is playing to the end, the spec mentions that media should do seek to the start position [1].

During seeking, the dispatched events order [2] for MediaElement should be
1. seeking
2. timeupdate
3. seeked

[1] https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:attr-media-loop-2
[2] https://html.spec.whatwg.org/multipage/media.html#seeking:dom-media-seek

Differential Revision: https://phabricator.services.mozilla.com/D9324

--HG--
extra : moz-landing-system : lando
2018-11-23 05:23:48 +00:00
alwu
cf4634f07a Bug 1505972 - request audio data when entering 'loopingDecoding' state if decoding has ended r=jya
When entering 'loopingDecoding' state, we should ensure we would continue to decoding even if
the audio decoding has finished before.

Differential Revision: https://phabricator.services.mozilla.com/D12589

--HG--
extra : moz-landing-system : lando
2018-11-22 13:27:21 +00:00
alwu
ce1f4614d0 Bug 1508484 - close audio queue if we already got the last audio frame when leaving 'loopingDecoding' state r=jya
When we're going to leave looping state and have got EOS before, we should mark audio queue
as ended because we have got all data we need.

Differential Revision: https://phabricator.services.mozilla.com/D12373

--HG--
extra : moz-landing-system : lando
2018-11-20 22:42:24 +00:00
Sylvestre Ledru
804b8b8883 Bug 1204606 - Reformat of dom/media r=jya
# skip-blame

Differential Revision: https://phabricator.services.mozilla.com/D12251

--HG--
extra : moz-landing-system : lando
2018-11-19 13:25:37 +00:00
alwu
495a70cf3a Bug 1506286 - part2 : finish queue after discarding data. r=jya
After discarding looping data, all data playback needed are in the queue. There is no need to
request more data, so we can finish the queue and disconnect the request.

Differential Revision: https://phabricator.services.mozilla.com/D11535

--HG--
extra : moz-landing-system : lando
2018-11-15 12:57:35 +00:00
alwu
31f9ef35fe Bug 1506286 - part1 : use clock time to decide whether need to discard data. r=jya
Should use both adjusted time to do time comparison.

Differential Revision: https://phabricator.services.mozilla.com/D11534

--HG--
extra : moz-landing-system : lando
2018-11-15 21:53:50 +00:00
Dorel Luca
0a1112ab71 Backed out 3 changesets (bug 1499903) for frequently asserting at dom/media/MediaDecoderStateMachine.cpp
Backed out changeset 634b4c2dad35 (bug 1499903)
Backed out changeset 1a77eb131a2b (bug 1499903)
Backed out changeset ed4236eceb1a (bug 1499903)
2018-11-07 05:40:07 +02:00
alwu
0c4634255b Bug 1499903 - part1 : correct the events order when we're in the seamless looping. r=chunmin
When the media which has `loop` attribute is playing to the end, the spec mentions that media should do seek to the start position [1].

During seeking, the dispatched events order [2] for MediaElement should be
1. seeking
2. timeupdate
3. seeked

[1] https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:attr-media-loop-2
[2] https://html.spec.whatwg.org/multipage/media.html#seeking:dom-media-seek

Differential Revision: https://phabricator.services.mozilla.com/D9324

--HG--
extra : moz-landing-system : lando
2018-11-06 16:55:38 +00:00
alwu
7ac4e5d426 Bug 1498440 - part6 : only enable 'loopingDecodingState' for audio seamless looping r=jya
We don't have any implementation for video seamless looping yet, so we only use 'loopingDecodingState' for
audio for now.

Differential Revision: https://phabricator.services.mozilla.com/D9319

--HG--
extra : moz-landing-system : lando
2018-11-05 22:06:01 +00:00
alwu
fa0d371ff0 Bug 1498440 - part5 : rename PopEvent() to PopFrontEvent(). r=jya
We only have a interest in the data which is popped out from the front side of the queue.

Differential Revision: https://phabricator.services.mozilla.com/D9190

--HG--
extra : moz-landing-system : lando
2018-11-05 22:05:58 +00:00
alwu
055cfe1842 Bug 1498440 - part4 : discard redudant looping data when cancel looping. r=jya
When we cancel seamless looping, we should discard audio data whose time are later than the last
audio frame's time in the audio track.

Differential Revision: https://phabricator.services.mozilla.com/D9189

--HG--
extra : moz-landing-system : lando
2018-11-05 22:04:45 +00:00
alwu
62bedf505c Bug 1498440 - part3 : remove time-adjustment related codes in ReaderProxy. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D9188

--HG--
extra : moz-landing-system : lando
2018-11-05 22:04:12 +00:00
alwu
75004e489e Bug 1498440 - part2 : implement state transition. r=jya
If looping is on, decoding state will be 'loopingDecoding' state.

Differential Revision: https://phabricator.services.mozilla.com/D9187

--HG--
extra : moz-landing-system : lando
2018-11-05 22:02:58 +00:00
alwu
9cce4dc5eb Bug 1498440 - part1 : implement MDSM's 'LoopingDecodingState'. r=jya
This state is used to handle decoding when the media is in seamless looping. The advantage to create a new state is that we can totally separate looping and non-looping codes and then they won't affect each other anymore.

The new state will be responsible for
(1) time adjustment
(2) handle EOS and seek to the first sample

Differential Revision: https://phabricator.services.mozilla.com/D9186

--HG--
extra : moz-landing-system : lando
2018-11-05 22:02:20 +00:00
Bogdan Tara
4119f6ad2e Backed out 3 changesets (bug 1499903) for causing bug 1502637 CLOSED TREE
Backed out changeset 3c7165875616 (bug 1499903)
Backed out changeset 106752b77131 (bug 1499903)
Backed out changeset 3f6d3c425b42 (bug 1499903)
2018-10-29 23:32:50 +02:00