Commit graph

14 commits

Author SHA1 Message Date
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Mirko Bonadei
185e802971 Prefix AUDIO_DEVICE_INCLUDE_ANDROID_AAUDIO with WEBRTC_.
Since it is a WebRTC-only macro, let's prefix it with WEBRTC_.

Bug: None
Change-Id: I309666858ea898dc7cd1a68c21be190f98c87b11
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129935
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27327}
2019-03-28 08:44:27 +00:00
Lu Liu
c771c805f1 Use scoped_refptr to share the instance of OpenSLEngineManager
Use rtc::scoped_refptr instead of std::unique_ptr to hold the instance
of OpenSLEngineManager; this makes it safe to share it between
OpenSLESRecorder and OpenSLESPlayer.

Bug: webrtc:10436
Change-Id: Ibd0717e5410020c89a40bfdb05953a02378a6a4b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128651
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27253}
2019-03-22 20:15:42 +00:00
Paulina Hensman
1ca30a7e41 Decouple input and output sample rate overrides.
We may sometimes want to override only input or only output, or
override them with different values. This change allows setting the
overrides separately.


Change-Id: Ib0c44cb7a3cfa834f997fb6cd54f7cad68705f41
Bug: webrtc:10441
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128763
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27236}
2019-03-22 11:56:01 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Karl Wiberg
918f50c5d1 Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.

This CL was generated by the following script:

  git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
  git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
  git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
  git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
  git cl format

Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.

Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
2018-07-05 10:59:49 +00:00
Jiawei Ou
e266c80ce3 Guard the android aaudio headers include with the aaudio preprocessor
Bug: webrtc:9365
Change-Id: Iba7ea24abb1b4d617a61079b3ec2ed2a3148c865
Reviewed-on: https://webrtc-review.googlesource.com/81341
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23539}
2018-06-07 20:00:15 +00:00
Magnus Jedvert
c7da266cb8 Android JNI generation: Set JNI namespace in build files
This CL removes the use of the @JNINamespace annotation and instead
sets the correct JNI namespace in the build file.

Bug: webrtc:8278
Change-Id: Ia4490399e45a97d56b02c260fd80df4edfa092bf
Reviewed-on: https://webrtc-review.googlesource.com/76440
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23299}
2018-05-18 10:44:38 +00:00
Paulina Hensman
498592d391 Increase logging for Java ADM
The new ADM code removed some redundancies, which led to a decrease in
log output. This especially affected NS and AEC logs. This change
reintroduces these log messages, making debugging easier. "Acoustic
Echo Canceler" has been changed to AEC for easier grepping.

Some new logging is also added.

Bug: webrtc:7452
Change-Id: I9bfb91895931d73d92f3187c8c7c5b7524ac05ba
Reviewed-on: https://webrtc-review.googlesource.com/71401
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23003}
2018-04-24 13:50:06 +00:00
Magnus Jedvert
66f1e9eb34 Android: Add AudioDeviceModule interface and clean up implementation code
This CL introduces sdk/android/api/org/webrtc/audio/AudioDeviceModule.java,
which is the new interface for audio device modules on Android.

This CL also refactors the main AudioDeviceModule implementation, which
is sdk/android/api/org/webrtc/audio/JavaAudioDeviceModule.java and makes
it conform to the new interface. The old code used global static methods
to configure the audio device code. This CL gets rid of all that and uses
a builder pattern in JavaAudioDeviceModule instead. The only two dynamic
methods left in the interface are setSpeakerMute() and setMicrophoneMute().
Removing the global static methods allowed a significant cleanup, and e.g.
the file sdk/android/src/jni/audio_device/audio_manager.cc has been
completely removed.

The PeerConnectionFactory interface is also updated to allow passing in
an external AudioDeviceModule. The current built-in ADM is encapsulated
under LegacyAudioDeviceModule.java, which is the default for now to
ensure backwards compatibility.

Bug: webrtc:7452
Change-Id: I64d5f4dba9a004da001f1acb2bd0c1b1f2b64f21
Reviewed-on: https://webrtc-review.googlesource.com/65360
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22765}
2018-04-06 10:13:02 +00:00
Magnus Jedvert
e2971ec2ab Android audio manager: Move responsibility of OpenSLES engine
The OpenSLES engine is currently managed by the AudioManager which is
a generic class shared between different kinds of audio input/output.
This CL moves the responsibility of the OpenSLES engine to the actual
OpenSLES implementations.

Bug: webrtc:7452
Change-Id: Iecccb03ec5cd12ce2f3fdc44daaedae27aecf88b
Reviewed-on: https://webrtc-review.googlesource.com/64520
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22661}
2018-03-28 20:31:26 +00:00
Magnus Jedvert
1a18e0ac46 Android audio code: Replace C++ template with input/output interface
Bug: webrtc:7452
Change-Id: Id816500051e065918bba5c2235d38ad8eb50a8eb
Reviewed-on: https://webrtc-review.googlesource.com/64442
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22660}
2018-03-28 19:19:37 +00:00
Magnus Jedvert
32362a6729 Android: Simplify moved audio device module
This CL performs some simplifications and cleanups of the moved audio code.
 * All JNI interaction now goes from the C++ audio manager calling into
   the Java audio manager. The calls back from the Java code to the C++
   audio manager are removed (this was related to caching audio parameters).
   It's simpler this way because the Java code is now unaware of the C++
   layer and it will be easier to make this into a Java interface.
 * A bunch of state was removed that was related to caching the audio parameters.
 * Some unused functions from audio manager was removed.
 * The Java audio manager no longer depends on ContextUtils, and the context has
   to be passed in externally instead. This is done because we want to get rid of
   ContextUtils eventually.
 * The selection of what AudioDeviceModule to create (AAudio, OpenSLES
   input/output is now exposed in the interface. The reason is that client should
   decide and create what they need explicitly instead of setting blacklists
   in static global WebRTC classes. This will be more modular long term.
 * Selection of what audio device module to create (OpenSLES combinations) no
   longer requires instantiating a C++ AudioManager and is done with static
   enumeration methods instead.

Bug: webrtc:7452
Change-Id: Iba29cf7447a1f6063abd9544d7315e10095167c8
Reviewed-on: https://webrtc-review.googlesource.com/63760
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22542}
2018-03-21 17:48:28 +00:00
Paulina Hensman
89dd7bf924 Move android audio device code into sdk/android
This CL adds a stand-alone Android AudioDeviceModule in the
sdk/android folder. It's forked from modules/audio_device/android/
and then simplified for the Android case. The stand-alone Android
ADM is available both in the native_api and also under a field trial
in the Java API.

Bug: webrtc:7452
Change-Id: If6e558026bd0ccb52f56d78ac833339a5789d300
Reviewed-on: https://webrtc-review.googlesource.com/60541
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22517}
2018-03-20 16:04:33 +00:00