Commit Graph

261 Commits

Author SHA1 Message Date
Christian Holler
92b529251c Bug 1567444 - Check start and end time validity in AudioTrimmer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D38652

--HG--
extra : moz-landing-system : lando
2019-07-23 00:55:07 +00:00
alwu
441473d744 Bug 1563949 - part4 : prevent direct usage of 'AppendElement()' to append sample. r=jya
We should always append sample by using `AppendSample()` to assert whether a sample is valid, so making `mSamples` private can prevent a direct usage of the nsTarry's `AppendElement()`.
Also provide a method to return non-const mSamples which is only used for the move semantics.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 21:11:21 +00:00
alwu
44cfc7989a Bug 1563949 - part3 : handle invalid sample in demuxer. r=jya
Return demux error when we get a invalid sample. For mp4 demuxer, we use `MOZ_DIAGNOSTIC_ASSERT` instead because we are pretty sure that it won't happen.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 20:48:15 +00:00
alwu
424b48c982 Bug 1563949 - part2 : add 'AppendSample' to assert that a sample should always be valid r=jya
We don't want to have a sample with invalid time, duration, end time or end timecode, so add a diagnostic assertion to check. And will handle invalid sample for demuxers in next patch.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 20:16:26 +00:00
Christian Holler
8cfda79e0d Bug 1465407 - Add media fuzzing targets. r=jya
Depends on D35776

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

--HG--
extra : moz-landing-system : lando
2019-07-16 14:50:17 +00:00
Mihai Alexandru Michis
e0b0dfa5eb Backed out 15 changesets (bug 1014393) for causing bustages in TestMuxer.cpp and gmock-internal-utils.h CLOSED TREE
Backed out changeset 0ddbdbfa87f6 (bug 1014393)
Backed out changeset 37399c83d3bf (bug 1014393)
Backed out changeset fe652475a785 (bug 1014393)
Backed out changeset 2812ca77d87d (bug 1014393)
Backed out changeset 6755ef7b361c (bug 1014393)
Backed out changeset 72e545bdcce3 (bug 1014393)
Backed out changeset 2f030ee55722 (bug 1014393)
Backed out changeset e9416b502170 (bug 1014393)
Backed out changeset 5a01d6d44634 (bug 1014393)
Backed out changeset 3457a5065dc4 (bug 1014393)
Backed out changeset 2a4999e0475b (bug 1014393)
Backed out changeset 0be3804dc04e (bug 1014393)
Backed out changeset 234994d8f136 (bug 1014393)
Backed out changeset d17f91ff2014 (bug 1014393)
Backed out changeset 25f58baa8159 (bug 1014393)

--HG--
rename : dom/media/encoder/EncodedFrame.h => dom/media/encoder/EncodedFrameContainer.h
2019-07-12 17:18:23 +03:00
Andreas Pehrson
221a8dfeca Bug 1014393 - Use undef-after-def pattern in MediaRecorder and related files. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D37700

--HG--
extra : moz-landing-system : lando
2019-07-12 13:42:00 +00:00
Andreas Pehrson
2e37cdaa99 Bug 1014393 - Break out muxing and queueing of track data from MediaEncoder to new Muxer class. r=bryce
This first of all does some refactoring of how metadata is encoded in
MediaEncoder. This is now guided by the new Muxer class. If we're ready to pass
data to the muxer and it does not have metadata yet, we provide metadata before
giving it any media data. This metadata is passed to the muxer in a single call.
The metadata provided in this call must stay valid for the entire recording.
This removes MediaEncoder::GetEncodedMetadata().

This also removes the ctor argument from the WebMWriter since it can now rely on
the single SetMetadata() instead.
To comply with the ContainerWriter::SetMetadata() docs,
WebMWriter::SetMetadata() will now also sanity check metadata.

ContainerWriter instances are updated somewhat, to accommodate these changes.

Lastly, and most important, the new Muxer class manages muxing of the (up to)
two tracks into a single container, ensuring that timestamps increase
monotonically throughout a recording.

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

--HG--
extra : moz-landing-system : lando
2019-07-12 13:41:15 +00:00
Bryce Van Dyk
f767feb399 Bug 1014393 - Update EncodedFrame class to more closely resemble MediaData class. r=pehrsons
This changes EncodedFrame to behave more like MediaData, so that EncodedFrame
can be used with the MediaQueue data structure. It also provides a somewhat
more consistent interface across media data types.

MozReview-Commit-ID: I2o6n30ErxB

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

--HG--
extra : moz-landing-system : lando
2019-07-12 13:40:47 +00:00
Bryce Van Dyk
79c5e43bd4 Bug 1014393 - Remove EncodedFrameContainer. r=pehrsons
Remove EncodedFrameContainer and clean up areas where it was used.
EncodedFrameContainer provided a wrapper around an
nsTArray<RefPtr<EncodedFrame>>, but it simplifies the code to simply expose
this array. Also clean up unused enums in EncodedFrame, and clean up some of
the outdated comments for our encoded frame handling.

MozReview-Commit-ID: Bh3VKesVoJE

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

--HG--
rename : dom/media/encoder/EncodedFrameContainer.h => dom/media/encoder/EncodedFrame.h
extra : moz-landing-system : lando
2019-07-12 13:40:33 +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
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
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
Nathan Froyd
b0bda317b7 Bug 1507922 - make ownership of MetadataTags more clear in the ogg code; r=gerald,jya
Use UniquePtr for return types, so it's obvious who has ownership.
2018-11-20 10:10:31 -05: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
0bb982d5d5 Bug 1502488 - Fix opus mapping 2 channels count check. r=padenot
Add gtest

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

--HG--
extra : moz-landing-system : lando
2018-10-29 09:44:18 +00:00
Jean-Yves Avenard
0d443a3096 Bug 1482605 - Don't error on Opus channel mapping version 2. r=padenot
We do not perform any channels placement, instead we leave the channels in the order they come in.

Add corresponding tests.

Differential Revision: https://phabricator.services.mozilla.com/D3153
2018-08-14 14:38:42 +02: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
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
Jean-Yves Avenard
f44bc2efdb Bug 1409664 - P6. Remove flac in ogg preference. r=bryce
Summary:
Let's always enable it.

Depends on D1618

Tags: #secure-revision

Bug #: 1409664

Differential Revision: https://phabricator.services.mozilla.com/D1619
2018-07-03 11:45:17 -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
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Jean-Yves Avenard
6edfbc05e3 Bug 1444479 - P6. Make Opus and Vorbis decoder deal with more channels than 8. r=padenot
Under 8 channels, the audio will be reordered so it can be playable on any platforms.
Over 8 channels, the channels will be as output by the decoder. Playing of such stream will be platform dependent as neither Opus nor Vorbis define a channel layout with more than 8 channels.

With WebAudio however, the result will be platform independent (as long as you don't attempt to play it)

MozReview-Commit-ID: 93ATiKm9y20
2018-03-24 10:58:01 +01:00
Videet
01ad0f3438 Bug 547707: replaced hardcoded strings by definitions in nsMimeTypes.h r=gerald
MozReview-Commit-ID: 6f85pRUe8Tg

--HG--
extra : rebase_source : f41797530bf9211f3fe875a5da860132f5bd2c7c
2018-03-06 17:43:57 +01:00
Chris Peterson
37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
JW Wang
5efcbcb3a8 Bug 1427932. P2 - fix the calculation of |endTime|. r=jya
MozReview-Commit-ID: 2a8FxMdgM8e

--HG--
extra : rebase_source : a287b19c5c2d6d3c5a2fb454c14b390f60e63667
extra : source : 49211ab256d7742cf83b16e6a2fa6ed3d53f1b46
2018-01-04 11:10:19 +08:00
JW Wang
b23b5d2214 Bug 1427932. P1 - replace NS_ASSERTION with MOZ_ASSERT to catch more bugs. r=jya
MozReview-Commit-ID: H5SNFz956nG

--HG--
extra : rebase_source : 8ee27dabc1cda0b4001464a1d78705aa2a306cd5
extra : source : ab0dab8a566c0090dd900a9fbcdd97cc7b622cbc
2018-01-04 11:09:54 +08:00
Gurzau Raul
5ec8060d2b Backed out 2 changesets (bug 1427932) for failures on tests/browser/chrome/test_media_playback.html r=backout on a CLOSED TREE
Backed out changeset fbae5269d99a (bug 1427932)
Backed out changeset 8b7cc135f1a5 (bug 1427932)
2018-01-10 11:08:57 +02:00
JW Wang
d7381b7711 Bug 1427932. P2 - fix the calculation of |endTime|. r=jya
MozReview-Commit-ID: 2a8FxMdgM8e

--HG--
extra : rebase_source : a287b19c5c2d6d3c5a2fb454c14b390f60e63667
extra : source : 49211ab256d7742cf83b16e6a2fa6ed3d53f1b46
2018-01-04 11:10:19 +08:00
JW Wang
02d2fed70e Bug 1427932. P1 - replace NS_ASSERTION with MOZ_ASSERT to catch more bugs. r=jya
MozReview-Commit-ID: H5SNFz956nG

--HG--
extra : rebase_source : 8ee27dabc1cda0b4001464a1d78705aa2a306cd5
extra : source : ab0dab8a566c0090dd900a9fbcdd97cc7b622cbc
2018-01-04 11:09:54 +08:00
JW Wang
7faefe8a6c Bug 1428682 - set MediaData::mOffset properly in OggDemuxer. r=jya
mOffset is important for MediaCache to evaluate the playback rate in bytes for
a live stream. Failing to set this field (initially 0) will cause MediaCache to
assume very low playback rate (in bytes) and not to download enough bytes for
decoder to consume without underflow.

This issue is manifested by bug 1427527 where a live ogg stream is played.

MozReview-Commit-ID: JiaXtpWCl09

--HG--
extra : rebase_source : af5928fd616058d4cbe1679e4ed2149641795b89
extra : intermediate-source : e31743f828f783845ad13fbbb23fb0b6af8ccb45
extra : source : 4ea2a67444f783724d9151be4f08878b50895a54
2018-01-08 10:21:59 +08:00
Alastor Wu
0963f88b98 Bug 1417300 - store mDecodedAudioDuration before adjusting sample time. r=jya
mDecodedAudioDuration should only save unadjusted timestamp, or it would
cause next adjustment to be incorrect.

MozReview-Commit-ID: 7grtYs075p0

--HG--
extra : rebase_source : ad146e7c34b6154629c1ff98992d5c0209d3ef80
2017-12-11 00:03:51 +08: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
50105cec03 Bug 1417300 - adjust sample time before calculating the total decoded duration. r=jya
We do not want to perform the adjustment of the timestamp after reading the ogg
chain but before. Otherwise the parent's mDecodedAudioDuration would be adjusted
causing the sample's time to be twice the value it should be.

MozReview-Commit-ID: 50VrOCzrwFg

--HG--
extra : rebase_source : 48b1efecb138ca7fa0e4c0584e21be1b6850cce3
2017-12-01 10:54:13 +08:00
Alfredo.Yang
41a2709293 Bug 1411525 - use BufferReader in flac/ogg parser. r=kinetik
MozReview-Commit-ID: 5chnxLnpqmY

--HG--
extra : rebase_source : 85e68812f1d354813ae36731a5a36bfe7f58c2e2
2017-10-19 10:16:32 +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
Alastor Wu
a08c8019d2 Bug 1398139 - part2 : adjust sample's start time for chained ogg. r=jya
For chained ogg files, the new part would contain new timestamp from zero, so
we need to add the duration of previously decoded data to make sure the current
time is correct.

MozReview-Commit-ID: Bb1lCiKz4uQ

--HG--
extra : rebase_source : 5cfd81eb092a042e6394aa5209516ad75e741a37
2017-09-15 18:05:10 +08:00
Gerald Squelart
7dbe315e25 Bug 1398999 - nsDequeFunctor::operator() doesn't need to return anything - r=froydnj
Its return value is never used, and most implementations return nullptr anyway.

MozReview-Commit-ID: 8rxC053mmE8

--HG--
extra : rebase_source : 61a0b8b1373396182efd27d3c01b96e5e5541364
2017-02-09 14:06:36 +11: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
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
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
Chris Pearce
09b9dbe471 Bug 1390748 - Remove ChannelMediaDecoder::CloneImpl() and remove subclasses of ChannelMediaDecoder. r=jwwang
MozReview-Commit-ID: 6nlBArYgwEJ

--HG--
extra : rebase_source : 5a87dfe0d77fc23d36a4f57452322c39d720698c
2017-08-15 17:52:17 +12:00
Chris Pearce
502cbde454 Bug 1390748 - Remove OggDecoder::CreateStateMachine(). r=jwwang
MozReview-Commit-ID: 2JgZ2Ppv6as

--HG--
extra : rebase_source : 5ce2fe9136dcd32f62f7de0e85523cdcda8fa206
2017-08-15 16:21:35 +12:00
Carsten "Tomcat" Book
c6627dee5c Backed out changeset 57be2e971ae2 (bug 1390748) for bustage
--HG--
extra : rebase_source : d698de5ec05677e010c0a47f27a1753c40acb90d
2017-08-17 08:37:17 +02:00