Commit graph

572 commits

Author SHA1 Message Date
Artem Titov
94b57c044e Cleanup BUILD.gn files from imports like foo:foo
Repalce all occurrences of foo:foo in deps with just foo in BUILD.gn
files.

Done with Sublime regex replace.
Find: \b([-a-zA-Z0-9_]+):+\1\b
In: *.gn
Replace with: \1

Bug: None
Change-Id: I40aba1b14face687a595b852ffe443cb20197611
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127899
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27225}
2019-03-21 13:05:28 +00:00
Artem Titov
533a9fec55 Clean BUILD.gn files: remove extra :memory
Use //third_party/abseil-cpp/absl/memory instead of
//third_party/abseil-cpp/absl/memory:memory in BUILD.gn files.

Bug: None
Change-Id: I47c915f0847b102b37c5b38009c91b315cd3a1b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128615
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27222}
2019-03-21 12:09:50 +00:00
Magnus Jedvert
98d85fe9a4 Android: Expose underlying EGL context in API
This CL adds a way to extract the underlying android.opengl.EGLContext
and javax.microedition.khronos.egl.EGLContext for EglBase14 and
EglBase10 respectively. The reason is that clients can't be expected to
use only WebRTC's OpenGL code and might need to integrate with their
own GL code.

Bug: None
Change-Id: Ie00a564de45a090683542a52005da7e43c586ced
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127888
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27205}
2019-03-20 11:26:19 +00:00
Karl Wiberg
0611a15c29 Make the stacktrace unit test more robust
The stacktrace unit test was flaking on arm32; my theory is that this
happened when the thread whose stack we were dumping was doing a
system call inside `params->deadlock_start_event.Set();` in
ThreadFunction(). (This would be a problem because, according to the
comment at the bottom of the file, "stack traces originating from
kernel space do not include user space stack traces for ARM32.")

Attempt to solve this problem by spinning on an atomic flag instead,
since this involve no system calls. And add a short sleep to the main
thread, to give the other thread time to get from the barrier to the
thing it's actually supposed to deadlock on.

Bug: webrtc:10420
Change-Id: I4c6392157c8a06c64cb11146ffe9368e5bade6fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128340
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27158}
2019-03-18 11:19:13 +00:00
Karl Wiberg
ab03638eb6 Let threads opt in to having their stack traces printed
The video decoder thread is the pilot user.

For now this is an Android-only feature, since that's the only
platform we can print stack traces on.

Bug: webrtc:9987
Change-Id: Ie638c619673b5f159d91a32683fd787baf46479a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126222
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27127}
2019-03-14 11:46:28 +00:00
Danil Chapovalov
471783fc87 Remove rtc::QueuedTask alias, use webrtc::QueuedTask directly
Use absl::WrapUnique/absl::make_unique to create the queued tasks.

Bug: webrtc:10191
Change-Id: I8f47a60cb326b0fc361c7f0e338b25373d39937c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126525
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27063}
2019-03-11 16:49:21 +00:00
Danil Chapovalov
ad89528051 Reland "Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current"
This reverts commit 42d8c93ec3.

Reason for revert: Got Aliby for FEC test flakes

Original change's description:
> Revert "Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current"
> 
> This reverts commit 304e9d2df3.
> 
> Reason for revert: Breaks downstream projects.
> Seems to make VideoSendStreamTest.SupportsFlexfecSimulcastVp8 flaky.
> 
> Original change's description:
> > Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current
> > 
> > Bug: webrtc:10191
> > Change-Id: I506cc50a90c73a6a4f6a3de36de0999cca72f5ba
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126230
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#27035}
> 
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org
> 
> Change-Id: If98324f88e4b3d18bf2fe33597dfb9711867c243
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10191
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126484
> Reviewed-by: Yves Gerey <yvesg@webrtc.org>
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27041}

TBR=danilchap@webrtc.org,kwiberg@webrtc.org,yvesg@webrtc.org

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

Bug: webrtc:10191
Change-Id: Id87a17ae415142b8e0b11ba03ae7bad84a473fb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126720
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Yves Gerey <yvesg@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27056}
2019-03-11 12:32:49 +00:00
Yves Gerey
42d8c93ec3 Revert "Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current"
This reverts commit 304e9d2df3.

Reason for revert: Breaks downstream projects.
Seems to make VideoSendStreamTest.SupportsFlexfecSimulcastVp8 flaky.

Original change's description:
> Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current
> 
> Bug: webrtc:10191
> Change-Id: I506cc50a90c73a6a4f6a3de36de0999cca72f5ba
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126230
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27035}

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

Change-Id: If98324f88e4b3d18bf2fe33597dfb9711867c243
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10191
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126484
Reviewed-by: Yves Gerey <yvesg@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27041}
2019-03-08 16:14:54 +00:00
Danil Chapovalov
304e9d2df3 Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current
Bug: webrtc:10191
Change-Id: I506cc50a90c73a6a4f6a3de36de0999cca72f5ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126230
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27035}
2019-03-08 13:17:46 +00:00
Niels Möller
87e2d785a0 Prepare for splitting FrameType into AudioFrameType and VideoFrameType
This cl deprecates the FrameType enum, and adds aliases AudioFrameType
and VideoFrameType.

After downstream usage is updated, the enums will be separated
and be moved out of common_types.h.

Bug: webrtc:6883
Change-Id: I2aaf660169da45f22574b4cbb16aea8522cc07a6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/123184
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27011}
2019-03-07 10:12:57 +00:00
Sami Kalliomäki
67f862ea96 Guard against calls to OnEncodedFrame after Release.
Bug: b/126961661
Change-Id: I62ad5cb2fac5d0ae2b781390ec3b847d8a2b739c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125725
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26998}
2019-03-06 16:28:16 +00:00
Peter Wen
7bc331f664 Android: Use android_deps directly
This is preparing for upstream removing the alias java_groups for the
individual support library targets: https://crrev.com/c/1500780

Bug: chromium:937987
Change-Id: I1c9efd83f6997288b334f3dc2f41233fa4e2ab61
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125961
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#26995}
2019-03-06 15:14:42 +00:00
Danil Chapovalov
07a4f2b267 Merge rtc_task_queue(_api|_impl)? build targets into one
Ignore rtc_link_task_queue_impl flag,
instead use build_with_chromium for custom chromium implementation injection

This changes TaskQueue implementation used in webrtc fuzzers in chromium:
from own webrtc implementation to chromium's.

Bug: webrtc:10191
Change-Id: I63be28b680ae8ea8ee1dbf0c699263c392ce29d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125196
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26977}
2019-03-05 20:13:38 +00:00
Niels Möller
6ec2f547d7 Fix mis-spelled TODO items
No-Try: true
Tbr: kwiberg@webrtc.org
Bug: webrtc:10198
Change-Id: Iedcafb89d3fd39a812d410db1b2ed6fac8fade38
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125724
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26972}
2019-03-05 13:45:39 +00:00
Paulina Hensman
0a16916ac8 Use JavaAudioDeviceModule as default
Previously, we have created a Legacy ADM when no ADM is supplied.
With this change we will start creating a Java ADM instead.

The end goal is to make injection mandatory, and never creating ADMs.
This is one step on the way, and will allow us to clean up the Legacy
ADM code.

Bug: webrtc:7452
Change-Id: Ib99adc50346fe6b748f9435d2fc6321a50c3ee4e
Reviewed-on: https://webrtc-review.googlesource.com/c/123887
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26949}
2019-03-04 13:44:33 +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
philipel
d1d0359895 Remove memsets of CodecSpecificInfo.
CodecSpecificInfo has a default constructor, so initializing by memset is not necessary and is in the way of adding non-trivial members.

Related chromium CL: https://chromium-review.googlesource.com/c/chromium/src/+/1495533

Bug: webrtc:10342
Change-Id: I36046f919f5fc34ea51de7288ff5c9cc0f2950b8
Reviewed-on: https://webrtc-review.googlesource.com/c/125093
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26924}
2019-03-01 13:30:56 +00:00
Mirko Bonadei
fc52b912a3 Implicitly suppress //build/config/clang:find_bad_constructs.
Since there is no way to enable/disable these diagnostics at runtime,
this CL moves the suppression into the rtc_* templates in order to
remove the need to explicitly add the snippet of code needed to
suppress it (currently copy/pasted in 144 locations).

The diagnostic that causes the most problems is the one about "complex
class/struct explicit ctor/dtor" [1] because WebRTC doesn't find
it useful enough.

Other diagnostics are good (for example the one that warns about
using "virtual" instead of "override", but that will be covered by
this clang-tidy check [2]) while others are Chromium related so
they have never triggered.

[1] - https://cs.chromium.org/chromium/src/tools/clang/plugins/FindBadConstructsConsumer.cpp?l=147-167&rcl=b4bebe1aa15dba7ca5fcc6456a81a55665327c3a
[2] - https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html

Bug: webrtc:163
Change-Id: Icbf27efa5b369100a31e6a32df1a0913729b3b34
Reviewed-on: https://webrtc-review.googlesource.com/c/125088
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26918}
2019-03-01 10:18:17 +00:00
Danil Chapovalov
328027b6c4 Replace fatal error with error log
While passing negative delta is an error it is not fatal and recovered next line.

Bug: None
Change-Id: I3b9ce234a7763ba92bd158c9eda8ba4bd7a06f4b
Reviewed-on: https://webrtc-review.googlesource.com/c/124702
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26916}
2019-03-01 07:02:42 +00:00
Karl Wiberg
6fe413df0e sdk/android:native_api_stacktrace: Declare a more narrow set of dependencies
Bug: webrtc:10308
Change-Id: Ib8bc341c926f1de9f75b7488f20dbc71ac111c8e
Reviewed-on: https://webrtc-review.googlesource.com/c/124994
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26914}
2019-03-01 02:53:11 +00:00
Paulina Hensman
cf7c58458e Only draw frames with height and width >0
There has been some crashes due to frames having illegal sizes, most
likely 0x0. Probably these frames are created as a workaround for
something.

It would be best to stop 0x0 frames from being created in the first
place, but a reasonable quick fix is to just not draw those frames.

Bug: webrtc:10367
Change-Id: Ib93057c4de7285773c99614b4e7d9bd4b099c4dc
Reviewed-on: https://webrtc-review.googlesource.com/c/124988
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26897}
2019-02-28 14:08:38 +00:00
Mirko Bonadei
28221dee85 Fix more -Wextra-semi.
Chromium has enabled -Wextra-semi on Android, iOS and Windwos builds:
https://chromium-review.googlesource.com/c/1489138
https://chromium-review.googlesource.com/c/1489180
https://chromium-review.googlesource.com/c/1489102

This CL fixes some minor problems in WebRTC and it is a follow-up of
https://webrtc-review.googlesource.com/c/src/+/123560 and
https://webrtc-review.googlesource.com/c/124440.

Bug: webrtc:10355, chromium:926235
Change-Id: Ie9e49077a72c783c3e0fbc21bbe237d7338407e4
Reviewed-on: https://webrtc-review.googlesource.com/c/124680
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26873}
2019-02-27 11:36:23 +00:00
Åsa Persson
f2889bbaf4 Add option to inject YuvConverter to SurfaceTextureHelper.
Add option to inject VideoFrameDrawer to YuvConverter and EglRenderer.

Bug: none
Change-Id: I0aab0026c30b41d72f70fb00b251aed5e4a4a774
Reviewed-on: https://webrtc-review.googlesource.com/c/123443
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26848}
2019-02-26 07:47:52 +00:00
Karl Wiberg
32562250ca "Remove" loophole in rtc::Thread::ScopedDisallowBlockingCalls
It was previously possible to escape the sandbox by calling
rtc::Thread::SetAllowBlockingCalls(true).

This CL only removes the loophole on non-Android builds, because we
still have old Android code that relies on it. We expect that code to
go away soon-ish, though.

Bug: webrtc:9987
Change-Id: Ida96400d0abe430af4c2046284795d37d64f6613
Reviewed-on: https://webrtc-review.googlesource.com/c/123523
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26792}
2019-02-21 13:20:53 +00:00
Alvaro Martinez
ce27875b83 [AndroidAudioRecord] Added audio format parameter to configure AudioRecord - JavaAudioDeviceModule
Added audio format field and set method to Builder. - WebRTCAudioRecord. Added audio format field, added to constructor. Default audio format value AudioFormat.ENCODING_PCM_16BIT. initRecord(), added how to calculate bytesPerFrame, depends on audioFormat.

First commit and contribution, updated AUTHORS file

Bug: None
Change-Id: I16f660d42350ec9ce2e329b239bd7f6324e76dfe
Reviewed-on: https://webrtc-review.googlesource.com/c/122302
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26775}
2019-02-20 15:08:53 +00:00
Magnus Jedvert
e9652ca6ec Android: Add video processing interface
This CL adds an API for injecting video processing after the WebRTC
CPU and QP scaling step.

Bug: webrtc:10247
Change-Id: I776498e1e9113f50e953ee411bbb31f181863312
Reviewed-on: https://webrtc-review.googlesource.com/c/119953
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26740}
2019-02-18 15:46:42 +00:00
Sami Kalliomäki
3073c728ac Fix AndroidVideoDecoderTest for new Robolectric version.
New Robolectric version doesn't allow Surface to be constructed with a
null SurfaceTexture.

Bug: webrtc:10323
Change-Id: Ib6991d40b12b81d16ecb04787945cc4045e99b40
Reviewed-on: https://webrtc-review.googlesource.com/c/123236
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26734}
2019-02-18 12:56:42 +00:00
Mirko Bonadei
d2f04360a6 Make sdk/android:{audio,video}_api_java publicly visible.
Bug: None
Change-Id: I7a2b4d643fa776b4bf2ab3a4860bbc8892dc1a86
Reviewed-on: https://webrtc-review.googlesource.com/c/123229
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26732}
2019-02-18 09:03:11 +00:00
Niels Möller
dac03d9bb0 Move MediaConstraintsInterface to sdk/, and make it a concrete class
Bug: webrtc:9239
Change-Id: I545ebf59b078dd94bc466886616dd374e4b2e226
Reviewed-on: https://webrtc-review.googlesource.com/c/122502
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26682}
2019-02-14 12:07:07 +00:00
Niels Möller
260a71d47c Delete deprecated method PeerConnectionFactory::CreateVideoSource
Bug: webrtc:6353
Change-Id: Icb8847b234e7a844a4dff9ff44861f6967ac7b5b
Reviewed-on: https://webrtc-review.googlesource.com/c/118661
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26587}
2019-02-07 14:24:02 +00:00
Magnus Jedvert
9025bd5142 Separate AndroidVideoTrackSource::OnFrameCaptured from adaptation
AndroidVideoTrackSource::OnFrameCaptured currently does adaptation
before passing frames on. We want to add video processing between
adaptation and delivering the frame to the rest WebRTC C++. This
CL prepares for that by splitting OnFrameCaptured() into a separate
adaptation step and delivery step.

Bug: webrtc:10247
Change-Id: Iab759bac7f3072d4552ece80d0b81fc3e634c64c
Reviewed-on: https://webrtc-review.googlesource.com/c/119952
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26571}
2019-02-06 14:33:59 +00:00
Magnus Jedvert
99b275d126 Introduce class that handles native wrapping of AndroidVideoTrackSource
This CL attempts to do separation of concerns by introducing a simple
class that only handles JNI wrapping of a C++ AndroidVideoTrackSource.
This layer can be easiliy mocked out in Java unit tests.

Bug: webrtc:10247
Change-Id: Idbdbfde6d3e00b64f3f310f76505801fa496580d
Reviewed-on: https://webrtc-review.googlesource.com/c/121562
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26556}
2019-02-05 16:36:26 +00:00
Magnus Jedvert
167316b833 Remove proxy layer from AndroidVideoTrackSource
This layer is not needed since the methods are thread safe, and the
classes those method touches (VideoBroadcaster, cricket::VideoAdapter)
are thread safe.

Bug: webrtc:10247
Change-Id: Id4e309de4ac1b9669052aaa60d3bd1ed965aaa29
Reviewed-on: https://webrtc-review.googlesource.com/c/120801
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26543}
2019-02-05 10:50: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
Mirko Bonadei
d970807e0c Remove rtc_base/scoped_ref_ptr.h.
The type rtc::scoped_refptr<T> is now part of api/. Please include it from
api/scoped_refptr.h.

More info: See: https://groups.google.com/forum/#!topic/discuss-webrtc/Mme2MSz4z4o.

Bug: webrtc:9887, webrtc:8205
No-Try: True
Change-Id: Ic6c7c81e226e59f12f7933e472f573ae097b55bf
Reviewed-on: https://webrtc-review.googlesource.com/c/119041
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26414}
2019-01-25 20:29:58 +00:00
Magnus Jedvert
443760d4ba Android: Add option to print native stack traces in PeerConnectionFactory API
This CL hooks up the recently added native stack trace functionality to
the existing PeerConnectionFactory API.

Bug: webrtc:10168
Change-Id: I16189d2988b1359fc53f9a4d0b3d06f34e2a8fd5
Reviewed-on: https://webrtc-review.googlesource.com/c/118600
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26344}
2019-01-21 16:07:26 +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
fad0893688 Android: Remove static thread references from PeerconnectionFactory
This CL prepares for adding stack trace capability to the native part of
the Android PeerConnectionFactory code. The main blocker this CL removes
is the static printStackTrace() function. We need this function to be
non-static since the C++ counterpart of PCF is non-static. This Cl also
performs various other cleanups in surrounding code.

This CL:
 * Removes static thread references from PeerconnectionFactory and turns
   them into non-static member variables.
 * Adds a non-static alternative to
   PeerconnectionFactory.printStackTraces().
 * Removes the rtc::Thread::Invoke() calls, and turns them into
   asynchronous posts.
 * Consolidates the two different Java PCF ctors into one, so that there
   is one shared path used by both native API and Java API.

Bug: webrtc:10168
Change-Id: I05dbf5b17069d4a115d9adafc25faa121f23b945
Reviewed-on: https://webrtc-review.googlesource.com/c/115961
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26329}
2019-01-20 12:14:05 +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
Erik Språng
f93eda1705 Move some video codec constants to separate file.
kMaxSimulcastStreams, kMaxSpatialLayers and kMaxTemporalStreams don't
really beling on VideoBitrateAllocation.
common_types.h is going away and it feels dubious to requrie include
of the full VideoEncoder api to use them. Therefore moving them into a
seprate file/target.

Also includes some remaining cleanup of includes.

Bug: webrtc:9271
Change-Id: I7ded3d97a9a835ac756159700774445a2b93a697
Reviewed-on: https://webrtc-review.googlesource.com/c/117305
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26299}
2019-01-17 15:29:53 +00:00
Niels Möller
24871e4cbe Rename EncodedImage::_buffer --> buffer_, and make private
Bug: webrtc:9378
Change-Id: I0a0636077b270a7c73bafafb958132fa648aca70
Reviewed-on: https://webrtc-review.googlesource.com/c/117722
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26294}
2019-01-17 12:38:15 +00:00
Niels Möller
77536a2b81 Rename EncodedImage::_length --> size_, and make private.
Use size() accessor function. Also replace most nearby uses of _buffer
with data().

Bug: webrtc:9378
Change-Id: I1ac3459612f7c6151bd057d05448da1c4e1c6e3d
Reviewed-on: https://webrtc-review.googlesource.com/c/116783
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26273}
2019-01-16 07:40:47 +00:00
Qingsi Wang
a0d4580936 Add the equals method to IceServer.
Bug: None
Change-Id: I4bac54489a44a4577cc221ba51351e4a3a92e69b
Reviewed-on: https://webrtc-review.googlesource.com/c/116081
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26271}
2019-01-16 01:06:17 +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
Bjorn Terelius
b8b3c9918f Clean up visibility and dependencies of RTC event log build targets.
- Remove visibility of encoder target.
- Remove unnecessary dependency on task_queue.
- Remove CreateRtcEventLogFactory() declaration from the rtc_event_log_api target
  since the function is not defined in that target.

Bug: None
Change-Id: Id9edee86f358d08ea063d62bd96e9653c5b06d55
Reviewed-on: https://webrtc-review.googlesource.com/c/116060
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26215}
2019-01-11 11:05:12 +00:00