Commit Graph

333 Commits

Author SHA1 Message Date
Jean-Yves Avenard
92251eaa4f Bug 1532858 - Ensure metadata values are sane. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D22484

--HG--
extra : moz-landing-system : lando
2019-03-15 02:30:09 +00:00
Jean-Yves Avenard
38ff00ec95 Bug 1530835 - Set frame duration to 0 when out of order frames are seen. r=bryce
WebM specify that timestamp must be monotonically increasing. Unfortunately, this is not always the case.

WebM doesn't have a concept of frame duration, the duration is calculated as being the delta between the next frame's time and the current one. So non-monotonically increasing timestamps would have caused negative duration.

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

--HG--
extra : moz-landing-system : lando
2019-03-01 18:56:01 +00:00
Bryce Van Dyk
79377d1363 Bug 1504060 - Log instead of asserting that webm samples do not have timestamps > segment druation. r=alwu
We're able to hit this assertion in the wild due to bad muxers. As such, replace
the assert with a log. If a sample has a time stamp > the segment duration, use
that instead of the duration for calculating our next time stamp. Use an
explicit int64_t type in the signature for our next time stamp calculation
as the logging explicitly expects an int64_t (makes it harder to change the
types involved and footgunning by having a wrong formatter in the logs).

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

--HG--
extra : moz-landing-system : lando
2019-03-01 18:20:00 +00:00
Ryan Hunt
00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Bryce Van Dyk
fa9d86fda5 Bug 1487416 - Replace mValid and mMode with mCryptoScheme for track and sample crypto structs. r=jya
Explicitly store the crypto scheme being used on our crypto structs to let us
differentiate between cenc and cbcs data. In doing so remove mMode and replace
mValid with IsEncrypted() for the following reasons:
- Different modes within the existing schemes are not currently utilized by the
  spec: the scheme implies mode. Having a mode and a scheme could lead to confusion
  between the two. We can return mMode if ever needed by the spec --
  possibly if the isProtected flag which we were tracking with mMode, is
  ever changed to be more than a bool in the spec.
- mValid was typically used to check if these structs contained valid crypto
  data or not. With only one scheme this was often shorthand for 'IsEncrypted',
  but with multiple schemes what is considered valid data for one may not be for
  another. Do away with this and just explicitly have an 'IsEncrypted'.

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

--HG--
extra : moz-landing-system : lando
2019-01-11 15:29:45 +00:00
Cosmin Sabou
15939f75f2 Backed out 6 changesets (bug 1487416) for causing Android build bustages on RemoteDataDecoder.cpp. CLOSED TREE
Backed out changeset 05bcc598e9fb (bug 1487416)
Backed out changeset b99936efbbc9 (bug 1487416)
Backed out changeset ee55b284223e (bug 1487416)
Backed out changeset d25449127f8f (bug 1487416)
Backed out changeset f7c201b7f9bc (bug 1487416)
Backed out changeset 233aedc8b42e (bug 1487416)
2019-01-10 23:37:20 +02:00
Bryce Van Dyk
1a3a965df3 Bug 1487416 - Replace mValid and mMode with mCryptoScheme for track and sample crypto structs. r=jya
Explicitly store the crypto scheme being used on our crypto structs to let us
differentiate between cenc and cbcs data. In doing so remove mMode and replace
mValid with IsEncrypted() for the following reasons:
- Different modes within the existing schemes are not currently utilized by the
  spec of implementation. Having a mode and a scheme could lead to confusion
  between the two. We can return mMode if ever needed by the spec.
- mValid was typically used to check if these structs contained valid crypto
  data or not. With only one scheme this was often shorthand for 'IsEncrypted',
  but with multiple schemes what is considered valid data for one may not be for
  another. Do away with this and just explicitly have an 'IsEncrypted'.

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

--HG--
extra : moz-landing-system : lando
2019-01-10 18:37:48 +00:00
Jean-Yves Avenard
3d5c3c9538 Bug 1512456 - P4. Replace assert with MOZ_ASSERT. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D14027

--HG--
extra : moz-landing-system : lando
2018-12-11 10:46:25 +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
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
Jean-Yves Avenard
6aea43ac23 Bug 1497951 - P6. Remove resolution detection in webm demuxer. r=bryce
This is now done in the MediaChangeMonitor.

Depends on D10912

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

--HG--
extra : moz-landing-system : lando
2018-11-07 13:49:53 +00:00
Jean-Yves Avenard
b10364a15f Bug 1493198 - P2. Use enum for describing color depth. r=mattwoodrow
Depends on D6662

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

--HG--
extra : moz-landing-system : lando
2018-09-25 20:44:55 +00:00
Bryce Van Dyk
8d1b27c4a2 Bug 1492915 - Stop WebMDemuxer from inspecting partially encrypted packets for keyframe information. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D6415

--HG--
extra : moz-landing-system : lando
2018-09-21 15:58:13 +00:00
alwu
863b4b7a26 Bug 1476649 - part2 : adjust next-timestamp for the last frame r=jya
When reading samples from plain file resource, if we can't get the duration from sample, that means it's the last sample. Therefore, the next timestamp should be the track's duration.

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

--HG--
extra : moz-landing-system : lando
2018-09-20 08:27:56 +00:00
alwu
56b18353de Bug 1476649 - part1 : reuse same pattern code. r=jya
As audio track sample and video track sample are both using the same code pattern, we can eliminate
redundant codes.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 21:05:32 +00:00
Bryce Van Dyk
d3c1de1214 Bug 1491117 - Do not add crypto info to unencrypted samples from encrypted WebM tracks. r=jya
WebMs with encrypted tracks may have unencrypted samples in these tracks.
Previously we would populate some of the crypto metadata on these samples. This
data was correct, but it was potentially misleading to include crypto metadata on
clear samples.

This changeset alters the behaviour so that we do not populate any such data for
unencrypted packets. This should not alter existing behaviour, notably the
Widevine CDM version 9 should continue to work. However, this change makes our
samples easier to feed to version 10 of the CDM. Without this change, we would
need to do extra conversion steps to appease the new CDM.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 17:09:29 +00:00
Jean-Yves Avenard
11e8a29e1f Bug 1481176 - P4. Make CanHandleMediaType usable off the main thread. r=bryce
This is done by ensuring that all methods is called are usable off the main thread and creating the required preference accessors.

Differential Revision: https://phabricator.services.mozilla.com/D2790
2018-08-07 19:21:59 +02:00
Jean-Yves Avenard
d7eb320e7a Bug 1476975 - P3. Fix canPlayType/isTypeSupported for AV1 content. r=dminor
AV1 support is behind a pref, as such, the result of canPlayType should depends on the value of that pref.

Additionally to this change we remove AOMDecoder::IsSupportedCodec as it implied confusion on what a codec mimetype is. There are two type of codec mimetype: the one describing the container content ("av1") and the one describing the codec itself "video/av1")
AOMDecoder shouldn't know anything about containers (e.g. mp4 or webm)

--HG--
extra : rebase_source : 72ebe662f76fb6c9d8be1f753890601aac440061
2018-07-20 10:24:56 +02:00
Noemi Erli
76fe049448 Backed out 3 changesets (bug 1476975) for mochitest failures on test_can_play_type_webm.html
Backed out changeset 91585d095420 (bug 1476975)
Backed out changeset 798f4894ffd5 (bug 1476975)
Backed out changeset b5377ceef34f (bug 1476975)
2018-07-20 21:27:01 +03:00
Jean-Yves Avenard
4d4b32ccf8 Bug 1476975 - P3. Fix canPlayType/isTypeSupported for AV1 content. r=dminor
AV1 support is behind a pref, as such, the result of canPlayType should depends on the value of that pref.

Additionally to this change we remove AOMDecoder::IsSupportedCodec as it implied confusion on what a codec mimetype is. There are two type of codec mimetype: the one describing the container content ("av1") and the one describing the codec itself "video/av1")
AOMDecoder shouldn't know anything about containers (e.g. mp4 or webm)
2018-07-20 19:04:46 +02:00
Jean-Yves Avenard
d346b32eb9 Bug 1409664 - P11. Add GetTracksInfo method to all MediaDecoder instances. r=bryce
Summary:
Allows to build an array ot TrackInfo built from the mimetype provided. This will allow to create dummy decoder to check that if they are supported and how well the decoder will perform.

Depends on D1623

Tags: #secure-revision

Bug #: 1409664

Differential Revision: https://phabricator.services.mozilla.com/D1624
2018-07-03 11:45:20 -07:00
Andi-Bogdan Postelnicu
60732a90a5 Bug 1453795 - DOM/Media - Initialize member fields in classes/ structures. r=jyavenard
--HG--
extra : rebase_source : 0c785260497fadf98cf3cff8b9fcae8ea699c2c1
2018-06-15 10:25:02 +03:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nicholas Nethercote
51f2b494ea Bug 1448222 - Remove MediaPrefs. r=jya
This patch converts all the prefs in MediaPrefs to the new StaticPrefs system.

Note that the "media.wmf.skip-blacklist" pref was present in both MediaPrefs
and gfxPrefs. The copy in MediaPrefs was never used; this explains why this
patch does not add an entry for it to StaticPrefList.h.

Note also that the patch removes themedia.rust.mp4parser pref, because it's
unused.

MozReview-Commit-ID: IfHP37NbIjY

--HG--
extra : rebase_source : df84ea813b7c366d7be663c696891325610149c8
2018-03-20 09:48:56 +11:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
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
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02: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
Dorel Luca
f41b03eca9 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE 2018-02-19 22:15:23 +02:00
Milan Sreckovic
7571df7e7c Bug 1424371: Use BaseRect access methods instead of member variables in dom/ r=qdot
MozReview-Commit-ID: HXWhggOMIEK

--HG--
extra : rebase_source : 9c9eacf80d2b7f78faa82a1549170b98d12cdaa8
2018-02-19 12:56:10 -05:00
Sylvestre Ledru
9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Gerald Squelart
c5aeab4f69 Bug 1407810 - Use DDMOZ_LOG in media stack - r=jwwang
Mostly-mechanical replacement of MOZ_LOG with DDMOZ_LOG, usually just removing
the class name and `this` pointer (as they are already implicitly recorded).
Some files needed a bit more work when logging was done from helper classes or
static functions.

MozReview-Commit-ID: IeJJmzYqWMQ

--HG--
extra : rebase_source : 94200838dcdaf6c3bda9de30042ce2d307237eef
2017-10-13 16:31:59 +11:00
Gerald Squelart
1b357db99b Bug 1407810 - Use DDLogger in media stack - r=jwwang
Mostly-mechanical additions:
- Log constructions&destructions, usually by just inheriting from
  DecoderDoctorLifeLogger, otherwise with explicit log commands (for internal
  classes for which DecoderDoctorTraits can't be specialized),
- Log links between most objects, e.g.: Media element -> decoder -> state
  machine -> reader -> demuxer -> resource, etc.

And logging some important properties and events (JS events, duration change,
frames being decoded, etc.)

More will be added later on, from just converting MOZ_LOGs, and as needed.

MozReview-Commit-ID: KgNhHSz35t0

--HG--
extra : rebase_source : dd7206e350e32671adc6f3b9e54ebf777251de2c
2017-10-10 17:55:27 +11:00
Alastor Wu
7440c83cae Bug 1362440 - part2 : parsing entire content to decide whether it's media segment. r=kinetik
The spec [1] defines what's the media segment, and the parser would return error
if the format is not correct.

[1] https://w3c.github.io/media-source/webm-byte-stream-format.html

MozReview-Commit-ID: 4hq59Pywz2t

--HG--
extra : rebase_source : 1136d2a673f11d612e0eb711db6affdce42bb525
2017-10-30 15:27:30 +08:00
Alastor Wu
58382a8ca5 Bug 1362440 - part1 : add timecode checking for parser r=kinetik
The spec [1] defines that
"Timecode (e7) MUST appear before Block (a1) or SimpleBlock (a3)".

[1] https://www.matroska.org/technical/specs/index.html

MozReview-Commit-ID: 7g8lgckuNif

--HG--
extra : rebase_source : 4945dc4b0ab4b7480bf9c6416f9776fd6313c1e1
2017-10-30 15:27:27 +08:00
James Cheng
bcfbcfbc4a Bug 1410022 - Remove redundant PDM::Supports check caused by bug 1407919 part6. r=gerald
MozReview-Commit-ID: EoAARcmhjlV

--HG--
extra : rebase_source : 560d91e004f0787278e7e3181e58c953c27368e5
2017-10-19 18:03:09 +08:00
James Cheng
638d7ea11b Bug 1407919 - Part6 - Check bit depth in WebMDecoder to determine if we support HDR. r=gerald
MozReview-Commit-ID: Jq569mlINNh

--HG--
extra : rebase_source : 57a352d9e621fc9a204f8865784332ec9aab96a5
2017-10-17 15:45:09 +08:00
James Cheng
b40f82f1ce Bug 1407919 - Part2 - Use the helper function to tell if it is a vp8/9 codec string. r=gerald
MozReview-Commit-ID: G0AKSExgm3R

--HG--
extra : rebase_source : 252395963f0f0f9d8d853e83e5cfa4b1f7fc3948
2017-10-13 14:18:29 +08:00
Gerald Squelart
b0442493e5 Bug 1405531 - Remove unused MediaDataDemuxer::HasTrackType - r=jwwang
The only actual code use in MediaSourceDemuxer can trivially be folded into
its caller GetNumberTracks in the same class.

MozReview-Commit-ID: E6zh98zmJwJ

--HG--
extra : rebase_source : 9358dc37523d6cd7c1a4d5ec62a790db6a092063
2017-10-04 11:40:29 +11:00
Jean-Yves Avenard
ac1d631264 Bug 1393087 - P3: Retry backward to find keyframe. r=kinetik
When we seek in a webm containing an alpha channel, the first frame of a cluster may not be a keyframe for both channels. So seek backward until we find one.

We limit such operation on video with an alpha channel to prevent potential regression (even though thoses files would technically be invalid)

MozReview-Commit-ID: 14ETazkQ0AG

--HG--
extra : rebase_source : 8e106a382605c23769da5a8da5b88d107833cc6e
2017-09-25 16:47:08 +02:00
Jean-Yves Avenard
f219b74756 Bug 1393087 - P2. Add methods for range-based loops. r=gerald
MozReview-Commit-ID: 6xvug7AP8jj

--HG--
extra : rebase_source : 539dfe8942062abbf6887eaca8ef9532e6892cb0
2017-09-25 16:43:55 +02:00
Jean-Yves Avenard
c7f6c04dad Bug 1393087 - P1. Only consider a video frame as keyframe if both channels are keyframes. r=kinetik
We want both the normal and alpha channels to be keyframe.

MozReview-Commit-ID: 9hHo7v97R3s

--HG--
extra : rebase_source : c531b8947b96760ad03e4dc75e6431706ebaa5a5
2017-09-25 15:59:47 +02:00
Jean-Yves Avenard
9349efba14 Bug 1396515: Fix incorrect && and || operator placements. r=sylvestre
Includes some side 80 columns fix.

MozReview-Commit-ID: IXRoQfM0Hjc

--HG--
extra : rebase_source : 918cf87b2ce82c8de245dcb23cc359289ac5f21f
2017-09-04 11:27:43 +02:00
Jean-Yves Avenard
64a4b87c4c Bug 1394591 - P6. Simplify some internal codec mimetype. r=gerald
The codec mimetype is now shown in the media devtools. May as well make it readable.

MozReview-Commit-ID: 6rccDiTR24m

--HG--
extra : rebase_source : 7b8d1da8f05d0c46d5fd57b5e604ec3aed36a5f2
2017-09-01 23:04:39 +02:00
Sebastian Hengst
e9bfcd79f9 Backed out changeset de401d17868d (bug 1394591) 2017-09-04 00:06:51 +02:00
Jean-Yves Avenard
9b2818843f Bug 1394591 - P6. Simplify some internal codec mimetype. r=gerald
The codec mimetype is now shown in the media devtools. May as well make it readable.

MozReview-Commit-ID: 6rccDiTR24m

--HG--
extra : rebase_source : 7b8d1da8f05d0c46d5fd57b5e604ec3aed36a5f2
2017-09-01 23:04:39 +02:00
Chris Pearce
ec0ac75c45 Bug 1394648 - Switch from nsInt{Point,Rect,Size} to gfx::Int{Point,Rect,Size} in dom/media. r=jwwang
The nsRect.h and nsSize.h headers typedef nsIntRect to gfx::IntRect etc, so the
rect/size objects we use will be the same, just under a different name.
However the old headers #include a bunch of things we don't use, so we if we
use the gfx objects directly we end up with a smaller include graph.

MozReview-Commit-ID: 7S4OSqBJK9m

--HG--
extra : rebase_source : 7cc48507356ce754e8395af957fa68a28711e00a
2017-08-29 14:00:33 +12:00
JW Wang
448e22c303 Bug 1392178 - move MediaResource::CachedReadAt to MediaResourceIndex. r=gerald
MozReview-Commit-ID: LnAXXaRQ4C

--HG--
extra : rebase_source : cc041eeb94807b4e235ca2b827d4db13f1410e09
extra : intermediate-source : fd1bff4bb32ae8cefd909d709d28a229e35fa110
extra : source : 677ede60ac88260d779502d25102c7a66bf0d65c
2017-08-21 14:33:38 +08:00
Chris Pearce
38854683c2 Bug 1390748 - Remove unnecessary includes in *Decoders. r=jwwang
MozReview-Commit-ID: 3bfAdpopOfp

--HG--
extra : rebase_source : c9b0a0991d731b38d3f077f90cd4f79b6470fe38
2017-08-16 17:19:39 +12:00