Commit graph

66 commits

Author SHA1 Message Date
Peter Thatcher
54cfdf3754
Add control for choosing between AEC3 and AECM (#67) 2022-02-23 18:59:14 -07:00
Artem Titov
d7ac581045 Use backticks not vertical bars to denote variables in comments for /sdk
Bug: webrtc:12338
Change-Id: Ifaad29ccb63b0f2f3aeefb77dae061ebc7f87e6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227024
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34561}
2021-07-27 14:39:06 +00:00
Tommi
87f7090fd9 Replace more instances of rtc::RefCountedObject with make_ref_counted.
This is essentially replacing `new rtc::RefCountedObject` with
`rtc::make_ref_counted` in many files. In a couple of places I
made minor tweaks to make things compile such as adding parenthesis
when they were missing.

Bug: webrtc:12701
Change-Id: I3828dbf3ee0eb0232f3a47067474484ac2f4aed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215973
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33852}
2021-04-27 17:01:59 +00:00
Niels Möller
f4e3e2b83f Delete rtc::Callback0 and friends.
Replaced with std::function.

Bug: webrtc:6424
Change-Id: Iacc43822cb854ddde3cb1e5ddd863676cb07510a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205005
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33281}
2021-02-16 12:41:35 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Artem Titov
c8421c4c3e Replace rtc::ThreadChecker with webrtc::SequenceChecker
Bug: webrtc:12419
Change-Id: I825c014cc1c4b1dcba5ef300409d44859e971144
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205002
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33136}
2021-02-02 14:56:27 +00:00
Mirko Bonadei
3b68aa346a Move some RTC_LOG to RTC_DLOG.
Some locations in the WebRTC codebase RTC_LOG the value of the
__FUNCTION__ macro which probably is useful in debug mode. Moving
these instances to RTC_DLOG saves ~10 KiB on arm64.

Bug: webrtc:11986
Change-Id: I5d81cc459d2850657a712b9aed80c187edf49a3a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203981
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33086}
2021-01-28 10:05:00 +00:00
Taylor Brandstetter
07fc24d9a3 Removing NetworkMonitorFactory static global.
It's now passed through CreatePeerConnectionFactory like all similar
injectable dependencies.

Also removing network_monitor.h from native_api/base, since clients
should all be moved to the new location now.

Bug: webrtc:9883
Change-Id: I3776262ce2a2a380d01c163f4d18a0dfad4b5b41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181401
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31931}
2020-08-13 20:50:23 +00:00
Taylor Brandstetter
ebf31b346b Move Android network monitor to separate target/directory.
Not sure why it was lumped in with base in the first place.
But now that it's not set via a static method, it makes less sense.

Bug: webrtc:9883
Change-Id: Ia46834865fa485c9949a01fec10cecba465246ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180741
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31852}
2020-08-04 20:16:07 +00:00
Taylor Brandstetter
239ac8a4e2 Reland "Pass NetworkMonitorFactory through PeerConnectionFactory."
This is a reland of 003c9be817

Found some downstream code that relies on
NetworkMonitorFactory::SetFactory, so I'm adding those methods back
temporarily. BasicNetworkManager will fall back to the static factory
if the one passed into PeerConnectionFactory is null.

Original change's description:
> Pass NetworkMonitorFactory through PeerConnectionFactory.
>
> Previously the instance was set through a static method, which was
> really only done because it was difficult to add new
> PeerConnectionFactory construction arguments at the time.
>
> Now that we have PeerConnectionFactoryDependencies it's easy to clean
> this up.
>
> I'm doing this because I plan to add a NetworkMonitor implementation
> for iOS, and don't want to inherit this ugliness.
>
> Bug: webrtc:9883
> Change-Id: Id94dc061ab1c7186b81af8547393a6e336ff04c2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180241
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Taylor <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31815}

TBR=hta@webrtc.org, sakal@webrtc.org

Bug: webrtc:9883
Change-Id: I2e817c423f21936f87532a9694eb9a0a1b70c212
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180722
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31824}
2020-08-01 00:36:27 +00:00
Taylor
cfba4ffe31 Revert "Reland "Pass NetworkMonitorFactory through PeerConnectionFactory.""
This reverts commit 7ded733518.

Reason for revert: Found more code calling NetworkMonitorFactory::SetFactory...

Original change's description:
> Reland "Pass NetworkMonitorFactory through PeerConnectionFactory."
> 
> This is a reland of 003c9be817
> 
> Original change's description:
> > Pass NetworkMonitorFactory through PeerConnectionFactory.
> >
> > Previously the instance was set through a static method, which was
> > really only done because it was difficult to add new
> > PeerConnectionFactory construction arguments at the time.
> >
> > Now that we have PeerConnectionFactoryDependencies it's easy to clean
> > this up.
> >
> > I'm doing this because I plan to add a NetworkMonitor implementation
> > for iOS, and don't want to inherit this ugliness.
> >
> > Bug: webrtc:9883
> > Change-Id: Id94dc061ab1c7186b81af8547393a6e336ff04c2
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180241
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Commit-Queue: Taylor <deadbeef@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#31815}
> 
> TBR=hta@webrtc.org, sakal@webrtc.org
> 
> Bug: webrtc:9883
> Change-Id: Ibf69a22e8f94226908636c7d50ff9eda65bd4129
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180720
> Reviewed-by: Taylor <deadbeef@webrtc.org>
> Commit-Queue: Taylor <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31822}

TBR=deadbeef@webrtc.org,sakal@webrtc.org,hta@webrtc.org

Change-Id: Iae51b94072cec9abc021eed4e51d1fbeee998adc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180721
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31823}
2020-07-31 22:44:39 +00:00
Taylor Brandstetter
7ded733518 Reland "Pass NetworkMonitorFactory through PeerConnectionFactory."
This is a reland of 003c9be817

Original change's description:
> Pass NetworkMonitorFactory through PeerConnectionFactory.
>
> Previously the instance was set through a static method, which was
> really only done because it was difficult to add new
> PeerConnectionFactory construction arguments at the time.
>
> Now that we have PeerConnectionFactoryDependencies it's easy to clean
> this up.
>
> I'm doing this because I plan to add a NetworkMonitor implementation
> for iOS, and don't want to inherit this ugliness.
>
> Bug: webrtc:9883
> Change-Id: Id94dc061ab1c7186b81af8547393a6e336ff04c2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180241
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Taylor <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31815}

TBR=hta@webrtc.org, sakal@webrtc.org

Bug: webrtc:9883
Change-Id: Ibf69a22e8f94226908636c7d50ff9eda65bd4129
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180720
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31822}
2020-07-31 22:05:02 +00:00
Taylor
7d627545cb Revert "Pass NetworkMonitorFactory through PeerConnectionFactory."
This reverts commit 003c9be817.

Reason for revert: Breaks downstream build which is still using
SetFactory/ReleaseFactory. Probably will need to update this in lockstep.

Original change's description:
> Pass NetworkMonitorFactory through PeerConnectionFactory.
> 
> Previously the instance was set through a static method, which was
> really only done because it was difficult to add new
> PeerConnectionFactory construction arguments at the time.
> 
> Now that we have PeerConnectionFactoryDependencies it's easy to clean
> this up.
> 
> I'm doing this because I plan to add a NetworkMonitor implementation
> for iOS, and don't want to inherit this ugliness.
> 
> Bug: webrtc:9883
> Change-Id: Id94dc061ab1c7186b81af8547393a6e336ff04c2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180241
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Taylor <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31815}

TBR=deadbeef@webrtc.org,sakal@webrtc.org,hta@webrtc.org

Change-Id: I1f09df7be9c860017d515e5a87488340afa6eda6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180640
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31818}
2020-07-31 07:34:42 +00:00
Taylor Brandstetter
003c9be817 Pass NetworkMonitorFactory through PeerConnectionFactory.
Previously the instance was set through a static method, which was
really only done because it was difficult to add new
PeerConnectionFactory construction arguments at the time.

Now that we have PeerConnectionFactoryDependencies it's easy to clean
this up.

I'm doing this because I plan to add a NetworkMonitor implementation
for iOS, and don't want to inherit this ugliness.

Bug: webrtc:9883
Change-Id: Id94dc061ab1c7186b81af8547393a6e336ff04c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180241
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31815}
2020-07-30 20:52:28 +00:00
Markus Handell
0dd35d3732 Migrate to webrtc::GlobalMutex.
Bug: webrtc:11567
Change-Id: I853434745c427e54474739e9c573e0f6f4fcedef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179283
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31732}
2020-07-15 10:32:20 +00:00
Markus Handell
18523c34b4 Migrate rtc_base to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: Ib8630e0cf1266e7c3f8ce718e1ed9f8848f42ec8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178806
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31682}
2020-07-08 20:38:54 +00:00
Markus Handell
6efc14b33d VideoTrackSourceInterface: make some newly introduced methods pure virtual.
Bug: webrtc:11114
Change-Id: Ic4d3835ae84b6a652c49f30a9c275870bbf3dacf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174440
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31211}
2020-05-11 12:28:32 +00:00
Magnus Jedvert
6a92e0ebba Android: Allow for re-assigning ScopedJavaGlobalRef
Currently, ScopedJavaGlobalRef can only be set at creation and never
changed. This CL makes it possible to re-set these.

Bug: b/153389044
Change-Id: I6be92dae83a9f5f3d87aa44dde226b874f4ca0a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174041
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31145}
2020-04-29 13:36:32 +00:00
Magnus Jedvert
3d687a1e3e Add null checks in stacktrace.cc
We have seen crashes originating from derefencing nullptrs in this code,
for unknown reasons. This CL adds null checks to protect against this.
The stacktraces will be missing or truncated when this happens.


Bug: b/147338449
Change-Id: Ieb006f0f8dec4f9621e4df2e2c1a9641f086df86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173593
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31079}
2020-04-16 09:26:11 +00:00
Sergey Silkin
f16e550c14 Expose java to native conversion of bitrate limits in public API.
A downstream project needs this functionality.

Bug: none
Change-Id: I316ca5066383a7fe73e793b305c14b48f622b70e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172843
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31031}
2020-04-08 07:38:59 +00:00
Danil Chapovalov
5740f3e2b8 Clarify expectation on GlobalLock
Merge GlobalLock and GlobalLockPod, make member private.
annotate creation of all GlobalLocks with ABSL_CONST_INIT

Bug: None
Change-Id: I29abcc86796ec0e45b15df7d26392309d1bf7324
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156303
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29447}
2019-10-11 13:11:11 +00:00
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
Eric Stevenson
0d65fb5451 Mass refactoring: Change JNI #includes to use full paths (webrtc/).
Using relative paths for JNI includes is causing build failures in chromium.

WebRTC already uses full include paths for generated JNI headers, so this CL
just removes the "jni_package" parameter from WebRTC generate_jni() targets
and removes the "jni/" portion of includes. The "jni_package" variable will be
removed from the generate_jni() template shortly.

To fix includes:
find . -name *.cc -exec sed -i -E 's@(#include.+generated.+jni)/jni/(.+_jni.h)@\1/\2@' {} \;

See https://groups.google.com/a/chromium.org/forum/?#!topic/java/MEovGrAwbqI
for discussion on naming scheme.

No-Try: True
TBR: kwiberg@webrtc.org
Bug: chromium:964169
Change-Id: I758c1b41bf6f5005587e55b82f14065fe251baad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143521
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28380}
2019-06-26 08:23:14 +00:00
Sebastian Jansson
c01367db40 Deprecating ThreadChecker specific interface.
All changes outside thread_checker.h are by:
s/CalledOnValidThread/IsCurrent/
s/DetachFromThread/Detach/

Bug: webrtc:9883
Change-Id: Idbb1086bff0817db58e770116acf4c9d60fae8b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131023
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27494}
2019-04-08 16:58:07 +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
Karl Wiberg
c130d42aab Add ability to unwind stack for the current thread
Bug: webrtc:10308
Change-Id: Ia82cb7512524bede8da69bbc747ece6e718733ab
Reviewed-on: https://webrtc-review.googlesource.com/c/124993
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26945}
2019-03-04 10:31:40 +00:00
Mirta Dvornicic
d8b980464c Add scaleResolutionDownBy to RtpParameters.Encoding in Android SDK.
Bug: webrtc:10069
Change-Id: I8130836c495d5584ca3e11e9e3155916b871ab21
Reviewed-on: https://webrtc-review.googlesource.com/c/120926
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26535}
2019-02-04 16:50:24 +00:00
Sami Kalliomäki
ee61f9440a Fix a bug in video_encoder_wrapper where int array was not freed properly.
JNI_COMMIT doesn't actually free the buffer.

From JNI docs:
0: copy back the content and free the elems buffer
JNI_COMMIT: copy back the content but do not free the elems buffer
JNI_ABORT: free the buffer without copying back the possible changes

Also introduces helper methods to help avoid this problem in the
future.

Bug: webrtc:10132
Change-Id: I769df286d3bd186fdf39ee2363e9002f36454509
Reviewed-on: https://webrtc-review.googlesource.com/c/120600
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26529}
2019-02-04 13:12:07 +00:00
Steve Anton
f380284035 (7) Rename files to snake_case: remove forwarding headers
Bug: webrtc:10159
Change-Id: I2ba899e0283b953538c7941c8790213e36d7c70e
Reviewed-on: https://webrtc-review.googlesource.com/c/118561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26417}
2019-01-26 00:33:46 +00:00
Magnus Jedvert
7510e4aac5 Reland "Android: Add helper methods for printing native stack traces"
This is a reland of dc32cc00e8

Relanding because this CL was not the culprit for the Chrome bot.
(This code shouldn't even be executed in Chrome).

Original change's description:
> Android: Add helper methods for printing native stack traces
>
> This CL adds utility functions to unwind the stack for a given thread on
> Android ARM devices. This works on top of unwind.h and unwinds native
> (C++) stack traces only. Unwinding a thread from another thread is done
> by overriding the signal handler with a custom function and then
> interrupting the specific thread.
>
> Bug: webrtc:10168
> Change-Id: If5adffd3a6bb57bf502168743e09a7eefc292bf3
> Reviewed-on: https://webrtc-review.googlesource.com/c/118141
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26328}

TBR=tommi

Bug: webrtc:10168
Change-Id: I4c33c2c147cf10c0172c98a55d32dd35a08517c8
Reviewed-on: https://webrtc-review.googlesource.com/c/118704
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26341}
2019-01-21 15:18:56 +00:00
Magnus Jedvert
700615fb1c Revert "Android: Add helper methods for printing native stack traces"
This reverts commit dc32cc00e8.

Reason for revert: Seems to be breaking Chromium FYI, https://www.google.com/url?q=https://ci.chromium.org/p/chromium/builders/luci.chromium.webrtc.fyi/WebRTC%2520Chromium%2520FYI%2520Android%2520Tests%2520%2528dbg%2529%2520%2528K%2520Nexus5%2529/1807&sa=D&source=hangouts&ust=1548149426180000&usg=AFQjCNGh9aBqv2wNE12D8-6rn9-AJR-cNg

Original change's description:
> Android: Add helper methods for printing native stack traces
> 
> This CL adds utility functions to unwind the stack for a given thread on
> Android ARM devices. This works on top of unwind.h and unwinds native
> (C++) stack traces only. Unwinding a thread from another thread is done
> by overriding the signal handler with a custom function and then
> interrupting the specific thread.
> 
> Bug: webrtc:10168
> Change-Id: If5adffd3a6bb57bf502168743e09a7eefc292bf3
> Reviewed-on: https://webrtc-review.googlesource.com/c/118141
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26328}

TBR=magjed@webrtc.org,tommi@webrtc.org

Change-Id: I6e01f9226ef60777cb422baeab042bce8944f9ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10168
Reviewed-on: https://webrtc-review.googlesource.com/c/118683
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26336}
2019-01-21 11:08:36 +00:00
Magnus Jedvert
dc32cc00e8 Android: Add helper methods for printing native stack traces
This CL adds utility functions to unwind the stack for a given thread on
Android ARM devices. This works on top of unwind.h and unwinds native
(C++) stack traces only. Unwinding a thread from another thread is done
by overriding the signal handler with a custom function and then
interrupting the specific thread.

Bug: webrtc:10168
Change-Id: If5adffd3a6bb57bf502168743e09a7eefc292bf3
Reviewed-on: https://webrtc-review.googlesource.com/c/118141
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26328}
2019-01-20 12:01:50 +00:00
Steve Anton
aec15aa810 (5) Rename files to snake_case: install forwarding headers
Mechanically generated with this command:

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

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ic8e99f71f2da62e5c99863c6d24a8cfe311466cd
Reviewed-on: https://webrtc-review.googlesource.com/c/115682
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26227}
2019-01-11 17:13:36 +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
Steve Anton
1c05765831 (3) Rename files to snake_case: move the files
Mechanically generated with this command:

tools_webrtc/do-rename.sh move all-renames.txt

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8b05b6eab9b9d18b29c2199bbea239e9add1e690
Reviewed-on: https://webrtc-review.googlesource.com/c/115481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26225}
2019-01-11 17:05:20 +00:00
Magnus Jedvert
9514071500 Android: Support externally aligned timestamps
This support is needed if there is a big delay between the creation of
frames and the time they are delivered to the WebRTC C++ layer in
AndroidVideoTrackSource. This is the case if e.g. some heavy video
processing is applied to the frames that takes a couple of hundred
milliseconds. Currently, timestamps coming from Android video sources
are aligned to rtc::TimeMicros() once they reach the WebRTC C++ layer in
AndroidVideoTrackSource. At this point, we "forget" any latency that
might occur before this point, and audio/video sync consequently
suffers.

Bug: webrtc:9991
Change-Id: I7b1aaca9a60a978b9195dd5e5eed4779a0055607
Reviewed-on: https://webrtc-review.googlesource.com/c/110783
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25654}
2018-11-15 11:41:06 +00:00
Yves Gerey
2e00abc98e Reland "[cleanup] Remove useless includes."
Reason for reland: Downstream project fixed.

Original change's description:

> [cleanup] Remove useless includes.
>
> Manual cleanup guided by include-what-you-use diagnostic.
>
> Bug: webrtc:8311
> Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
> Reviewed-on: https://webrtc-review.googlesource.com/c/103320
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25013}

Bug: webrtc:8311
Change-Id: Id6ec4aeb798886a90ace640a190eaf16497ba31b
Reviewed-on: https://webrtc-review.googlesource.com/c/104120
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25034}
2018-10-08 07:44:19 +00:00
Oleh Prypin
96a0f61917 Revert "[cleanup] Remove useless includes."
This reverts commit be8b5348c7.

Reason for revert: Breaks downstream project

Original change's description:
> [cleanup] Remove useless includes.
> 
> Manual cleanup guided by include-what-you-use diagnostic.
> 
> Bug: webrtc:8311
> Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
> Reviewed-on: https://webrtc-review.googlesource.com/c/103320
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25013}

TBR=phoglund@google.com,phoglund@webrtc.org,yvesg@webrtc.org

Change-Id: I7a6e1cdfef685173b76f234ad598083043dcd9a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8311
Reviewed-on: https://webrtc-review.googlesource.com/c/104022
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25015}
2018-10-05 13:13:45 +00:00
Yves Gerey
be8b5348c7 [cleanup] Remove useless includes.
Manual cleanup guided by include-what-you-use diagnostic.

Bug: webrtc:8311
Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
Reviewed-on: https://webrtc-review.googlesource.com/c/103320
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25013}
2018-10-05 11:51:06 +00:00
Sami Kalliomäki
05b552f76a Deprecate PeerConnectionFactory#createVideoSource(VideoCapturer).
This is done in preparation of moving VideoCapturer out of
video_api_java. Clients should update to using
createVideoSource(boolean).

CapturerObserver is moved to a separate file because it needs to stay
in video_api_java to allow VideoSource to depend on it.

Bug: webrtc:9496
Change-Id: I3c93f6bc4df553919dcbe05b00ef4c68f2c9ab60
Reviewed-on: https://webrtc-review.googlesource.com/87305
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23868}
2018-07-06 10:35:46 +00:00
Rasmus Brandt
bfd44e0837 Add JavaToNativeVideoCodecInfo to native API.
This conversion function is useful for downstream native codecs
which want to take a VideoCodecInfo in the Java wrapper and use it
as a SdpVideoFormat in the C++ object.

Bug: webrtc:9495
Change-Id: Id2ece708eafd4be648fafff9e94aa13ace504bdf
Reviewed-on: https://webrtc-review.googlesource.com/87381
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23865}
2018-07-06 09:32:51 +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
Danil Chapovalov
196100efa6 Replace rtc::Optional with absl::optional
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}
2018-06-21 09:32:56 +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
Sami Kalliomäki
ff1de0af6b Add Android native API: CreateJavaVideoSource
Adds Android native API for creating VideoTrackSourceInterface objects
that can be fed frames using VideoCapturer.CapturerObserver.

NativeCapturerObserver is moved out of VideoSource because it will now
be used without a VideoSource. It now takes a pointer to
AndroidVideoTrackSource directly instead of VideoTrackSourceProxy.

VideoSource and NativeCapturerObserver JNI code is moved away from
androidvideotracksource.cc to their own files. This allows using
AndroidVideoTrackSource independently.

Bug: webrtc:8769
Change-Id: Ifb9e1eb27d4c8237597d19d932ca6e863abb4d27
Reviewed-on: https://webrtc-review.googlesource.com/76924
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23269}
2018-05-17 07:41:51 +00:00
Florent Castelli
b7d9d8346f Implement RtpCodecParameters::parameters
This will return all the fmtp parameters for the codecs, except for
DTMF codes that don't fit the key=value pattern.

Bug: webrtc:7112
Change-Id: I06a203ff64df2c3bc9bc2082cd0f374718b23510
Reviewed-on: https://webrtc-review.googlesource.com/71801
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23250}
2018-05-15 17:12:02 +00:00
Magnus Jedvert
8a483be137 Android JNI: Disallow automatic conversion from long to jint
Start using JniIntWrapper from Chromium instead of bypassing
it in jni_generator_helper.h.

Bug: webrtc:8278
Change-Id: I20313e1e610b05f79c210e823ab50cfb2073674e
Reviewed-on: https://webrtc-review.googlesource.com/74841
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23230}
2018-05-15 07:43:05 +00:00