Commit graph

814 commits

Author SHA1 Message Date
Mirko Bonadei
7acc2d9fe3 Revert "Refactor rtc_base build targets."
This reverts commit 69241a93fb.

Reason for revert: Breaks WebRTC roll into Chromium.

Original change's description:
> Refactor rtc_base build targets.
>
> The "//rtc_base:rtc_base" build target has historically been one of the
> biggest targets in the WebRTC build. Big targets are the main source of
> circular dependencies and non-API types leakage.
>
> This CL is a step forward into splitting "//rtc_base:rtc_base" into
> smaller targets (as originally started in 2018).
>
> The only non-automated changes are (like re-wiring the build system):
> * The creation of //rtc_base/async_resolver.{h,cc} which allows to
>   break a circular dependency (is has been extracted from
>   //rtc_base/net_helpers.{h,cc}).
> * The creation of //rtc_base/internal/default_socket_server.{h,cc} to
>   break another circular dependency.
>
> Bug: webrtc:9987
> Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32941}

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

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

No-Try: True
Bug: webrtc:9987
Change-Id: I1e36ad64cc60092f38d6886153a94f1a58339256
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201840
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32986}
2021-01-14 21:27:38 +00:00
Sami Kalliomäki
6e509f9167 Handle case createShader throws an exception.
Ensures the state of the class remains correct even if an unhandled
exception is thrown from this method.

Bug: b/176214704
Change-Id: I94504bb8aa4bd2dba45d116d5fa13da070a3b60f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201621
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32963}
2021-01-13 15:50:12 +00:00
Mirko Bonadei
69241a93fb Refactor rtc_base build targets.
The "//rtc_base:rtc_base" build target has historically been one of the
biggest targets in the WebRTC build. Big targets are the main source of
circular dependencies and non-API types leakage.

This CL is a step forward into splitting "//rtc_base:rtc_base" into
smaller targets (as originally started in 2018).

The only non-automated changes are (like re-wiring the build system):
* The creation of //rtc_base/async_resolver.{h,cc} which allows to
  break a circular dependency (is has been extracted from
  //rtc_base/net_helpers.{h,cc}).
* The creation of //rtc_base/internal/default_socket_server.{h,cc} to
  break another circular dependency.

Bug: webrtc:9987
Change-Id: I0c8f5e7efe2c8fd8e6bffa0d6dd2dd494cf3df02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196903
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32941}
2021-01-11 18:32:30 +00:00
philipel
360da05ed1 Remove webrtc::VideoDecoder::PrefersLateDecoding.
This is just general cleanup.

The assumed behavior is late decoding, and this function is not used to make any decision (except in the deprecated jitter buffer).

Bug: webrtc:12271
Change-Id: Ifb48186d55903f068f25e44c5f73e7a724f6f456
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/200804
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32940}
2021-01-11 18:02:25 +00:00
Niels Möller
6afa794b6e Delete deprecated H264BitstreamParser methods
Bug: webrtc:10439
Change-Id: I1513907f03f9adfcf5657298e69d60519af764ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198121
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32934}
2021-01-11 09:31:54 +00:00
Ivo Creusen
c25a3a3a1e Use low latency mode on Android O and later.
This CL makes it possible to use a low-latency mode on Android O and later. This should help to reduce the audio latency. The feature is disabled by default and needs to be enabled when creating the audio device module.

Bug: webrtc:12284
Change-Id: Idf41146aa0bc1206e9a2e28e4101d85c3e4eaefc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196741
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32854}
2020-12-17 10:29:21 +00:00
Peter Kotwicz
1afe2be9a9 Update webrtc guava dependency part 2
This CL renames webrtc guava dependencies from
third_party/guava:guava_android_java that I missed in
https://webrtc-review.googlesource.com/c/src/+/195720

BUG=chromium:2560401

Change-Id: I702cdbe10af57070b5a9db3b8f4ba913489fe42e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196181
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32737}
2020-12-02 07:48:34 +00:00
Gaurav Vaish
69662a99d3 Add API Level guard for allowedCapturePolicy
AudioAttributes::getAllowedCapturePolicy was added in API Level 29.
Update WebRtcAudioTrack to add API Level check before using the API.

Bug: webrtc:12250
Change-Id: Ica6604eb1d7fa736a0e64729a022eefcfb7b3020
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195941
Commit-Queue: Gaurav Vaish <gvaish@chromium.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32735}
2020-12-01 22:59:25 +00:00
Peter Kotwicz
625964f6e0 Update webrtc guava dependency
This CL renames webrtc guava dependencies from
third_party/guava:guava_android_java  to
//third_party/android_deps:guava_android_java

This is in preparation for deleting third_party/guava:guava_android_java

BUG=chromium:2560401

No-Presubmit: True
Change-Id: If9227f4ac4d24386896c47eeb38142a76a27a4ea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195720
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32730}
2020-12-01 14:54:03 +00:00
Danil Chapovalov
06bbeb3398 in Av1 encoder wrapper communicate end_of_picture flag similar to VP9
In particular move end_of_picture flag out of vp9 specific information
since VP9 is not the only codec that can use spatial scalability and
thus need to distinguish layer frame and picture (aka temporal unit).

Bug: webrtc:12167
Change-Id: I0d046d8785fbea55281209ad099738c03ea7db96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192542
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32588}
2020-11-11 14:00:52 +00:00
Gaurav Vaish
b249d0a905 Allow AudioAttributes to be app/client configurable
WebRtcAudioTrack is hardcoded to configure AudioAttributes with
1. usage=USAGE_VOICE_COMMUNICATIOON
2. contentType=CONTENT_TYPE_SPEECH

This change allows AudioAttributes to be configured via the
 JavaAudioDeviceModule.

Bug: webrtc:12153
Change-Id: I67c7f6e572c5a9f3a8fde674b6600d2adaf17895
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191941
Commit-Queue: Gaurav Vaish <gvaish@chromium.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32583}
2020-11-11 06:18:10 +00:00
Karl Wiberg
c95b939667 Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()
And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.

Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
2020-11-09 10:47:55 +00:00
philipel
c780f25f1a Remove remaining variables related to incomplete frames.
Bug: webrtc:9378, webrtc:7408
Change-Id: I5b26f09a2da13906b421d0bcf615e721b66d4ce7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190860
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32552}
2020-11-04 16:07:43 +00:00
Mirko Bonadei
8cc6695652 Reformat python files checked by pylint (part 1/2).
After recently changing .pylintrc (see [1]) we discovered that
the presubmit check always checks all the python files when just
one python file gets updated.

This CL moves all these files one step closer to what the linter
wants.

Autogenerated with:

# Added all the files under pylint control to ~/Desktop/to-reformat
cat ~/Desktop/to-reformat | xargs sed -i '1i\\'
git cl format --python --full

This is part 1 out of 2. The second part will fix function names and
will not be automated.

[1] - https://webrtc-review.googlesource.com/c/src/+/186664

No-Presubmit: True
Bug: webrtc:12114
Change-Id: Idfec4d759f209a2090440d0af2413a1ddc01b841
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190980
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32530}
2020-10-30 10:13:11 +00:00
philipel
1b0d5437c9 Removed _completeFrame since we never allow incomplete frames.
In the old jitter buffer the two VCMVideoProtection modes |kProtectionNone| and |kProtectionFEC| could be set on the jitter buffer for it to not wait for NACK and instead generate incomplete frames. This has not been possible for a long time.

Bug: webrtc:9378, webrtc:7408
Change-Id: I0a2d3ec34d721126c1128306d5fad88314f8d59f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190680
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32513}
2020-10-28 16:00:27 +00:00
Niels Möller
7c85d395d7 Delete unneeded includes of system_wrappers/include/sleep.h
Non-test usage is in modules/audio_device and modules/desktop_capture.

Bug: None
Change-Id: Ie7dd89aa40e6dcfa9e49e1956b87b50fd9f1c227
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190140
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32484}
2020-10-26 09:55:26 +00:00
Niels Möller
d40c764ba8 Delete leftover mention of AsyncInvoker
Bug: None
Change-Id: I8900873f096225fecfbb2115642fa16178078db6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189545
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32440}
2020-10-19 13:10:42 +00:00
Niels Möller
299c839919 Add back AndroidVideoBuffer::CropAndScale
Now compatible with the recently added interface method
VideoFramebuffer::CropAndScale.

Bug: webrtc:11976
Change-Id: I461cf2de1d73ca953fda0ecad84d216b8b7ac879
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187493
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32391}
2020-10-13 14:46:16 +00:00
Ilya Nikolaevskiy
38e9b06151 Reland "Add scaling interface to VideoFrameBuffer"
(Reland with no changes after the fix to the downstream project)

This can be overriden for kNative frame types to perform scaling efficiently.

Default implementations for existing buffer types require actual
buffer implementation, thus this CL also merges "video_frame"
with "video_frame_I420" build targets.

Originally Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186303

(Landing with TBR as it's unchaged reland of already approved CL)
TBR=nisse@webrtc.org,sakal@webrtc.org

Bug: webrtc:11976, chromium:1132299
Change-Id: Ia23f7d3e474bd9cdc177104cc5c6d772f04b210f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187345
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32362}
2020-10-09 08:30:50 +00:00
Ilya Nikolaevskiy
441dbf9a56 Revert "Add scaling interface to VideoFrameBuffer"
This reverts commit c79f1d8cfb.

Reason for revert: Breaks downstream project.

Original change's description:
> Add scaling interface to VideoFrameBuffer
>
> This can be overriden for kNative frame types to perform scaling efficiently.
>
> Default implementations for existing buffer types require actual
> buffer implementation, thus this CL also merges "video_frame"
> with "video_frame_I420" build targets.
>
> Bug: webrtc:11976, chromium:1132299
> Change-Id: I3bf5f6bf179db5e7ab165b1c2301980043a08765
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186303
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/master@{#32352}

TBR=mbonadei@webrtc.org,sakal@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,eshr@google.com

Change-Id: I86ac697bf963ef7e2c4f2ed34c3a7bf04f4f1ce1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11976
Bug: chromium:1132299
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187344
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32354}
2020-10-08 14:16:23 +00:00
Ilya Nikolaevskiy
c79f1d8cfb Add scaling interface to VideoFrameBuffer
This can be overriden for kNative frame types to perform scaling efficiently.

Default implementations for existing buffer types require actual
buffer implementation, thus this CL also merges "video_frame"
with "video_frame_I420" build targets.

Bug: webrtc:11976, chromium:1132299
Change-Id: I3bf5f6bf179db5e7ab165b1c2301980043a08765
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186303
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#32352}
2020-10-08 13:33:00 +00:00
Niels Möller
efaa77d80e Delete AllowBlockingCalls and android_media_codec_common.h
Unused since https://webrtc-review.googlesource.com/c/src/+/172721

Bug: None
Change-Id: I06caa65e4517471bb9740469c0e51dbaaa7fc5d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186302
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32278}
2020-10-01 16:38:09 +00:00
Philipp Hancke
79d8df021c android: add rollback RTCSdpType
BUG=webrtc:11796,webrtc:11970

Change-Id: I0047c7a050c344ef58735d9d0d6534b1ddf6c4d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184263
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#32243}
2020-09-30 06:14:57 +00:00
Bin Zhu
66515d6676 Allow clients to provide custom scheduler to AudioModule
Bug: None
Change-Id: Ie80f84c64a43e957d7f8c4b61ac2f1495d292b50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184300
Commit-Queue: Bin Zhu <ricebin@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32201}
2020-09-25 17:00:28 +00:00
Tomas Gunnarsson
77baeee99e Make MessageHandler be a pure virtual interface.
Bug: webrtc:11908
Change-Id: I35d3c4005d970082bff8c5ff24186aab54205c37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185340
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32194}
2020-09-25 11:44:02 +00:00
Paulina Hensman
3060d33cca Remove instance of IP logging in NetworkMonitorAutoDetect
Bug: b/152283155
Change-Id: I75ce0f2d7107a2c25f5df73a75b505051163399b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185183
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32183}
2020-09-24 10:52:48 +00:00
Ilya Nikolaevskiy
4c87d83d03 Extend I420 frame buffer pool to also create NV12 buffers
Bug: webrtc:11956
Change-Id: I758a28f2755cfa72ad486fbe1f9209f356eb5fa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184510
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32147}
2020-09-21 09:46:15 +00:00
Mirta Dvornicic
8452ea86c5 Synchronize modifications to frame_extra_info_ in jni::VideoEncoderWrapper.
Since https://webrtc-review.googlesource.com/c/src/+/161447,
frame_extra_info_ is modified from both the encoder thread and the
callback thread.

Bug: None
Change-Id: Idece4d19cae6d8363428234721616f6ca6f85832
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184121
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32095}
2020-09-14 11:15:32 +00:00
Taylor Brandstetter
32eb03a1fb Get rid of NetworkMonitorBase helper class.
All it provides is a method to call a signal on the network thread,
so it's not worth the added complexity. Implementations of
NetworkMonitorInterface must hop to the network thread anyway to
guard their members.

Also added some thread annotations to AndroidNetworkMonitor.

Bug: webrtc:9883
Change-Id: I64bb82ea593433f3a52871dbb75eb2ac4f47d69c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181420
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32087}
2020-09-11 18:22:14 +00:00
Tomas Gunnarsson
abdb470d00 Make MessageHandler cleanup optional.
As documented in webrtc:11908 this cleanup is fairly invasive and
when a part of a frequently executed code path, can be quite costly
in terms of performance overhead. This is currently the case with
synchronous calls between threads (Thread) as well with our proxy
api classes.

With this CL, all code in WebRTC should now either be using MessageHandlerAutoCleanup
or calling MessageHandler(false) explicitly.

Next steps will be to update external code to either depend on the
AutoCleanup variant, or call MessageHandler(false).

Changing the proxy classes to use TaskQueue set of concepts instead of
MessageHandler. This avoids the perf overhead related to the cleanup
above as well as incompatibility with the thread policy checks in
Thread that some current external users of the proxies would otherwise
run into (if we were to use Thread::Send() for synchronous call).

Following this we'll move the cleanup step into the AutoCleanup class
and an RTC_DCHECK that all calls to the MessageHandler are setting
the flag to false, before eventually removing the flag and make
MessageHandler pure virtual.

Bug: webrtc:11908
Change-Id: Idf4ff9bcc8438cb8c583777e282005e0bc511c8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183442
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32049}
2020-09-07 12:57:15 +00:00
Bin Zhu
ffebf4fe63 update JavaAudioDeviceModule.Builder.build() to return JavaAudioDeviceModule
Bug: None
Change-Id: Iff43debf677ed4a006a8edabde9455566f5cb159
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182580
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Bin Zhu <ricebin@google.com>
Cr-Commit-Position: refs/heads/master@{#32001}
2020-08-26 17:43:37 +00:00
Bin Zhu
12e8511d55 expose MediaProjection
BUG=None

Change-Id: I82f97f02272d882cd2fdc0d9869f2879ba3bbc30
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182440
Commit-Queue: Bin Zhu <ricebin@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31993}
2020-08-25 16:53:40 +00:00
Jonas Oreland
93a9d19d4e p2p_transport_channel: Add estimated disconnected time to CandidatePairChangeEvent
This patch adds a computed estimate on how long the ice stack
was disconnected before switching to a new connection.

The metric is currently computed as now - max(connection->last_data_recevied())
and has resonably good precision.

Bug: webrtc:11862
Change-Id: I8950d55f0eadcf164de089cdb715b4f7eed0a4c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182002
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31969}
2020-08-20 11:40:01 +00:00
Harald Alvestrand
7f8b434009 Modify Android API to use SetDirectionWithError
This clears the decks for deprecating and eventually removing
the nonstandard SetDirection method.

Bug: chromium:980879
Change-Id: Ibc291de3db690e9ef4e6cb3550390d7728f02a83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181860
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31948}
2020-08-17 11:55:55 +00:00
Sami Kalliomäki
9d9d10c7ed Log a warning in STHelper if a frame is already pending.
Bug: b/163785724
Change-Id: Ic2cf1e13f5ccc8115b3132b21c60577f9fb8994f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181660
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31934}
2020-08-14 12:28:10 +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
Harald Alvestrand
6060df5948 Reland "Implement transceiver.stop()"
This is a reland of 11dc6571cb

One fix that makes Web Platform Tests pass in debug mode is applied.

Original change's description:
> Implement transceiver.stop()
>
> This adds RtpTransceiver.StopStandard(), which behaves according to
> the specification at
> https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
>
> It modifies RTCPeerConnection.getTransceivers() to return only
> transceivers that have not been stopped.
>
> Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762
>
> Bug: chromium:980879
> Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31893}

Bug: chromium:980879
Change-Id: Ide31d929ac5ea118d83fdf6a35a592af23f7dfa7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181263
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31907}
2020-08-11 10:46:23 +00:00
Harald Alvestrand
a88c9776de Revert "Implement transceiver.stop()"
This reverts commit 11dc6571cb.

Reason for revert: Breaks Chromium WPT tests

Original change's description:
> Implement transceiver.stop()
> 
> This adds RtpTransceiver.StopStandard(), which behaves according to
> the specification at
> https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
> 
> It modifies RTCPeerConnection.getTransceivers() to return only
> transceivers that have not been stopped.
> 
> Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762
> 
> Bug: chromium:980879
> Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31893}

TBR=sakal@webrtc.org,kthelgason@webrtc.org,hta@webrtc.org,guidou@webrtc.org,marinaciocea@webrtc.org

Change-Id: Ibdc24f7d41e481293ca74ba6d1572de64f7e4654
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:980879
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181262
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31897}
2020-08-10 18:06:30 +00:00
Harald Alvestrand
11dc6571cb Implement transceiver.stop()
This adds RtpTransceiver.StopStandard(), which behaves according to
the specification at
https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop

It modifies RTCPeerConnection.getTransceivers() to return only
transceivers that have not been stopped.

Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762

Bug: chromium:980879
Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31893}
2020-08-10 13:29:15 +00:00
Danil Chapovalov
2b69693bdb Reland "Stop using RTPFragmentationHeader in sdk/android as unneeded"
This is a reland of 0d000c0530

Original change's description:
> Stop using RTPFragmentationHeader in sdk/android as unneeded
> 
> Bug: webrtc:6471
> Change-Id: I81bbea4b7fd6e0325791456bb521e9dd0a64487d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180806
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31836}

Bug: webrtc:6471
Change-Id: I30cb83338178529bb07372022760cdf18bd3be92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181202
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31889}
2020-08-10 10:19:24 +00:00
Jonas Oreland
f7721fb246 Add interface for os/firmware to affect ICE selection.
This patch adds an interface for os/firmware to set a network
preference NOT_PREFERRED / NEUTRAL that can be picked up by
an IceController and used when selection ice candidate pair.

The patch exposes this using an Android Intent based interface.

BUG: webrtc:11825
Change-Id: Ic12b6bf704fde7f9c912020dd7bc79ccae4613ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180883
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31877}
2020-08-07 10:07:43 +00:00
Taylor Brandstetter
c88fe70a8d Make Android/iOS local/remote description accessors thread safe.
Since the descriptions can be modified on the signaling thread,
ToString can only be safely called on that thread.

Bug: webrtc:11791
Change-Id: Icf6aada8aa66d00be94c6bda7b22e41b5d3bbc17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180541
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31862}
2020-08-05 22:34:46 +00:00
Dennis Angelo
2a8f226374 Changed AndroidVideoDecoder to also handle IllegalArgumentException and IllegalStateException during the init of the decoder and fallback to a software decoder
Bug: webrtc:11785
Change-Id: I984d65947274b62fdcae20772537d20851cb25ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180460
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31856}
2020-08-05 09:41:49 +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
Niels Möller
2b781bf908 Deprecate write-only member CodecInfo::is_hardware_accelerated
This member of the CodecInfo struct was set in several places, but not
used for anything. To aid deletion, this cl defines a default implementation
of VideoEncoderFactory::QueryVideoEncoder.

The next step is to delete almost all downstream implementations of that method,
since the only classes that have to implement it are the few factories that
produce "internal source" encoders, e.g., for Chromium remoting.

Bug: None
Change-Id: I1f0dbf0d302933004ebdc779460cb2cb3a894e02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179520
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31844}
2020-08-04 07:56:49 +00:00
Artem Titov
c85990cadd Revert "Stop using RTPFragmentationHeader in sdk/android as unneeded"
This reverts commit 0d000c0530.

Reason for revert: CL that added API with 2 params callback was reverter: https://webrtc-review.googlesource.com/c/src/+/180821

Original change's description:
> Stop using RTPFragmentationHeader in sdk/android as unneeded
> 
> Bug: webrtc:6471
> Change-Id: I81bbea4b7fd6e0325791456bb521e9dd0a64487d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180806
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31836}

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

Change-Id: I15809f663fd365ab11c0667e3705314fdbb38024
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:6471
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180822
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31840}
2020-08-03 19:30:36 +00:00
Danil Chapovalov
0d000c0530 Stop using RTPFragmentationHeader in sdk/android as unneeded
Bug: webrtc:6471
Change-Id: I81bbea4b7fd6e0325791456bb521e9dd0a64487d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180806
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31836}
2020-08-03 15:57:43 +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