Commit Graph

13270 Commits

Author SHA1 Message Date
Nathan Froyd
a31fa9e19c Bug 1453437 - return UniquePtr from MediaRawData::CreateWriter; r=gerald
Returning UniquePtr is nicer than returning raw pointers, and has the
nice side effect of forcing us to clean up the uses of nsAutoPtr that
were hanging about.
2018-04-12 15:28:21 -04:00
Sebastian Hengst
0eb9d87997 merge mozilla-inbound to mozilla-central. a=merge 2018-04-12 22:20:13 +03:00
Tom Ritter
8a27d79dfd Bug 1446346 Remove skips for webaudio tests that should now be fixed r=padenot
MozReview-Commit-ID: GfkOOv8VLkA

--HG--
extra : rebase_source : 8d7f66b8744bffc28c71f8c4de546840827af7d6
2018-04-11 21:50:04 -05:00
Tom Ritter
1e46fe37dc Bug 1446346 If an AudioContext hasn't been started, do not bother clamping/jittering the CurrentTime r=padenot
This will resolve several intermittments that were occuring because we would
occasionally get unlucky and have a jitter midpoint of 0, making an unstarted
AudioContext report a CurrentTime of 100us (or 1ms - whatever our clamp value
was.)

MozReview-Commit-ID: 45zXLbB93wP

--HG--
extra : rebase_source : 23ea5964dc49543c2b4ca45890c4c08456e75c73
2018-04-11 11:34:57 -05:00
Margareta Eliza Balazs
7bd6a55b97 Backed out changeset 2198e282bdcf (bug 1451681) for bustage in /builds/worker/workspace/build/src/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp on a CLOSED TREE 2018-04-12 16:30:43 +03:00
Jean-Yves Avenard
4446aa0310 Bug 1451681 - Handle case where crypto plain size definition didn't exist. r=cpearce
Also ensure that the MP4 demuxer can't create such sample.

MozReview-Commit-ID: JANgHNiiz2H

--HG--
extra : rebase_source : 652d311cb69e6c3ed3b1ba91719e79acb0a4bb9c
2018-04-09 11:39:13 +02:00
Jan-Ivar Bruaroey
6a472b4cb4 Bug 1452031 - Close fingerprint concern by removing code no longer needed to handle NotFoundError spec case. r=pehrsons
MozReview-Commit-ID: KVQjO18PL0I

--HG--
extra : rebase_source : 3e8f94c486bad728c5c54b8ea3f148f452ea2b07
2018-04-10 01:49:15 -04:00
Jan-Ivar Bruaroey
4665da444b Bug 1452031 - InternalError is not a valid gUM error per spec. Use AbortError instead. r=pehrsons
MozReview-Commit-ID: 3pMRl1XgkfS

--HG--
extra : rebase_source : 6e3ce9812657b09f0a38b5e807cc7b01b0a6789e
2018-04-06 15:06:16 -04:00
Jan-Ivar Bruaroey
b5b5ad5862 Bug 1452031 - Use strong types for Media error names, fixing OverconstrainedError typo. r=pehrsons
MozReview-Commit-ID: AqGoW9rBdl5

--HG--
extra : rebase_source : fc7a638a2502aaebf318a35c6135755558a7396b
2018-04-10 01:22:53 -04:00
Margareta Eliza Balazs
1dff32311e Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-04-12 12:46:52 +03:00
Andreas Pehrson
c376bbc538 Bug 1450954 - Add back code to undo screenshare constraints hack. r=jib
MozReview-Commit-ID: 9rDRj7U8vQi

--HG--
extra : source : e2bd588aa90fe44fe38caed6bc7680111394b934
extra : histedit_source : 148034b0adc84941ae9c39716bb3da6d8258e3a4
2018-04-10 13:13:41 +02:00
shindli
108a654fb8 Merge inbound to mozilla-central. a=merge 2018-04-12 02:45:34 +03:00
Boris Zbarsky
2542e6eb8a Bug 1452741. Stop using the no-arg DOMEventTargetHelper constructor in MediaTrack. r=bkelly
MozReview-Commit-ID: AbE3XJdj4KO
2018-04-11 10:27:00 -04:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Bryce Van Dyk
f16be73b01 Bug 1447273 - Add test to check that different GainNode configuraitons produce correct output. r=padenot
MozReview-Commit-ID: 6iaCqotLmug

--HG--
extra : rebase_source : abdc6daf57979cb117e4a0e41078594c68d6d58e
2018-04-05 14:58:08 -04:00
Dan Minor
82684c47c4 Bug 1453030 - Add crashtest; r=bwc
MozReview-Commit-ID: 2p3VwoOTICx

--HG--
extra : rebase_source : fd5cbfc8eb607c274875df60f484a66e126db081
2018-04-10 13:36:43 -04:00
Dan Minor
30d5029270 Bug 1453030 - Only create RTCDTMFSender on audio RTCRtpSender senders; r=bwc
MozReview-Commit-ID: KsnUYCs8IYU

--HG--
extra : rebase_source : 2bee2f713ef65ef5baaa6cd37a3f9521beaa9a73
2018-04-10 13:19:42 -04:00
Andreea Pavel
525c9e7907 Merge mozilla-central to autoland. a=merge on a CLOSED TREE 2018-04-11 17:38:56 +03:00
Nika Layzell
0c3ba13e4c Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj 2018-04-10 17:49:47 -04:00
Andreas Pehrson
351446a16c Bug 1447273 - Consider all AudioChunk members in AudioChunk::CanCombineWithFollowing. r=padenot
MozReview-Commit-ID: 1Fz1GNxRF3P

--HG--
extra : rebase_source : 377a96799f159431f2ab9d34d200ba9110fb2fca
2018-03-26 18:33:42 +02:00
Andreas Pehrson
9b7bfe9819 Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r=padenot
MozReview-Commit-ID: 9pk5xKrYoa6

--HG--
extra : rebase_source : 06dfaeab1e6d579aabd1a8ec02e8dd708396e821
2018-03-26 18:33:09 +02:00
Byron Campen [:bwc]
c67de40370 Bug 1449272 - Part 2: When using both offerToReceiveAudio and offerToReceiveVideo, create the audio transceiver first. r=jib
MozReview-Commit-ID: ClgChq6FLQ7

--HG--
extra : rebase_source : e2c2e9f2abd609522d618b6828c4447f4a515dd0
2018-03-27 13:36:02 -05:00
Byron Campen [:bwc]
aa7de1ce53 Bug 1449272 - Part 1: Update test-case to expect the audio transceiver first when using both offerToReceiveAudio and offerToReceiveVideo. r=jib
MozReview-Commit-ID: FXvNRVIMdQN

--HG--
extra : rebase_source : 88c16c0d32bc8d0008ac92a138930d5ac8d836bc
2018-03-27 13:35:16 -05:00
Andreea Pavel
f4081d2372 Backed out changeset e2949379e13e (bug 1451759) for linux debug failures at dom/media/tests/mochitest/test_peerConnection_addAudioTrackToExistingVideoStream.html on a CLOSED TREE
Enter commit message.  Lines beginning with 'HG:' are removed.
2018-04-11 12:38:00 +03:00
Alex Chronopoulos
0286edbecd Bug 1451759 - Default fake device on media mochitests for Linux debug builds to avoid errors of loopback device. r=jib
MozReview-Commit-ID: GB2n54P4zP5

--HG--
extra : rebase_source : 34fce9df5e207cbdb08cef02cbf494ff7f07b2a5
2018-04-10 17:15:58 +03:00
Chris Pearce
79ee61bdff Bug 1435133 - Test that we delay media play start until we know whether a media has audio or not. r=bryce
Test that play() on a media without audio called before
readyState >= HAVE_METADATA will still play.

MozReview-Commit-ID: 1FeDrEfCEum

--HG--
extra : rebase_source : be6d07905aad853ad028eac372e4e380bdeb1a49
extra : source : e98b4a7aaf020fa3d6d59cb0f53680ef6466d154
2018-04-06 17:13:39 +12:00
Chris Pearce
2be26b6b7c Bug 1443942 - Move code to toggle high res timers into VideoSink. r=jya
We have code in the MDSM to toggle on high resolution timers on Windows when we
start/stop playing because the VideoSink relies on being awoken by timers to
update the set of current frames in the compositor's queue, and on Windows 7 we
end up dropping frames due to the timer lag without this.

We assert in the MDSM's destructor that we've turned off high res timers (as
they cause needless battery drain, so we only want them on when we need them),
and the new test_mediarecorder_principals is hitting that assert on Windows. I
think we're missing turning them off when we create a new VideoSink for
outputting to the MSG. That affects the value returned by
MediaDecoderStateMachine->mVideoSink->IsPlaying(), which is what we use to
decide whether we should enable high resolution timers. We track whether we've
enabled high res timers in MDSM::mHiResTimersRequested, and that gets out of
sync with IsPlaying() when we re-create the MediaSink.

Rather than trying to handle all the permutations of places where we need to
turn off high resolution timers in the MDSM, we're better to move the code to
toggle high res timers into the VideoSink, as that's actually where we need to
be sure that we have high resolution timers enabled anyway. It's the VideoSink
after all that is relying on timers for frame update, not the MDSM.

Also remove the media.hi-res-timers.enabled pref, as we haven't needed it.

MozReview-Commit-ID: 9dNxcYxPDZH

--HG--
extra : rebase_source : 6e403d59bb5f1dd0241fe8298a823ba08b1670fb
2018-04-06 13:33:28 +12:00
Chris Pearce
dd45189315 Bug 1443942 - Rewrite test_mediarecorder_principals. r=bryce
I changed this test earlier in this set of commits to use
midflight-redirect.sjs so that we get more reliable and predictable cross
origin redirects during the download. Unfortunately this test now times out on
Windows.

This test times out on Windows because midflight-redirect.sjs redirects at 1/4
through the resource, whereas this test expects to be able to play through to
1/5 through the resource, and on Windows that seems to be not reached during
playback. This is likely due to decode latency being higher on Windows.

On top of that, the test's first case can sometimes call MediaRecorder.start()
before the redirect has happened, and before the principal has changed, and so
start() doesn't throw a SecurityError as expected, and the test intermittently
fails.

Additionally, the test's code could be clearer if we used async/await.

So rewrite the test to use async/await, and take advantage of
midflight-redirect.sjs's redirect being more predictable than the old
dynamic_redirect.sjs. Basically, we can be careful to wait for either
"loadedmetadata" or "error" on the media element in order to be more confident
the redirect has or hasn't happened yet.

We still can't be 100% sure that the redirect won't have already happened by
the time our "loadedmetadata" handlers run. It's quite possible that the
download has reached 1/4 through the resource by the time the loadedmetadata
handler has run, so we need to handle the "error" and "loadedmetadata" events
racing.

MozReview-Commit-ID: 8plMjkXgjYt

--HG--
extra : rebase_source : 7305598f40c09219494f3e7150799d8875b7c30e
2018-04-05 13:35:14 +12:00
Chris Pearce
a19e516c04 Bug 1443942 - Ensure MediaCacheStreams are initialized with the length of the resource, not the length of the byte range response. r=jya
I'm seeing intermittent failures of test_midflight_redirect_blocked. In this
test, our custom server responds to Firefox's 0- HTTP Byte Range request with a
[0,200] response. When Firefox requests 200-, the server responds with a cross
origin redirect, and then the remainder of the resource.

However sometimes while running test_midflight_redirect_blocked the MP4 demuxer
reads through all 200 bytes while trying to parse metadata before the redirect
has occurred and fed more data into the cache, and so the demuxer thinks it's
hit end of stream, and reports a failure. The demuxer thinks it's hit end of
stream, because we initialize the MediaCacheStream length in
ChannelMediaResource::Open() with the value of the Content-Length HTTP header.
But in an HTTP byte range response, the Content-Length header tells you the
length of the range returned, not the length of the entire resource. The length
of the resource is in the Content-Range header, we need to use that if
available.

So to fix this intermittent test failure, we need to also parse the
Content-Range header in ChannelMediaResource::Open(), and use the length from
that if available.

MozReview-Commit-ID: 29pPRsUvxag

--HG--
extra : rebase_source : ba1ef03d65ebd22698a29d8385f36b4c747ccf43
2018-04-04 12:36:00 +12:00
Chris Pearce
fbd7f61c3c Bug 1443942 - Fix dom/media/test/midflight-redirect.sjs. r=jya
Problems here:
* The variable `to` is undefined for byte range requests to the end of
the resource, making the math fail. Firefox normally makes ranges requests like
this.
* The bytes.length/4 calculation may not be a whole number, so can
result in a byte range header part of the way between two bytes. We need to
round the length off.
* Instead of re-calculating the contentLength, we can just use the length of
the actual byterange substring being returned. That's clearer.
* test_midflight_redirect_blocked needs the redirect to happen
before metadata has completed loading, but other tests require the redirect to
happen *after* metadata is loaded. So add a redirectAt query parameter for the
requester to control when to redirect.

MozReview-Commit-ID: I6n1NqK0Uze

--HG--
extra : rebase_source : a6bd68fe75cfd4c46f63ca815c5a4e9390bd671a
2018-04-04 14:30:15 +12:00
Chris Pearce
9f21b62342 Bug 1443942 - Switch over to midflight redirect for all redirect media tests. r=jya
We have two SJS files; midflight-redirect.sjs and dynamic_redirect.sjs,
which are very similar, but dynamic_redirect.sjs is buggy, so we should
just use midflight-redirect.sjs.

dynamic_redirect.sjs is buggy because it relies on the client doing multiple
HTTP requests to it in order to redirect, but we can't actually guarantee
this. Previously users of it would try things like setting a small MediaCache
size, or only using Ogg for which we expect a seek to the end to calculate
the duration, but I have observed the entire resource being downloaded in
one hit before the media element has finished loading metadata, meaning the
seek (in the Ogg case) can happen without another HTTP request. This is even
with a small MediaCache.

midfligh-redirect.sjs solves this problem by explicitly only returning a
partial response, so the client is forced to make another HTTP request,
which we will serve a redirect to.

MozReview-Commit-ID: 39imyayhnBG

--HG--
extra : rebase_source : 603532e4af0bf304c34739de5b0b243174e3831d
2018-03-29 18:16:33 +13:00
Chris Pearce
6a06dbd8b8 Bug 1443942 - Rewrite test_mixed_principals. r=jya
The original test is failing, as it assumed we'd not error when
origins were mixed without CORS, and the original test was using
outdated practises, so rewrite it.

MozReview-Commit-ID: KlOH83GUOk

--HG--
extra : rebase_source : 2c79691fddc93af0e04d8f23fa31ac8588a8d6e1
extra : amend_source : 2989317530f536915f011977c8f34e048410b018
2018-03-28 16:56:37 +13:00
Chris Pearce
5913d0470e Bug 1443942 - Make redirect SJS' serve with headers to prevent Necko caching. r=jya
Try to prevent Necko from caching the results of our SJS media responses, as
some of the test that use it rely on the server being hit and serving a
redirect. Sometimes the tests which rely on hitting a redirect in an SJS
where timing out without this, as Necko would cache the response and not
hit the server, and so not hit the redirect.

Also include a noise parameter to increase the likelihood that the URL is
unique, to further reduce the chance that Necko caches the result.

MozReview-Commit-ID: 3cLEiDoh4HG

--HG--
extra : rebase_source : 24c152d46540866f14211fae30f1e59c5d23b6d4
2018-03-28 16:55:46 +13:00
Chris Pearce
99ff9f62be Bug 1443943 - Ensure redirect SJS' serve the correct content types. r=jya
dynamic_redirect.sjs and midflight-redirect.sjs are serving files
with "Content-Type: video/ogg", which is incorrect and could lead
to problems given that we're not always asking it to serve Ogg
files. So include the type be to served as a query parameter.

MozReview-Commit-ID: 5f0PXy8lL3G

--HG--
extra : rebase_source : 757395a21317655422767efe3f7c1923a19c0114
2018-03-28 16:51:04 +13:00
Chris Pearce
e8c1b1b7f1 Bug 1443942 - Test for blocking midflight redirects in media elements. r=jya
Test that playback works if we don't block, doesn't if we do block, and does
if we do block and CORS is used.

MozReview-Commit-ID: 9PTZXLOdHIU

--HG--
extra : rebase_source : db7f0c61b64990623ef035b266cf052c45df1c76
2018-03-06 14:44:26 +13:00
Chris Pearce
259a33e836 Bug 1443942 - Block mid-flight redirects to cross origin destinations during media loads. r=jya
There's no compelling use case for mid-flight redirects, and Chrome
already blocks it, so there's little point in maintaining it.

Add a hidden pref to toggle blocking, so we can toggle it off during
testing to ensure that we're blocking a working mid-flight redirect.

MozReview-Commit-ID: EnGNmYFr8Uv

--HG--
extra : rebase_source : a2f4b7c68b73ecc4c7525d4e41e834f4caf85707
2018-03-06 09:55:03 +13:00
Noemi Erli
11310197b3 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-04-09 19:54:32 +03:00
Noemi Erli
b55e1a1cbc Merge inbound to mozilla-central. a=merge 2018-04-09 19:46:07 +03:00
Coroiu Cristina
fa24350f83 Backed out 2 changesets (bug 1306529) for build bustage on a CLOSED TREE
Backed out changeset 87206102c699 (bug 1306529)
Backed out changeset 7e70a7f597c4 (bug 1306529)
2018-04-09 15:59:58 +03:00
Kartikaya Gupta
5cbb6be895 Bug 1426199 - Re-enable more crashtests that are now passing. r=sotaro 2018-04-09 08:02:12 -04:00
Andreas Pehrson
2027a140e6 Bug 1452472 - Guard against stopped source and removed listener after timer fired. r=jib
MozReview-Commit-ID: 72M3xpbOgXP

--HG--
extra : rebase_source : c4ddcce0eac7b7539a61f389010f09383e15ee1f
2018-04-09 13:53:32 +02:00
Takuro Ashie
297ca3383c Bug 1306529 - OmxDataDecoder: Fix a stall issue on shutting down r=jya
Because the shutdown closure awaits finishing itself by
TaskQueue::AwaitShutdownAndIdle(), the function blocks infinitely.

The code is wrongly introduced at the following commit:

  * https://bugzilla.mozilla.org/show_bug.cgi?id=1319987
    * https://hg.mozilla.org/mozilla-central/rev/b2171e3e8b69

This patch calls it on mTaskQueue intead of mOmxTaskQueue to
avoid the issue.

MozReview-Commit-ID: 4qmX2QlniEG

--HG--
extra : rebase_source : f0784c0c5b2e39d2078a5aff72be03b52e413139
extra : intermediate-source : 635153e1dcdc442f8d72727b6fe504842b4ffa31
extra : source : bf011140459cc227c9435e3960770bafb3cecb8e
2018-03-27 16:37:21 +09:00
Takuro Ashie
6e0c9d24c2 Bug 1306529 - Add initial implementation of PureOmxPlatformLayer r=jya
It's a concrete class of OmxPlatformLayer for accessing OpenMAX IL
libraries directly. It will be usable on various embedded linux systems.
Note that it's not enabled by default yet. Add the following config to
your mozconfig.

  ac_add_options --enable-openmax

TODO: Implement zero-copy mode

MozReview-Commit-ID: EMEXAKzzR64

--HG--
extra : rebase_source : d7c5b9baf66d87db38723b278c57fd581a3cbf98
extra : intermediate-source : b8c671a02a4fce085433b16db998c9b04ace87db
extra : source : 131b65580e3dd5c9dcb0ba6a05c16ab90c2dcc68
2018-03-28 18:21:04 +09:00
Alex Chronopoulos
16d2b965f6 Bug 1451781 - Check if output device is mono and remove stereo check in order to disable opus channel inversion. r=jya
MozReview-Commit-ID: 3x27rBs5Ika

--HG--
extra : rebase_source : 0b7232a0705edceda8793444c140aa947cc99d51
2018-04-09 13:07:58 +03:00
Andreas Pehrson
1e2190d040 Bug 1451798 - Check the variable actually containing the string. r=jib
MozReview-Commit-ID: 2xizfHwVPiW

--HG--
extra : rebase_source : 345327a6721e84b64ba3b66cb308dbe1100391bb
2018-04-06 15:06:46 +02:00
Noemi Erli
3c6217a11e Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-04-07 01:03:50 +03:00
Noemi Erli
2108ebfea1 Bug 1446456 - disable test_audioParamSetCurveAtTimeTwice.html for frequent failures on Linux and Windows. r=jmaher
--HG--
extra : rebase_source : 36dfabc5d23aca549f544c25d4f2ef90329dea7d
2018-04-06 13:18:00 +03:00
Nils Ohlmeier [:drno]
c9b218795e Bug 1451926: add a user pref for AV1 codec. r=cpearce
MozReview-Commit-ID: 9R6Ac4O81Ji

--HG--
extra : rebase_source : bd2f46b5596c0ebafc4f60bb8bf1812a8bf776f5
2018-04-05 20:35:57 -07:00
Eliza Balazs
930bf58210 Bug 1446346 - Disable test_audioParamLinearRamp.html on linux and windows for frequent failures. r=jmaher 2018-04-04 06:01:00 +03:00
Andreea Pavel
7a4b9a3f56 Merge mozilla-inbound to mozilla-central. a=merge
--HG--
extra : rebase_source : 66bd87105d99036ada5008499ff0eaea579b531a
2018-04-06 13:20:21 +03:00