Commit Graph

916 Commits

Author SHA1 Message Date
Jean-Yves Avenard
71e0f46c33 Bug 1325707: P4. Fix coding style of MediaDataDemuxers. r=gerald
MozReview-Commit-ID: AV2lXwVZqLV

--HG--
extra : rebase_source : f66559f4d104516c8dfd2c9a146dfba8672dce33
2017-02-07 09:23:34 +01:00
Jean-Yves Avenard
b7844bd5c3 Bug 1319987: P9. More coding style fixes. r=gerald
MozReview-Commit-ID: DhFRqkWQZny

--HG--
extra : rebase_source : 03ed44efc83fe9cab7fc975229ac4e5746aff96b
2017-01-27 13:20:37 +01:00
Florian Quèze
bdc1ffa608 Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws. 2017-01-30 08:10:22 +01:00
Florian Quèze
f187782ccf Bug 1334250 - script-generated patch to avoid removeEventListener calls when a variable is used for the event name, r=jaws. 2017-01-27 10:48:00 +01:00
Florian Quèze
0e0865f4fc Bug 1331599 - script-generated patch to replace removeEventListener calls with the once option when possible, r=jaws. 2017-01-25 07:01:52 +01:00
Bevis Tseng
f2bdbd8fd1 Bug 1314833 - Part 2.1: Factor out AbstractThread::MainThread() used in Media Playback. r=billm,jwwang
MozReview-Commit-ID: 9yJi3iDtVZG

--HG--
extra : rebase_source : 39c720ccc576ed9247b5e8abb70d99d7873b3ad6
2016-11-29 13:03:36 +08:00
JW Wang
992114f5fd Bug 1332160 - use nsCString internally whenever possible. r=gerald
MozReview-Commit-ID: 1DUaJWfbL88

--HG--
extra : rebase_source : f4a02736b0385e4be6258a185822f7855d0b0189
extra : intermediate-source : 1faaf4254a2e1ce2c096a8650b66d07c84c7fdbe
extra : source : c23fc2cea382627af8ff20ae3edea926eaa6d51a
2017-01-18 16:51:31 +08:00
Gerald Squelart
f17dd305d6 Bug 1331289 - Use MediaContainerType in MediaResource, SourceBuffer, TrackBuffersManager, and dependencies - r=jya
Continuing the work of replacing MIME strings with MediaContainerType, starting
from MediaResource and following the dependencies.

Most changes are mechanical: Just change ns*String into MediaContainerType, and
MIME string literals into MEDIAMIMETYPE("a/b").
Some checks for empty/invalid strings and lowercase comparisons can go, thanks
to the always-valid always-lowercase-MIME invariants of MediaContainerType.

One special case in is MediaSourceResource, which used to have an empty string
as its type (because its own type is not relevant, but its SourceBuffers carry
types). Because the inherited GetContentType *must* be overridden, and must
return a MediaContainerType, we needed a valid type even though it should not
be seen in the real world. I've chosen "application/x.mediasource" for that.

MozReview-Commit-ID: 1aCH75Kh2e6

--HG--
extra : rebase_source : 0d9cd9b69c264e5dcfc3845f80ee107f4bcbcd9a
2016-12-28 18:59:02 +11:00
Gerald Squelart
5745998021 Bug 1331770 - Rename 'MediaContentType' to 'MediaContainerType' - r=jya
MozReview-Commit-ID: F0BWai8vPyo

--HG--
rename : dom/media/MediaContentType.cpp => dom/media/MediaContainerType.cpp
rename : dom/media/MediaContentType.h => dom/media/MediaContainerType.h
extra : rebase_source : 640ada96750b4496055087e80ae3f600c9df31c9
2017-01-18 11:59:03 +11:00
Florian Quèze
85611a7b6d Bug 1331081 - script generated patch to omit addEventListener/removeEventListener's third parameter when it's false, r=jaws.
--HG--
extra : rebase_source : a22344ee1569f58f1f0a01017bfe0d46a6a14602
2017-01-17 11:50:25 +01:00
Jean-Yves Avenard
ff5bf730de Bug 1329480: [MSE] Do not reject partial boxes. r=gerald
Partial content less than 8 bytes long was incorrectly rejected.

We now assume that content is valid unless it is explicitly incorrect (bad box type)

MozReview-Commit-ID: 8L32mNVjzxh

--HG--
extra : rebase_source : 980242aab96d5b96dc7e62ad289e8ecd7b228032
2017-01-13 17:38:40 +01:00
Gerald Squelart
f3a92fa0a6 Bug 1330284 - Use MediaContentType in MP4Decoder - r=jya
MozReview-Commit-ID: 9Npl40Iicjc

--HG--
extra : rebase_source : 27df1df1cdf8eb8b608e155c0146c8b09d655de4
2017-01-01 12:27:45 +11:00
Gerald Squelart
5587e692df Bug 1329568 - Remove MediaContentType crutches - r=jya
Now that we have move all data-handling functions to MediaMIMEType and friends,
we can remove direct accesses to data from MediaContentType, to better separate
the context that MediaContentType represents, from the data it includes.

Dependent code needs to be mechanically updated to now use the proper APIs.

Note that in most places, we just extract MIME strings. Further work will take
place in later bugs, to completely replace these strings with MediaContentType
or more appropriate types...

MozReview-Commit-ID: LoX8dhX7OlB

--HG--
extra : rebase_source : cf221ac3c104f99b36cfa055afcf67d3bca26d0e
2017-01-01 09:24:24 +11:00
Gerald Squelart
d206c54fef Bug 1329568 - MediaSource::IsTypeSupported should report a NotSupportedError if type is not supported - r=jya
Bug 1176218 made IsTypeSupported return a DOMTypeError if the type cannot be
parsed, but this was incorrect.
This was not important until now, because the basic parser accepted invalid
MIME types and therefore would never report an error there.
But the next couple of patches will introduce a stronger check that will
refuse types other that "application/...", "audio/...", and "video/...", and
would now trip the web-platform tests.

MozReview-Commit-ID: EeyFnyurEZK

--HG--
extra : rebase_source : 76f831ddc3c19e0d820454f6f949d44e15d6773c
2017-01-13 14:58:23 +11:00
JW Wang
4f5754ca55 Bug 1328130. Part 2 - remove MozPromiseRequestHolder::Begin(). r=gerald
MozReview-Commit-ID: JL27n0Era6E

--HG--
extra : rebase_source : e6de76db3fb35b110370497f4060ea1c3f527f23
extra : intermediate-source : 5bc39a45ef042b895a5abda59cc0796e8cfb4be3
extra : source : a7f7faded7b112e8a971ca96b091a9a22214a2bb
2017-01-11 16:33:29 +08:00
Wes Kocher
48f75e3c03 Backed out 13 changesets (bug 1329568) for wpt-11 failures in mediasource-addsourcebuffer.html a=backout CLOSED TREE
Backed out changeset 8f37ee96bd78 (bug 1329568)
Backed out changeset 706da9f85272 (bug 1329568)
Backed out changeset c316c8d24d32 (bug 1329568)
Backed out changeset 90a091e65db3 (bug 1329568)
Backed out changeset da855d6a78bb (bug 1329568)
Backed out changeset 3a49367220e3 (bug 1329568)
Backed out changeset 453851b40e3e (bug 1329568)
Backed out changeset 662529436cc4 (bug 1329568)
Backed out changeset 7c62078beb88 (bug 1329568)
Backed out changeset 99758b5f7918 (bug 1329568)
Backed out changeset 2ce9dcf0c274 (bug 1329568)
Backed out changeset 644f206d06d6 (bug 1329568)
Backed out changeset e1ed12f057c8 (bug 1329568)

MozReview-Commit-ID: FhJlySehxHi
2017-01-12 15:10:52 -08:00
Gerald Squelart
3a78522186 Bug 1329568 - Remove MediaContentType crutches - r=jya
Now that we have move all data-handling functions to MediaMIMEType and friends,
we can remove direct accesses to data from MediaContentType, to better separate
the context that MediaContentType represents, from the data it includes.

Dependent code needs to be mechanically updated to now use the proper APIs.

Note that in most places, we just extract MIME strings. Further work will take
place in later bugs, to completely replace these strings with MediaContentType
or more appropriate types...

MozReview-Commit-ID: LoX8dhX7OlB

--HG--
extra : rebase_source : 63eba419e5cb8a69500008145769c8e4ef99f33f
2017-01-01 09:24:24 +11:00
Gerald Squelart
cd181bc396 Bug 1329561 - MediaContentType is always valid - r=jya
MediaContentType can only be created through MakeMediaContentType(), which
returns a Maybe<MediaContentType>.
If the return value is Nothing, parsing failed.
Otherwise the contained MediaContentType object is guaranteed to be valid;
E.g., GetMIMEType() will always return a non-empty string.

Note that this interface will change a lot in the following bugs&patches, so
please don't worry about the 'Get' in the never-failing GetMIMEType(), it will
be gone soon!

MozReview-Commit-ID: IjGKkQ6RVd4

--HG--
extra : rebase_source : 5254af80dec0beb05da49f68c12fecc28edd725e
2016-12-01 12:56:11 +11:00
Gerald Squelart
1cc4e2c254 Bug 1329319 - Allow NewRunnableMethod to method of a non-refcounted base class - r=froydnj
This is done by storing the object pointer based on the exact pointee type,
instead of as hinted by the method-pointer, which could be a non-refcounted
base class.

The stored pointer type is statically-checked to be derived from (or the same
as) the class type from the method-pointer, to prevent misuses.

One change had to be done in TrackBuffersManager, as it was passing another
type and relying on implicit pointer conversions. A simple `.get()` to pass
the raw pointer type (to be stored in a RefPtr) fixed that one issue.

MozReview-Commit-ID: 4kH0XdjB5Rk

--HG--
extra : rebase_source : 40ad68820cfce469ecda272f430062f05dfcd09f
2017-01-10 10:49:08 +11:00
Wes Kocher
b0df943433 Backed out 2 changesets (bug 1329319) because it will not build a=backout
Backed out changeset ae96a44e6a8f (bug 1329319)
Backed out changeset a75ecabf7129 (bug 1329319)

MozReview-Commit-ID: HQ3on7jlZXN
2017-01-09 15:46:42 -08:00
Gerald Squelart
189314d9cf Bug 1329319 - Allow NewRunnableMethod to method of a non-refcounted base class - r=froydnj
This is done by storing the object pointer based on the exact pointee type,
instead of as hinted by the method-pointer, which could be a non-refcounted
base class.

The stored pointer type is statically-checked to be derived from (or the same
as) the class type from the method-pointer, to prevent misuses.

One change had to be done in TrackBuffersManager, as it was passing another
type and relying on implicit pointer conversions. A simple `.get()` to pass
the raw pointer type (to be stored in a RefPtr) fixed that one issue.

MozReview-Commit-ID: 4kH0XdjB5Rk

--HG--
extra : rebase_source : 3eb7fa3cb1873f71b4d5e7118d2dc48f6fdf2874
2017-01-09 11:11:16 +11:00
JW Wang
b245f6d89e Bug 1319295. Part 3 - enable dormant for the test. r=jya
MozReview-Commit-ID: 9dvmRXbr683

--HG--
extra : rebase_source : 89757edee2d01881902583b7c54a8f9084392248
extra : intermediate-source : 487459ad82406a06b9a5d1b4a53290c8aa3ee652
extra : source : 3e90c3305c9988daa2cef10b3209f629ccc6dd2d
2016-12-20 17:05:25 +08:00
Jean-Yves Avenard
0f319635c2 Bug 1324306: [MSE] Bump audio memory threshold to 20MB. r=gerald
MozReview-Commit-ID: LSAv3ujW2TX

--HG--
extra : rebase_source : 649dbc4b9d847c3d734c92408467fe309748682c
2016-12-19 20:17:50 +11:00
Jean-Yves Avenard
6182653bf0 Bug 1323847: [MSE] P4. Bump audio buffer size. r=gerald
Under some cases YouTube attempts to append more than 10MB of data ahead of currentTime. This causes the appendBuffer to be rejected with QUOTA_EXCEEDED_ERR as as per spec.

Bug 1320829 slightly increased the size of the MediaRawData object (by 36 bytes) which on average caused an increase of 470kB of the source buffer size causing the eviction threshold to be crossed quicker.
YouTube clears the entire source buffer once a buffer full is reported and reloads it all, causing an audible silence.

Bumping the threshold slightly is the only way to get around the problem.

MozReview-Commit-ID: HgtHFcZHUG1

--HG--
extra : rebase_source : 74b78a551c5eb827576d1797928cc4da51eb3dd1
2016-12-16 16:30:41 +11:00
Jean-Yves Avenard
95e0de057c Bug 1323847: [MSE] P2. Don't evict sample containing currentTime. r=gerald
MozReview-Commit-ID: KjX10EPzUJN

--HG--
extra : rebase_source : ef4e11a2f5a6a12cc7bf12715c4da0564f24c91c
2016-12-16 16:05:21 +11:00
Jean-Yves Avenard
41cae58779 Bug 1323847: [MSE] P1. Add extra logging. r=gerald
MozReview-Commit-ID: FL4aScnrTY3

--HG--
extra : rebase_source : d20a5805c79063640e12e9d5f11c6dfe70d4d214
2016-12-16 16:04:27 +11:00
Andrew McCreight
fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd
826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight
e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
Jean-Yves Avenard
0374bc4ac7 Bug 1322587: [MSE] P2. Allow additional top-level boxes. r=gerald
MozReview-Commit-ID: AE6EaPnOiJu

--HG--
extra : rebase_source : e713d4d4a755a1a6e835521d9774139d3a3e98d2
2016-12-09 09:21:21 -10:00
Jean-Yves Avenard
225e0aecd7 Bug 1322587: [MSE] P1. Fix error message. r=gerald
MozReview-Commit-ID: E6IH5t2uBKg

--HG--
extra : rebase_source : e3a8d0dcd0d0a87ae4e76378a6807cb6933e24b6
2016-12-09 09:03:09 -10:00
Ralph Giles
013b2b9c9f Bug 1320895 - Test ADTS frame size calculation. r=gerald
We don't generate timestamps for ADTS but we can verify
the Init Segment Range and Media Segment Range returned
by the parser match the frame size declared in the
Init Segment header.

MozReview-Commit-ID: FCZfxn9b69R

--HG--
extra : rebase_source : 44e6f842b815fcc1f21c3b2425a729f3773af319
2016-11-30 14:38:52 -08:00
Ralph Giles
d20f7b6309 Bug 1320895 - Correct ADTS frame size calculation. r=gerald
This should be bitwise OR rather than logical OR, which just
returns 1. This code has clearly never worked, but it isn't
currently called.

MozReview-Commit-ID: 9Iuy7a7P85O

--HG--
extra : rebase_source : 4da35a507993ee761ac952259c1be3a974a8a0ac
2016-11-30 13:23:18 -08:00
JW Wang
43e53b8e88 Bug 1320258. Part 1 - add a test case to test 'ended' is fired when seeking to the end of media. r=jya
MozReview-Commit-ID: 4cS9GiTYB7l

--HG--
extra : rebase_source : 20816f2e81c7488f4e0bc152b02f6949de15add8
extra : intermediate-source : 5a9a9b32dc576774aaa0834dd63b31644e557707
extra : source : f831993d1b06a1f18d9b599a9742a92833e5f6a0
2016-11-25 15:06:30 +08:00
Gerald Squelart
353902bada Bug 1313497 - AppendBufferTask can take SourceBufferAttributes by const& - r=jya
A small optimization found while working on the previous patch.

MozReview-Commit-ID: 4w2LI5mqUvS

--HG--
extra : rebase_source : 70b9ad73c57da5079df607b5176fcfa45ed42e81
2016-11-13 16:39:47 +11:00
Gerald Squelart
1e16643490 Bug 1313497 - Use InvokeAsync with Storages in TrackBuffersManager - r=jya
MozReview-Commit-ID: IkpuSyFgPbP

--HG--
extra : rebase_source : bc56bb4dbfef3381477896470f644c5897753505
2016-11-13 16:37:24 +11:00
Gerald Squelart
038cba7f2e Bug 1313497 - Pass TimeUnit by const& in MediaDataDemuxer - r=jya
Thanks to the previous patch, MediaDataDemuxer::Seek and
SkipToNextRandomAccessPoint (and all overrides in derived demuxers) can now
take their TimeUnit parameter by const&.

MozReview-Commit-ID: 6CqfjAXZ7Yk

--HG--
extra : rebase_source : c3453e4432d9e0281cf5eba55217b0c1d6312f5b
2016-11-13 15:13:51 +11:00
Gerald Squelart
25b7c80fa4 Bug 1313497 - Use InvokeAsync with Storages in MediaSourceDemuxer - r=jya
We now take a copy of the TimeUnit object, and can then pass it by rref to
internal methods.

MozReview-Commit-ID: J0Idw85NMcu

--HG--
extra : rebase_source : 9cb8dd45ff7b449074121df8618ee7295398138b
2016-11-13 12:03:26 +11:00
Gerald Squelart
8f286c5e0c Bug 1313497 - Use InvokeAsync with lambda to replace MediaSourceDemuxer::AttemptInit - r=jya
MozReview-Commit-ID: 5qsQ2zQAMV3

--HG--
extra : rebase_source : f8d82ca0198fb95e0add8fc3e5f4489dfc8b31f1
2016-11-13 11:40:46 +11:00
JW Wang
b89b9e675b Bug 1319357 - clean up media elements when media tests are done. r=jya
MozReview-Commit-ID: GHJAwxR50AG

--HG--
extra : rebase_source : bdb6d045fddf65d18779b056baa496dc1c71e756
extra : source : 691ffaaf98a3796c92bab0e58eb56d0212601acc
2016-11-22 17:02:08 +08:00
JW Wang
05b9e78f7b Bug 1319293 - Enable dormant for dom/media/mediasource/test/test_PlayEvents.html r=jya
MozReview-Commit-ID: 1cRcyTfF0Qc

--HG--
extra : rebase_source : e1d77bfdda8de1f46fd4d717024bdc6c9d924b74
extra : source : be6a71fc9ee695ec0461499b951f5939d254e9cf
2016-11-22 14:59:00 +08:00
JW Wang
a8b746d049 Bug 1318982 - Enable dormant for most media mochitests. r=jya
MozReview-Commit-ID: 7AXEhCmFUeR

--HG--
extra : rebase_source : fa42b09dda75c3385edc6f7decc240816195722b
extra : intermediate-source : 3376be75b913bbc3bd0920828f9e756982e9cac3
extra : source : ffee549ec036bc3ec1b9b1bccb26314c5adb5096
2016-11-02 16:56:38 +08:00
JW Wang
c73002e638 Bug 1315591 - remove duplicated waitUntilTime() in test_BufferingWait[_mp4].html. r=jya
MozReview-Commit-ID: 12Z9TJ4WVVt

--HG--
extra : rebase_source : 34b9d33b354c41f02ce0da7dfcf13612e809bd34
2016-11-07 11:49:38 +08:00
Jean-Yves Avenard
ad3b3a4b82 Bug 1314533: [MSE] P6. Allow to detect error during preliminary container parsing. r=gerald
MozReview-Commit-ID: KZ858ISWDmu

--HG--
extra : rebase_source : 776e858619f13178193a9be2e0857c69dea15984
2016-11-04 23:09:47 +11:00
Jean-Yves Avenard
a7ef8c33da Bug 1314533: [MSE] P4. Reject invalid webm block. r=gerald
An invalid webm block at this stage is either a non init segment or non media segment.

MozReview-Commit-ID: 46NrhCwqas1

--HG--
extra : rebase_source : b5be124fc0789cfe0fe757c5fb83f18a769a8bd4
2016-11-04 02:16:53 +11:00
Jean-Yves Avenard
5c340b140f Bug 1314533: [MSE] P3. Reject invalid MP4 boxes. r=gerald
MozReview-Commit-ID: F0FcQDqsLk7

--HG--
extra : rebase_source : 91d878d277013b7d78c32b9b0855d38989e94741
2016-11-04 01:49:19 +11:00
Jean-Yves Avenard
d7ed0c4335 Bug 1314533: [MSE] P2. Reject appendBuffer if invalid data found. r=gerald
This still requires all the ContainerParser to be updated in properly handling errors.

MozReview-Commit-ID: A7gDmXSJXmc

--HG--
extra : rebase_source : c438fdd40deb843e43f341d107e48171141dc746
2016-11-02 21:39:14 +11:00
Jean-Yves Avenard
fa47b59611 Bug 1314533: [MSE] P1. Change member prototype. r=gerald
MozReview-Commit-ID: L8H4oDoTm2b

--HG--
extra : rebase_source : d78504699223bfd63624bf2e603d274d4c06cca8
2016-11-02 21:29:13 +11:00
Sebastian Hengst
8ee9323cd0 Bug 1310297 - Remove test annotations using b2g, mulet or gonk: dom/media. r=RyanVM
MozReview-Commit-ID: JVsnpnBDeCC

--HG--
extra : rebase_source : 5a7ccee10b094808e3ee73de7a226306a9fd55fd
2016-11-05 11:29:16 +01:00
JW Wang
9fcd26988d Bug 1311872. Part 1 - remove dormant code from MediaDecoder and its friends. We will let MDSM solely decide when to enter/exit dormant. r=cpearce,jya
MozReview-Commit-ID: 4rRSGcruy7Z

--HG--
extra : rebase_source : 6bff3bde442dbc96ce23a4a1aabae9ec79f1b9f0
extra : intermediate-source : 456de41037090ff072925d937b001de31a479556
extra : source : 525be5a0f46950ced9efba9a7cfeda26ce73cfb8
2016-10-20 15:20:25 +08:00