When I run these tests locally, Gmock complained about the incorrect
mock function call and caused the test to fail.
Bug: None
Change-Id: I37c9168650471b171a5d7f7b4e3a4c6c6225d618
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292920
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#39292}
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.
Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
This change moves ScopedComInitializer out of core_audio_utility and
into rtc_base/win so it can be reused elsewhere more easily.
It also adds HSTRING and GetActivationFactory functionality to
rtc_base/win. These two were heavily based on what is already present
base/win.
All of these are necessary for the new window capturer based on the
Windows.Graphics.Capture API. You can see how these APIs will be
used in this CL: 186603: Implement WgcCaptureSession |
https://webrtc-review.googlesource.com/c/src/+/186603
Bug: webrtc:9273
Change-Id: I0a36373aac98be779ccbabe1053bb8d6e234f6a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188523
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32522}
New tests are:
- AudioDeviceTest.StartStopPlayoutWithRealDevice
- AudioDeviceTest.StartStopRecordingWithRealDevice
(the comments below only affects ADM2 on Windows):
When adding these tests it was found that we could hit the same known issue
as in https://bugs.chromium.org/p/chromium/issues/detail?id=803056 and the
same solution as in Chrome was therefore ported from Chrome to WebRTC.
Hence, this change also adds support for core_audio_utility::WaveFormatWrapper
to support devices that can return a format where only the WAVEFORMATEX parts is
initialized. The old version would only DCHECK for these devices and that could
lead to an unpredictable behavior.
Tbr: minyue
Bug: webrtc:11093
Change-Id: Icb238c5475100f251ce4e55e39a03653da04dbda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159982
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29824}
LogMessage::streams_ is a global and thus should have trivial destructor
Bug: None
Change-Id: Ie6a8029602f50b2bc5bab546ffc0365ef0954024
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157042
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29552}
Both the tests and the code under test are very old, unstaffed and not
a part of webRTC stack.
Here sanitizers make the tests hang, without providing useful report.
So we are just disabling them, without intention to re-enable them.
Bug: webrtc:10951
Change-Id: I40e97208606ba3f0eb5b19d404f7d038e6cc2bdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152487
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29157}
Lifetime issue: "webrtc_audio_module_rec_thread" was still accessing
AudioTransport mock at and after its destruction.
Bug: webrtc:9751
Change-Id: I24308077cdeb77e570b8ec74098f1ae3397b7155
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146217
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28635}
Rationale:
* More explicit (you won't miss that when glancing at the code).
* More consistent (see MAYBE_* in other tests).
* Allow to re-activate tests via CLI (--gtest_also_run_disabled_tests).
* Tests won't wrongly show up as PASSING (bug/webrtc:10819),
since they won't show up at all.
Bug: webrtc:9778
Change-Id: Ic32e18cb8ee2352def95206c2aa66e1dea0cc1e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146200
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28617}
Landing with TBR given vacation times and the fact that none of this
code is active "in production". The ADM2 implementation can be seen
as experimental (non-default) code and it takes some work to enable it
and replace the existing ADM. Hence, extremely low risk to break
anything.
TBR: henrik.lundin
Bug: webrtc:9265
Change-Id: Ia5cfb2aaa8eaf9537b916b3375f55d8df6287071
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145921
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28600}
Marking test as skipped is more honest than pretending it is successful!
Prevent confusion like in the following scenario for one given test:
- ubsan: launched and sometimes failing.
- tsan: never launched but always flagged OK.
Bug: webrtc:9778
Change-Id: Ie0be0759347eabd3c9d29dd5ea2de809511d1b97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145980
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28597}
Code is not used in production. Need this change for a local test.
Using TBR.
TBR: henrik.lundin
Bug: webrtc:9265
Change-Id: I9f0cb265a51507de59ef2d7fd151465133687525
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145330
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28557}
The test RunPlayoutAndRecordingInFullDuplex makes the speakers play the
signal it simultaneously records from the microphone, which can cause
full howling.
The test itself measures buffer usage and does not depend on what signal
is played through the speakers. This change mutes the speakers to prevent
howling when running modules_unittests.
Bug: webrtc:10704
Change-Id: I6176adb2fb5ce0e4d86f6f447476be8a88c2f2cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139889
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28140}
Googletest recently started replacing the term Test Case by Test Suite.
From now on, the preferred API is TestSuite*; the older TestCase* API
will be slowly deprecated.
This CL moves WebRTC to the new set of APIs.
More info in [1].
This CL has been generated with this script:
declare -A items
items[TYPED_TEST_CASE]=TYPED_TEST_SUITE
items[TYPED_TEST_CASE_P]=TYPED_TEST_SUITE_P
items[REGISTER_TYPED_TEST_CASE_P]=REGISTER_TYPED_TEST_SUITE_P
items[INSTANTIATE_TYPED_TEST_CASE_P]=INSTANTIATE_TYPED_TEST_SUITE_P
items[INSTANTIATE_TEST_CASE_P]=INSTANTIATE_TEST_SUITE_P
for i in "${!items[@]}"
do
git ls-files | xargs sed -i "s/\b$i\b/${items[$i]}/g"
done
git cl format
[1] - https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature
Bug: None
Change-Id: I5ae191e3046caf347aeee01554d5743548ab0e3f
Reviewed-on: https://webrtc-review.googlesource.com/c/118701
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26494}
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}
These changes are based on finding when using Tsan v2. More changes are
needed before usage of the THREAD_SANITIZER build flag can be removed.
Hence, all tests are still ignored when this flag is set. The changes
are still improvements.
See https://bugs.chromium.org/p/webrtc/issues/detail?id=9778#c10
for more details.
Bug: webrtc:9778
Change-Id: I1266cec48165046dcffc16f104ec5b88b41500b2
Reviewed-on: https://webrtc-review.googlesource.com/102440
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24880}
The flaky crash is happening in the constructor.
Bug: webrtc:9778
Change-Id: I9ac9a89e033e17de690e594ef263ff83d14fcc5a
Reviewed-on: https://webrtc-review.googlesource.com/101880
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24829}
These tests have become flaky on thread sanitizer.
Bug: webrtc:9778
Change-Id: Ife7004acf11ef1b3cb9d5720da25d4efb2395faf
Reviewed-on: https://webrtc-review.googlesource.com/101841
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Artem Titarenko <artit@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24824}
Now checks the preferred channel configuration and requests implicit channel
upmixing (audio engine extends from 2 to N channels internally) if the
preferred number of channels is larger than two; i.e., initialize the
stream in stereo even if the preferred configuration is multi-channel.
To summarize: with this CL, it is now possible to use e.g. a 7.1 headset
with a native WebRTC client. All internal processing in WebRTC will be in
stereo, and the audio device will be opened up in stereo as well to match
WebRTC. Before this change, we would open up the audio device using 8
channels but that was not supported by WebRTC.
Bug: webrtc:9265
Change-Id: I1530fee28c4b8b5cda29ab6baf8d65fd391d935d
Reviewed-on: https://webrtc-review.googlesource.com/98421
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24743}
Second round of the new Windows ADM is now ready for review. Main
changes are:
Supports internal (automatic) restart of audio streams when an active
audio stream disconnects (happens when a device is removed).
Adds support for IAudioClient3 and IAudioClient2 for platforms which
supports it (>Win8 and >Win10).
Modifies the threading model to support restart "from the inside" on
the native audio thread.
Adds two new test methods for the ADM to emulate restart events or
stream-switch events.
Adds two new test methods to support rate conversion to ensure that
audio can be tested in loopback even if devices runs at different
sample rates.
Added initial components for low-latency support. Verified that it works
but disabled it with a flag for now.
Bug: webrtc:9265
Change-Id: Ia8e577daabea6b433f2c2eabab4e46ce8added6a
Reviewed-on: https://webrtc-review.googlesource.com/86020
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24578}
This is a no-op change because rtc::Optional is an alias to absl::optional
This CL generated by running script passing top level directories except rtc_base and api
find $@ -type f \( -name \*.h -o -name \*.cc -o -name \*.mm \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+
find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"[\./api]*:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;
git cl format
Bug: webrtc:9078
Change-Id: I9465c172e65ba6e6ed4e4fdc35b0b265038d6f71
Reviewed-on: https://webrtc-review.googlesource.com/84584
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23697}
Summary of what this CL does:
Existing users can keep using the old ADM for Windows as before.
A new ADM for Windows is created and a dedicated factory method is used
to create it. The old way (using AudioDeviceImpl) is not utilized.
The new ADM is based on a structure where most of the "action" takes
place in new AudioInput/AudioOutput implementations. This is inline
with our mobile platforms and also makes it easier to break out common
parts into a base class.
The AudioDevice unittest has always mainly focused on the "Start/Stop"-
parts of the ADM and not the complete ADM interface. This new ADM supports
all tests in AudioDeviceTest and is therefore tested in combination with
the old version. A value-parametrized test us added for Windows builds.
Improved readability, threading model and makes the code easier to maintain.
Uses the previously landed methods in webrtc::webrtc_win::core_audio_utility.
Bug: webrtc:9265
Change-Id: If2894b44528e74a181cf7ad1216f57386ee3a24d
Reviewed-on: https://webrtc-review.googlesource.com/78060
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23554}
This CL resolves some minor issues related to running ADM unittests on Windows.
It is rather common on Windows that devices can't be opened up in mono mode and
some tests have been hardcoded to use mono and that leads to crashes and/or error
logs. Now, all tests runs in stereo as well.
NOTRY=TRUE
Bug: None
Change-Id: Iebf11a6ff63c19ff1be45575a8e0a3df4e112bd4
Reviewed-on: https://webrtc-review.googlesource.com/62940
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22510}
Both macros do the same thing, as wrappers for
__attribute__((guarded_by)), and more names for the same thing doesn't
add to clarity.
Bug: none
Change-Id: Iaaf7b21dbf3345ee90fee22c39b636823d195eb0
Reviewed-on: https://webrtc-review.googlesource.com/48361
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21929}
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.
This CL was uploaded by git cl split.
Bug: None
Change-Id: I9f581b44a43db701300e100a3ff70d90e3dd4f6e
Reviewed-on: https://webrtc-review.googlesource.com/23572
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21581}
Specifically, I'm moving
safe_compare.h
safe_conversions.h
safe_minmax.h
They shouldn't be part of the API, and moving them to an appropriate
subdirectory of rtc_base/ is a good way to keep track of that.
BUG=webrtc:8445
Change-Id: I458531aeb30bcf4291c4bec3bf22a2fffbf054ff
Reviewed-on: https://webrtc-review.googlesource.com/20860
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20829}
Unit test now checks that ADM:Init() works before any test runs.
It means that all tests will be skipped on bots that lack Pulse
support which is as how it worked before this CL as well. But then,
we detected the lack of support by checking that the audio layer had
changed from Pulse to Alsa.
As a consequence, I also decided to inject fake/mock ADMs in more
unit tests. One was actually already injected for other reasons
(see https://codereview.webrtc.org/2997383002/) but it had accidentally
been "reverted" later in combination with other changes.
To summarize: before this change we had a set of unit tests where real
audio was tested but it was not the intention of the test or required.
In addition, some Linux bots (VM:s) did not support PulseAudio and on
them the tests relied on a fallback mechanism to ALSA to work, i.e.,
we had a rather complex dependency on hardware. This dependency has now
been removed and it should result in more stable tests.
Bug: webrtc:7306, webrtc:7806
Change-Id: Ia0485658c04a4ef3b3f2dc0d557d73738067304b
Reviewed-on: https://webrtc-review.googlesource.com/8640
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20307}