Граф коммитов

729 Коммитов

Автор SHA1 Сообщение Дата
Andreas Pehrson b8cbd64557 Bug 1651745 - Change MediaEngineSource::SetTrack to take a MediaTrack base class. r=padenot
This allows us to pass in different sub classes, which the next patch will do.

Differential Revision: https://phabricator.services.mozilla.com/D95933
2020-11-05 16:42:07 +00:00
Andreas Pehrson 7b6488e143 Bug 1651745 - Memoize the max channel count in AudioSegment::MaxChannelCount(). r=padenot
When an AudioCallbackDriver starts a fallback SystemClockDriver is running in
its stead. The AudioTrack getting fed data from the input stream of the driver
will get real data while the AudioCallbackDriver is running, and silence while
the fallback driver is running.

If the MediaStreamTrack representing the microphone source is part of a
MediaStream being played by an HTMLMediaElement; and another MediaStreamTrack
representing another source with a lower channel count than the microphone is
part of another MediaStream being played by another HTMLMediaElement; then:
1. We start the graph with the other source's output channel count, and a
   fallback driver.
2. Once the audio driver has started, it adds data at a higher channel count
   than the graph's to its MediaTrack. The driver switches audio driver to
   match the new channel count.
3. The new driver starts with a fallback driver, which adds silence to the
   track. Silence has no channel count, so the graph sees only the channel
   count of the other source and switches audio driver to match this.
4. Go to 1.

This patch fixes makes us memoize a previously returned max channel count for an
AudioSegment for use when there is only null data (e.g., silence) present in the
segment. This applies to step 3 above, where no audio driver would be switched
because the graph still sees the mic's channel count.

Differential Revision: https://phabricator.services.mozilla.com/D95931
2020-11-05 15:34:04 +00:00
John Lin 5a219579ad Bug 1640416 - p3: add test cases for video encoder config size. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D94462
2020-11-05 01:30:31 +00:00
Sylvestre Ledru fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila 964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru 5f29324f60 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Andi-Bogdan Postelnicu 7e612d6c92 Bug 1671641 - Make `dom/media/gtest` buildable outside of `unified-build` environment. r=sg
Depends on D94985

Differential Revision: https://phabricator.services.mozilla.com/D94991
2020-10-28 16:30:30 +00:00
Andreas Pehrson 32fa8ec95b Bug 1657246 - Test that an AudioCallbackDriver restarts after an error. r=padenot
This change looks bigger than it intuitively should. This is because it adds an
input while we wait for the restart.

When we are on the fallback driver, it will only run (from EnsureNextIteration)
if it needs to, i.e., if there are commands or data to process. We open an audio
input that will generate data for the graph, keeping the fallback driver
running.

We could have kept it running in other ways too, but this seemed easier to
regress without noticing -- an active input that sees an error and then
restarting it doesn't work.

Differential Revision: https://phabricator.services.mozilla.com/D94567
2020-10-28 09:37:04 +00:00
Andreas Pehrson 8626145948 Bug 1657246 - Properly stop the MockCubebStream after forcing an error in it. r=padenot
Without this MockCubeb will call into this (destroyed) stream again once
another stream exists.

Differential Revision: https://phabricator.services.mozilla.com/D94565
2020-10-28 00:58:22 +00:00
Andreas Pehrson 34167ca7be Bug 1657246 - Split MockCubeb into .h and .cpp. r=padenot
This lets MockCubebStream methods reference MockCubeb instances.

Differential Revision: https://phabricator.services.mozilla.com/D94563
2020-10-28 00:58:13 +00:00
Csoregi Natalia 4e9f1c5359 Backed out 6 changesets (bug 1657246) for mingw bustage on TestAudioTrackGraph.cpp. CLOSED TREE
Backed out changeset a7c8f608a2f4 (bug 1657246)
Backed out changeset 9ee3d71303c6 (bug 1657246)
Backed out changeset fbba0ed1f3e9 (bug 1657246)
Backed out changeset e7d0acdef9c3 (bug 1657246)
Backed out changeset 0382b9eb2507 (bug 1657246)
Backed out changeset 28d15a125fed (bug 1657246)
2020-10-28 02:50:05 +02:00
Andreas Pehrson 4e03ba3415 Bug 1657246 - Test that an AudioCallbackDriver restarts after an error. r=padenot
This change looks bigger than it intuitively should. This is because it adds an
input while we wait for the restart.

When we are on the fallback driver, it will only run (from EnsureNextIteration)
if it needs to, i.e., if there are commands or data to process. We open an audio
input that will generate data for the graph, keeping the fallback driver
running.

We could have kept it running in other ways too, but this seemed easier to
regress without noticing -- an active input that sees an error and then
restarting it doesn't work.

Differential Revision: https://phabricator.services.mozilla.com/D94567
2020-10-27 14:38:31 +00:00
Andreas Pehrson 3594402f0a Bug 1657246 - Properly stop the MockCubebStream after forcing an error in it. r=padenot
Without this MockCubeb will call into this (destroyed) stream again once
another stream exists.

Differential Revision: https://phabricator.services.mozilla.com/D94565
2020-10-27 14:37:35 +00:00
Andreas Pehrson 9639dbe74b Bug 1657246 - Split MockCubeb into .h and .cpp. r=padenot
This lets MockCubebStream methods reference MockCubeb instances.

Differential Revision: https://phabricator.services.mozilla.com/D94563
2020-10-27 19:46:56 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bryce Seager van Dyk 3b9b491f8b Bug 1669570 - Rename MediaController thread to MediaSupervisor. r=jya
This renames the thread and identifiers derived from the thread's name. This is
to avoid ambiguity over if the thread relates to the MediaController class,
which it does not.

Differential Revision: https://phabricator.services.mozilla.com/D93806
2020-10-26 15:13:37 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Matthew Gregan 5c30deb871 Bug 1670917 - Update cubeb_ops layout in MockCubeb. r=cubeb-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D94202
2020-10-21 09:24:20 +00:00
Andreas Pehrson 018bbad6a7 Bug 1667728 - Make FrameEncode gtest pass EOS for completion. r=bryce
Without this patch, the FrameEncode gtest encoder won't encode the last bit of
data, making the total duration 20ms too short.

When passing EOS we encode the lookahead worth of silence, so this patch also
accounts for that.

Differential Revision: https://phabricator.services.mozilla.com/D91957
2020-10-07 21:59:22 +00:00
Andreas Pehrson f0d67db160 Bug 1667728 - Test that encoding with opus at various input rates produces the expected number of frames. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91954
2020-10-07 21:58:55 +00:00
Andreas Pehrson 59bacb5f29 Bug 1667728 - Decide the need for a resampler, and the output rate, at construction. r=bryce
Certain logic, like AudioOutputFramesPerPacket(), is hinged off whether a
resampler exists. The resampler is destroyed when encoding is completed, making
such logic flawed from that point. To avoid this potential footgun we can decide
the output rate at construction time, since the input rate is known then.

Differential Revision: https://phabricator.services.mozilla.com/D91953
2020-10-07 21:58:57 +00:00
Andreas Pehrson ec3a23c754 Bug 1667728 - Use only one notion of sample rate for AudioTrackEncoder. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91951
2020-10-07 22:19:37 +00:00
Andreas Pehrson 335693edce Bug 1667728 - Use TimeUnit where applicable in MediaRecorder's EncodedFrame. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91728
2020-09-30 16:18:18 +00:00
Andreas Pehrson 0c7e9d79f3 Bug 1667728 - Make MediaRecorder's EncodedFrame immutable. r=bryce
Without this patch there was a gap between the default-ctor and when real values
got set. If setting a member was forgotten, it would have needed an audit to be
found. With this patch the compiler will make sure all values have been
explicitly handed to the ctor.

mFrameData (nsTArray) becomes Refcountable to allow VP8TrackEncoder to extend
the duration of an EncodedFrame by copying the last frame's ref and constructing
a new EncodedFrame with a longer duration than the last one's.

Differential Revision: https://phabricator.services.mozilla.com/D91724
2020-09-30 16:17:43 +00:00
Andreas Pehrson 5dcb49142e Bug 1667728 - Shift responsibility of adjusting packets with opus codec delay to opus encoder. r=bryce
This was originally handled by EbmlComposer. Since bug 1014393 this was handled
by MediaEncoder. By doing it in OpusTrackEncoder we can avoid reading hardcoded
fields in the opus metadata to get the codec delay value.

Differential Revision: https://phabricator.services.mozilla.com/D91723
2020-09-30 16:17:36 +00:00
Bryce Seager van Dyk 8f3d740b92 Bug 1668099 - Fix symbols that rely on unified build order in media gtests. r=jolin
Fix up includes so AnnexB.h and TestMediaDataEncoder.cpp don't rely on unified
build order. Reformat include lists to match style guide. Rework #include guard
on AnnexB.h to reflect style guide.

Differential Revision: https://phabricator.services.mozilla.com/D91825
2020-09-30 20:19:26 +00:00
Dan Minor 45562522d9 Bug 1665166 - Updates to moz.build files; r=ng
Depends on D91318

Differential Revision: https://phabricator.services.mozilla.com/D91319
2020-09-24 18:40:21 +00:00
Andreas Pehrson 51ef39e1d8 Bug 1664010 - Increase the wait time before default-initing in AudioTrackEncoder. r=bryce
One second is a bit short given that starting bluetooth input devices takes
several seconds on some platforms. Bug 1586370 may have worsened this since we
now process silence while waiting for an input to give us data.

Differential Revision: https://phabricator.services.mozilla.com/D91140
2020-09-24 14:17:03 +00:00
Andreas Pehrson ce274e63a2 Bug 1663662 - Pass the samplerate to EncodedFrame. r=bryce
Without this, EncodedFrame is relying on hardcoded values based on frame type.
That doesn't scale well.

Differential Revision: https://phabricator.services.mozilla.com/D91138
2020-09-24 13:43:52 +00:00
Andreas Pehrson 584611dfef Bug 1663662 - Add unittest. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D91136
2020-09-24 14:18:12 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Nico Grunbaum 54d899d308 Bug 1664900 - move /media/webrtc/signaling/src to /dom/media/webrtc;r=dminor,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D90179
2020-09-23 04:22:29 +00:00
Andreas Pehrson 72f1573cfe Bug 1665889 - Hide AudioInputProcessing include behind MOZ_WEBRTC. r=padenot
This has busted the MingW build, where webrtc is not supported.
AudioInputProcessing relies on upstream webrtc for audio processing: aec, etc.

Differential Revision: https://phabricator.services.mozilla.com/D90852
2020-09-22 13:36:19 +00:00
Andreas Pehrson 496afdc93f Bug 1656438 - Tighten PreSilence checks in TestAudioTrackGraph.cpp. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D90436
2020-09-17 06:13:50 +00:00
Andreas Pehrson ae9340d553 Bug 1656438 - Tighten estimated frequency check by accounting for drift factor. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D89987
2020-09-17 06:13:42 +00:00
Andreas Pehrson 87bb8fdaac Bug 1656438 - Make integer types explicit and unsigned in AudioDriftCorrection and friends. r=padenot
In particular, this patch gets rid of signed integers where negative values
don't make sense anyway.

Differential Revision: https://phabricator.services.mozilla.com/D89777
2020-09-17 06:13:40 +00:00
Andreas Pehrson f2944241a1 Bug 1656438 - Rework the audio drift correction logic. r=padenot
This patch simplifies the logic by reducing the number of paths, from two to
one method that changes the correction. This method now weighs the calculated
correction by 60% and the previous correction by 40% when setting the new value,
to provide a negative feedback loop that stabilizes around the desired amount of
buffering.

This leads to a smoother output with less noticable changes in the correction
value, while still reaching the desired amount of buffering quickly.

Tests are updated with new expectations accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D89776
2020-09-17 06:13:32 +00:00
Andreas Pehrson b4df626959 Bug 1656438 - Avoid overflowing the internal AudioResampler ring buffer. r=padenot
Depends on D89773

Differential Revision: https://phabricator.services.mozilla.com/D89774
2020-09-17 06:13:27 +00:00
Andreas Pehrson f7d9bfd345 Bug 1656438 - Handle null chunks in AudioVerifier. r=padenot
Depends on D89772

Differential Revision: https://phabricator.services.mozilla.com/D89773
2020-09-17 06:12:46 +00:00
Andreas Pehrson c27ee87bf9 Bug 1656438 - Run all MockCubebStreams off the same fake audio thread to avoid unwanted drift. r=padenot
With this patch, there is a fake audio thread present on a MockCubeb context as
soon as one MockCubebStream is running under that context. When the last running
MockCubebStream is stopped, the fake audio thread is joined and unset.

This adds a tad bit of complexity but results in zero unwanted drift between
MockCubebStreams under the same MockCubeb context. This is essential for stable
CrossGraphTrack tests.

A side effect of this is that the drift factor of a MockCubebStream does not
affect the interval at which data is processed, but rather the amount of data
processed each interval.

This patch also allows us to process data with virtually no wait time between
iterations (as opposed to wall-time 10ms-waits), for (much) speedier tests.

Differential Revision: https://phabricator.services.mozilla.com/D89772
2020-09-17 06:13:25 +00:00
Andreas Pehrson de1db03531 Bug 1656438 - Remove unused LOG macro from MockCubeb.h. r=padenot
Depends on D89770

Differential Revision: https://phabricator.services.mozilla.com/D89771
2020-09-17 06:13:23 +00:00
Andreas Pehrson 9ff7f789dd Bug 1656438 - Add license info to MockCubeb.h. r=padenot
Depends on D89769

Differential Revision: https://phabricator.services.mozilla.com/D89770
2020-09-17 06:13:20 +00:00
Andreas Pehrson 9a25e53483 Bug 1656438 - Rid MockCubeb.h of `using namespace` lines. r=padenot
Depends on D89768

Differential Revision: https://phabricator.services.mozilla.com/D89769
2020-09-17 06:13:18 +00:00
Andreas Pehrson a90bfce223 Bug 1656438 - Spell check and nits. r=padenot
Depends on D89767

Differential Revision: https://phabricator.services.mozilla.com/D89768
2020-09-17 06:12:06 +00:00
Andreas Pehrson 6784af499b Bug 1656438 - Test odd rates in TestAudioDriftCorrection. r=padenot
Depends on D89766

Differential Revision: https://phabricator.services.mozilla.com/D89767
2020-09-17 06:11:58 +00:00
Andreas Pehrson 93bc98f901 Bug 1656438 - Verify that the current buffer is close to the desired buffer in length. r=padenot
Depends on D89763

Differential Revision: https://phabricator.services.mozilla.com/D89764
2020-09-17 06:11:36 +00:00
Andreas Pehrson f76b443915 Bug 1656438 - Get rid of NUM_OF_FRAMES from MockCubeb. r=padenot
This allows us to configure the number of frames more dynamically, and update it
on the fly to simulate drift.

Differential Revision: https://phabricator.services.mozilla.com/D89763
2020-09-17 06:11:28 +00:00