Commit Graph

476 Commits

Author SHA1 Message Date
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
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
aa33941822 Bug 1014393 - Add gtests for the standalone muxer. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D35307

--HG--
extra : moz-landing-system : lando
2019-07-12 13:41:15 +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
a539255bf2 Bug 1014393 - Move AudioGenerator to its own files so it can be used in more media gtests. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D35389

--HG--
extra : moz-landing-system : lando
2019-07-12 13:41:08 +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
Andreas Pehrson
1abbf5c0b9 Bug 1558890 - Give more leeway to VideoFrameConverterTest::ClearFutureFramesOnJumpingBack. r=dminor
This does two things:
- Makes times relative to current time, with the only constraint that not a
  whole second may pass after the first frame, since that will trigger the
  same-frame timer.
- Changes asserts to use TimeDuration instead of TimeStamp for understandable
  logs.

This has proven needed on some macosx machines.

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

--HG--
extra : moz-landing-system : lando
2019-06-27 20:14:41 +00:00
Chris Pearce
42fd2adbaa Bug 1558364 - Add MediaSpan and use it for TrackBuffersManager::mInputBuffer. r=jya
As seen in this profile of a Twitch replay: https://perfht.ml/2K9Ydb3 we can
often end up spending time in TrackBuffersManager::CodedFrameProcessing()
shaving off bytes from the front off TrackBuffersManager::mInputBuffer. This
requires all the remaining bytes to be memmove'd down to the start of this
array. Sometimes we have close to 1MB in that buffer, and when we're just
trying to consume a few hundred bytes, that becomes high overhead.

So intead of using this "slice off, shuffle down" approach change
TrackBuffersManager::mInputBuffer to be a new type MediaSpan, which maintains a
RefPtr to a MediaByteBuffer and a span defining the subregion of the buffer we
care about. This means the RemoveElementsAt(0,N) operation becomes basically
free, and we can eliminate a few other copies we were doing as well.

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

--HG--
extra : moz-landing-system : lando
2019-06-14 02:10:09 +00:00
Brindusan Cristian
a7f24acb4b Backed out 2 changesets (bug 1558364) for build bustages at MediaSpan.h. CLOSED TREE
Backed out changeset 098ce3586133 (bug 1558364)
Backed out changeset 2e64d8db2b4b (bug 1558364)
2019-06-14 03:48:51 +03:00
Chris Pearce
d5f83d4740 Bug 1558364 - Add MediaSpan and use it for TrackBuffersManager::mInputBuffer. r=jya
As seen in this profile of a Twitch replay: https://perfht.ml/2K9Ydb3 we can
often end up spending time in TrackBuffersManager::CodedFrameProcessing()
shaving off bytes from the front off TrackBuffersManager::mInputBuffer. This
requires all the remaining bytes to be memmove'd down to the start of this
array. Sometimes we have close to 1MB in that buffer, and when we're just
trying to consume a few hundred bytes, that becomes high overhead.

So intead of using this "slice off, shuffle down" approach change
TrackBuffersManager::mInputBuffer to be a new type MediaSpan, which maintains a
RefPtr to a MediaByteBuffer and a span defining the subregion of the buffer we
care about. This means the RemoveElementsAt(0,N) operation becomes basically
free, and we can eliminate a few other copies we were doing as well.

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

--HG--
extra : moz-landing-system : lando
2019-06-14 00:31:02 +00:00
David Major
59dad3d157 Bug 1556738 - Tighten up some clang-cl warning allowances r=nalexander
Remove a few no-longer-necessary `AllowCompilerWarnings()` before anything that depends upon them sneaks in.

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

--HG--
extra : moz-landing-system : lando
2019-06-04 16:17:14 +00:00
Andreas Pehrson
4b297e5e1e Bug 1537986 - Make MediaSourceEngine::GetSettings mandatory. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D32960

--HG--
extra : moz-landing-system : lando
2019-05-31 10:54:56 +00:00
Jan Beich
83616a086b Bug 1552652 - Unbreak building tests on Tier3 after bug 1545079. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D31756

--HG--
extra : moz-landing-system : lando
2019-05-20 09:06:35 +00:00
Alex Chronopoulos
ec7353c721 Bug 1545079 - Create a gtest that exercises revive method of AudioCallbackDriver. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D30890

--HG--
extra : moz-landing-system : lando
2019-05-14 15:27:06 +00:00
Alex Chronopoulos
77b1b7585c Bug 1545079 - Enhance MockCubeb class to simulate a cubeb stream. r=padenot
On MochCubeb add a fake audio thread and the corresponding methods for stream_{init,start,stop,destroy}.

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

--HG--
extra : moz-landing-system : lando
2019-05-17 16:38:04 +00:00
Alex Chronopoulos
feeaa94e0d Bug 1545079 - Move MockCubeb on a seperate reusable header. r=padenot
Extract the existing MockCubeb logic from TestAudioDeviceEnumerator to a separate reusable header.

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

--HG--
extra : moz-landing-system : lando
2019-05-14 15:26:15 +00:00
Chris Pearce
b64a2d776d Bug 1538023 - Add support for -Inf to media::TimeUnits. r=jya
TimeUnits with a negative infinity value are used in the next patch.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 06:27:03 +00:00
Geoff Brown
18638f8bc4 Bug 1545235 - Enable some android gtests in dom/media/gtest; r=jmaher
With changes from bug 1548555, some of the gtests previously disabled on Android
can be re-enabled.

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

--HG--
extra : moz-landing-system : lando
2019-05-06 18:53:54 +00:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Geoff Brown
8d88b9a596 Bug 1318091 - Disable failing android gtests; r=bc
Disable gtests observed to fail on Android. Some of these are simple build
failures and failures due to file permissions or paths, while other failures
are more obscure.
Once Android gtests are running on mozilla-central, I will file follow-up
bugs inviting teams to investigate the failures and re-enable Android gtests
that are important to them.

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

--HG--
extra : moz-landing-system : lando
2019-04-08 20:58:21 +00:00
Sylvestre Ledru
03fc65347c Bug 1542146 - Apply the change with the option StatementMacros from clang-format-8 r=andi
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:42:17 +00:00
Sylvestre Ledru
03c8e8c2dd Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:41:42 +00:00
Csoregi Natalia
ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru
d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu
24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru
399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Chun-Min Chang
303117e873 Bug 1500713: P5 - Unit test for BufferReader. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D22814

--HG--
extra : moz-landing-system : lando
2019-03-29 23:38:29 +00:00
Chun-Min Chang
949167ee63 Bug 1500713: P4 - Return NullableTimeUnit from MP3TrackDemuxer::Duration(). r=jya
Differential Revision: https://phabricator.services.mozilla.com/D24302

--HG--
extra : moz-landing-system : lando
2019-03-29 23:38:29 +00:00
Chun-Min Chang
321883e56f Bug 1500713: P1 - MP3 Test for the files with VBRI headers. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D19096

--HG--
extra : moz-landing-system : lando
2019-03-29 23:38:27 +00:00
Andreas Pehrson
45fe07077f Bug 1494675 - Remove AllocationHandle. r=padenot
The handle was used to keep separate allocations of the same source in a single
process apart. Sources no longer use sharing, so we no longer need allocations
or their handles even as a concept.

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

--HG--
extra : moz-landing-system : lando
2019-03-27 14:10:24 +00:00
Andreas Pehrson
fac5e5cbd3 Bug 1538232 - Add gtests for TestVideoTrackEncoder handling MediaDecoder seek and pause. r=bryce
With bug 1423253 we need to handle resetting future frames directly, and that
bug made the signaling of when to reset a bit more explicit, so a null image
is sent when a MediaDecoder is paused, so we don't render frames that were
already buffered, but after the pause took effect. And an image where the
time stamp is earlier than the previous frame's is sent when a MediaDecoder
seeks, as it intends to discard any previously buffered frames and render
only the new ones.

Note that this hackish way of signaling a MediaDecoder's intention comes from
the fact that we have only an append-based API for pushing frames through a
track, but the MediaDecoder's behavior is tightly coupled to the ImageContainer
API of sending frames to the compositor; SetCurrentFrames.

We will be iterating towards a SetCurrentFrames-like API for video tracks in the
future, to have a cleaner solution to this problem.

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

--HG--
extra : moz-landing-system : lando
2019-03-25 14:45:21 +00:00
Andreas Pehrson
f415a5ea4e Bug 1538113 - Format YUVBufferGenerator. r=dminor
This removes windows line endings throughout the files, and clang-formats them.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 16:44:49 +00:00
Andreas Pehrson
a455b2a38a Bug 1538113 - Fix TestVideoTrackEncoder static-analysis warnings. r=bryce
Initially indicated by https://phabricator.services.mozilla.com/D22909#inline-140683
Some more found by ./mach static-analysis check dom/media/gtest/TestVideoTrackEncoder.cpp

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

--HG--
extra : moz-landing-system : lando
2019-03-22 16:43:28 +00:00
Paul Adenot
56f452b5fb Bug 1423253 - Really unbreak MINGW builds for video TestVideoFrameConverter, by not building it when WebRTC is disabled.
Differential Revision: https://phabricator.services.mozilla.com/D24499

--HG--
extra : moz-landing-system : lando
2019-03-22 13:03:09 +00:00
Paul Adenot
8a57bf6e92 Bug 1423253 - Unbreak MINGW by defining WEBRTC_WIN manually.
Differential Revision: https://phabricator.services.mozilla.com/D24496

--HG--
extra : moz-landing-system : lando
2019-03-22 12:31:31 +00:00
Andreas Pehrson
ae7831e5ad Bug 1423253 - Handle MediaDecoder pauses when future frames are already buffered. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D23588

--HG--
extra : moz-landing-system : lando
2019-03-22 11:45:51 +00:00
Andreas Pehrson
9e33da2826 Bug 1423253 - Make future frames in VideoTrackEncoder black when a track is disabled. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D22931

--HG--
extra : moz-landing-system : lando
2019-03-22 11:45:28 +00:00
Andreas Pehrson
021e97c215 Bug 1423253 - Make future frames in MediaPipeline black when a track is disabled. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D22928

--HG--
extra : moz-landing-system : lando
2019-03-22 11:45:15 +00:00
Andreas Pehrson
74e1a2c0aa Bug 1423253 - Drop old frames before they get processed in VideoFrameConverter. r=padenot
To avoid building up a queue of frames when the machine cannot keep up.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 11:44:40 +00:00
Andreas Pehrson
c459274366 Bug 1423253 - Pace future video frames in MediaPipeline. r=dminor,padenot
WebRTC.org doesn't handle receiving multiple future frames.
This will buffer future frames from a direct listener in MediaPipeline
and pass them on when the frame's wall clock timestamp has been reached.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 11:45:27 +00:00
Bryce Van Dyk
72efbe5517 Bug 1423253 - Move YUVBufferGenerator into its own files so it can be used by other media gtests. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D24234

--HG--
extra : moz-landing-system : lando
2019-03-22 11:45:25 +00:00
Andreas Pehrson
309b7a1eb8 Bug 1423253 - Make a VideoTrackEncoder gtest more explicit. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D22915

--HG--
extra : moz-landing-system : lando
2019-03-22 11:43:40 +00:00
Andreas Pehrson
e57962eea8 Bug 1423253 - Remove durations from VideoSegment::AppendFrame. r=padenot
VideoSegments still have durations, and they are still needed by the
MediaStreamGraph as it shuffles MediaSegments around.
They do not have a say in the wall-clock duration of video frames however.
Removing this should prevent any producers starting to add video chunks with
durations in the future.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 11:43:40 +00:00
Andreas Pehrson
04fb07dce9 Bug 1423253 - Disregard VideoChunk durations in VideoTrackEncoder. r=padenot
Long-term we want to lift durations out of video altogether, and only use
wall-clock timestamps. This patch achieves this in VideoTrackEncoder.

When the MediaStreamGraph is audio-only, the equivalent for video will be
completely duration-less. Until we have that, some pieces around the MSG will
still need durations for track-bookkeeping reasons.

This also integrates the DriftCompensator into VideoTrackEncoder, by
compensating for drift when frames are moved from mIncomingBuffer to
mOutgoingBuffer, i.e., when we recalculate time stamps into durations for the
underlying encoder to use.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 11:43:08 +00:00
Andreas Pehrson
e5ffaa1966 Bug 1423253 - Remove support for direct audio listeners from AudioTrackEncoder. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D22906

--HG--
extra : moz-landing-system : lando
2019-03-22 11:42:49 +00:00
Andreas Pehrson
097ee23c9e Bug 1423253 - Add drift compensation to MediaEncoder. r=padenot
This plumbs the DriftCompensator into the AudioTrackListener and
VideoTrackEncoder. The VideoTrackEncoder is however only finally integrated in
the future patch "Disregard VideoChunk durations in VideoTrackEncoder".

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

--HG--
extra : moz-landing-system : lando
2019-03-22 11:42:38 +00:00
Andreas Pehrson
a5346ec96d Bug 1423253 - Add a drift compensator to reclock video timestamps. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D22902

--HG--
extra : moz-landing-system : lando
2019-03-22 11:42:31 +00:00
Alex Chronopoulos
026c81cfc9 Bug 1534313 - Add new method in enumerator to get the device info from device name. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D22987

--HG--
extra : moz-landing-system : lando
2019-03-19 10:40:05 +00:00
shindli
8940f3f1cb Backed out 4 changesets (bug 1534313) for causing a perfmafailing Gtest in /builds/worker/workspace/build/application/firefox/gmp-clearkey CLOSED TREE
Backed out changeset fe17244230e8 (bug 1534313)
Backed out changeset fc232edfe6e8 (bug 1534313)
Backed out changeset eae4a9ff0b9b (bug 1534313)
Backed out changeset f4252f238b68 (bug 1534313)
2019-03-18 18:53:33 +02:00