Commit graph

195 commits

Author SHA1 Message Date
Danil Chapovalov
01ff41e594 Cleanup expired field trial WebRTC-Avx2SupportKillSwitch
Bug: webrtc:42221774
Change-Id: I92fab7d14fd0c2a9fd10e91fbad9c2831d7415ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349643
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42233}
2024-05-06 14:33:21 +00:00
Prashanth Swaminathan
d454815b19 Use //third_party/cpu_features directly
The Android SDK has a target that references the NDK, which references
the cpu_features library. Directly take a dependency on the final
library, as all the targets in the chain are just soft-transition
targets. This also enables us to remove the Android NDK dependency from
the BUILD.gn file of the SDK.

Bug: chromium:1446042
Test: CQ
Change-Id: I5178faa71a62711e5d96af71c0715acdc1d366db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307380
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40200}
2023-06-02 07:17:36 +00:00
Jared Siskin
7220ee97aa Format the rest
git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -vE "^(rtc_base|sdk|modules|api|call|common_audio|examples|media|net|p2p|pc)/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I9c7fc4e6fbb023809fb22a89a78be713de6990d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302063
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39978}
2023-05-03 12:56:39 +00:00
Emil Lundmark
9109e856d5 Add option to log a warning for unregistered field trials
Until now you only had the option to RTC_DCHECK for unregistered field
trials. This makes it possible to log a warning instead.

Bug: webrtc:14154
Change-Id: I8628054e3c9b5d690f241a93e61299126b732ed0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39417}
2023-02-28 15:43:18 +00:00
Henrik Lundin
cb4b0a6ad2 Check FMA3 support before use it in SincResampler
This is a port of crrev.com/c/2936677.

Previously we only checked avx2 support and then use avx2/fma
intrinsics in SincResampler(crrev.com/c/2654647),this CL also
checks the fma support and avoids using avx2 code if fma is not
supported.

Bug: chromium:1410691
Change-Id: Ibf7c0a1bead87ebe5d3978cfd20cc23525169f40
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291702
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39238}
2023-01-31 17:28:55 +00:00
Evan Shrubsole
e4c49e379a [Unwrap] Migrate RtpToNtpEstimator to use RtpTimestampUnwrapper
Bug: webrtc:13982
Change-Id: Ib32b374237e19d10b3d36fe981939289c34dd6e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288965
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39075}
2023-01-11 17:14:41 +00:00
Alessio Bazzica
54cf754dac APM: remove denormal disabler field trial
Always use the denormal disabler

Bug: chromium:1227566
Change-Id: I915567aac683a8cd23d6d09b75536c81fd4ee2a6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288680
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38936}
2022-12-21 11:27:02 +00:00
Emil Lundmark
2d7a3e7ca8 Rename test helper for registering field trial keys
This new name emphasizes that the field trial keys are only allowed
within the current scope. We already have test::ScopedFieldTrials that
can be used to ensure that the global field trials string itself is
isolated.

Bug: webrtc:14705
Change-Id: I8b66bbd9c11d97985292c334d2d3496a047074a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284862
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38796}
2022-12-02 13:21:28 +00:00
Emil Lundmark
6bf20cc76a Verify field trials looked up through field_trial::FindFullName
For now, the run-time check will only be enabled if the
rtc_strict_field_trials GN arg is set.

In order to allow testing with imaginary field trial keys, two test
helpers have been added. It's a bit awkward to test these since the
field trial string is already global, hence the helpers are also
modifying global state. Tests must make sure this global state is reset
between runs. Things won't be an issue anymore when [1] has removed the
global string.

[1] https://crbug.com/webrtc/10335

Bug: webrtc:14154
Change-Id: Ida44cc817079d7177325e2228cf1f1d242b799e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276269
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38447}
2022-10-20 10:46:01 +00:00
Niels Möller
a16786b87f Delete nisse@webrtc.org from OWNERS files
Bug: None
Change-Id: I65fd526b236850f6df0de4f9022c77937b82f11a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269213
Auto-Submit: Niels Moller <nisse@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37636}
2022-07-28 08:47:38 +00:00
Niels Möller
7a66900683 Delete rtc_base/atomic_ops.h
Bug: webrtc:9305
Change-Id: I3e8b0db03b84b5361d63db31ee23e6db3deabfe4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266497
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37348}
2022-06-28 08:32:13 +00:00
Niels Möller
f1d822b03b Delete variant of rtc::split that copies the output fields
Bug: webrtc:13579
Change-Id: I065a32704d48d5eed21aee0e9757cac9ecf7aa99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261951
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37160}
2022-06-09 08:29:33 +00:00
Ali Tofigh
969c1356af Adopt absl::string_view in system_wrappers/
Bug: webrtc:13579
Change-Id: Id0e6515c63a3c9aa6d7effef7a2bd8b5ef35af09
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262245
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36904}
2022-05-17 08:23:24 +00:00
Danil Chapovalov
fbe667298a Cleanup WebRTC-SystemIndependentNtpTimeKillSwitch
it was added year ago in
https://webrtc-review.googlesource.com/c/src/+/213425

Bug: webrtc:11327
Change-Id: I95a0cf261a5a755dbdadd5e1e71ce031be4a195b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261950
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36872}
2022-05-13 08:52:15 +00:00
Peter Kasting
662d7f11d5 Fixes to support building in -std=c++20 mode.
* Structs with user-declared constructors are no longer considered
  aggregates, so remove the declarations when possible
* Types of both arguments to "==" must match to avoid "ambiguous
  function call" warning
* Various types of math involving enums are deprecated, so replace with
  constexprs where necessary
* ABSL_CONST_INIT must be used on definition as well as declaration
* volatile memory may no longer be read from and written to by the same
  operator, so replace e.g. "n++" with "n = n + 1"
* Replace an outdated check for no_unique_address support with
  __has_cpp_attribute
* std::result_of(f(x)) has been removed, replace with
  std::invoke_result(f, x)

Bug: chromium:1284275
Change-Id: I77b366ab1da7eb2c1e4c825b2714417c31ee5903
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261221
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Tomas Gunnarsson <tommi@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36786}
2022-05-05 17:15:58 +00:00
Gustaf Ullberg
8b8d0b5eac Check for BMI2 support before enabling AVX2 code paths
With MSVC, compiling with AVX2 support will also result in the
generation of BMI2 instructions. Some early Haswell CPUs reportedly support AVX2 but not BMI2. We have seen crashes (illegal instruction)
on these CPUs in our AVX2 code paths on MULX instructions (part of BMI2).

Including a check for BMI2 when checking for AVX2 support is
expected to solve the issue.

Please see the bug referenced below for more background on this issue.

Bug: chromium:1315519
Change-Id: I3a0a9838f1f632704ba505ecbb81a6f8b1889319
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260323
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Andreasson <henrika@google.com>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36701}
2022-04-29 08:41:52 +00:00
Florent Castelli
c3e6e3a3e8 Remove dependency on rtc_base_approved from most targets
Bug: webrtc:9838
Change-Id: Ibd0199803597eff48ca139a5cecdc3209c62c5d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259873
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36643}
2022-04-25 12:15:30 +00:00
Florent Castelli
71337f387e Move random out of rtc_base_approved
Bug: webrtc:9838
Change-Id: I64a5ef18c19d446139354d04aa6cb2a76d18aad0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258762
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36572}
2022-04-19 14:00:47 +00:00
Florent Castelli
dd837e28fa Remove //rtc_base:timeutils from public deps
Bug: webrtc:8603
Change-Id: Iaca9356d16275a02e8842c783f259131d72ef010
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257914
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36460}
2022-04-06 11:23:21 +00:00
Florent Castelli
e10a9f609a Remove //rtc_base:safe_conversions from public deps
Bug: webrtc:8603
Change-Id: I285ac30975039f8fe9882d1673cc8e4a615c8618
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257912
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36452}
2022-04-05 20:04:59 +00:00
Florent Castelli
4467ad7835 Remove //rtc_base:macromagic from public deps
Bug: webrtc:8603
Change-Id: I9708df48c9bde9f86ba2d1a92a278bb0d09f3865
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257909
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36444}
2022-04-05 12:36:12 +00:00
Florent Castelli
0af55ba60d Remove //rtc_base:logging from public deps
Bug: webrtc:8603
Change-Id: I2704da8618f88032adac7ae9eb2a0f47fce4a836
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257908
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36443}
2022-04-05 10:31:19 +00:00
Florent Castelli
bddfe0215c Remove //rtc_base:atomicops from public deps
Bug: webrtc:8603
Change-Id: If1fb37e44d5ab277e16895ca50325b3a86bd135f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257907
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36432}
2022-04-04 18:25:48 +00:00
Ali Tofigh
04c881683d Switch to absl::string_view in field_trial::FindFullName()
Bug: webrtc:13579
Change-Id: Iaaea42957afb4af66ad5eea6447e75dddc13b5ea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256263
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36288}
2022-03-22 10:35:15 +00:00
Danil Chapovalov
ae4fb618d7 Cleanup RtpToNtpEstimator
- Use NtpTime instead of pair of uint32_t to represent ntp time
- Increase precision estimate with NtpTime precision instead of ms precision
- Hide helper structs as private types
- Modernize interface to prefer return values over output parameters
- embed LinearRegression helper into the only user: UpdateParameters

Bug: webrtc:13757
Change-Id: I0a62a03e2869b2ae1eacaa15253accc43ba0a598
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254780
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36232}
2022-03-17 10:26:57 +00:00
Mirko Bonadei
83240ac0bc Only FindFullName should be injectable at link-time.
When WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT is defined, only
webrtc::field_trial::FindFullName should be defined at link time, the
other functions should not be part of this interface.

No-Try: True
Bug: webrtc:10335
Change-Id: I81bcefcde6a51bcf8e410af91b5401f23e039d50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255340
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36191}
2022-03-14 14:25:55 +00:00
Byoungchan Lee
c065e739e2 Remove RTC_DISALLOW_COPY_AND_ASSIGN more.
Bug: webrtc:13555, webrtc:13082
Change-Id: I9c07708108da0a26f5e228384fd56cef4d1540b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35749}
2022-01-20 11:00:18 +00:00
Mirko Bonadei
fb8a3e4f6c Stricter sysconf(_SC_NPROCESSORS_ONLN) output check.
While the output should never be 0, in case it is, DetectNumberOfCores()
can crash because of an RTC_CHECK. Let's fall back on the default
value of 1 instead.

Bug: chromium:1282179
Change-Id: Ice083bff4222bbe7e92d789293a7c7b01b7fbd5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/244088
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35614}
2022-01-03 16:34:33 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
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}
2021-11-15 21:44:59 +00:00
John Elliott
59aba46c6f Removed timezone usage in UnixRealTimeClock::CurrentTimeVal when calling gettimeofday.
Timezone (tz) was unused in this case. When porting webRTC to certain platforms it caused runtime asserts when unsupported.
Additionally, the timezone parameter is obsolete and should now be NULL according to
https://man7.org/linux/man-pages/man2/gettimeofday.2.html.

Bug: None
Change-Id: Ic9183dd79b371ddcaad5da797ccb91beeea2be2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236722
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35293}
2021-11-02 05:32:10 +00:00
Mirko Bonadei
329137590e Fix -Wunused-but-set-variable.
This is part of a set of CLs to fix the Chromium roll.

Bug: None
Change-Id: I7cc1e5b84a2443f311fb4e047954d7d4d9c41189
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236761
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35284}
2021-10-31 12:40:38 +00:00
Mirko Bonadei
da6a9d58f8 Use GTEST_SKIP() instead of early return.
The issue for iOS platforms was fixed by crrev.com/c/2505276.

Bug: webrtc:13057
Change-Id: I0f01c1291184f4c7960db746951255961a962303
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228520
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34740}
2021-08-12 15:24:13 +00:00
Alessio Bazzica
0441bb625f APM: add HW-only denormal disabler
Denormal numbers (see [1]) may origin in APM when the input is zeroed
after a non-zero signal. In extreme cases, instructions involving
denormal operands may run as much as 100 times slower, which seems to
be the case (to some extent) of crbug.com/1227566.

This CL adds a class that disables denormals only via hardware on x86
and on ARM. The class is used in APM and it is an adaption of [2].

Tested: appr.tc call on Chromium (Win, Mac)

[1] https://en.wikipedia.org/wiki/Denormal_number
[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/audio/denormal_disabler.h

Fixed: chromium:1227566
Change-Id: I0ed2eab55dc597529f09f93c26c7a01de051fdbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227768
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34701}
2021-08-10 15:48:22 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
Artem Titov
f0671921a1 Use backticks not vertical bars to denote variables in comments for /system_wrappers
Bug: webrtc:12338
Change-Id: Ibd6a1b11fae9927be6f3122499d8e33ebeb82388
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227026
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34560}
2021-07-27 14:37:27 +00:00
Mirko Bonadei
25ab3228f3 Replace assert() with RTC_DCHECK().
CL partially auto-generated with:

git grep -l "\bassert(" | grep "\.[c|h]" | \
  xargs sed -i 's/\bassert(/RTC_DCHECK(/g'

And with:

git grep -l "RTC_DCHECK(false)" |  \
  xargs sed -i 's/RTC_DCHECK(false)/RTC_NOTREACHED()/g'

With some manual changes to include "rtc_base/checks.h" where
needed.

A follow-up CL will remove assert() from Obj-C code as well
and remove the #include of <assert.h>.

The choice to replace with RTC_DCHECK is because assert()
is because RTC_DCHECK has similar behavior as assert()
based on NDEBUG.

This CL also contains manual changes to switch from
basic RTC_DCHECK to other (preferred) versions like
RTC_DCHECK_GT (and similar).

Bug: webrtc:6779
Change-Id: I00bed8886e03d685a2f42324e34aef2c9b7a63b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34442}
2021-07-09 07:49:43 +00:00
Paul Hallak
2491dbdf0b Make Clock::ConvertTimestampToNtpTime pure virtual
No-Try because of lack of infra lack of capacity on macs.

No-Try: True
Bug: webrtc:11327
Change-Id: I9296bb92fdd62800da3ddd80789164c80350577d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219782
Commit-Queue: Paul Hallak <phallak@google.com>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34073}
2021-05-21 09:55:14 +00:00
Paul Hallak
b59e9045bf Add the ability to convert a timestamp to NTP time.
The timestamps returned by the clocks do not have an epoch. Each clock
should be able to convert a timestamp it returns to an NTP time.
The default implementation for querying for an NTP time is converting
the current timestamp.

This is favored over returning the offset between the relative and the
NTP time because there is a field trial that makes the real clock revert
to using system dependent methods for getting the NTP time.

Bug: webrtc:11327
Change-Id: Ia139b2744b407cae94420bf9112212ec577efb16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219687
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Paul Hallak <phallak@google.com>
Cr-Commit-Position: refs/heads/master@{#34071}
2021-05-21 04:34:11 +00:00
Paul Hallak
0de1ed0244 Have only two pure virtual methods for webrtc::Clock,
`CurrentTime` and `CurrentNtpTime`. Make all other methods non-virtual.

Bug: webrtc:11327
Change-Id: I391d9eaec1ba27ec4f8e1901498c68c28a7ec4ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219466
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Paul Hallak <phallak@google.com>
Cr-Commit-Position: refs/heads/master@{#34065}
2021-05-20 10:44:11 +00:00
Paul Hallak
704d6e518a Consolidate the different NTP clocks into one.
WebRTC code has two ways of querying for the NTP time:
- rtc::TimeMillis() + NtpOffsetMs()
- Clock::CurrentNtpTime

`Clock::CurrentNtpTime` is not monotonic and is platform dependent.
This CL changes its implementation return `rtc::TimeMillis() +
NtpOffsetMs()`

More info is available in the attached bug.

Bug: webrtc:11327
Change-Id: I34fe4cc2d321c2b63275c93be21122c9de1ab403
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213425
Commit-Queue: Paul Hallak <phallak@google.com>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33655}
2021-04-08 13:54:04 +00:00
Paul Hallak
314b78d467 Remove Clock::NtpToMs.
This helper method does not belong to the Clock class. Also, it's simple enough that it's not needed.

Bug: webrtc:11327
Change-Id: I95a33f08fd568b293b591171ecaf5e7aef8d413c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214123
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Paul Hallak <phallak@google.com>
Cr-Commit-Position: refs/heads/master@{#33652}
2021-04-08 10:37:20 +00:00
Johannes Kron
373bb7bec4 Don't use SystemTimeNanos() for current wallclock time on WINUWP
SystemTimeNanos() will soon be replaced with another implementation
when built with Chromium. This will break the assumption of
SystemTimeNanos() being relative to the NTP epoch. To avoid breaking
any UWP apps, call the TimeHelper::Ticks() function directly, which
is synchronized with the NTP epoch during initialization.

Bug: chromium:516700
Change-Id: I4e50cb3f88d06e1385e73b1a9ded52956501dc1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208520
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33324}
2021-02-23 14:53:22 +00:00
Andrey Logvin
e7c79fd3d6 Remove from chromium build targets that are not compatible with it.
We need to be able build chromium with rtc_include_tests = true. It
reveals a lot of targets that are not compatible with chromium but
aren't marked so.

`rtc_include_tests=true` has been considered a way to disable targets for the Chromium build, causing an overload on rtc_include_tests while the meaning of the two GN args (rtc_include_tests and build_with_chromium) should be kept separated.

Bug: webrtc:12404
Change-Id: I2f72825445916eae7c20ef9338672d6a07a9b9ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203890
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33124}
2021-02-01 13:46:19 +00:00
Andrey Logvin
7864600a6e Add absl_deps field for rtc_test and rtc_executable
To be able to build these targets in chromium we need to replace all abseil dependencies with "//third_party/abseil-cpp:absl".

Bug: webrtc:12404
Change-Id: Ie0f6af73f2abc73e5744520cfd9a6414e2f948e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202762
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33108}
2021-01-29 16:40:49 +00:00
Niels Möller
9308b7af1e Delete use of RWLockWrapper from SimulatedClock
Instead, use lock-less reads and increments of current time,
with relaxed memory order.

Bug: webrtc:12102
Change-Id: I0e804d97d7adb5d3d115544487573ea03d132590
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191225
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32543}
2020-11-04 08:01:08 +00:00
Per Åhgren
a43178c871 Reland "Activating AVX2 support by default"
This is a reland of ad148272b8

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

Bug: webrtc:11663, chromium:1134234
Change-Id: I0cb34cf08d4d14bc3aee055254493c9c9ee8faa0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186401
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32303}
2020-10-03 22:37:13 +00:00
Andrey Logvin
082fac73be Revert "Reland "Activating AVX2 support by default""
This reverts commit a0ad0bbf8f.

Reason for revert: Speculative revert. I suspect it breaks downstream project

Original change's description:
> Reland "Activating AVX2 support by default"
>
> This is a reland of ad148272b8
>
> Original change's description:
> > Activating AVX2 support by default
> >
> > This CL activates the newly added AVX2 support by default.
> > The activation is done beneath a kill-switch.
> >
> > Beyond the above, the CL also changes an incorrect DCHECK_GT
> > to a DCHECK_GE.
> >
> > Bug: webrtc:11663
> > Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32193}
>
> Bug: webrtc:11663
> Change-Id: Ib41dc1d1c5865f2828699c462939d15d5562df47
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186262
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32270}

TBR=mbonadei@webrtc.org,saza@webrtc.org,peah@webrtc.org,kwiberg@webrtc.org

Change-Id: I1305fad8d19ba0bd69a38b9e2959af54f900535d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11663
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186304
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32273}
2020-10-01 13:39:07 +00:00
Per Åhgren
a0ad0bbf8f Reland "Activating AVX2 support by default"
This is a reland of ad148272b8

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

Bug: webrtc:11663
Change-Id: Ib41dc1d1c5865f2828699c462939d15d5562df47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186262
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32270}
2020-10-01 12:19:19 +00:00
Per Åhgren
80907be915 Revert "Activating AVX2 support by default"
This reverts commit ad148272b8.

Reason for revert: Speculative revert to investigate test failures

Original change's description:
> Activating AVX2 support by default
>
> This CL activates the newly added AVX2 support by default.
> The activation is done beneath a kill-switch.
>
> Beyond the above, the CL also changes an incorrect DCHECK_GT
> to a DCHECK_GE.
>
> Bug: webrtc:11663
> Change-Id: I231ccb2f5efabf74cd8190411daa954b2b94a2a0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183042
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32193}

TBR=mbonadei@webrtc.org,saza@webrtc.org,peah@webrtc.org,kwiberg@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11663
Change-Id: Ibb019e8c702dce45ebf47f1c1e8db19069b4964d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186081
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32259}
2020-09-30 15:30:04 +00:00
Per Åhgren
c18be4a547 Revert "Deactivating AVX2 support by default"
This reverts commit 3f8966f4ab.

Reason for revert: The issues identified during testing were found to be unrelated to the AVX2 code.

Original change's description:
> Deactivating AVX2 support by default
>
> This CL deactivates the AVX2 support by default due to issues identified
> during testing.
>
>
> Bug: webrtc:11663
> Change-Id: Ib42791a8da9a93c986f69bfc85def2158525af79
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185818
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32231}

TBR=mbonadei@webrtc.org,peah@webrtc.org,nisse@webrtc.org

Change-Id: I132c9e436cfb0145c8744902b2ea3bca8c8f0f79
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11663
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186044
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32252}
2020-09-30 13:33:35 +00:00