Commit graph

7 commits

Author SHA1 Message Date
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Yves Gerey
988cc0870b [Cleanup] Add missing #include. Remove useless ones.
This CL is the result of running include-what-you-use tool on part
of the code base (audio target and dependencies) plus manual fixes.

bug: webrtc:8311
Change-Id: I277d281ce943c3ecc1bd45fd8d83055931743604
Reviewed-on: https://webrtc-review.googlesource.com/c/106280
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25311}
2018-10-23 11:32:56 +00:00
Alex Loiko
03ad9b892c Fine-grained limiter metrics.
The FixedGainController is used in two places.
One is the AudioMixer. There it's used to limit the audio level after
adding streams. The other is GainController2, where it's placed after
steps that could boost the audio level outside the allowed range.

We log metrics from the FGC. To avoid confusion, this CL makes the two
use cases log to different histograms.

Chromium histogram CL is
https://chromium-review.googlesource.com/c/chromium/src/+/1170833

Bug: webrtc:7494
Change-Id: I1abe60fd8e96556f144d2ee576254b15beca1174
Reviewed-on: https://webrtc-review.googlesource.com/93464
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24284}
2018-08-15 08:32:18 +00:00
Alex Loiko
250155d0db Fix histogram logging in InterpolatedGainCurve.
We had the following pattern:

if (case_A) metric = METRIC_A;
if (case_B) metric = METRIC_B;
RTC_HISTOGRAM_COUNTS_10000(metric, value);

That's wrong, because once the logging macro runs once, it will use
the same histogram no matter what the first argument is. The macro
expands into roughly

static Histogram* histogram_ptr = nullptr;
if (histogram_ptr == nullptr) {
  // Look up the histogram and put in histogram_ptr
}
// Add data through the histogram pointer.

We change the logging to use macros with string literals. We add a
macro for every of the 4 possible invocations. The macros will expand
to one static pointer each.

Bug: webrtc:8925
Change-Id: Ic7e4a6299eff31dd5988047edfcedce7d369e5ce
Reviewed-on: https://webrtc-review.googlesource.com/64724
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22606}
2018-03-26 14:17:00 +00:00
Alex Loiko
b9a02e523c Change place of UMA logging in AudioMixer.
And fix typo in UMA metric.

We have this pattern in the FrameCombiner component of the AudioMixer:

  if (number_of_streams <= 1) {
    // Copy or fill with zeros.
    return;
  }
  // Mix and limit
  LogMixingStats(/* args */);

When there is only one remote stream, info about active streams and
sample rate is not logged. This CL moves the call to log stats before
the 'return'.

Bug: webrtc:8925
Change-Id: I7b54f61f628273631909dafbfafa21e155e18d4a
Reviewed-on: https://webrtc-review.googlesource.com/62860
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22493}
2018-03-19 14:10:51 +00:00
Alex Loiko
6f2fcb4962 Add more Audio Mixer and Fixed Gain Controller metrics.
We want to know how the AudioMixer is used and how FixedGainController
behaves.

The WebRTC.Audio.Agc2.FixedDigitalGainCurveRegion.* metrics measures
how often the input level hits different regions of the Fixed Gain
Controller gain curve (when the limiter is enabled). They also measure
how long the metrics stay in different regions. They are related to
WebRTC.Audio.ApmCaptureOutputLevelPeakRms, but the new metrics measure
the level before any processing done in APM.

The AudioMixer mixes incoming audio streams. Their number should be
mostly constant, and often some of them could be muted. The metrics
WebRTC.Audio.AudioMixer.NumIncomingStreams,
WebRTC.Audio.AudioMixer.NumIncomingActiveStreams log the number of
incoming stream and how many are not muted. We currently don't have
any stats related to that.

The metric WebRTC.Audio.AudioMixer.MixingRate logs the rate selected
for mixing. The rate can sometimes be inferred from
WebRTC.Audio.Encoder.CodecType. But that metric measures encoding and
not decoding, and codecs don't always map to rates.

See also accompanying Chromium CL
https://chromium-review.googlesource.com/c/chromium/src/+/939473

Bug: webrtc:8925
Change-Id: Ib1405877fc1b39e5d2f0ceccba04434813f20b0d
Reviewed-on: https://webrtc-review.googlesource.com/57740
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22443}
2018-03-15 10:51:06 +00:00
Alex Loiko
a05ee82c4c Fixed Digital mode of AGC2 implementation finished.
This CL adds the GainCurveApplier (GCA). It owns a
FixedDigitalLevelEstimator (LE) and an InterpolatedGainCurve
(IGC). The GCA uses the LE to compute the input signal level, looks up
a gain from IGC and applies it on the signal.

The other IGC and LE submodules were added in previous CLs [1] and
[2].

This CL also turns on AGC2 in the APM fuzzer.

[1] https://webrtc-review.googlesource.com/c/src/+/51920
[2] https://webrtc-review.googlesource.com/c/src/+/52381

Bug: webrtc:7949
Change-Id: Idb10cc3ca9d6d2e4ac5824cc3391ed8aa680f6cd
Reviewed-on: https://webrtc-review.googlesource.com/54361
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22103}
2018-02-20 15:59:25 +00:00