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}
The type rtc::scoped_refptr<T> is now part of api/. Please include it from
api/scoped_refptr.h.
More info: See: https://groups.google.com/forum/#!topic/discuss-webrtc/Mme2MSz4z4o.
Bug: webrtc:9887, webrtc:8205
No-Try: True
Change-Id: Ic6c7c81e226e59f12f7933e472f573ae097b55bf
Reviewed-on: https://webrtc-review.googlesource.com/c/119041
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26414}
This is a propagation of upstream chromium change needed to
resume DEPS autorolls into WebRTC.
Original comment from upstream change:
> This change is made in preparation for an ErrorProne
> check to catch this at compile time. See bug for details.
Bug: chromium:771683
Change-Id: I56aed15f73a633dcadae7ece6c645cd3596f9257
Reviewed-on: https://webrtc-review.googlesource.com/c/113505
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Artem Titarenko <artit@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25951}
Also rename runningOnLollipopOrHigher() etc in WebRtcAudioUtils
to runningOnApi21OrHigher() etc since mapping API numbers to
names is error prone.
Bug: webrtc:9818
Change-Id: I4a71de72e3891ca2b6fc2341db9131bb2db4cce7
Reviewed-on: https://webrtc-review.googlesource.com/c/103820
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25009}
This CL removes a set of DCHECKs in AudioDeviceBuffer (ADB) where the goal has been
to ensure that some methods are called on one and the same native I/O thread.
The implementation of the ADB is platform independent but the underlying (driving)
audio components differ between platforms. This combination has shown to generate complex
corner cases such as:
- OS dependent I/O-thread(s) changes while audio is active
- OS dependent audio device changes and it leads to restart of native I/O threads
- Start/Stop of audio has different timing depending on platform and possibly also usage of
JNI and/or emulators.
To summarize: the gain of maintaining the current strict thread checking (in Debug mode)
is not worth all the efforts trying to resolve complex dynamic cases where the native
I/O threads changes ID.
TBR=glaznev
Bug: b/115385789
Change-Id: I681c89adec497a18b97d2a40421c04ea218fd919
Reviewed-on: https://webrtc-review.googlesource.com/100200
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24723}
Removes redundant field initializers such as null, 0 and false.
Bug: webrtc:9742
Change-Id: I1e54f6c6000885cf95f7af8e2701875a78445497
Reviewed-on: https://webrtc-review.googlesource.com/99481
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24676}
First version was reverted in https://webrtc-review.googlesource.com/c/src/+/97941.
The issue is now fixed.
TBR=ivoc
Bug: b/113648245
Change-Id: If631fdea95aa963952f15e48e9d2d678797dc225
Reviewed-on: https://webrtc-review.googlesource.com/97942
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24573}
Also ensures that audio parameters are accessed atomically.
Bug: b/113648245
Change-Id: Ic812bfe2b2c4cfb3b00d9d411bb4986dfeda1028
Reviewed-on: https://webrtc-review.googlesource.com/97331
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24550}
Running clang-format with chromium's style guide.
The goal is n-fold:
* providing consistency and readability (that's what code guidelines are for)
* preventing noise with presubmit checks and git cl format
* building on the previous point: making it easier to automatically fix format issues
* you name it
Please consider using git-hyper-blame to ignore this commit.
Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
...continuation of review in https://webrtc-review.googlesource.com/c/src/+/70781
This CL ensures that the FineAudioBuffer can support stereo and also adapts
all classes which uses the FineAudioBuffer.
Note that, this CL does NOT enable stereo on mobile platforms by default. All it does is to ensure
that we *can*. As is, the only functional change is that all clients
will now use a FineAudioBuffer implementation which supports stereo (see
separate unittest).
The FineAudioBuffer constructor has been modified since it is better to
utilize the information provided in the injected AudioDeviceBuffer pointer
instead of forcing the user to supply redundant parameters.
The capacity parameter was also removed since it adds no value now when the
more flexible rtc::BufferT is used.
I have also done local changes (not included in the CL) where I switch
all affected audio backends to stereo and verified that it works in real-time
on all affected platforms (Androiod:OpenSL ES, Android:AAudio and iOS).
Also note that, changes in:
sdk/android/src/jni/audio_device/aaudio_player.cc
sdk/android/src/jni/audio_device/aaudio_recorder.cc
sdk/android/src/jni/audio_device/opensles_player.cc
sdk/android/src/jni/audio_device/opensles_recorder.cc
are simply copies of the changes done under modules/audio_device/android since we currently
have two versions of the ADM for Android.
Bug: webrtc:9172
Change-Id: I1ed3798bd1925381d68f0f9492af921f515b9053
Reviewed-on: https://webrtc-review.googlesource.com/71201
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22998}
Currently this warnings prevernt chromium roll into webrtc, because we
consider them as errors. So to unblock roll all warning are suppressed.
All places are documented into bug and will be fixed later.
TBR=henrika@webrtc.org
Bug: webrtc:9175
Change-Id: I0bf5a4b65eb49308e28f71a92d42b5fad6a99b74
Reviewed-on: https://webrtc-review.googlesource.com/71420
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22956}
This work is also done as a preparation for adding stereo support to the
FineAudioBuffer.
Review hints:
Actual changes are in modules/audio_device/fine_audio_buffer.h,cc, the rest is
just adaptations to match these changes.
We do have a forked ADM today, hence, some changes are duplicated.
The changes have been verified on all affected platforms.
Bug: webrtc:6560
Change-Id: I413af41c43809f61455c45ad383fc4b1c65e1fa1
Reviewed-on: https://webrtc-review.googlesource.com/70781
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22938}
Removes current_mic_level_, new_mic_level_ and clock_drift_, together
with APIs for accessing them.
Bug: webrtc:8598
Change-Id: I8e07396fcafd2a719e204730e2c7d26797bed762
Reviewed-on: https://webrtc-review.googlesource.com/39783
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21632}
Starting from Chromium Roll [1], WebRTC should start to use NDK r16
for Android builds. The roll cannot be completed because of three
compilation errors:
../../sdk/android/src/jni/pc/androidnetworkmonitor.cc:15:9: error: 'RTLD_NOLOAD' macro redefined [-Werror,-Wmacro-redefined]
^
../../third_party/android_tools/ndk/sysroot/usr/include/dlfcn.h:62:9: note: previous definition is here
../../modules/audio_device/android/audio_record_jni.cc:251:41: error: format specifies type 'long long' but the argument has type 'jlong' (aka 'long') [-Werror,-Wformat]
ALOGD("direct buffer capacity: %lld", capacity);
../../modules/audio_device/android/audio_track_jni.cc:229:41: error: format specifies type 'long long' but the argument has type 'jlong' (aka 'long') [-Werror,-Wformat]
ALOGD("direct buffer capacity: %lld", capacity);
This CL forward fixes these errors in order to fix the Chromium Roll
into WebRTC.
[1] - https://webrtc-review.googlesource.com/c/src/+/37540
Bug: webrtc:8710
Change-Id: I5bc64e73919eee7c9e965a442a386b5e1897b56a
Reviewed-on: https://webrtc-review.googlesource.com/37640
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21510}
WebRTC.Audio.InitRecordingDurationMs and
WebRTC.Audio.StartRecordingDurationMs UMA stats are added on Android
to measure the time consumed on these two methods where the main part
of the work is done in Java.
Bug: b/67854242
Change-Id: I2d5487511402db18009d66a39c66d3f10d98cdd6
Reviewed-on: https://webrtc-review.googlesource.com/37420
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21494}
This CL is part of merging the helper functions for audio and non-audio JNI code.
The GetThreadInfo() function is unrelated to JNI and I would prefer not to keep
it in a JNI helper file. Also, GetThreadInfo() is a very small function and inlining
it makes it simpler and more transparent IMO, as well as removing a lot of unnecessary
std::string creations.
Bug: webrtc:8689
Change-Id: I7d238fee826d310c0f5343d18b92d0dff864fd6a
Reviewed-on: https://webrtc-review.googlesource.com/36302
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21466}
This reverts commit e7a5567954.
Reason for revert: Causes crashes when no permissions are granted - b/71056584
TBR=henrika@webrtc.org
Original change's description:
> Now uses AudioRecord.Builder on Android again.
>
> I tried to land the same change by reverting https://webrtc-review.googlesource.com/c/src/+/34443
> but the revert failed and I therefore land it manually here instead.
>
> TBR=glaznev@webrtc.org
>
> Bug: b/32742417
> Change-Id: Ied8ed3e7c7d67c51f781e39cbea952a2303278d9
> Reviewed-on: https://webrtc-review.googlesource.com/34442
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21351}
TBR=henrika@webrtc.org,glaznev@webrtc.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: b/32742417
Change-Id: I8fd27d4b8c7d5a04f24477fc0ddffae89f01d566
Reviewed-on: https://webrtc-review.googlesource.com/36463
Commit-Queue: Alex Glaznev <glaznev@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21456}
Trivial change. Adding Alex as TBR. Same log exists for playout already.
This change makes is easier to compare logs.
NOTRY=TRUE
TBR=glaznev
Bug: NONE
Change-Id: I5dd23a4435d7816d8c171a0769132ac9d2f7f5aa
Reviewed-on: https://webrtc-review.googlesource.com/34654
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21361}
Avoids hitting a DCHECK in AudioRecordJni::OnCacheDirectBufferAddress()
when first init attempt has failed and we try again.
Bug: b/69434512
Change-Id: I4396ba22981d9258d6d72188bad66104255f19cf
Reviewed-on: https://webrtc-review.googlesource.com/31842
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21218}
This type of check should instead be performed by the application/client.
If the app does not have mic permissions, construction of the AudioRecord
object will fail and the user will receive an error callback anyhow.
Bug: b/69434512
Change-Id: If1d7eff488f7c693697e048a567c17ed0c51f040
Reviewed-on: https://webrtc-review.googlesource.com/25261
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20839}
int32_t SetLoudspeakerStatus(bool enable)
int32_t GetLoudspeakerStatus(bool* enabled) const
These APIs are only implemented on iOS and they do not belong in the
native audio layer since the client can achieve the same functionality
by using the shared audio session in sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h.
It also gives the client a better flexibility in how the audio routing is done.
Bug: webrtc:7306
Change-Id: I853e2f57e0f5ae0a0f9fc4729ce961d81f92588b
Reviewed-on: https://webrtc-review.googlesource.com/23740
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20721}
In order to create a clean CL to switch to RTC_ prefixed LOG macros
this CL runs `git cl format --full` on the files with LOG macros in
the following directories:
- modules/audio_device
- modules/media_file
- modules/video_capture
This CL has been automatically generated with:
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
for d in media_file video_capture audio_device; do
cd modules/$d
git grep -l $m | grep -E "\.(cc|h|m|mm)$" | xargs sed -i "1 s/$/ /"
cd ../..
done
done
git cl format --full
Bug: webrtc:8452
Change-Id: I2858b6928e6bd79957f2e5e0b07028eb68a304b2
Reviewed-on: https://webrtc-review.googlesource.com/21322
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20613}
In https://chromium-review.googlesource.com/c/chromium/src/+/750645
Chromium started to use an ErrorProne plugin to discourage synchronized
public methods (an encourage the usage of synchronized blocks).
In order to unblock the Chromium Roll we can suppress these warnings
and decide if we want to align with Chromium on this check or ask
them to make it optional.
More details in the bug.
TBR=magjed@webrtc.org
Bug: webrtc:8491
Change-Id: Ie77a324e54aab44a4f59853959549f1d21f884a0
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/20060
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20569}