Commit Graph

542 Commits

Author SHA1 Message Date
Chris Pearce
8be5473cac Bug 1362212 - Implement HTMLMediaElement.reportCanPlayTelemetry. r=gerald
Defer determining whether we have usable decoders to an off-main thread in
order to avoid janking the main thread.

MozReview-Commit-ID: Ape5zEBBMrz

--HG--
extra : rebase_source : 1b77046ebb7bb2d4ff1ba53afce904d3de45c335
2017-05-10 11:31:16 +12:00
Sebastian Hengst
0f3dde8a14 Backed out changeset 5f263d6fb16d (bug 1362212) for build bustage on Linux - fails testing/xpcshell/selftest.py | XPCShellTestsTests.testAddTaskStackTrace. r=backout 2017-05-07 23:12:35 +02:00
Chris Pearce
aa3f97c3ef Bug 1362212 - Move canPlayType telemetry to an idle service observer off main thread. r=gerald
Currently we call HTMLMediaElement.canPlayType() in a JS function called
shortly after startup in order to collect telemetry as to how many of our users
don't have functioning decoders.

Unfortunately, HTMLMediaElement.canPlayType() checks whether we can play a
codec by instantiating a decoder, and this requires us to load the system
decoding libraries from disk. This requires disk I/O, which can cause jank. We
have some BHR reports showing that canPlayType can hang for > 8 seconds to back
this up.

So move the collection of this telemetry to an idle service observer, so that
we only collect this when the user is idle, and do it on a non-main thread so
it is less likely to cause jank.


MozReview-Commit-ID: HJQawmRxz

--HG--
extra : rebase_source : f5a8596fd9de770abd20e1a3e8ac0bcbb5b48599
2017-05-05 13:55:14 +12:00
Sebastian Hengst
64ea535650 Backed out changeset fe9ac1176159 (bug 1359058) 2017-05-05 00:32:36 +02:00
Jean-Yves Avenard
d9c615a36e Bug 1359058: P2. Rely on container flags when seeking in plain MP4. r=gerald
This reverts part of bug 1300296. In the worse case we'll get a decoding error. But we're only trading a bad behaviour for another.

MozReview-Commit-ID: H0gF3FqZsU6

--HG--
extra : rebase_source : 3886b757f3476060067811dcb385967769a67023
2017-04-26 16:43:54 +02:00
JW Wang
aab9f27e0f Bug 1359309. P1 - give mozilla::TaskQueue a name which will be useful in debugging Dispatch() failures. r=jya
MozReview-Commit-ID: 5FAVNo32fl7

--HG--
extra : rebase_source : 761fca752429d95e97be699976283baa35c64abb
extra : intermediate-source : 83282a7a5adbe7046212da85f9d16e39faa4bd5c
extra : source : 924af3ea0aa86888fd2745020be7900e6eb614f0
2017-04-25 14:57:55 +08:00
JW Wang
f2ea37e57b Bug 1357986 - Use helper functions of TimeUnit to make code more readable. r=kaku
1. using media::TimeUnit to save some typing.
2. replace TimeUnit() with TimeUnit::Zero().
3. replace TimeUnit::FromXXX(0) with TimeUnit::Zero().
4. replace TimeUnit::FromMicroseconds(std::numeric_limits<int64_t>::max()) with TimeUnit::FromInfinity().
5. replace some uses of int64_t with TimeUnit.
6. replace t > TimeUnit() with t.IsPositive().

MozReview-Commit-ID: 6hC94PXx86i

--HG--
extra : rebase_source : 1ea3b409e6ec12915f3e1a00359d6ff4152c8917
extra : intermediate-source : e31a12ad0e7a4840119036f261ed17eaaff85734
extra : source : ae07ee48000c4a52da0e4fd502b4d690ec51ce1f
2017-04-17 16:35:04 +08:00
JW Wang
302d82c85a Bug 1356530 - Change the type of MediaData::mTime to TimeUnit since int64_t is ambiguous. r=kaku
MozReview-Commit-ID: 4bVeqIuWO2O

--HG--
extra : rebase_source : d504ac15a6dc59ad42f3ab80faf23f629d74315f
extra : intermediate-source : 6e52995b6c8146451d98dffc62f6907755dc856e
extra : source : 82d2649cdafb5a6389f6858c23578811933580c9
2017-04-14 17:13:36 +08:00
JW Wang
235f1f55ed Bug 1356506 - change the type of MediaData::mTimecode to TimeUnit since int64_t is ambiguous. r=gerald
MozReview-Commit-ID: 7dO5OOUuORz

--HG--
extra : rebase_source : 1c1c020700d9180ef9f85d7e2e679f498ab71fce
extra : intermediate-source : d173c820bef7a113e28e9732c42e8c1af36160ab
extra : source : 04c08a780526ca3a5ac4d1a6f9b7ae30d9957e92
2017-04-14 14:52:14 +08:00
JW Wang
464497b945 Bug 1355756. P1 - change the type of MediaData::mDuration to TimeUnit. r=gerald
MozReview-Commit-ID: 3d4bUYtSuMI

--HG--
extra : rebase_source : 94c821b6d381421035e6a12cbe038436055c5822
extra : intermediate-source : 9a06beffc736486f47b9cf05e7f482e726d53068
extra : source : fdbdcd5c1474f04dc1dbde66fcf3a9ecec953053
2017-04-12 17:27:34 +08:00
JW Wang
d0454d90d1 Bug 1355745 - Change the type of TrackInfo::mMediaTime to TimeUnit. r=jya
MozReview-Commit-ID: 3vuPhLQBnFb

--HG--
extra : rebase_source : 465f8c6eb234694a101081bd5314cca63e4b3285
extra : source : bf604ecf38cbc46c286cc76c4f596fdfd397ac78
2017-04-12 16:53:09 +08:00
JW Wang
f45fa7374e Bug 1355740 - Change the type of TrackInfo::mDuration to TimeUnit. r=jya
MozReview-Commit-ID: P7aqw4d5Vk

--HG--
extra : rebase_source : f22743fec9c8b70cbb092e3b26e252e7a4cb0b31
extra : source : 2413cd58f073b734a2cb85cec3658942bfd46e08
2017-04-12 16:41:36 +08:00
Gerald Squelart
1564d36454 Bug 1341483 - MP4Metadata::GetTrackIndice() now also returns a success/error code - r=kinetik
MozReview-Commit-ID: BIgvy5eKNJl

--HG--
extra : rebase_source : 251d61df6136ab46d8efe33edd4199fa5aabd2f0
2017-03-15 16:55:50 +11:00
Gerald Squelart
2ea7fba755 Bug 1341483 - MP4Metadata::Crypto() now also returns a success/error code - r=kinetik
MozReview-Commit-ID: EywDv5JuDK6

--HG--
extra : rebase_source : 017cd996817b1aaa78f5c7bed9fa05da3baf442c
2017-02-27 21:32:03 +11:00
Gerald Squelart
7961918dfc Bug 1341483 - MP4Metadata::GetTrackInfo() now also returns a success/error code - r=kinetik
MozReview-Commit-ID: KQ3fJzZkrGW

--HG--
extra : rebase_source : b9f4324f50c81f4945c0a47e63af0cb616ba013e
2017-02-27 17:05:41 +11:00
Gerald Squelart
c93b449e6b Bug 1341483 - MP4Metadata::GetNumberTracks() now also returns a success/error code - r=kinetik
In addition to the returned MediaResult, a special number-of-tracks value
(not just 0) indicates an unrecoverable error.

For Rust-vs-Stagefright comparison purposes, an error is considered the same
as 0 (because Stagefright never returns errors, but Rust may, so complaining
about that would be too noisy, and useless to us.)

MozReview-Commit-ID: IwadWSOIWr4

--HG--
extra : rebase_source : 29f53ee6a02a0431adb0b615a122a4e7b480108c
2017-02-27 13:36:59 +11:00
Gerald Squelart
1bbbbd132d Bug 1341483 - MP4Metadata::Metadata() now also returns a success/error code - r=kinetik
The returned MediaResult is used as error or warning in MP4Demuxer::Init().

MozReview-Commit-ID: Bnv4xG8bCJ4

--HG--
extra : rebase_source : c1952ed61396834b0cd7da58c9b64481a5c46ab1
2017-02-27 13:01:11 +11:00
Gerald Squelart
0cb411e982 Bug 1343437 - MP4Demuxer::Init resolves with a MediaResult - r=jya
If MP4Demuxer::Init detects some recoverable error (e.g., invalid tracks when
others may still be usable), it will eventually Resolve the promise with the
first warning.

Later on, errors/warnings from the MP4Metadata parser will also be handled, to
provide even better diagnostics.

MozReview-Commit-ID: E9Rly9dhXW3

--HG--
extra : rebase_source : cae214d0c80297bd61156dc1a305a186da0974fe
2017-02-27 10:10:28 +11:00
Alfredo.Yang
48c54615b1 Bug 1343461 - add a wrapper class to encapsulate rust/stagefright sample table. r=gerald
MozReview-Commit-ID: 4UgToySaEmb

--HG--
extra : rebase_source : b91481f844d94bd3a9f7e6bfeaa08391f117e967
2017-03-01 10:53:49 +08:00
Gerald Squelart
bcdfea341d Bug 1343156 - Remove unnecessary MP4Metadata::HasCompleteMetadata - r=jya
MP4Metadata::Metadata() contains the same code at the beginning, so calling
HasCompleteMetadata() is unnecessary, so we should just remove it completely.

(Except to get a better error message, but this will be reinstated in an
upcoming bug.)

MozReview-Commit-ID: 2C3GI5fE0Ja

--HG--
extra : rebase_source : 2bdb6199222dcb0ca4012121a3fd4694b440be3e
2017-02-27 10:06:45 +11:00
Gerald Squelart
d32a15fe74 Bug 1341454 - MP4Demuxer::Init() pre-caches everything from MP4Metadata - r=jya
MP4Demuxer::Init() used to just create a minimal MP4Metadata structure, and
report success/failure from that alone. But other later-called functions
(e.g.: GetNumberTracks, GetTrackDemuxer, etc.) could still fail with no useful
error reporting, when MP4Metadata tried to gather more of the needed
information.
Also, MP4Demuxer needed to keep this MP4Metadata around forever, even though
it could contain an arbitrary amount of extra data that is not needed.

With this patch, MP4Demuxer::Init() fetches all the data that could ever be
needed, and then discards the MP4Metadata.
This ensures that no late-initialization errors could creep in, and also helps
reporting errors early and with better diagnostic information.

This bug focuses on Init(), a later bug will give MP4Metadata the ability
to report its own even-more-detailed errors.

MozReview-Commit-ID: 1NjzOeKa1JI

--HG--
extra : rebase_source : 02781395aa538cf2be984b695a7bc7e2b9b039b7
2017-02-23 14:56:51 +11:00
Tom Tromey
d2667a2b27 Bug 1060419 - make AppendPrintf and nsPrintfCString use Printf.h, r=froydnj
MozReview-Commit-ID: 2E8FoiNxU8L

--HG--
extra : rebase_source : 810ac727bef0751f24edea18c52e0ec170bf367d
2016-12-14 09:32:21 -07:00
Sylvestre Ledru
92ed0479a5 Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/media/ r=jya
MozReview-Commit-ID: 5ewd0uy2Kgk

--HG--
extra : rebase_source : 957074ab07621d73574a3919b1895798210747fc
2017-02-09 15:42:59 +01:00
Jay Harris
42bd35ef04 Bug 1339204 - Adds VP9 and VP9.0 as supported types in the MP4Decoder r=cpearce
MozReview-Commit-ID: 4vZGvb7nbVb

--HG--
extra : rebase_source : 26c190bd29953178fe3762a6d4426a5566d21d40
2017-02-14 10:31:02 +13:00
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
Jay Harris
efb83af7fa Bug 1318792 - Adds support for sbgp and sgpd boxes occuring in the sampletable r=jya
MozReview-Commit-ID: JaFGeZKFPRg

--HG--
extra : rebase_source : 07137a6923478b837794a1fa2cf617bfd08e41d6
2017-01-25 11:35:16 +13:00
Jay Harris
107910f23e Bug 1318792 - Adds support for sbgp and sgpd boxes in the traf box r=jya
MozReview-Commit-ID: 7aHEaCTJm22

--HG--
extra : rebase_source : d160d3d64f3848f697e648eae2dafa481800bedd
2017-01-25 12:10:35 +13:00
Bill McCloskey
ec760e9fba Bug 1332494 - Move TaskCategory definition to xpcom/threads/TaskCategory.h (r=froydnj)
MozReview-Commit-ID: ET43PbGRgxl
2017-01-26 14:45:58 -08: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
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
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
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
Chris Peterson
4b56a6fac1 Bug 1324183 - Part 1: Remove some Windows Vista and 7 version checks in dom/media/. r=gerald
--HG--
extra : amend_source : 64fbc1c09fd0b5d1b7c560716f8b23003662fe95
extra : histedit_source : b94fa9bb663c607affe43740e3a546861d6a74fb
2016-12-17 16:59:52 -08: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
Jean-Yves Avenard
3b3c30e066 Bug 1315567: P3. Expose flac codec as being available in mp4. r=gerald
MozReview-Commit-ID: 7C6W1KGQ1jE

--HG--
extra : rebase_source : 338dd05c33543f84740fb68da28845154dc27f74
2016-11-07 10:57:28 +11:00
Jean-Yves Avenard
5b64448a75 Bug 1315567: P2. Expose opus codec as being available in mp4. r=gerald
MozReview-Commit-ID: GU8me70Igsq

--HG--
extra : rebase_source : 30ca879dba9e1a9e68da1081f683247b1f09179a
2016-11-07 11:08:32 +11:00
Jean-Yves Avenard
cd31dea4bd Bug 1315567: P1. Remove invalid test. r=gerald
audio/opus is a codec type, not a MP4 container one. aType can never be audio/opus

MozReview-Commit-ID: E8tONlF4COA

--HG--
extra : rebase_source : d26a4dce2adcf1f82e56a2b5c2dd5ee1500fcd84
2016-11-07 12:56:55 +11:00
Chris Pearce
50e79d67a0 Bug 1314858 - Add MP4Decoder::IsAAC. r=gerald
We have this for H.264, so we may as well have it for AAC too.

MozReview-Commit-ID: 2k64ANJGUNN

--HG--
extra : rebase_source : 6fe2543788afd26682d31c0ec45b9ac80e501ab1
2016-11-02 09:43:45 +13: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
Gerald Squelart
413e411d7c Bug 1176218 - p12. Use new PDM's Supports(Trackinfo) in MP4Decoder - r=jya
MP4Decoder can translate the new MediaContentType into the relevant TrackInfo
to interrogate PDMs about codec support, with extra information if present.

MozReview-Commit-ID: K0jcYm8pJrp

--HG--
extra : rebase_source : e809824285a85035b81ad7f91406bce6393384f6
2016-10-07 15:51:22 +11:00
Gerald Squelart
700d804c16 Bug 1176218 - p9. Pass MediaContentType to MP4Decoder::CanHandleMediaType - r=jya
Just passing the new MediaContentType struct, with no processing changes (yet).

MozReview-Commit-ID: KZ4xkCihPb1

--HG--
extra : rebase_source : e40eb72cc63e0a814306c25ea9b609178517729e
2016-10-01 18:10:18 +10:00
Matt Woodrow
a36eef926a Bug 1300682 - Part 5: Use KnowsCompositor to initialize decoders and create one for VideoDecoderParent to use. r=nical,jya 2016-10-07 21:13:33 +13:00
James Cheng
48efb9caad Bug 1300654 Part1-Remove MOZ_EME from code base. r=cpearce,smaug
MozReview-Commit-ID: JboGO0w4tcE

--HG--
extra : rebase_source : abfe53f30081f74fc39c900cab48d08c7574bfec
2016-09-08 18:06:20 +08:00
Carsten "Tomcat" Book
d2c3fe7fd3 merge autoland to mozilla-central a=merge 2016-09-14 12:07:02 +02:00
Ben Kelly
f0d440f9d1 Bug 1300118 P1 Make TaskQueue deliver runnables to nsIEventTarget. r=bholley 2016-09-13 20:12:15 -07:00
Jean-Yves Avenard
70ed5282de Bug 1299072: P18. Use MediaResult with InitPromise. r=gerald
MozReview-Commit-ID: JiLgiyxvfNC

--HG--
extra : rebase_source : 4cc453a5fe7b1e4f4b865c31a24a5feed64df7e4
2016-09-13 13:06:18 +10:00
Jean-Yves Avenard
20dc9102e8 Bug 1299072: P12. Use MediaResult for MediaDataDemuxer promises. r=gerald
MozReview-Commit-ID: JeQrmoHbb8m

--HG--
extra : rebase_source : 1f4581e5789f18b358a6f5bb5f8595cc7a75110b
2016-09-12 12:22:20 +10:00