Commit graph

277 commits

Author SHA1 Message Date
Ivo Creusen
83bd29081c Remove the AudioProcessing::Create methods.
Due to the growing number of arguments, these functions are being replaced by the AudioProcessingBuilder class.

Bug: webrtc:8668
Change-Id: Ic3936fbd47d92eac22a857a678dca5fd8c029d8b
Reviewed-on: https://webrtc-review.googlesource.com/46241
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21826}
2018-01-31 13:09:39 +00:00
Ivo Creusen
09fa4b04dd Make the echo detector injectable.
This adds a generic interface for an echo detector, and makes it possible to inject one into the audio processing module.

Bug: webrtc:8732
Change-Id: I30d97aeb829307b2ae9c4dbeb9a3e15ab7ec0912
Reviewed-on: https://webrtc-review.googlesource.com/38900
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21588}
2018-01-11 15:43:01 +00:00
Ivo Creusen
5ec7e12760 Added a builder class for the AudioProcessingModule.
As the number of injectable components of the APM increases, it is become increasingly unwieldy to keep expanding the Create function with more parameters. This builder class should make it easier to inject more components in the future.

Bug: webrtc:8668
Change-Id: If91547527760486c2a4daa9696bee22ec1d7675e
Reviewed-on: https://webrtc-review.googlesource.com/34651
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21425}
2017-12-22 12:19:03 +00:00
Alex Loiko
5825aa673c Render-side pre-processing in APM.
This CL adds a way to insert a custom render-side pre-processor to
APM. The pre-processor operates in full-band mode before anything
else. Currently the render processing chain is (if everything is
enabled):

Network --> [Pre processing] --> [Band split] -->
[IntelligibilityEnhancer] --> [Echo canceller (read-only)] -->
[Band merge] --> Playout

Since the render pre processor and capture post processor have the
same interface, I renamed webrtc::PostProcessing into
webrtc::CustomProcessing.

The old APM factory method PostProcessing will be deprecated and
dependencies updated as part of webrtc:8665

NOTRY=True

Bug: webrtc:8665
Change-Id: Ia381cbf12e336d6587406a14d77243d931f69a31
Reviewed-on: https://webrtc-review.googlesource.com/29201
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21327}
2017-12-18 16:11:03 +00:00
Per Åhgren
83c4a02b76 Added metric for the delay in AEC3.
Bug: webrtc:8569
Change-Id: I659049a411654bd3a252ab29008fac467f903efd
Reviewed-on: https://webrtc-review.googlesource.com/25600
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20892}
2017-11-27 12:52:42 +00:00
Ivo Creusen
56d460902e Use the new AudioProcessing statistics everywhere.
The new interface uses optionals instead of default values, and only values that are actually used are included. To make it easy to add/remove stats in the future, the struct itself is copied around on all layers, instead of copying the values one by one. This CL also fixes a bug which caused several APM statistics to get stuck at a fixed level when there are no more receive streams (after some period where there were receive streams). Since APM doesn't know this happens, an argument was added to the GetStats call to pass this information down to APM.

Bug: webrtc:8563, b/67926135
Change-Id: I96cc008353355bb520c4523f5c5379860f73ee24
Reviewed-on: https://webrtc-review.googlesource.com/25621
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20877}
2017-11-24 18:17:39 +00:00
Gustaf Ullberg
09b9faed53 APM reports AEC3 ERL and ERLE metrics also via the old GetStatistics function.
The audio processing module reports the metrics 'echo return loss'
and 'echo return loss enhancement' for AEC3 via the old, soon to be
replaced, GetStatistics fuction.

Bug: webrtc:8533
Change-Id: I6b2286b5cdf8f20ebf14f82f1180f6bfb6c00c68
Reviewed-on: https://webrtc-review.googlesource.com/25642
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20869}
2017-11-24 14:13:59 +00:00
Gustaf Ullberg
332150d7df APM reports ERL and ERLE metrics for AEC3.
The audio processing module reports the metrics 'echo return loss'
and 'echo return loss enhancement' for AEC3.

Bug: webrtc:8533
Change-Id: I166c504adf013d6cb5d6d3c9717d0622c3454bb7
Reviewed-on: https://webrtc-review.googlesource.com/24880
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20835}
2017-11-22 15:01:47 +00:00
Ivo Creusen
ae02609645 Add parallel stats interface with optional stats to APM.
This new parallel GetStatistics function uses Optionals to indicate if stats are valid or not, and no longer relies on default values. It also takes an argument to indicate if receive streams are present, and if not several stats will not be set.

Bug: b/67926135
Change-Id: I175de1c65c414bea6ec9ca8b0b16f07cb2308d9f
Reviewed-on: https://webrtc-review.googlesource.com/17942
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20789}
2017-11-20 13:13:20 +00:00
Mirko Bonadei
675513b96a Stop using LOG macros in favor of RTC_ prefixed macros.
This CL has been generated with the following script:

for m in PLOG \
  LOG_TAG \
  LOG_GLEM \
  LOG_GLE_EX \
  LOG_GLE \
  LAST_SYSTEM_ERROR \
  LOG_ERRNO_EX \
  LOG_ERRNO \
  LOG_ERR_EX \
  LOG_ERR \
  LOG_V \
  LOG_F \
  LOG_T_F \
  LOG_E \
  LOG_T \
  LOG_CHECK_LEVEL_V \
  LOG_CHECK_LEVEL \
  LOG
do
  git grep -l $m | xargs sed -i "s,\b$m\b,RTC_$m,g"
done
git checkout rtc_base/logging.h
git cl format

Bug: webrtc:8452
Change-Id: I1a53ef3e0a5ef6e244e62b2e012b864914784600
Reviewed-on: https://webrtc-review.googlesource.com/21325
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20617}
2017-11-09 11:56:32 +00:00
Gustaf Ullberg
bd83b914c3 Separate AEC3 config from AudioProcessing::Config.
The struct containing the config for AEC3 is removed from
AudioProcessing::Config and is put in a new struct called
EchoCanceller3Config.

AEC3 should no longer be activated through
AudioProcessing::ApplyConfig. Instead an EchoCanceller3Factory
can be injected at AudioProcessing creation.

Bug: webrtc:8346
Change-Id: I27e3592e675eec3632a60c45d9e0d12514c2c567
Reviewed-on: https://webrtc-review.googlesource.com/11420
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20342}
2017-10-19 08:19:52 +00:00
Gustaf Ullberg
ce045acd94 Enable Echo Control at injection.
Echo Control is enabled in capture_nonlocked_ when injected.
Renamed echo_canceller3_enabled to echo_controller_enabled.

Bug: webrtc:8346
Change-Id: Icf441f07ce64719358841544da7579feeb7cfdbb
Reviewed-on: https://webrtc-review.googlesource.com/10808
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20311}
2017-10-16 13:28:37 +00:00
Gustaf Ullberg
8eb9c7d838 Added EchoCanceller3Factory.
Added EchoCanceller3Factory that implements EchoControlFactory and can
be used for injecting EchoCanceller3 into Audio Processing Module.

Renamed InitializeEchoCanceller3 to InitializeEchoController.

Bug: webrtc:8346
Change-Id: I47078da6a49aca1ee41f6a9d5b7b8e91bb5c11a3
Reviewed-on: https://webrtc-review.googlesource.com/9220
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20299}
2017-10-14 07:38:32 +00:00
Gustaf Ullberg
052c78d93f Removed unused AudioProcessing::Create.
Bug: webrtc:8346
Change-Id: I3f0e0727c0377c138202b25100766b3c34e6536a
Reviewed-on: https://webrtc-review.googlesource.com/9381
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20288}
2017-10-13 14:18:27 +00:00
Alessio Bazzica
270f7b5353 AGC2 dummy module: fixed gain param, APM integration, audioproc_f adaptation
In preparation of coming CLs that will add an AGC interface to make the
gain controller injectable.

This CL simplifies AGC2 (dummy sub-module of audioproc_f) since it only
implements the fixed digital mode with hard-clipping - i.e., no limiter
is used.
The AGC2 config now includes the fixed gain to apply and audioproc_f
has been adapted accordingly.
Finally, this CL slightly simplifies the AGC2 integration into APM.

This CL is a continuation of https://codereview.webrtc.org/2995043002/

Bug: webrtc:7494
Change-Id: I3d554ea4dc6208928352059feb14987edabf14c7
Reviewed-on: https://webrtc-review.googlesource.com/4661
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20278}
2017-10-13 11:05:37 +00:00
Gustaf Ullberg
002ef28272 Added EchoControlFactory interface.
The factory for EchoControl is changed from an rtc::Callback1 to an
interface. This avoids using rtc::Callback1 outside of WebRTC.
This also makes the EchoControl factory more similar to other
factories in the code base.

Bug: webrtc:8345
Change-Id: Ie61b9416ed771f8c756326736d17e339eb768469
Reviewed-on: https://webrtc-review.googlesource.com/8900
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20272}
2017-10-13 09:03:07 +00:00
Gustaf Ullberg
d8579e0133 EchoControl factory injectable in AudioProcessing.
This CL enables a factory method creating acoustic echo cancellers
that inherit EchoControl to be injected into the audio processing
module. AudioProcessing will call the factory method to create an
instance of the EchoControl subclass when needed. In the event of
sample rate changes, AudioProcessing will recreate the object using
the factory method.

Bug: webrtc:8346
Change-Id: I0c508b4d4cdb35569864cefaa0e3aea2555cc9b9
Reviewed-on: https://webrtc-review.googlesource.com/7742
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20251}
2017-10-11 14:52:06 +00:00
Gustaf Ullberg
59ff0e216b Renamed echo_canceller3 to echo_controller in APM.
Simple rename to reflect that any AEC implementing the EchoControl
interface could be used instead of EchoCanceller3.

Bug: webrtc:8346
Change-Id: Id9abdc15bf3e0b30197077b8c11e20891a7463b3
Reviewed-on: https://webrtc-review.googlesource.com/7611
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20203}
2017-10-09 10:38:02 +00:00
Niels Möller
84255bbe3b Add explicit includes of refcountedobject.h where it is used.
This is in preparation for deleting the include in rtc_base/refcount.h,
but that change has to wait for some downstream applications to 
not rely in the indirect include.

Partial reland of "Make rtc_base/refcount.h self contained, not including refcountedobject.h."

This is a reland of b7239a9dc8
Original change's description:
> Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> 
> The refcount.h file doesn't depend on anything from
> refcountedobject.h. The motivation of this change to make it possible
> to add additional declarations to refcount.h, and include it from
> refcountedobject.h.
> 
> Bug: webrtc:8270
> Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> Reviewed-on: https://webrtc-review.googlesource.com/5760
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20106}

Bug: webrtc:8270
Change-Id: I63a42712f6c1ec83823c629d1a954fd1a04d4a6c
Reviewed-on: https://webrtc-review.googlesource.com/7281
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20185}
2017-10-06 13:00:14 +00:00
Niels Moller
fb26f85b79 Revert "Reland "Make rtc_base/refcount.h self contained, not including refcountedobject.h.""
This reverts commit bf6937a8e9.

Reason for revert: Broke internal projects.

Original change's description:
> Reland "Make rtc_base/refcount.h self contained, not including refcountedobject.h."
> 
> This is a reland of b7239a9dc8
> Original change's description:
> > Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> > 
> > The refcount.h file doesn't depend on anything from
> > refcountedobject.h. The motivation of this change to make it possible
> > to add additional declarations to refcount.h, and include it from
> > refcountedobject.h.
> > 
> > Bug: webrtc:8270
> > Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> > Reviewed-on: https://webrtc-review.googlesource.com/5760
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20106}
> 
> Bug: webrtc:8270
> Change-Id: I9738f6680ab52d0f43639a1a39175fdba5957681
> Reviewed-on: https://webrtc-review.googlesource.com/5840
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20180}

TBR=kwiberg@webrtc.org,nisse@webrtc.org

Change-Id: I342b241f5bb707b59ccf2d15a1a5befecb53a52e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8270
Reviewed-on: https://webrtc-review.googlesource.com/7280
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20181}
2017-10-06 11:05:55 +00:00
Niels Möller
bf6937a8e9 Reland "Make rtc_base/refcount.h self contained, not including refcountedobject.h."
This is a reland of b7239a9dc8
Original change's description:
> Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> 
> The refcount.h file doesn't depend on anything from
> refcountedobject.h. The motivation of this change to make it possible
> to add additional declarations to refcount.h, and include it from
> refcountedobject.h.
> 
> Bug: webrtc:8270
> Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> Reviewed-on: https://webrtc-review.googlesource.com/5760
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20106}

Bug: webrtc:8270
Change-Id: I9738f6680ab52d0f43639a1a39175fdba5957681
Reviewed-on: https://webrtc-review.googlesource.com/5840
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20180}
2017-10-06 10:20:48 +00:00
Gustaf Ullberg
c522298e03 Added first version of the EchoControl interface, used for AEC abstraction.
Bug: webrtc:8346
Change-Id: I792a5f8eefb98388de199fea12c017759fdc6c1e
Reviewed-on: https://webrtc-review.googlesource.com/6780
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20174}
2017-10-06 07:24:43 +00:00
Niels Moller
d25fa78daf Revert "Make rtc_base/refcount.h self contained, not including refcountedobject.h."
This reverts commit b7239a9dc8.

Reason for revert: Broke chromium mac build, compilation failures on content/renderer/media/webrtc/webrtc_video_frame_adapter.h.

Original change's description:
> Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> 
> The refcount.h file doesn't depend on anything from
> refcountedobject.h. The motivation of this change to make it possible
> to add additional declarations to refcount.h, and include it from
> refcountedobject.h.
> 
> Bug: webrtc:8270
> Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> Reviewed-on: https://webrtc-review.googlesource.com/5760
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20106}

TBR=kwiberg@webrtc.org,nisse@webrtc.org

Change-Id: I7334597cc8979ba9cfaff526967084349ef27f3c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8270
Reviewed-on: https://webrtc-review.googlesource.com/5800
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20107}
2017-10-03 09:49:04 +00:00
Niels Möller
b7239a9dc8 Make rtc_base/refcount.h self contained, not including refcountedobject.h.
The refcount.h file doesn't depend on anything from
refcountedobject.h. The motivation of this change to make it possible
to add additional declarations to refcount.h, and include it from
refcountedobject.h.

Bug: webrtc:8270
Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
Reviewed-on: https://webrtc-review.googlesource.com/5760
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20106}
2017-10-03 09:37:30 +00:00
Sam Zackrisson
0beac583bb Add PostProcessing interface to audio processing module.
This CL adds an interface for a generic PostProcessing module that
is optionally added to the APM at construction time.

(Parenthetically this CL also adds a missing lock check to
InitializeGainController2.)

Bug: webrtc:8201
Change-Id: I7de64cf8d5335ecec450da8a961660906141d42a
Reviewed-on: https://webrtc-review.googlesource.com/1570
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19973}
2017-09-26 14:07:15 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/modules/audio_processing/audio_processing_impl.cc (Browse further)