Commit graph

572 commits

Author SHA1 Message Date
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
Magnus Jedvert
80e7a7fd1a Android: Output VideoFrames from SurfaceTextureHelper
Bug: webrtc:9412
Change-Id: Iffc8dae2fdfb8d7e5c730b433614b7aa30ceb55b
Reviewed-on: https://webrtc-review.googlesource.com/83943
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23867}
2018-07-06 10:34:41 +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
Magnus Jedvert
b4918dad6a Android: Deprecated custom matrix helper functions in RendererCommon
All usage of these functions should be migrated to use
android.opengl.Matrix instead.

Bug: webrtc:9487
Change-Id: I023761b31cae7e7af9b537928b849657baa5bb8b
Reviewed-on: https://webrtc-review.googlesource.com/87263
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23853}
2018-07-05 12:16:34 +00:00
Magnus Jedvert
783c6e3a72 Android camera: Replace custom matrix operations with android.opengl.Matrix
Bug: webrtc:9412, webrtc:9487
Change-Id: I68e5a03026b1ab8236a05ece79690d4a8755c093
Reviewed-on: https://webrtc-review.googlesource.com/86947
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23851}
2018-07-05 12:02:24 +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
Magnus Jedvert
431f14ef69 Android: Remove deprecated VideoRenderer and I420Frame
Bug: webrtc:9181
Change-Id: I9a38a35ae33ed385a9a5add0a5f51ec035019d91
Reviewed-on: https://webrtc-review.googlesource.com/71661
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23849}
2018-07-05 10:37:59 +00:00
Magnus Jedvert
f4aeb891b7 Android: Handle StartRecording() failure gracefully
This CL also adds a test to test the behavior when StartRecording()
fails, which is the case when e.g. the microphone is already in use.

Bug: webrtc:9491
Change-Id: Ifce60ce5e9b7fa7521ca5c9fe20794233456b9ce
Reviewed-on: https://webrtc-review.googlesource.com/87105
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23842}
2018-07-04 14:08:54 +00:00
Mirko Bonadei
23f71a8144 Remove usage of //build/config/clang:extra_warnings.
Bug: webrtc:9251
Change-Id: I13522eafff1a4d6a9fe909c305efa0e4581a56c7
Reviewed-on: https://webrtc-review.googlesource.com/86880
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23819}
2018-07-03 12:35:49 +00:00
Emircan Uysaler
98badbcd9f Add VP9 profile negotiation to SDP
This CL adds VP9 profile information in SDP. It adds the necessary fields and
enums to codec containers.

Additional profiles will be followed.

Bug: webrtc:9376
Change-Id: I78574714f06f8087262a71dd64c01f31a229dd54
Reviewed-on: https://webrtc-review.googlesource.com/81960
Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23810}
2018-07-02 23:38:41 +00:00
Qingsi Wang
9f1de69008 Add ADAPTER_TYPE_ANY in AdapterType.
ADAPTER_TYPE_ANY can be used to set the network ignore mask if an
application does not want candidates from the any address ports, the
underlying network interface types of which are not determined in
gathering. The ADAPTER_TYPE_ANY is also given the maximum network cost
so that when there are candidates from explicit network interfaces,
these candidates from the any address ports as backups, if they ever
surface, are not preferred if the other candidates have at least the
same network condition.

Bug: webrtc:9468
Change-Id: I20c3a40e9a75b8fb34fad741ba5f835ecc3b0d92
Reviewed-on: https://webrtc-review.googlesource.com/85880
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23807}
2018-07-02 17:59:11 +00:00
Taylor Brandstetter
dc99e244ca Removing deadbeef@ from OWNERS files.
Since I'm leaving Google.

Bug: None
Notry: True
Change-Id: Ibb5c3e09fce007d149200dcb6cac74be53084764
Reviewed-on: https://webrtc-review.googlesource.com/86461
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23795}
2018-07-02 00:40:38 +00:00
Paulina Hensman
7a29426142 Detach audio devices from thread on terminate.
To allow the AudioDeviceModule to be reinitialized on a different thread
after termination, detach AudioDeviceModule and the input/output devices
when Terminate is called. Also destroy the AudioDeviceBuffer.

Bug: webrtc:7452
Change-Id: I50ef77c531f33d4efa0567d0475dd8280337bed9
Reviewed-on: https://webrtc-review.googlesource.com/86127
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23784}
2018-06-29 12:00:17 +00:00
Paulina Hensman
1ec04f19c6 Reland "Reland "Injectable logging""
This is a reland of 21219a0e43

The default implementation of OnLogMessage(msg, sev, tag) discarded
the tag, resulting in FileRotatingLogSink not receiving tags.

Since the revert the default implementation of
OnLogMessage(msg, sev, tag) has been updated to add the tag to the log
message. A more efficient implementation of it has also been added for
FileRotatingLogSink.

Unit tests are added for the default implementation and for Loggable
injection.

Original change's description:
> Reland "Injectable logging"
>
> Any injected loggable or NativeLogger would be deleted if PCFactory
> was reinitialized without calling setInjectableLogger. Now native
> logging is not implemented as a Loggable, so it will remain active
> unless a Loggable is injected.
>
> This is a reland of 59216ec4a4
>
> Original change's description:
> > Injectable logging
> >
> > Allows passing a Loggable to PCFactory.initializationOptions, which
> > is then injected to Logging.java and logging.h. Future log messages
> > in both Java and native will then be passed to this Loggable.
> >
> > Bug: webrtc:9225
> > Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> > Reviewed-on: https://webrtc-review.googlesource.com/73243
> > Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#23241}
>
> Bug: webrtc:9225
> Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee
> TBR: kwiberg
> Reviewed-on: https://webrtc-review.googlesource.com/77140
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23310}

Bug: webrtc:9225
Change-Id: I67a5728fe772f0bedc9509713ed8b8ffdc31af81
TBR: kwiberg
Reviewed-on: https://webrtc-review.googlesource.com/80860
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23711}
2018-06-21 13:44:53 +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
Mirko Bonadei
beb2d9813c Removing usage of //build/config/compiler:no_size_t_to_int_warning.
Bug: webrtc:9251, webrtc:1348
Change-Id: I76e52abbfab5666cad73044b49172a9799539108
Reviewed-on: https://webrtc-review.googlesource.com/84144
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23686}
2018-06-20 13:44:26 +00:00
Mirko Bonadei
de212ca039 Removing some MSVC warning suppression flags.
Bug: webrtc:9251
Change-Id: Idf13b49648459a37fe0a3cac12ff993ce27439d9
Reviewed-on: https://webrtc-review.googlesource.com/84281
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23685}
2018-06-20 12:41:46 +00:00
Paulina Hensman
fa2b8d7456 Add separate native library for instrumentationtests
Also adds api in PCF for specifying which library to load.

This is in preparation for a CL adding a native function
to be used only in tests.

Bug: webrtc:9225
Change-Id: I72eff272350404729424176758bfa81f7da81836
Reviewed-on: https://webrtc-review.googlesource.com/84125
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23663}
2018-06-19 14:59:06 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Niels Möller
5d848f3ad6 Delete picture id and tl0 index from CodecSpecificInfo.
This is a followup to https://webrtc-review.googlesource.com/61640,
moving the responsibility for setting these values to the
PayloadRouter.

Bug: webrtc:8830
Change-Id: I8e5a02cf7bb7417166f04d5511aab7a778799bc1
Reviewed-on: https://webrtc-review.googlesource.com/83164
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23654}
2018-06-19 11:14:16 +00:00
Magnus Jedvert
c66613daf7 Android: Simlify createOesTextureBuffer() in VideoFrameBufferTest
There is no need to hold on to the render thread after the OES texture
buffer has been created. toI420() is handled by the thread in the
SurfaceTextureHelper.

Bug: webrtc:9391
Change-Id: Ide081bc083db72bb991f1deba74d3cecf3e1fee6
Reviewed-on: https://webrtc-review.googlesource.com/84121
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23652}
2018-06-19 10:26:46 +00:00
Jonas Olsson
f8e5c110ee Refactor checks to use a copy of the new logging backend.
As a bonus, this shrinks the android release version of libjingle_peerconnection_so.so by ~25k in local tests.

We could try to unify the backend with the logging one, but that turns out to be surprisingly tricky due to dependency loops and chromium overrides.

Bug: webrtc:8982
Change-Id: I66854dd333f568d9b2a5f46bbead14b2e31179be
Reviewed-on: https://webrtc-review.googlesource.com/79623
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23634}
2018-06-15 13:48:25 +00:00
Magnus Jedvert
65c61dcfce Android: Add helper class for generating OpenGL shaders
This CL adds a helper class GlShaderBuilder to build an instances of
RendererCommon.GlDrawer that can accept multiple input sources
(OES, RGB, or YUV) using a generic fragment shader as input.

Bug: webrtc:9355
Change-Id: I14a0a280d2b6f838984f7b60897cc0c58e2a948a
Reviewed-on: https://webrtc-review.googlesource.com/80940
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23622}
2018-06-15 09:06:45 +00:00
Magnus Jedvert
6507054db1 Android: Add tests for VideoFrame.Buffer.toI420() and cropAndScale()
This CL adds tests that are primarily targeting
VideoFrame.Buffer.toI420() and cropAndScale(), but includes the whole
chain for YuvConverter, GlRectDrawer, and VideoFrameDrawer.

It also includes a couple of fixes to bugs that were exposed by the new
tests.

Bug: webrtc:9186, webrtc:9391
Change-Id: I5eb62979a8fd8def28c3cb2e82dcede57c42216f
Reviewed-on: https://webrtc-review.googlesource.com/83163
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23611}
2018-06-14 11:06:37 +00:00
Magnus Jedvert
b7700d370d Android: Fix VideoTrack behavior for adding/removing VideoSinks
In particular:
 * Trying to remove a VideoSink that was not attached should be a no-op.
 * Trying to remove a null VideoSink should be a no-op.
 * Adding the same VideoSink multiple times should a no-op, and should
   not create duplicate native VideoSinks.
 * Trying to add a null VideoSink should throw an exception in the Java
   layer instead of crashing in native code.

This CL also adds tests that verify these behaviors.

Bug: webrtc:9403
Change-Id: I928b7bb7f683634e287d7fec9e26f4179f73c150
Reviewed-on: https://webrtc-review.googlesource.com/83322
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23602}
2018-06-13 15:51:17 +00:00
Niels Möller
e3cf3d0496 Use enum class for VideoCodecMode and VideoCodecComplexity.
Bug: webrtc:7660
Change-Id: I6a8ef01f8abcc25c8efaf0af387408343a7c8ba3
Reviewed-on: https://webrtc-review.googlesource.com/81240
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23595}
2018-06-13 12:26:09 +00:00
Zhi Huang
b57e169f3c Add a flag to actively reset the SRTP parameters
Add a new flag to RtcConfiguration. By setting that flag to true, the
SRTP parameters will be reset whenever the DTLS transports are reset
after every offer/answer negotiation.

The flag is added to Android and Objc wrapper as well.

This should only be used as a workaround for the linked bug, if the
application knows that the other party is affected (for instance,
using a version number).

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

Bug: chromium:835958
Change-Id: I6db025e1c69bf83e1b1908f7df4627430db9920c
Reviewed-on: https://webrtc-review.googlesource.com/83101
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23587}
2018-06-12 20:32:00 +00:00
Florent Castelli
abe301fe6c Add HeaderExtensions to RtpParameters
Bug: webrtc:7580
Change-Id: I4fcf3e8bc4975a6b2baa6f24a17c254d2bf521d9
Reviewed-on: https://webrtc-review.googlesource.com/78288
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23584}
2018-06-12 17:01:40 +00:00
Anders Carlsson
dd3e0ab2bf Make rtc_software_fallback_wrappers target visible.
Need to depend on them from Chromium.

Bug: webrtc:7925
Change-Id: Iea1bb3b937c602920bfd87f885c87c790ac7bc17
Reviewed-on: https://webrtc-review.googlesource.com/82061
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23580}
2018-06-12 12:51:34 +00:00
Anders Carlsson
80a0a4c482 Remove software fallback in Android hardware codec factories.
Remove backwards compatiblity. Users who need software codecs should
migrate to the DefaultVideoCodecFactories.

Bug: webrtc:7925
Change-Id: Ifb41c9511d53c17c83222422c221b595bc056cb2
Reviewed-on: https://webrtc-review.googlesource.com/82920
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23563}
2018-06-11 15:59:09 +00:00
Magnus Jedvert
fe89271bee Android: Use JavaToNativeString in PeerConnectionFactory_InitializeFieldTrials
Bug: b/109736242
Change-Id: I56a404c2e6c8c842b23465249f72897cee0878b5
Reviewed-on: https://webrtc-review.googlesource.com/81742
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23558}
2018-06-09 17:38:06 +00:00
henrika
ec9c745228 Adds support for new Windows ADM with limited API support.
Summary of what this CL does:

Existing users can keep using the old ADM for Windows as before.

A new ADM for Windows is created and a dedicated factory method is used
to create it. The old way (using AudioDeviceImpl) is not utilized.

The new ADM is based on a structure where most of the "action" takes
place in new AudioInput/AudioOutput implementations. This is inline
with our mobile platforms and also makes it easier to break out common
parts into a base class.

The AudioDevice unittest has always mainly focused on the "Start/Stop"-
parts of the ADM and not the complete ADM interface. This new ADM supports
all tests in AudioDeviceTest and is therefore tested in combination with
the old version. A value-parametrized test us added for Windows builds.

Improved readability, threading model and makes the code easier to maintain.

Uses the previously landed methods in webrtc::webrtc_win::core_audio_utility.

Bug: webrtc:9265
Change-Id: If2894b44528e74a181cf7ad1216f57386ee3a24d
Reviewed-on: https://webrtc-review.googlesource.com/78060
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23554}
2018-06-08 14:44:38 +00:00
Danil Chapovalov
350531e2a3 Revert "Move class VideoCodec from common_types.h to its own api header file."
This reverts commit efc71e565e.

Reason for revert: probably breaks downstream test

Original change's description:
> Move class VideoCodec from common_types.h to its own api header file.
> 
> Bug: webrtc:7660
> Change-Id: I91f19bfc2565461328f30081f8383e136419aefb
> Reviewed-on: https://webrtc-review.googlesource.com/79881
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23544}

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

Change-Id: Id8bd37c79c2f8d09a4d88368765230103f1db2c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7660
Reviewed-on: https://webrtc-review.googlesource.com/82101
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23547}
2018-06-08 11:04:23 +00:00
Niels Möller
efc71e565e Move class VideoCodec from common_types.h to its own api header file.
Bug: webrtc:7660
Change-Id: I91f19bfc2565461328f30081f8383e136419aefb
Reviewed-on: https://webrtc-review.googlesource.com/79881
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23544}
2018-06-08 07:55:04 +00:00
Magnus Jedvert
b616d09e1b Android: Add deprecation annotations to VideoRenderer and I420Frame
Bug: webrtc:9181
Change-Id: Ice569c88ce1a2cda6a314f2889c8b64b55cb8c8f
Reviewed-on: https://webrtc-review.googlesource.com/81746
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23543}
2018-06-08 07:46:24 +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
3ecec84c83 Android: Throw exception in CallSessionFileRotatingLogSink if dir is null
This CL throws an IllegalArgumentException in case the dir path argument
is null. This makes the error more clear than crashing in native JNI
code while trying to convert a null string.

Bug: b/106732994
Change-Id: Ib04ebf017c6e33b9896fc1e1db051a853838a7f4
Reviewed-on: https://webrtc-review.googlesource.com/81740
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23535}
2018-06-07 13:16:40 +00:00
Sami Kalliomäki
1659e97767 Use DecimalFormat instead of String.format.
Speculative fix to a problem where String.format crashes with
"java.lang.NullPointerException at Formatter$FormatSpecifier.addZeros :
Attempt to get length of null array" on some devices.

Bug: b/80240768
Change-Id: I8e67b7107a37ad7d6f978b9de368f14d37efecb2
Reviewed-on: https://webrtc-review.googlesource.com/80883
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23523}
2018-06-05 14:28:04 +00:00
Magnus Jedvert
e4e1ce903b Android: Remove deprecated CapturerObserver methods
Bug: webrtc:9181
Change-Id: Ibf558102f41bf9fa3fcfa2b4bab7c7675e889bfc
Reviewed-on: https://webrtc-review.googlesource.com/77682
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23521}
2018-06-05 14:03:56 +00:00
Ilya Nikolaevskiy
b6c462d4e4 Cleanup webrtc:: namespace from leaked TimingFrameFlags
Bug: webrtc:9351
Change-Id: Ifbc0a522bf13ab62a2e490b9f129eacfabe7796f
Reviewed-on: https://webrtc-review.googlesource.com/80961
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23520}
2018-06-05 13:52:04 +00:00
Mirko Bonadei
ab55c34ef1 Remove warning suppression flags from sdk/android.
Bug: webrtc:9251
Change-Id: Iafd10a09dd34dfdd590711bb5c6a36d08298d1e7
Reviewed-on: https://webrtc-review.googlesource.com/79882
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23513}
2018-06-04 20:08:40 +00:00
Niels Möller
520ca4e3b8 Delete enum RtpVideoCodecTypes, replaced with VideoCodecType.
Bug: webrtc:8995
Change-Id: I0b44aa26f2f6a81aec7ca1281b8513d8e03228b8
Reviewed-on: https://webrtc-review.googlesource.com/79561
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23507}
2018-06-04 11:53:17 +00:00
Alex Glaznev
5abd78b40a Revert "Reland "Injectable logging""
This reverts commit 21219a0e43.

Reason for revert: No tags are written when routing logs to a file - b/86953692

Original change's description:
> Reland "Injectable logging"
> 
> Any injected loggable or NativeLogger would be deleted if PCFactory
> was reinitialized without calling setInjectableLogger. Now native
> logging is not implemented as a Loggable, so it will remain active
> unless a Loggable is injected.
> 
> This is a reland of 59216ec4a4
> 
> Original change's description:
> > Injectable logging
> >
> > Allows passing a Loggable to PCFactory.initializationOptions, which
> > is then injected to Logging.java and logging.h. Future log messages
> > in both Java and native will then be passed to this Loggable.
> >
> > Bug: webrtc:9225
> > Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> > Reviewed-on: https://webrtc-review.googlesource.com/73243
> > Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#23241}
> 
> Bug: webrtc:9225
> Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee
> TBR: kwiberg
> Reviewed-on: https://webrtc-review.googlesource.com/77140
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23310}

TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,phensman@webrtc.org

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

Bug: webrtc:9225
Change-Id: I4d0a5990b5f742cc1a96afde3ca97fad9143d2d4
Reviewed-on: https://webrtc-review.googlesource.com/80641
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23498}
2018-06-01 20:10:26 +00:00
Sami Kalliomäki
aa35aeaa66 Write to file on a dedicated thread in VideoFileRenderer.
The disk cannot always keep up to with the frames produced. To solve
this, write to disk on a dedicated thread so we don't block rendering.

Bug: b/80409365
Change-Id: If9ef3eb6948d81deebb987420599fef446b082d6
Reviewed-on: https://webrtc-review.googlesource.com/79800
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23483}
2018-06-01 08:43:02 +00:00
Taylor Brandstetter
cdd05f0cc1 Implement proper SCTP data channel closing procedure.
The proper closing procedure is:
1. Alice resets outgoing stream.
2. Bob receives incoming stream reset, resets his outgoing stream.
3. Alice receives incoming stream reset; channel closed!
4. Bob receives acknowledgement of reset; channel closed!

https://tools.ietf.org/html/draft-ietf-rtcweb-data-channel-13#section-6.7

However, up until now we've been sending both an incoming and outgoing reset
from the side initiating the closing procedure, and doing nothing on the remote
side.

This means that if you call "Close" and the remote endpoint is using an old
version of WebRTC, the channel's state will be stuck at "closing" since the
remote endpoint won't send a reset. Which is already what happens when Firefox
is talking to Chrome.

This CL also fixes an issue where the DataChannel's state prematurely went to
"closed" before the closing procedure was complete. Which could result in a
new DataChannel attempting to re-use the ID and failing.

TBR=magjed@webrtc.org

Bug: chromium:449934, webrtc:4453
Change-Id: Ic1ba813e46538c6c65868961aae6a9780d68a5e2
Reviewed-on: https://webrtc-review.googlesource.com/79061
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23478}
2018-05-31 21:01:53 +00:00
Åsa Persson
613591a5b8 Add min_bitrate_bps to RtpEncodingParameters.
This CL adds the field but does not implement any functionality using it.

Bug: webrtc:9341
Change-Id: I533fc7f8bc1e40207aa16b834e0d7daa60709614
Reviewed-on: https://webrtc-review.googlesource.com/78741
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23466}
2018-05-31 10:17:57 +00:00
Sami Kalliomäki
cd51375e0c Write frames directly to disk in VideoFileRenderer.
Storing raw frames in memory leads to the application running out of
memory during long running tests.

Bug: b/80409365
Change-Id: I9fea171dc76cf0b3b6bba64c60a91353f69fafaa
Reviewed-on: https://webrtc-review.googlesource.com/79581
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23430}
2018-05-29 12:54:55 +00:00
Harald Alvestrand
73771a893f Prepare to remove old OnFailure implementations
This removes usage of the old OnFailure methods on CreateSessionDescriptionObserver
and SetSessionDescriptionObserver, so that WebRTC will continue to compile
once all the default implementations are removed.

Bug: chromium:589455
Change-Id: Id67295b3ad0c30d24d79589c2041acdd507a19f3
Reviewed-on: https://webrtc-review.googlesource.com/78480
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23427}
2018-05-29 10:34:14 +00:00
Florent Castelli
dacec71b16 Add Rtcp parameters for PeerConnection senders
Bug: webrtc:7580
Change-Id: Ibcf5e849a1f11f21fa75f6d006fecf1cd54f8552
Reviewed-on: https://webrtc-review.googlesource.com/78063
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23407}
2018-05-28 09:28:59 +00:00
Sami Kalliomäki
cc02cb595f Add getSupportedCodecs to VideoDecoderFactory interface.
The default implementation of the method is to return an empty list.
Clients should update their implementations before WebRTC starts calling
this method.

Also updates internal WebRTC implentations of this interface to
implement the method.

Bug: webrtc:7925
Change-Id: I258de2f09f6d4cc5dd9f4657e5d54e8411f8f5d8
Reviewed-on: https://webrtc-review.googlesource.com/77641
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23325}
2018-05-21 13:21:45 +00:00
Paulina Hensman
21219a0e43 Reland "Injectable logging"
Any injected loggable or NativeLogger would be deleted if PCFactory
was reinitialized without calling setInjectableLogger. Now native
logging is not implemented as a Loggable, so it will remain active
unless a Loggable is injected.

This is a reland of 59216ec4a4

Original change's description:
> Injectable logging
>
> Allows passing a Loggable to PCFactory.initializationOptions, which
> is then injected to Logging.java and logging.h. Future log messages
> in both Java and native will then be passed to this Loggable.
>
> Bug: webrtc:9225
> Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> Reviewed-on: https://webrtc-review.googlesource.com/73243
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23241}

Bug: webrtc:9225
Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee
TBR: kwiberg
Reviewed-on: https://webrtc-review.googlesource.com/77140
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23310}
2018-05-18 15:04:16 +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
Alex Glaznev
4f81038a52 Revert "Injectable logging"
This reverts commit 59216ec4a4.

Reason for revert:  forces all logs to have identical tag

Original change's description:
> Injectable logging
> 
> Allows passing a Loggable to PCFactory.initializationOptions, which
> is then injected to Logging.java and logging.h. Future log messages
> in both Java and native will then be passed to this Loggable.
> 
> Bug: webrtc:9225
> Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> Reviewed-on: https://webrtc-review.googlesource.com/73243
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23241}

TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,phensman@webrtc.org

Change-Id: I27c9587238325b69b26166434740869021b7db8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9225
Reviewed-on: https://webrtc-review.googlesource.com/76885
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23253}
2018-05-15 22:33:53 +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
Florent Castelli
cebf50ff75 Reland "Implement RtpParameters.transaction_id for PC RtpSenderInterface"
This is a reland of 5faf36ef3c
The issue in Chrome has been fixed and this should be safe to reland.

TBR=deadbeef

Original change's description:
> Implement RtpParameters.transaction_id for PC RtpSenderInterface
>
> The transaction_id field should be refreshed for every getParameters()
> call and checked at each setParameters() call.
> This also checks that getParameters() was ever called to return a proper
> error code.
>
> Bug: webrtc:7580
> Change-Id: I6c6fe289542e486fc422cdc61577982b0529d4c1
> Reviewed-on: https://webrtc-review.googlesource.com/70820
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23120}

Bug: webrtc:7580
Change-Id: Iabd41fb21afdf452c039d5513824ae334f8d1d3f
Reviewed-on: https://webrtc-review.googlesource.com/76980
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23247}
2018-05-15 15:51:02 +00:00
Paulina Hensman
59216ec4a4 Injectable logging
Allows passing a Loggable to PCFactory.initializationOptions, which
is then injected to Logging.java and logging.h. Future log messages
in both Java and native will then be passed to this Loggable.

Bug: webrtc:9225
Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
Reviewed-on: https://webrtc-review.googlesource.com/73243
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23241}
2018-05-15 12:36:01 +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
Gustavo Garcia
df3630d65d Fix retry opening camera if there is an exception during getParameters in Camera1Session
Bug: webrtc:8258
Change-Id: I27190bc57d9e80df3a40aac9e7114554289c2563
Reviewed-on: https://webrtc-review.googlesource.com/47820
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23210}
2018-05-14 10:04:49 +00:00
Niels Möller
c6ce9c5938 New file api/video/BUILD.gn
Build targets involving files under api/video/ are moved into this
file, from api/BUILD.gn. In addition, drop "_api" part of target
names, and move the header file api/videosinkinterface.h to
api/video/video_sink_interface.h.

Bug: webrtc:9253
Change-Id: I2896d3f063db8dff902bc29738578395b2fcc155
Reviewed-on: https://webrtc-review.googlesource.com/75500
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23207}
2018-05-14 06:57:38 +00:00
Sami Kalliomäki
ee98be7811 Fix handling non-tightly packed ByteBuffers in HardwareVideoDecoder.
Before this CL, there would be an out-of-bounds write in the ByteBuffer
copying when a decoded frame had height != sliceHeight.

Bug: webrtc:9194
Change-Id: Ibb80e5555e8f00d9e1fd4cb8a73f5e4ccd5a0b81
Tested: 640x360 loopback with eglContext == null in AppRTCMobile on Pixel.
Reviewed-on: https://webrtc-review.googlesource.com/74120
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23184}
2018-05-09 09:15:46 +00:00
Paulina Hensman
24bebb86bd Add checks and offset when using byteBuffer in WebRtcAudioRecord.
See bug for more info.

In this case, the offset of the byteBuffer was observed to be 4 bytes
when testing, meaning that the first 4 bytes sent to the AudioSamples
callback were empty, and the last 4 bytes that should have been sent
were not sent.

This CL adjusts the range copied from the backing array to match the
offset.

Bug: webrtc:9175
Change-Id: I40ac6e10c6d7058ead7eff1c9fa2f342920cf2a4
Reviewed-on: https://webrtc-review.googlesource.com/75123
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23172}
2018-05-08 12:36:22 +00:00
Rasmus Brandt
5f0d0e737e Re-enable PeerConnectionTest#testTrackRemovalAndAddition.
Let the test expect calls to onRenegotiationNeeded(), as introduced by
https://codereview.webrtc.org/2977493002.

Bug: webrtc:7761
Change-Id: If8e3c484236f6599cc225a0398bbbc9cf6c356a5
Reviewed-on: https://webrtc-review.googlesource.com/48364
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23165}
2018-05-08 09:57:26 +00:00
Niels Möller
8df3a388a3 Deprecate RTPFragmentationHeader argument to VideoDecoder::Decode
Intend to delete in a later cl.

Bug: webrtc:6471
Change-Id: Icf0fcd40e0d3287dc59b684fae6552b40b47204a
Reviewed-on: https://webrtc-review.googlesource.com/39511
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23162}
2018-05-08 08:09:35 +00:00
Seth Hampson
31dbc246d7 Adding PeerConnection.Observer.onTrack to the Java SDK.
Bug: webrtc:8869
Change-Id: I4c33f9ddf293af8c093a8726431a3574ff2b6e39
Reviewed-on: https://webrtc-review.googlesource.com/73966
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23155}
2018-05-07 18:22:48 +00:00
Max Morin
909338b027 Revert "Implement RtpParameters.transaction_id for PC RtpSenderInterface"
This reverts commit 5faf36ef3c.

Reason for revert: fast/peerconnection/RTCRtpSender-setParameters.html
 failing in webrtc roll, probably this CL? https://chromium-review.googlesource.com/c/chromium/src/+/1045889.

Original change's description:
> Implement RtpParameters.transaction_id for PC RtpSenderInterface
> 
> The transaction_id field should be refreshed for every getParameters()
> call and checked at each setParameters() call.
> This also checks that getParameters() was ever called to return a proper
> error code.
> 
> Bug: webrtc:7580
> Change-Id: I6c6fe289542e486fc422cdc61577982b0529d4c1
> Reviewed-on: https://webrtc-review.googlesource.com/70820
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23120}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,sakal@webrtc.org,kthelgason@webrtc.org,orphis@webrtc.org

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

Bug: webrtc:7580
Change-Id: I86da108227f8fc8d235bb2e9559377c800595b8c
Reviewed-on: https://webrtc-review.googlesource.com/74740
Reviewed-by: Max Morin <maxmorin@webrtc.org>
Commit-Queue: Max Morin <maxmorin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23134}
2018-05-07 08:02:34 +00:00
Florent Castelli
5faf36ef3c Implement RtpParameters.transaction_id for PC RtpSenderInterface
The transaction_id field should be refreshed for every getParameters()
call and checked at each setParameters() call.
This also checks that getParameters() was ever called to return a proper
error code.

Bug: webrtc:7580
Change-Id: I6c6fe289542e486fc422cdc61577982b0529d4c1
Reviewed-on: https://webrtc-review.googlesource.com/70820
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23120}
2018-05-04 13:07:25 +00:00
Magnus Jedvert
35b67f0710 Reland "Android: Remove deprecated PeerConnectionFactory ctors"
This is a reland of 3e0dee2660

Original change's description:
> Android: Remove deprecated PeerConnectionFactory ctors
>
> This CL removes deprecated PeerConnectionFactory ctors as well as some
> deprecated comments and functions left from the
> PeerConnectionFactory.initialize work.
>
> Bug: webrtc:9158
> Change-Id: I757f85b52cbfdbe15bf2570c394202b898892550
> Reviewed-on: https://webrtc-review.googlesource.com/70400
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23085}

TBR=sakal

Bug: webrtc:9158
Change-Id: Idb3628be85cc3268a7a4cf6990af5ed2f406ab07
Reviewed-on: https://webrtc-review.googlesource.com/74400
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23114}
2018-05-04 09:36:04 +00:00
Karl Wiberg
7ba22b8eea Break out the part of the iSAC codec that's used for Voice Activity Detection
The audio processing code is using parts of the iSAC codec to do voice
activity detection (VAD), but it's undesirable for it to pull in the
entire iSAC codec as a dependency. So this CL factors out the parts of
iSAC that's needed for VAD to a separate build target.

Bug: webrtc:8396
Change-Id: I884e25d8fd0bc815fca664352b0573b4b173880e
Reviewed-on: https://webrtc-review.googlesource.com/69640
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23110}
2018-05-04 08:53:34 +00:00
Sam Zackrisson
207e6f8cd9 Revert "Android: Remove deprecated PeerConnectionFactory ctors"
This reverts commit 3e0dee2660.

Reason for revert: broke internal project.

Original change's description:
> Android: Remove deprecated PeerConnectionFactory ctors
> 
> This CL removes deprecated PeerConnectionFactory ctors as well as some
> deprecated comments and functions left from the
> PeerConnectionFactory.initialize work.
> 
> Bug: webrtc:9158
> Change-Id: I757f85b52cbfdbe15bf2570c394202b898892550
> Reviewed-on: https://webrtc-review.googlesource.com/70400
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23085}

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

Change-Id: I6a38e65b9ebfe7ccd783b87f6cef0b41d6c6ba38
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9158
Reviewed-on: https://webrtc-review.googlesource.com/74080
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23089}
2018-05-03 09:45:32 +00:00
Mirko Bonadei
edcd2cc572 Avoid allocation/copy by using GetFloatArrayRegion.
Bug: None
Change-Id: Ia049591f1d8d819d651ec8f359f318a7b9c12e43
Reviewed-on: https://webrtc-review.googlesource.com/74001
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23088}
2018-05-03 09:09:51 +00:00
Magnus Jedvert
26b9e12289 Android: Let VideoSource dispose SurfaceTextureHelper
This CL is a follow-up to
https://webrtc-review.googlesource.com/c/src/+/71666 where a lot of code
was removed. Accidentally, the code that called
SurfaceTextureHelper.dispose() was removed. This code used to reside in
surfacetexturehelper.cc. This CL reintroduces the call to dispose in the
VideoSource.java backwards compatibility path.

Bug: webrtc:9181
Change-Id: I3e439dbf97965d806d238f7697561ac5ee9e79f1
Reviewed-on: https://webrtc-review.googlesource.com/73180
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23087}
2018-05-03 08:50:01 +00:00
Magnus Jedvert
3e0dee2660 Android: Remove deprecated PeerConnectionFactory ctors
This CL removes deprecated PeerConnectionFactory ctors as well as some
deprecated comments and functions left from the
PeerConnectionFactory.initialize work.

Bug: webrtc:9158
Change-Id: I757f85b52cbfdbe15bf2570c394202b898892550
Reviewed-on: https://webrtc-review.googlesource.com/70400
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23085}
2018-05-03 07:56:41 +00:00
Qingsi Wang
26e0849061 Fix a null pointer bug in NetworkMonitorAutoDetect.getNetworkState.
Bug: webrtc:9168
Change-Id: I2cc4bb4dee6cec29400de2a8e030eea42868d9ba
Reviewed-on: https://webrtc-review.googlesource.com/73540
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23082}
2018-05-02 17:42:17 +00:00
Kári Tristan Helgason
cad94449dd Remove H264 CHP field trial code.
Bug: webrtc:8317
Change-Id: I2da3cc6578dd8ff6e88052bc33cd38cb92af46dc
Reviewed-on: https://webrtc-review.googlesource.com/73242
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23077}
2018-05-02 13:42:37 +00:00
Qingsi Wang
de2ed7dc18 Support VPN adapter type in WebRTC Android.
The VPN adapter type is not effectively supported in WebRTC Android for
1) the network monitor may not obtain the VPN adapter type from the OS,
e.g. via NetworkInfo.getType, 2) and VPN adapter type is replaced
by the adapter type of an underlying network by the network monitor in
the current implementation. Specifically, WebRTC Android would
previously classify VPNs as either type ADAPTER_TYPE_UNKNOWN, or the
type of the currently active network (which we assume the VPN is
using).

In this CL, VPNs are classified as ADAPTER_TYPE_VPN whenever possible,
and the underlying network type, if available from the VPN, is
separately stored and used to prioritize ICE candidates in network path
selection.

This allows ADAPTER_TYPE_VPN to be used in networkIgnoreMask to ignore
VPNs when gathering ICE candidates.

Bug: webrtc:9168
Change-Id: I9513c76a114ba967437b699e71223a4a2f13f34a
Reviewed-on: https://webrtc-review.googlesource.com/70960
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23061}
2018-04-27 22:49:33 +00:00
Magnus Jedvert
5ebb82ba9c Android: Remove video recording functionality from the camera classes
There was an attempt to add MediaRecording functionality to the camera
classes, but it was never finished and never worked properly. This CL
removes the code for it. In the future, if offline video recording is
needed we should add it as a VideoSink instead of inside the camera
classes.

Bug: webrtc:9144
Change-Id: I74b70d4b128aa212d84e70da01e5e19133c5af24
Reviewed-on: https://webrtc-review.googlesource.com/69642
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23050}
2018-04-27 07:38:05 +00:00
Sergey Silkin
bc0f0d3ded Rename end_of_superframe to end_of_picture.
For consistency with the VP9 RTP spec which uses term "picture" for set
of frames which belong to the same time instance.

Bug: none
Change-Id: I30e92d5debb008feb58f770b63fe10c2e0029267
Reviewed-on: https://webrtc-review.googlesource.com/72180
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23040}
2018-04-26 15:47:17 +00:00
Oleh Prypin
775d07e277 Avoid ObjectToString warning
sdk/android/src/java/org/webrtc/HardwareVideoDecoder.java:210: warning: [ObjectToString] android.media.MediaCodec is final and does not override Object.toString, converting it to a string will print its identity (e.g. `android.media.MediaCodec@ 4488aabb`) instead of useful information.
      Logging.d(TAG, "decode uninitalized, codec: " + codec + ", callback: " + callback);

Bug: None
No-Try: True
Change-Id: Ief08f8f7fcbd16091cac4d4f0b4d30e82f5b1bd3
Reviewed-on: https://webrtc-review.googlesource.com/72840
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23032}
2018-04-26 14:33:10 +00:00
Anders Carlsson
1f433e46db Mark built-in software video codecs as poisonous.
The goal is to make these injectable, and only VP8 and VP9 specific
targets should depend on them.

Bug: webrtc:7925
Change-Id: Ie9239a54d197fe70c93de0582797211fef6997a2
Reviewed-on: https://webrtc-review.googlesource.com/72082
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23021}
2018-04-25 11:34:33 +00:00
Magnus Jedvert
1a759c6354 Android: Only use Java VideoFrames internally
This CL removes internal support for anything else than Android frames
that are wrapped Java VideoFrames. This allows for a big internal
cleanup and we can remove the internal class AndroidTextureBuffer and
all logic related to that. Also, the C++ AndroidVideoTrackSource no
longer needs to hold on to a C++ SurfaceTextureHelper and we can
remove all JNI code related to SurfaceTextureHelper. Also, when these
methods are removed, it's possible to let VideoSource implement the
CapturerObserver interface directly and there is no longer any need for
AndroidVideoTrackSourceObserver. Clients can then initialize
VideoCapturers themselves outside the PeerConnectionFactory, and a new
method is added in the PeerConnectionFactory to allow clients to create
standalone VideoSources that can be connected to a VideoCapturer outside
the factory.

Bug: webrtc:9181
Change-Id: Ie292ea9214f382d44dce9120725c62602a646ed8
Reviewed-on: https://webrtc-review.googlesource.com/71666
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23004}
2018-04-24 13:51:11 +00:00
Paulina Hensman
498592d391 Increase logging for Java ADM
The new ADM code removed some redundancies, which led to a decrease in
log output. This especially affected NS and AEC logs. This change
reintroduces these log messages, making debugging easier. "Acoustic
Echo Canceler" has been changed to AEC for easier grepping.

Some new logging is also added.

Bug: webrtc:7452
Change-Id: I9bfb91895931d73d92f3187c8c7c5b7524ac05ba
Reviewed-on: https://webrtc-review.googlesource.com/71401
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23003}
2018-04-24 13:50:06 +00:00
henrika
29e865a5d8 Adds stereo support to FineAudioBuffer for mobile platforms.
...continuation of review in https://webrtc-review.googlesource.com/c/src/+/70781

This CL ensures that the FineAudioBuffer can support stereo and also adapts
all classes which uses the FineAudioBuffer.

Note that, this CL does NOT enable stereo on mobile platforms by default. All it does is to ensure
that we *can*. As is, the only functional change is that all clients
will now use a FineAudioBuffer implementation which supports stereo (see
separate unittest).

The FineAudioBuffer constructor has been modified since it is better to
utilize the information provided in the injected AudioDeviceBuffer pointer
instead of forcing the user to supply redundant parameters.

The capacity parameter was also removed since it adds no value now when the
more flexible rtc::BufferT is used.

I have also done local changes (not included in the CL) where I switch
all affected audio backends to stereo and verified that it works in real-time
on all affected platforms (Androiod:OpenSL ES, Android:AAudio and iOS).

Also note that, changes in:

sdk/android/src/jni/audio_device/aaudio_player.cc
sdk/android/src/jni/audio_device/aaudio_recorder.cc
sdk/android/src/jni/audio_device/opensles_player.cc
sdk/android/src/jni/audio_device/opensles_recorder.cc

are simply copies of the changes done under modules/audio_device/android since we currently
have two versions of the ADM for Android.

Bug: webrtc:9172
Change-Id: I1ed3798bd1925381d68f0f9492af921f515b9053
Reviewed-on: https://webrtc-review.googlesource.com/71201
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22998}
2018-04-24 11:58:54 +00:00
Magnus Jedvert
e987f2b765 Android: Stop using VideoRenderer class
This CL updates the WebRTC code to stop using the old VideoRenderer and
VideoRenderer.I420Frame classes and instead use the new VideoSink and
VideoFrame classes.

This CL is the first step and the old classes are still left in the code
for now to keep backwards compatibility.

Bug: webrtc:9181
Change-Id: Ib0caa18cbaa2758b7859e850ddcaba003cfb06d6
Reviewed-on: https://webrtc-review.googlesource.com/71662
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22989}
2018-04-23 16:04:11 +00:00
Magnus Jedvert
b9ac121598 Android: Update MediaCodecVideoDecoder to output VideoFrames
Bug: webrtc:9181
Change-Id: I7eba15167536e453956c511a056143b039f52b92
Reviewed-on: https://webrtc-review.googlesource.com/71664
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22988}
2018-04-23 16:03:07 +00:00
Erik Språng
566124a6df Move BitrateAllocation to api/ and rename it VideoBitrateAllocation
Since the webrtc_common build target does not have visibility set, we
cannot easily use BitrateAllocation in other parts of Chromium.
This is currently blocking parts of chromium:794608, and I know of other
usage outside webrtc already, so moving it to api/ should be warranted.

Also, since there's some naming confusion and this class is video
specific rename it VideoBitrateAllocation. This also fits with the
standard interface for producing these: VideoBitrateAllocator.

Bug: chromium:794608
Change-Id: I4c0fae40f9365e860c605a76a4f67ecc9b9cf9fe
Reviewed-on: https://webrtc-review.googlesource.com/70783
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22986}
2018-04-23 15:31:27 +00:00
Sami Kalliomäki
7d8f5949b2 Make depending on a specific audio implementation optional.
Splits out audio_java into audio_api_java and
java_audio_device_module_java.

Makes depending on java_audio_device_module_jni optional for clients
that do not use it. It is only necessary to depend on this target if
depending on java_audio_device_module_java.

Also some cleanup.

Bug: webrtc:7452
Change-Id: Ic6c4dbe11db3ed8330802a8e90203acb8ef18e72
Reviewed-on: https://webrtc-review.googlesource.com/70220
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22981}
2018-04-23 14:18:47 +00:00
Magnus Jedvert
acdaaaf29a Android: Fix cropping logic for NV12/NV21 buffers
Bug: webrtc:9186
Change-Id: I06ad4c4b08a564e177c47fc109261f2f6d303c7b
Reviewed-on: https://webrtc-review.googlesource.com/71741
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22980}
2018-04-23 14:12:37 +00:00
Karl Wiberg
bb23c838f5 GN hack to tag targets as poisonous (and use it with audio codecs)
Only specially taggged targets may transitively depend on poisonous
targets. We first apply it to audio codecs.

This makes it much clearer exactly what parts of the code still have
dependencies on the audio codecs (and we want to eventually get rid of
pretty much all of them).

Bug: webrtc:8396, webrtc:9121
Change-Id: Iba5c2e806c702b5cfe881022674705f647896d43
Reviewed-on: https://webrtc-review.googlesource.com/69520
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22979}
2018-04-23 13:41:47 +00:00
Artem Titov
3d19009c56 Temporary suppress bytebuffer warnings.
Currently this warnings prevernt chromium roll into webrtc, because we
consider them as errors. So to unblock roll all warning are suppressed.
All places are documented into bug and will be fixed later.

TBR=henrika@webrtc.org

Bug: webrtc:9175
Change-Id: I0bf5a4b65eb49308e28f71a92d42b5fad6a99b74
Reviewed-on: https://webrtc-review.googlesource.com/71420
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22956}
2018-04-20 11:45:28 +00:00
henrika
8d7393bb28 FineAudioBuffer now uses 16-bit audio samples to match the AudioDeviceBuffer.
This work is also done as a preparation for adding stereo support to the
FineAudioBuffer.

Review hints:

Actual changes are in modules/audio_device/fine_audio_buffer.h,cc, the rest is
just adaptations to match these changes.

We do have a forked ADM today, hence, some changes are duplicated.

The changes have been verified on all affected platforms.

Bug: webrtc:6560
Change-Id: I413af41c43809f61455c45ad383fc4b1c65e1fa1
Reviewed-on: https://webrtc-review.googlesource.com/70781
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22938}
2018-04-19 12:20:28 +00:00
Magnus Jedvert
aedd090b72 Android JavaAudioDeviceModule: Defer creation of native ADM
Any native call before PeerConnectionFactory.initialize() will fail.
This means creation of JavaAudioDeviceModule will fail if it's created
before PeerConnectionFactory.initialize(). Clients should technically
always call PeerConnectionFactory.initialize() first, but we can help
the situation by deferring creation of the native ADM until it's
actually needed.

Bug: webrtc:7452
Change-Id: I53df2bdb980a8bdc413975f1cea6bcf297b453d5
Reviewed-on: https://webrtc-review.googlesource.com/70763
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22936}
2018-04-19 10:33:28 +00:00
Seth Hampson
7ba2e19c17 Removing deprecated label() that is no longer used.
Bug: webrtc:8977
Change-Id: Ic1e4d0b83b1379fd5269240842eeb52f86f56cdb
Reviewed-on: https://webrtc-review.googlesource.com/65880
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22925}
2018-04-18 18:04:05 +00:00
Sami Kalliomäki
8619e8a3d7 Add VideoEncoder.ScalingSettings.toString method.
Bug: None
Change-Id: Ib7563bdec49736b104d3cbb52a7c77b6aa142030
Reviewed-on: https://webrtc-review.googlesource.com/70500
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22922}
2018-04-18 14:36:19 +00:00
Rasmus Brandt
4478d9b773 Update Android HW encoders to the latest CodecSpecificInfoVP9 changes.
- Always set |first_frame_in_picture| and |end_of_superframe|.
- Avoid division by zero when calculating the gof_idx.

Bug: webrtc:9157
Change-Id: I19e48fa4f639815c874edec0e32deb5914912410
Tested: AppRTCMobile
Reviewed-on: https://webrtc-review.googlesource.com/70143
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22903}
2018-04-17 13:35:23 +00:00
Magnus Jedvert
080e7b27f5 Android: Log OpenGL shader source code in case of compile error
Logging the OpenGL shader source code makes it easier to debug problems.

Bug: None
Change-Id: Ie4724b1353511eae3806e98270b04e5daa4c11fc
Reviewed-on: https://webrtc-review.googlesource.com/69322
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22900}
2018-04-17 13:05:03 +00:00
Magnus Jedvert
1d270f8193 Reland "Android: Generalize and make TextureBufferImpl public"
This reverts commit 64051d4975.

Reason for revert: Fix applied.

Original change's description:
> Revert "Android: Generalize and make TextureBufferImpl public"
> 
> This reverts commit 28111d7fa0.
> 
> Reason for revert: Crashes video_quality_loopback_test.
> 
> Original change's description:
> > Android: Generalize and make TextureBufferImpl public
> > 
> > This CL generalizes TextureBufferImpl so it's useful from other contexts than
> > from a SurfaceTextureHelper, and fixes a bug in cropAndScale(). It also exposes
> > the class in the api so that clients don't have to duplicate the logic.
> > 
> > Bug: None
> > Change-Id: Ib82aa8bee025ec14de74a7be9d91fd4e5298a248
> > Reviewed-on: https://webrtc-review.googlesource.com/69819
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22875}
> 
> TBR=magjed@webrtc.org,sakal@webrtc.org
> 
> Change-Id: Ica7fc181fec70b8b79f39f0e114eef81a03aa116
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: None
> Reviewed-on: https://webrtc-review.googlesource.com/70240
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22878}

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

Change-Id: I173d1ccfe0baa80460f796ebaedc51731233108f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/70183
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22883}
2018-04-16 15:08:38 +00:00
Sami Kalliomäki
64051d4975 Revert "Android: Generalize and make TextureBufferImpl public"
This reverts commit 28111d7fa0.

Reason for revert: Crashes video_quality_loopback_test.

Original change's description:
> Android: Generalize and make TextureBufferImpl public
> 
> This CL generalizes TextureBufferImpl so it's useful from other contexts than
> from a SurfaceTextureHelper, and fixes a bug in cropAndScale(). It also exposes
> the class in the api so that clients don't have to duplicate the logic.
> 
> Bug: None
> Change-Id: Ib82aa8bee025ec14de74a7be9d91fd4e5298a248
> Reviewed-on: https://webrtc-review.googlesource.com/69819
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22875}

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

Change-Id: Ica7fc181fec70b8b79f39f0e114eef81a03aa116
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/70240
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22878}
2018-04-16 13:38:59 +00:00
Magnus Jedvert
28111d7fa0 Android: Generalize and make TextureBufferImpl public
This CL generalizes TextureBufferImpl so it's useful from other contexts than
from a SurfaceTextureHelper, and fixes a bug in cropAndScale(). It also exposes
the class in the api so that clients don't have to duplicate the logic.

Bug: None
Change-Id: Ib82aa8bee025ec14de74a7be9d91fd4e5298a248
Reviewed-on: https://webrtc-review.googlesource.com/69819
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22875}
2018-04-16 12:16:48 +00:00
Paulina Hensman
a2a9875dc2 Add unit tests for Android audio device module
The tests are a combination of the old audio_device_unittest.cc and
audio_manager_unittest.cc, with the exception of a few that were no
longer relevant.

RunPlayoutAndRecordingInFullDuplex remains disabled according to its
comment, but has been verified to pass on at least one device.
MeasureLoopbackLatency also remains disabled, but has not been tested due
to lack of necessary hardware.

Bug: webrtc:7452
Change-Id: Ie361bc8f5e1990729d7b4699faf2a73abe3cbe8d
Reviewed-on: https://webrtc-review.googlesource.com/69340
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22836}
2018-04-12 09:27:45 +00:00
Magnus Jedvert
2ed62b3c9b Android: Allow construction of GlTextureFrameBuffer from non-OpenGL thread
This CL makes it possible to create a GlTextureFrameBuffer from any
thread. The actual GL resources will be allocated the first time
setSize() is called. The purpose is to be able to use 'final' variables
more often for this class and avoid @Nullable annotations.

Bug: None
Change-Id: I350304bcd33fd674990254df37a615995972f322
Reviewed-on: https://webrtc-review.googlesource.com/69241
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22835}
2018-04-12 07:19:46 +00:00
Paulina Hensman
30d5f6d7f7 Small cleanup in sdk/android ADM
Mainly remove CHECKinitialized_ macro and AGC functionality. Also make
actual behavior clearer in some functions.

Bug: webrtc:7452
Change-Id: I1eac86f4eaff7b14820d3e4192b15c20ab6acb45
Reviewed-on: https://webrtc-review.googlesource.com/69161
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22820}
2018-04-11 13:44:56 +00:00
Sami Kalliomäki
61db3fd77f Make VideoFrame.Buffer implementations lock-free.
Replaces lock-based implementation with AtomicInteger.

Bug: webrtc:7749
Change-Id: I226093b0af2090c080dfd4f87ed8f33a3f9efbd8
Reviewed-on: https://webrtc-review.googlesource.com/64162
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22798}
2018-04-09 16:29:59 +00:00
Paulina Hensman
11b34f4d08 Remove chromium clang style errors affecting sdk/android/media_jni
Bug: webrtc:163
Change-Id: I1e98174817ca032ee13f9a6a386803382843389d
Reviewed-on: https://webrtc-review.googlesource.com/67360
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22796}
2018-04-09 13:55:49 +00:00
Magnus Jedvert
66f1e9eb34 Android: Add AudioDeviceModule interface and clean up implementation code
This CL introduces sdk/android/api/org/webrtc/audio/AudioDeviceModule.java,
which is the new interface for audio device modules on Android.

This CL also refactors the main AudioDeviceModule implementation, which
is sdk/android/api/org/webrtc/audio/JavaAudioDeviceModule.java and makes
it conform to the new interface. The old code used global static methods
to configure the audio device code. This CL gets rid of all that and uses
a builder pattern in JavaAudioDeviceModule instead. The only two dynamic
methods left in the interface are setSpeakerMute() and setMicrophoneMute().
Removing the global static methods allowed a significant cleanup, and e.g.
the file sdk/android/src/jni/audio_device/audio_manager.cc has been
completely removed.

The PeerConnectionFactory interface is also updated to allow passing in
an external AudioDeviceModule. The current built-in ADM is encapsulated
under LegacyAudioDeviceModule.java, which is the default for now to
ensure backwards compatibility.

Bug: webrtc:7452
Change-Id: I64d5f4dba9a004da001f1acb2bd0c1b1f2b64f21
Reviewed-on: https://webrtc-review.googlesource.com/65360
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22765}
2018-04-06 10:13:02 +00:00
Sami Kalliomäki
1641ca3dd3 Split out video targets from //sdk/android:base_java.
Bug: webrtc:9048
Change-Id: Icda0fabf41610f99254d244e0b11d321eee345f7
Reviewed-on: https://webrtc-review.googlesource.com/65120
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22752}
2018-04-05 16:02:09 +00:00
Paulina Hensman
a680a6a4af Enable and fix chromium clang warnings in sdk/android targets.
Targets:
base_jni, internal_jni, video_jni, vp8_jni and vp9_jni

Bug: webrtc:163
Change-Id: I4aa68c81e6e7cbe5fdf78c90e464b46c55633252
Reviewed-on: https://webrtc-review.googlesource.com/66820
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22744}
2018-04-05 11:22:03 +00:00
Magnus Jedvert
e2be7ee2e8 Android: Split out audio device targets
This CL splits out the audio device module Java code into a separate
target, and also splits up the audio device module implementations into
three different build targets, one for OpenSLES, AAudio, and the Java
based implementation.

Bug: webrtc:7452, webrtc:9048
Change-Id: I8ec09c73580b468837223ddd420fb29ca61fdea5
Reviewed-on: https://webrtc-review.googlesource.com/66461
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22727}
2018-04-04 11:50:30 +00:00
Sami Kalliomäki
0bdb5dd0a9 Fix framerate based bitrate adjuster.
Fixes target bitrate calculation for framerate based adjuster. Adds new
API to bitrate adjuster - getCodecConfigFramerate() - that returns the
FPS that should be passed to MediaCodec on initialization.

Bug: b/73741487, cl/186656928
Change-Id: Ia4a5e99d302de67fbee0c132ab8e9392bc205b44
Reviewed-on: https://webrtc-review.googlesource.com/65162
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22716}
2018-04-04 07:41:29 +00:00
Magnus Jedvert
a21090b770 Android: Remove IsCommunicationModeEnabled() from AudioManager
This method is only used for logging and is blocking further refactoring
work. Once the refactoring and cleanup of the external AudioDeviceModule
is complete, we can revisit what logging we want and need and add it in
a cleaner way.

Bug: webrtc:7452
Change-Id: If08bcfb37860e9e7b9b5105cb75f748b53775f69
Reviewed-on: https://webrtc-review.googlesource.com/65460
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22678}
2018-03-29 12:06:17 +00:00
Magnus Jedvert
27e41c52f5 Android: Split out VolumeLogger class
The VolumeLogger class contains enough logic to deserve its own file.
Also, I want to potentially remove WebRtcAudioManager.java but keep
volume logging. One problem I see with the VolumeLogger is that it
spawns a new thread, and we should try to keep the number of threads
in WebRTC to a minimum. Right now we use excessively many threads.

Bug: webrtc:7452
Change-Id: I4dd8ffb4265903926f0b372715fc6b876fe5d393
Reviewed-on: https://webrtc-review.googlesource.com/65401
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22676}
2018-03-29 11:36:47 +00:00
Magnus Jedvert
003211c5da Android: Rename AudioDeviceModule to JavaAudioDeviceModule
The class called AudioDeviceModule today is an implementation of a
future interface. We want to reserve the name AudioDeviceModule for
the actual interface. The implementation class has been renamed to
JavaAudioDeviceModule. 'Java' here refers to the fact that the
implementation is using android.media.AudioRecord as input and
android.media.AudioTrack as output, and this is opposed to native
AudioDeviceModule implementations such as OpenSLES and AAudio.

Bug: webrtc:7452
Change-Id: Ifc243c2e169b12a50128ee3252f06d574aa7b358
Reviewed-on: https://webrtc-review.googlesource.com/65400
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22673}
2018-03-29 10:55:37 +00:00
Magnus Jedvert
e2971ec2ab Android audio manager: Move responsibility of OpenSLES engine
The OpenSLES engine is currently managed by the AudioManager which is
a generic class shared between different kinds of audio input/output.
This CL moves the responsibility of the OpenSLES engine to the actual
OpenSLES implementations.

Bug: webrtc:7452
Change-Id: Iecccb03ec5cd12ce2f3fdc44daaedae27aecf88b
Reviewed-on: https://webrtc-review.googlesource.com/64520
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22661}
2018-03-28 20:31:26 +00:00
Magnus Jedvert
1a18e0ac46 Android audio code: Replace C++ template with input/output interface
Bug: webrtc:7452
Change-Id: Id816500051e065918bba5c2235d38ad8eb50a8eb
Reviewed-on: https://webrtc-review.googlesource.com/64442
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22660}
2018-03-28 19:19:37 +00:00
Sami Kalliomäki
d7e12668cb Remove unnecessary dependencies from //sdk/android:base_java.
Bug: b/77199993
Change-Id: I6cb82b1f19fa986f1f03bf69281e0dec8ea8891a
Reviewed-on: https://webrtc-review.googlesource.com/65160
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22654}
2018-03-28 15:49:46 +00:00
Sami Kalliomäki
725c106d8c Split out peerconnection, swcodec and hwcodec targets from Android SDK.
Bug: webrtc:9048
Change-Id: I3094ca8993cd754a0ea799e325f941d3ffd5578b
Reviewed-on: https://webrtc-review.googlesource.com/63700
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22644}
2018-03-28 10:46:26 +00:00
Sami Kalliomäki
dc52651911 Annotate rest of WebRTC with @Nullable.
Bug: webrtc:8881
Change-Id: Ic199efa73a0b3b9437df1e8fe5a1814a70380993
Reviewed-on: https://webrtc-review.googlesource.com/64884
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22639}
2018-03-28 08:30:06 +00:00
Magnus Jedvert
ff4cac9c48 Android audio device template: Don't use output parameters
Our style guide dictates that we should prefer using return values rather
than output parameters when we can. Some of the methods like
MaxSpeakerVolume() are not required to be able to provide a value. In
these cases I changed the return type to an rtc::Optional.

Also, this CL fixes a bug with StereoRecordingIsAvailable() that would
not previously be passed along correctly in the template layer.

Bug: webrtc:7452
Change-Id: I0a1f455093bfe092627118d65a996212a65eeb2b
Reviewed-on: https://webrtc-review.googlesource.com/64401
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22629}
2018-03-27 14:16:20 +00:00
Magnus Jedvert
61fce40f7a Android: Fix compilation of moved aaudio
Setting rtc_enable_android_aaudio currently leads to build problems.
This CL fixes that.

Bug: webrtc:7452
Change-Id: I6460a97fbff795b8df5ef8a585c2880fc7d4331b
Reviewed-on: https://webrtc-review.googlesource.com/64402
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22590}
2018-03-24 11:57:47 +00:00
Taylor Brandstetter
5e55fe845e Adding flag to enable/disable use of SRTP_AES128_CM_SHA1_32 crypto suite.
This flag (added to CryptoOptions) will allow applications to opt-in to
use of this suite, before it's disabled by default later. See bug for
more details.

TBR=magjed@webrtc.org

Bug: webrtc:7670
Change-Id: I800bedd4b26d807b6b7ac66b505d419c3323e454
Reviewed-on: https://webrtc-review.googlesource.com/64390
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22586}
2018-03-23 19:26:55 +00:00
Karl Wiberg
29e7bee330 Move aligned memory utilities to rtc_base/memory/
This moves them from an API directory (system_wrappers/include/) to a
non-API directory, which is exactly what we want for utilities like
this.

BUG=webrtc:8445

Change-Id: I6dc34fe662f5d87b3b5288d33055345bc6bf91db
Reviewed-on: https://webrtc-review.googlesource.com/21164
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22567}
2018-03-22 14:13:24 +00:00
Artem Titov
70899e012f Add support for creating java PCF from native one.
Add support for creating java PeerConnectionFactory from native one
by adding:
1. Constructor from native pointer in java PeerConnectionFactory
2. Method NativeToJavaPeerConnectionFactory in
sdk/android/native/api/peerconnection/peerconnectionfactory.h that
provides ability to convert native factory to java one.

Bug: webrtc:8946
Change-Id: Ibe8b019bd0d45849e2b16d74663d054784526746
Reviewed-on: https://webrtc-review.googlesource.com/62344
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22564}
2018-03-22 13:37:24 +00:00
Sami Kalliomäki
e7592d8d5f Annotate libjingle_peerconnection_java with @Nullable.
Bug: webrtc:8881
Change-Id: Ida2ef6c003567d19529c21629c916ed40e8de3a6
Reviewed-on: https://webrtc-review.googlesource.com/63380
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22563}
2018-03-22 13:13:44 +00:00
Magnus Jedvert
32362a6729 Android: Simplify moved audio device module
This CL performs some simplifications and cleanups of the moved audio code.
 * All JNI interaction now goes from the C++ audio manager calling into
   the Java audio manager. The calls back from the Java code to the C++
   audio manager are removed (this was related to caching audio parameters).
   It's simpler this way because the Java code is now unaware of the C++
   layer and it will be easier to make this into a Java interface.
 * A bunch of state was removed that was related to caching the audio parameters.
 * Some unused functions from audio manager was removed.
 * The Java audio manager no longer depends on ContextUtils, and the context has
   to be passed in externally instead. This is done because we want to get rid of
   ContextUtils eventually.
 * The selection of what AudioDeviceModule to create (AAudio, OpenSLES
   input/output is now exposed in the interface. The reason is that client should
   decide and create what they need explicitly instead of setting blacklists
   in static global WebRTC classes. This will be more modular long term.
 * Selection of what audio device module to create (OpenSLES combinations) no
   longer requires instantiating a C++ AudioManager and is done with static
   enumeration methods instead.

Bug: webrtc:7452
Change-Id: Iba29cf7447a1f6063abd9544d7315e10095167c8
Reviewed-on: https://webrtc-review.googlesource.com/63760
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22542}
2018-03-21 17:48:28 +00:00
Magnus Jedvert
2955d82eca Android audio record/track: Remove intermediate JNI manager
After using JNI generation, there is no need to have a separate class
handling JNI interaction.

Bug: webrtc:7452
Change-Id: I25de6007190d826e2790cf6219a6ac861acfb6a8
Reviewed-on: https://webrtc-review.googlesource.com/63800
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22541}
2018-03-21 16:30:58 +00:00
Magnus Jedvert
08006d4133 Android AppRTCMobile: Use new audio device code
This CL contains some follow-up fixes for
https://webrtc-review.googlesource.com/c/src/+/60541. It removes all use
of the old voiceengine implementation from AppRTCMobile.

Bug: webrtc:7452
Change-Id: Iea21a4b3be1f3cbb5062831164fffb2c8051d858
Reviewed-on: https://webrtc-review.googlesource.com/63480
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22530}
2018-03-21 12:40:18 +00:00
Magnus Jedvert
8fc7948cc2 Android: Generate audio JNI code
This CL only affects the forked Android audio device code. The old code
at webrtc/modules/audio_device/android/ is unaffected.

Bug: webrtc:8689, webrtc:8278
Change-Id: I696b8297baba9a0f657ea3df808f57ebf259cb06
Reviewed-on: https://webrtc-review.googlesource.com/36502
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22528}
2018-03-21 10:01:38 +00:00
Magnus Jedvert
37e36027e2 Android: Add henrika@ as owner of audio code
NOTRY=True

Bug: webrtc:7452
Change-Id: I494481cef437d26fd9fd5e0286f95fb2c1c6e56a
Reviewed-on: https://webrtc-review.googlesource.com/63442
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22527}
2018-03-21 09:59:18 +00:00
Paulina Hensman
89dd7bf924 Move android audio device code into sdk/android
This CL adds a stand-alone Android AudioDeviceModule in the
sdk/android folder. It's forked from modules/audio_device/android/
and then simplified for the Android case. The stand-alone Android
ADM is available both in the native_api and also under a field trial
in the Java API.

Bug: webrtc:7452
Change-Id: If6e558026bd0ccb52f56d78ac833339a5789d300
Reviewed-on: https://webrtc-review.googlesource.com/60541
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22517}
2018-03-20 16:04:33 +00:00
Qingsi Wang
22e623ad68 Add configurable threshold for writability state update.
Add configurable parameters in RTCConfiguration with the default value
given by the constants CONNECTION_WRITE_CONNECT_TIME and
CONNECTION_WRITE_CONNECT_FAILURES in the ICE implementation. These two
parameters define the time period for which a candidate pair must wait
for ping response and the minimum number of connectivity checks that
the pair must send without response before its state becomes unreliable
from writable as defined in the current ICE implementation.

Bug: webrtc:8988
Change-Id: I484599b7d776489a87741ffea8926df766095da9
Reviewed-on: https://webrtc-review.googlesource.com/60704
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22411}
2018-03-13 18:54:03 +00:00
Sami Kalliomäki
b9f4bf29d0 Remove build hooks implementation from AAR-builds.
It is unnecessary to include the build hooks implementation because we
don't use them. It was also causing errors because the interface the
class implements is not included in the AAR.

Also removes comments about re-enabling build hooks because it has grown
into something very Chromium specific and it is unlikely that we want to
re-enable them.

Bug: webrtc:8964, webrtc:8168
Change-Id: Ia95af13e90a5511554305d2688ced820e9914beb
Reviewed-on: https://webrtc-review.googlesource.com/61302
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22386}
2018-03-12 14:38:39 +00:00
Sami Kalliomäki
3e77afd0d2 Add an example app for Android native API.
The app is a simple loopback demo demonstrating the usage of Android
native API. This is an initial version and I will add support for
HW codecs etc. in the future.

Bug: webrtc:8769
Change-Id: Ifb6209769dabeb8ca3185b969a1ef8afd6d84390
Reviewed-on: https://webrtc-review.googlesource.com/60540
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22385}
2018-03-12 14:22:59 +00:00
Oleh Prypin
72467c24ac Fix NarrowingCompoundAssignment warning
This ErrorProne warning was enabled in
http://crrev.com/96c7ab0153ae97a8d8e05949f36cd7bb8eedbf1d
https://webrtc-review.googlesource.com/60849

Bug: None
Change-Id: I5e622f84925ee96e7743d2c08d17fcdb4c4a0f55
Reviewed-on: https://webrtc-review.googlesource.com/60940
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22362}
2018-03-09 13:52:09 +00:00
Qingsi Wang
e6826d2461 Add configurable connectivity check intervals.
The connectivity check intervals for candidate pairs with strong and
weak connectivity are currently constants in the ICE implementation. A
set of suboptimal value of these constants for a given application may
result in undesirable behavior including excessive network switching
latency. This CL adds these intervals to RTCConfiguration that is
available to applications to configure, while maintaining the original
constants as their default value for compatibility with existing
applications.

Bug: webrtc:8988
Change-Id: I804b0f4cf7881be7d3c8aec2776bc9596de72482
Reviewed-on: https://webrtc-review.googlesource.com/60585
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22351}
2018-03-09 08:09:43 +00:00
Sami Kalliomäki
564299a2a3 Fix applicationContext passed to NetworkMonitor from NDK being unused.
Bug: webrtc:8769
Change-Id: I7c50f5efece88019b04f8c298f44886ca8258509
Reviewed-on: https://webrtc-review.googlesource.com/60740
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22342}
2018-03-08 15:17:53 +00:00
Anders Carlsson
6deb65c2af Move hardwarevideoencoderfactory jni for building w/o SW codecs.
This file ended up in the wrong place and prevented building without
SW codecs.

Bug: webrtc:7925
Change-Id: I7909561d96051d5653821130c666ac66938e3edc
Reviewed-on: https://webrtc-review.googlesource.com/59640
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22320}
2018-03-07 09:13:42 +00:00
Seth Hampson
9a58cc00e0 Update the android AppRTC to use PeerConnection Unified Plan API.
This updates AppRTC to use addTrack instead of addStream, and removes
the use of onAddStream, because we no longer have to wait for this to be
fired to set the remote track's video renderers.

Bug: webrtc:8869
Change-Id: I1ecae684a9bc4b30512e8c5d717e72b52c589831
Reviewed-on: https://webrtc-review.googlesource.com/57840
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22318}
2018-03-07 01:56:01 +00:00
Seth Hampson
c384e14707 Add new PeerConnection APIs to the Java SDK.
This adds wrappers to the following native APIs:
- SdpSemantics enum added to the RTCConfiguration
- RtpTransceiver
- PeerConnection.addTrack
- PeerConnection.removeTrack
- PeerConnection.addTransceiver
- PeerConnection.getTransceivers
These APIs are used with the new Unified Plan semantics.

Bug: webrtc:8869
Change-Id: I19443f3ff7ffc91a139ad8276331f09e57cec554
Reviewed-on: https://webrtc-review.googlesource.com/57800
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22317}
2018-03-07 01:17:41 +00:00
Honghai Zhang
2e7a459fe7 Reland "Fix race conditions in NetworkMonitor. This change makes the class thread-safe."
This is a reland of 1f4cb9f22d

Original change's description:
> Fix race conditions in NetworkMonitor.
> This change makes the class thread-safe.
>
> Bug: b/73773043
> Change-Id: I1ad13e4f15907e3dd1fef1307f9c654e53b69b22
> Reviewed-on: https://webrtc-review.googlesource.com/57040
> Commit-Queue: Honghai Zhang <honghaiz@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22238}

Bug: b/73773043
Change-Id: I9279d514d0735327f9c133be445e5131aace5722
TBR: sakal@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/59240
Reviewed-by: Honghai Zhang <honghaiz@webrtc.org>
Commit-Queue: Honghai Zhang <honghaiz@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22295}
2018-03-05 18:54:00 +00:00
Seth Hampson
243cd32a9e Updating android/README.
Updating the gn args to be more accurate and including information about
fetching the appropriate webrtc android checkout. This is so that this
README will include all necessary information for compiling the android
code for future developers.

Bug: webrtc:8869
Change-Id: I641183705370273d4a8cab044f08b2d203a26102
Reviewed-on: https://webrtc-review.googlesource.com/59060
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22260}
2018-03-01 20:22:48 +00:00
Philip Eliasson
b12e434d4c Revert "Fix race conditions in NetworkMonitor."
This reverts commit 1f4cb9f22d.

Reason for revert: Suspect this CL break downstream projects.

Original change's description:
> Fix race conditions in NetworkMonitor.
> This change makes the class thread-safe.
> 
> Bug: b/73773043
> Change-Id: I1ad13e4f15907e3dd1fef1307f9c654e53b69b22
> Reviewed-on: https://webrtc-review.googlesource.com/57040
> Commit-Queue: Honghai Zhang <honghaiz@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22238}

TBR=sakal@webrtc.org,pthatcher@webrtc.org,honghaiz@webrtc.org

Change-Id: I549fa2ad50a414693682fb66584affd62036a09d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/73773043
Reviewed-on: https://webrtc-review.googlesource.com/59120
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22246}
2018-03-01 10:36:23 +00:00
Honghai Zhang
1f4cb9f22d Fix race conditions in NetworkMonitor.
This change makes the class thread-safe.

Bug: b/73773043
Change-Id: I1ad13e4f15907e3dd1fef1307f9c654e53b69b22
Reviewed-on: https://webrtc-review.googlesource.com/57040
Commit-Queue: Honghai Zhang <honghaiz@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22238}
2018-03-01 06:08:33 +00:00
Sami Kalliomäki
9ddc14daca Deprecate ContextUtils.getApplicationContext.
Allows passing in the application context to NetworkMonitor in
startMonitoring. The audio code will refactored once it is moved under
sdk/android.

Bug: webrtc:8937
Change-Id: I50c917a845fc4f711899a97d34c04813cc68b68c
Reviewed-on: https://webrtc-review.googlesource.com/58091
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22231}
2018-02-28 15:04:03 +00:00
Tommi
e51a0a8bf1 Re-Reland "Some cleanup for the logging code:""
This is a reland of 12dc1842d6.

Original change's description:
> Some cleanup for the logging code:
>
> * Only include 'tag' for Android. Before there was an
>   extra std::string variable per log statement for all
>   platforms.
> * Remove unused logging macro for Windows and 'module' ctor argument.
> * Move httpcommon code out of logging and to where it's used.
>
> Change-Id: I347805d3df2cee2840c0d2eef5bfefaff1cdbf37
> Bug: webrtc:8928
> Reviewed-on: https://webrtc-review.googlesource.com/57183
> Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22184}

Bug: webrtc:8928
Change-Id: Ib97895aaeb376e19f136d258c0259a340235a5d1
Reviewed-on: https://webrtc-review.googlesource.com/58200
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22208}
2018-02-27 15:59:39 +00:00
siddhartha sivakumar
f7706aecdc Revert "Forward fix jni_generator_helper.h."
This reverts commit 63e83c77ae.

Reason for revert: JNI generator is not using the heap profiler
anymore.

Original change's description:
> Forward fix jni_generator_helper.h.
>
> In crrev.com/531028, the JNI generator starts to add heap profiler
> events to JNI generated functions.
>
> This will cause a ~80KiB regression and at the moment it is breaking
> the Chromium Roll into WebRTC.
>
> This CL defines a void macro to re-enable the Chromium Roll avoiding
> the size regression.
>
> Bug: chromium:801260
> Change-Id: I9543299199c4e14b6b9b235c5cb98c0d53cf29ea
> Reviewed-on: https://webrtc-review.googlesource.com/43021
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21730}

TBR=mbonadei@webrtc.org,magjed@webrtc.org,sakal@webrtc.org

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

Bug: chromium:801260
Change-Id: I7dac211b89d8206dc461af0a17b6d53cc8661b2a
Reviewed-on: https://webrtc-review.googlesource.com/58040
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22206}
2018-02-27 15:10:39 +00:00
Zhi Huang
d81aac48ee Revert "Reland "Some cleanup for the logging code:""
This reverts commit 12dc1842d6.

Reason for revert: Some internal tests keeps failing with this change.

Original change's description:
> Reland "Some cleanup for the logging code:"
> 
> This is a reland of 9ecdcdf2b5.
> 
> Original change's description:
> > Some cleanup for the logging code:
> > 
> > * Only include 'tag' for Android. Before there was an
> >   extra std::string variable per log statement for all
> >   platforms.
> > * Remove unused logging macro for Windows and 'module' ctor argument.
> > * Move httpcommon code out of logging and to where it's used.
> > 
> > Change-Id: I347805d3df2cee2840c0d2eef5bfefaff1cdbf37
> > Bug: webrtc:8928
> > Reviewed-on: https://webrtc-review.googlesource.com/57183
> > Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22184}
> 
> Bug: webrtc:8928
> Change-Id: Id062a5b61917e66561f6c8441c2defd525e38f16
> Reviewed-on: https://webrtc-review.googlesource.com/57880
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22191}

TBR=kwiberg@webrtc.org,tommi@webrtc.org,jonasolsson@webrtc.org

Change-Id: I2b04e361459926a503552a0e1fcf3d1da3ddb643
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8928
Reviewed-on: https://webrtc-review.googlesource.com/58101
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22195}
2018-02-27 01:59:14 +00:00
Tommi
12dc1842d6 Reland "Some cleanup for the logging code:"
This is a reland of 9ecdcdf2b5.

Original change's description:
> Some cleanup for the logging code:
> 
> * Only include 'tag' for Android. Before there was an
>   extra std::string variable per log statement for all
>   platforms.
> * Remove unused logging macro for Windows and 'module' ctor argument.
> * Move httpcommon code out of logging and to where it's used.
> 
> Change-Id: I347805d3df2cee2840c0d2eef5bfefaff1cdbf37
> Bug: webrtc:8928
> Reviewed-on: https://webrtc-review.googlesource.com/57183
> Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22184}

Bug: webrtc:8928
Change-Id: Id062a5b61917e66561f6c8441c2defd525e38f16
Reviewed-on: https://webrtc-review.googlesource.com/57880
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22191}
2018-02-26 22:00:34 +00:00
Philip Eliasson
278aa42718 Revert "Some cleanup for the logging code:"
This reverts commit 9ecdcdf2b5.

Reason for revert: Breaks downstream project.

Original change's description:
> Some cleanup for the logging code:
> 
> * Only include 'tag' for Android. Before there was an
>   extra std::string variable per log statement for all
>   platforms.
> * Remove unused logging macro for Windows and 'module' ctor argument.
> * Move httpcommon code out of logging and to where it's used.
> 
> Change-Id: I347805d3df2cee2840c0d2eef5bfefaff1cdbf37
> Bug: webrtc:8928
> Reviewed-on: https://webrtc-review.googlesource.com/57183
> Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22184}

TBR=kwiberg@webrtc.org,tommi@webrtc.org,jonasolsson@webrtc.org

Change-Id: I37a13d766fbdee2adb7f45231cf8be6b2b456bec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8928
Reviewed-on: https://webrtc-review.googlesource.com/57720
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22187}
2018-02-26 14:54:52 +00:00
Tommi
9ecdcdf2b5 Some cleanup for the logging code:
* Only include 'tag' for Android. Before there was an
  extra std::string variable per log statement for all
  platforms.
* Remove unused logging macro for Windows and 'module' ctor argument.
* Move httpcommon code out of logging and to where it's used.

Change-Id: I347805d3df2cee2840c0d2eef5bfefaff1cdbf37
Bug: webrtc:8928
Reviewed-on: https://webrtc-review.googlesource.com/57183
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22184}
2018-02-26 12:09:50 +00:00
Niels Möller
225c787c6e Move default thresholds from QualityScaler to encoders.
Overriding implementations of VideoEncoder::GetScalingSettings that
want to enable quality scaling must now provide the thresholds.

Bug: webrtc:8830
Change-Id: I75c47cb56ac1b9cf77401684980b3167e485f51c
Reviewed-on: https://webrtc-review.googlesource.com/46622
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22172}
2018-02-23 13:12:36 +00:00
Sami Kalliomäki
d60d5c4479 Improve Java video codec error handling.
FALLBACK_SOFTWARE is now treated as a critical error and results in
immediate fallback to software coding if available. If ERROR is
returned, codec reset is attempted. If that fails, software fallback
is used.

Bug: b/73498933
Change-Id: I7fe163efd09e6f27c72491e9595954ddc59b1448
Reviewed-on: https://webrtc-review.googlesource.com/54901
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22169}
2018-02-23 09:07:36 +00:00
Sami Kalliomäki
0611065256 Update JavaI420Buffer.allocate to use native allocations.
This ensures memory is released timely and avoids problems with garbage
collection.

Native buffers don't support array operation, so FileVideoCapturer had
to be update to use FileChannel to write ByteBuffers directly.

Bug: None
Change-Id: I3f63d2adc159e9f39f0c68dd0bd6b1747686584e
Reviewed-on: https://webrtc-review.googlesource.com/55262
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22118}
2018-02-21 08:40:26 +00:00
Qingsi Wang
db53f8e604 Add configurable STUN binding request interval.
STUN candidates use STUN binding requests to keep NAT bindings open. The
interval at which the STUN keepalive pings are sent is configurable now
via RTCConfiguration.

TBR=sakal@webrtc.org

Bug: None
Change-Id: I5f99ea3fe1e9042fa2bf7dcab0aace78f57739e6
Reviewed-on: https://webrtc-review.googlesource.com/54180
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22109}
2018-02-20 23:32:46 +00:00
Ying Wang
0dd1b0a4b2 Revert "Revert "Enables PeerConnectionFactory using external fec controller""
This reverts commit 00733015fa.

Reason for revert: The reason for a downstream test failure on the original commit and a workaround has been found. Solution is to keep a PeerConnectionFactory constructor implementation as the same as before.

Original change's description:
> Revert "Enables PeerConnectionFactory using external fec controller"
>
> This reverts commit 4f07bdb255.
>
> Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java
>
> Original change's description:
> > Enables PeerConnectionFactory using external fec controller
> >
> > Bug: webrtc:8799
> > Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> > Reviewed-on: https://webrtc-review.googlesource.com/43961
> > Commit-Queue: Ying Wang <yinwa@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22038}
>
> TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org
>
> Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8799
> Reviewed-on: https://webrtc-review.googlesource.com/54080
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22040}

TBR=deadbeef@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org

Bug: webrtc:8799
Change-Id: If9f3292bfcc739782967530c49f006d0abbc38a8
Reviewed-on: https://webrtc-review.googlesource.com/55400
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22100}
2018-02-20 12:41:55 +00:00
Sami Kalliomäki
ad148a36ea Add native API for creating AndroidNetworkMonitorFactory.
Moves AndroidNetworkMonitor out of pc folder. Even clients not using
PeerConnection seem to be using it and it doesn't have any dependencies
to the PeerConnection API.

Bug: webrtc:8769
Change-Id: I2bdeff9f5c9925e13388fbc77aa9b264a7583548
Reviewed-on: https://webrtc-review.googlesource.com/53260
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22051}
2018-02-16 12:34:11 +00:00
Taylor Brandstetter
00733015fa Revert "Enables PeerConnectionFactory using external fec controller"
This reverts commit 4f07bdb255.

Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java

Original change's description:
> Enables PeerConnectionFactory using external fec controller
> 
> Bug: webrtc:8799
> Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> Reviewed-on: https://webrtc-review.googlesource.com/43961
> Commit-Queue: Ying Wang <yinwa@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22038}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org

Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8799
Reviewed-on: https://webrtc-review.googlesource.com/54080
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22040}
2018-02-15 20:07:24 +00:00
Ying Wang
4f07bdb255 Enables PeerConnectionFactory using external fec controller
Bug: webrtc:8799
Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
Reviewed-on: https://webrtc-review.googlesource.com/43961
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22038}
2018-02-15 16:58:26 +00:00
Sami Kalliomäki
2bde85046a Fix memory leak in NativeToJavaVideoFrame.
This method used to just wrap frame when passed a native frame and
create a new one when passed non-native frame. This caused a memory
leak when a new frame was returned because the caller didn't release
the frame. Now the method always returns a new frame and the caller is
responsible for releasing it.

Bug: webrtc:8892, b/72675429
Change-Id: I06d67a6ed4c059cae1d709c51b0266f9c72fef1a
Reviewed-on: https://webrtc-review.googlesource.com/53840
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22033}
2018-02-15 14:26:45 +00:00
Niels Möller
8366e177e7 Rename Call::Config to CallConfig, keep old name as alias.
We want api/peerconnectioninterface.h (and corresponding build target)
to not depend on call.h, and generally we treat Call as an internal,
non-api, class. But we need CallFactoryInterface in the api in order to
enable use of PeerConnection with or without support for media.

Making CallConfig a top-level class makes it possible to forward declare
it, together with Call, for use in callfactoryinterface.h and
peerconnectioninterface.h.

Delete the peerconnection_and_implicit_call_api target, replaced by
new target callfactory_api, to link between Call and Peerconnection.

Bug: webrtc:7504
Change-Id: I5e3978ef89bcd6705e94536f8676bcf89fc82fe1
Reviewed-on: https://webrtc-review.googlesource.com/46201
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22020}
2018-02-14 15:14:39 +00:00
Jonathan Yu
fa6a283953 Add wrapper for VideoSink and VideoFrame to Android native_api.
Bug: webrtc:8769
Change-Id: If944b2a52a86666bebf094ec0e3c74c076d6c3d2
Reviewed-on: https://webrtc-review.googlesource.com/50740
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22001}
2018-02-13 14:10:04 +00:00
Sami Kalliomäki
78498cf5ee Implements JavaToNativeStringMap and adds tests for native API.
Implements JavaToNativeStringMap that is a replacement for
JavaToStdMapStrings. It uses a new template method JavaToNativeMap. Also
adds testing support for native API and a test for JavaToNativeStringMap.

Bug: webrtc:8769
Change-Id: I580d4992a899ebe02da39af450fa51d52ee9b88b
Reviewed-on: https://webrtc-review.googlesource.com/48060
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21967}
2018-02-09 10:34:44 +00:00
Tommi
8e545eee1e Revert "Use SRTP_AES128_CM_SHA1_80 by default instead of SRTP_AES128_CM_SHA1_32."
This reverts commit 6780c51b23.

Reason for revert:

More details in crbug.com/810292

Original change's description:
> Use SRTP_AES128_CM_SHA1_80 by default instead of SRTP_AES128_CM_SHA1_32.
> 
> A field has been added to "CryptoOptions" to enable SRTP_AES128_CM_SHA1_32
> from native apps if really necessary.
> 
> R=​deadbeef@webrtc.org
> 
> Bug: webrtc:7670
> Change-Id: I36b6ab3e302fbf3cda2611ff196757e43a56e704
> Reviewed-on: https://webrtc-review.googlesource.com/41420
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Joachim Bauch <jbauch@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21952}

TBR=deadbeef@webrtc.org,magjed@webrtc.org,jbauch@webrtc.org

Change-Id: I643dbe023eca526f2cda4d97df045f2533741dd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7670
Reviewed-on: https://webrtc-review.googlesource.com/49880
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21961}
2018-02-08 16:25:31 +00:00
Niels Möller
d0dd90be62 New java ScalingSettings constructors.
Deprecate old constructors. Intended to make java api consistent with
the changes in https://webrtc-review.googlesource.com/c/src/+/46622.

Bug: webrtc:8830
Change-Id: Iadecb5d033b5de841873905af659d8d234b75c7d
Reviewed-on: https://webrtc-review.googlesource.com/49062
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21956}
2018-02-08 14:26:51 +00:00
Joachim Bauch
6780c51b23 Use SRTP_AES128_CM_SHA1_80 by default instead of SRTP_AES128_CM_SHA1_32.
A field has been added to "CryptoOptions" to enable SRTP_AES128_CM_SHA1_32
from native apps if really necessary.

R=deadbeef@webrtc.org

Bug: webrtc:7670
Change-Id: I36b6ab3e302fbf3cda2611ff196757e43a56e704
Reviewed-on: https://webrtc-review.googlesource.com/41420
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Joachim Bauch <jbauch@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21952}
2018-02-07 21:56:01 +00:00
Sami Kalliomäki
11c51dd53d Update documentation for VideoEncoder.Callback#onEncodedImage.
Allows assuming that the buffer is not accessed after the call returns.

Bug: b/72675429
No-Try: True
Change-Id: Iff4a05433c6eed6aefec49ce67486966b1ed882f
Reviewed-on: https://webrtc-review.googlesource.com/49161
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21940}
2018-02-07 15:30:21 +00:00
Sami Kalliomäki
95a5f00484 Update HWVideoEncoder to reuse codec buffer instead of copying the data.
In practice, this is safe since WebRTC doesn't access the buffer after the
callback returns. This avoids unnecessary memory allocations causing out of
memory errors.

Bug: b/72675429
Change-Id: I2ed0224f40b7e1fa67c7aba625b99211f9c1e0a3
Reviewed-on: https://webrtc-review.googlesource.com/49162
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21932}
2018-02-07 13:52:58 +00:00
Niels Möller
1e06289cdb Delete macro RTC_ACCESS_ON, replaced by RTC_GUARDED_BY.
Both macros do the same thing, as wrappers for
__attribute__((guarded_by)), and more names for the same thing doesn't
add to clarity.

Bug: none
Change-Id: Iaaf7b21dbf3345ee90fee22c39b636823d195eb0
Reviewed-on: https://webrtc-review.googlesource.com/48361
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21929}
2018-02-07 10:07:28 +00:00
Sami Kalliomäki
740f8e72df Android: Fix a race condition in VideoDecoderWrapper.
Fixes a race condition where frame_extra_infos_ is accessed from
multiple threads by adding a lock.

Adds thread safety idioms to the file to guard agains similar mistakes
in the future.

Bug: b/72979294
Change-Id: I0f2f947282a5b3414f1351e9e8e52ad523f7d2f6
Reviewed-on: https://webrtc-review.googlesource.com/48641
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21926}
2018-02-07 08:53:11 +00:00
Alex Leung
28e710798e Only allow MediaTek H264 HW Codec for O_MR1 or later
Bug: webrtc:8761
Change-Id: I3e5a1d97a5e89cb95bb94c2e892be1f3e63e9383
Reviewed-on: https://webrtc-review.googlesource.com/48200
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21900}
2018-02-06 09:21:50 +00:00
Jonathan Yu
7092368982 Fix race condition in cleanup of old frame records.
VideoEncoderWrapper may be released and reused (Release() followed by
InitEncode()). This often happens back to back when encoders are
reconfigured. Because encoded frames are posted asynchronously to the
encoder queue, they may be processed after the encoder associated with
them has already been released.

In the existing code, if a frame for the new encoder had already been
received, the processing of the frame for the old encoder would clear
out the record for the new encoder's frame. This is now fixed by only
clearing out records that are older than the encoded frame being
processed.

A particularly bad symptom is when the new encoder is used for the same
stream as the old one (but was reconfigured for e.g. a change in
resolution). In that case, the new encoder's initial keyframe gets
dropped, and all subsequent difference frames are based off the last
sent frame from the old encoder. This all renders as garbage until a new
keyframe is sent.

Bug: webrtc:8849
Change-Id: I25094f12b38e03e158dc10ac66e92aa9ebaa5541
Reviewed-on: https://webrtc-review.googlesource.com/47549
Commit-Queue: Jonathan Yu <yujo@chromium.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21896}
2018-02-05 18:44:24 +00:00
Sami Kalliomäki
debbc7801f Use correct presentationTimestampUs for VideoFrames in old encoder.
In MediaCodecVideoEncoder, VideoFrame timestamp was used as a
presentation timestamp. With this change timestamp maintained in C++
code is used instead. This matches the behaviour with old frame
callbacks.

Bug: b/72832862
Change-Id: I1f0543ebe837ccac22c83a81a81f3ea128e2a866
Reviewed-on: https://webrtc-review.googlesource.com/47381
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21872}
2018-02-02 13:37:16 +00:00
Sami Kalliomäki
682dc619f2 Conclude VideoFrame emit fieldtrial.
Concludes VideoFrame emit fieldtrial and start producing VideoFrames
by default. Deprecates old onByteBufferFrameCaptured and
onTextureFrameCaptured methods.

Bug: webrtc:8776
Change-Id: Icc224e9f8d89a30f04cf95dd46a498d69cffe9d0
Reviewed-on: https://webrtc-review.googlesource.com/43022
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21866}
2018-02-02 10:20:22 +00:00
Qingsi Wang
970b088878 Reland "Break up rtc_event_log_api to solve circular dependencies."
This is a reland of 001546da95
Original change's description:
> Break up rtc_event_log_api to solve circular dependencies.
>
> The original rtc_event_log_api is refactored to a pure API target plus
> multiple targets coupled with WebRTC implementations.
>
> Bug: None
> Change-Id: Iab9eee3f7bf4228c52d94a5f26fc39bb99b5033f
> Reviewed-on: https://webrtc-review.googlesource.com/43247
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Cr-Commit-Position: refs/heads/master@{#21811}

TBR=pthatcher@webrtc.org,deadbeef@webrtc.org,terelius@webrtc.org,stefan@webrtc.org

Bug: None
Change-Id: I3e7213733741cbfd5dd0076f32209e6bc42a0647
Reviewed-on: https://webrtc-review.googlesource.com/46900
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21862}
2018-02-01 22:47:52 +00:00
Qingsi Wang
9a5c6f8f3f Add the network preference to RTCConfiguration.
The network preference is added to RTCConfiguration and passed to ICE.
ICE considers now the preference set by applications over network
interface types when making decisions in candidate pair switching.

Bug: webrtc:8816
Change-Id: I40d2612705b54c83dd45772ac855808e0a76b1e1
Reviewed-on: https://webrtc-review.googlesource.com/44020
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21855}
2018-02-01 19:32:21 +00:00
Sami Kalliomäki
dff310227d Reorganize code in java_types to logical groups.
Reorganizes methods in java_types.h to logical groups. The order in
the source file matches the order in the header file.

Bug: webrtc:8769
Change-Id: Id3e1e80276a747a3d9952598207ac55493ac46b6
Reviewed-on: https://webrtc-review.googlesource.com/46146
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21842}
2018-02-01 13:09:01 +00:00
Mirko Bonadei
75df7282eb Revert "Break up rtc_event_log_api to solve circular dependencies."
This reverts commit 001546da95.

Reason for revert: breaks downstream projects.

Original change's description:
> Break up rtc_event_log_api to solve circular dependencies.
> 
> The original rtc_event_log_api is refactored to a pure API target plus
> multiple targets coupled with WebRTC implementations.
> 
> Bug: None
> Change-Id: Iab9eee3f7bf4228c52d94a5f26fc39bb99b5033f
> Reviewed-on: https://webrtc-review.googlesource.com/43247
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Cr-Commit-Position: refs/heads/master@{#21811}

TBR=phoglund@webrtc.org,deadbeef@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,pthatcher@google.com,pthatcher@webrtc.org,qingsi@google.com

Change-Id: I82540eac176c4abfb7e50dc51671585b32a1bace
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/46581
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21823}
2018-01-31 09:39:44 +00:00
Anders Carlsson
dd8c16574e Enable building WebRTC without built-in software codecs
This CL adds a GN build flag to include builtin software codecs
(enabled by default).

When setting the flag to false, libvpx can also be excluded. The
benefit is that the resulting binary is smaller.

Replaces https://webrtc-review.googlesource.com/c/src/+/29203

Bug: webrtc:7925
Change-Id: Id330ea8a43169e449ee139eca18e4557cc932e10
Reviewed-on: https://webrtc-review.googlesource.com/36340
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21818}
2018-01-31 08:33:59 +00:00
Qingsi Wang
001546da95 Break up rtc_event_log_api to solve circular dependencies.
The original rtc_event_log_api is refactored to a pure API target plus
multiple targets coupled with WebRTC implementations.

Bug: None
Change-Id: Iab9eee3f7bf4228c52d94a5f26fc39bb99b5033f
Reviewed-on: https://webrtc-review.googlesource.com/43247
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#21811}
2018-01-30 17:54:06 +00:00
Sami Kalliomäki
607f464b16 Remove ThreadUtils.waitUninterruptibly.
This method is an anti-pattern. Removes usage of the method from
CameraCapturer and deletes it.

Bug: webrtc:8456
Change-Id: I8a70ce968af412fa6e6b9308a9e05d6a8a1ba05d
Reviewed-on: https://webrtc-review.googlesource.com/46140
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21808}
2018-01-30 15:25:59 +00:00
Sami Kalliomäki
82f96e6a56 Create an experimental Android NDK.
Following files were split:
sdk/android/native_api/jni_helpers.h
  -> sdk/android/native_api/jni/java_types.h
sdk/android/native_api/jni_helpers.cc
  -> sdk/android/native_api/jni/java_types.cc

Skipping presubmit to avoid changing moved code.

Bug: webrtc:8769

Change-Id: I0ef0f6b297b5002322915660d26cca33e91ff05b
No-Presubmit: true
Reviewed-on: https://webrtc-review.googlesource.com/40800
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21799}
2018-01-30 09:33:42 +00:00
Sami Kalliomäki
88a0c4add3 Never use surface mode in MediaCodecVideoEncoder if egl_context_ is null.
When using VideoFrames, expect_encode_from_texture is true even for
ByteBuffer frames. This causes the encoder to sometimes initialize
itself in surface mode even when egl_context_ is not available.
This leads to a crash.

Bug: webrtc:8776
Change-Id: I8cac36514725b8f430d7bf456d481a4b0c6fcd42
Reviewed-on: https://webrtc-review.googlesource.com/43861
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21789}
2018-01-29 11:03:37 +00:00
Zach Stein
ba37b4b075 Change return type of RtpSenderInterface::SetParameters from bool to RTCError
Note that RTCErrorTypes are mapped to the following DOMException names:
INTERNAL_ERROR -> OperationError
UNSUPPORTED_PARAMETER -> OperationError
INVALID_STATE -> InvalidStateError
INVALID_MODIFICATION -> InvalidModificationError
INVALID_RANGE -> RangeError

Bug: webrtc:8772
Change-Id: I44e3fe2456b007b8fb227d37d74b07ba226a19e4
Reviewed-on: https://webrtc-review.googlesource.com/37141
Commit-Queue: Zach Stein <zstein@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21766}
2018-01-25 19:06:04 +00:00
Mirko Bonadei
63e83c77ae Forward fix jni_generator_helper.h.
In crrev.com/531028, the JNI generator starts to add heap profiler
events to JNI generated functions.

This will cause a ~80KiB regression and at the moment it is breaking
the Chromium Roll into WebRTC.

This CL defines a void macro to re-enable the Chromium Roll avoiding
the size regression.

Bug: chromium:801260
Change-Id: I9543299199c4e14b6b9b235c5cb98c0d53cf29ea
Reviewed-on: https://webrtc-review.googlesource.com/43021
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21730}
2018-01-23 10:33:26 +00:00
Niels Möller
1d7ecd29c7 Rename a few MediaConfig::Video flags for consistency.
enable_cpu_overuse_detection --> enable_cpu_adaptation
  disable_prerenderer_smoothing --> enable_prerenderer_smoothing

where the latter also gets opposite meaning.

Bug: none
Change-Id: Ic10de0871a87e86a899aefa72ecb7e46fcdeaa65
Reviewed-on: https://webrtc-review.googlesource.com/40280
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21726}
2018-01-22 17:32:58 +00:00
Sami Kalliomäki
e93de5ff70 Update libwebrtc to use dist_jar instead of custom java8_dist_jar.
The custom template seems to be broken. The necessary flag
"use_unprocessed_jars" has been added to dist_jar template and the
custom template is not needed anymore.

Bug: None
Change-Id: I0ca7a91ee47c8de659bcaffa5661bff55af50375
Reviewed-on: https://webrtc-review.googlesource.com/42680
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21721}
2018-01-22 15:24:18 +00:00
Sami Kalliomäki
75db552b33 Add VideoSink interface to VideoFileRenderer.
Bug: webrtc:8776
Change-Id: I1782b0c197abf6f82a200a2808ddc87d1f250326
Reviewed-on: https://webrtc-review.googlesource.com/41320
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21719}
2018-01-22 14:57:38 +00:00
Mirko Bonadei
848f31e57d Removing "initialized lambda captures" (C++14 feature).
WebRTC is still targeting C++11, this C++14 only feature sneaked in
because the Android toolchain used to build WebRTC on the trybots
uses C++14 features.

Bug: None
Change-Id: I095fb76134dff729c72b7660cdb3d6abc4de2e0c
Reviewed-on: https://webrtc-review.googlesource.com/42501
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21711}
2018-01-22 13:27:58 +00:00
Alex Leung
5b6891afdd Add MediaTek H264 and VP8 HW Codec Support with field trial
Bug: webrtc:8761
Change-Id: I06cdff086b624afaf3533ced3e5e4eaf3a862720
Reviewed-on: https://webrtc-review.googlesource.com/39980
Commit-Queue: Alex Leung <alexleung@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21699}
2018-01-19 19:58:03 +00:00
Ilya Nikolaevskiy
2ffe3e80db Reland Use runtime enabled features API to enable dual stream mode
This is an unchanged patch after dependency fixes in downstream projects are implemented.

Original patch was reviewed here:
https://webrtc-review.googlesource.com/c/src/+/39008

TBR=phoglund@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org,philipel@webrtc.org,lliuu@webrtc.org

Change-Id: I648bbf63d34282a48cabc854615005ec65b28cb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8287
Reviewed-on: https://webrtc-review.googlesource.com/40420
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21674}
2018-01-18 12:22:49 +00:00
Lu Liu
c1094eb81d Revert "Use runtime enabled features API to enable dual stream mode"
This reverts commit 6f011dfdd4.

Reason for revert: Broke internal builds

Original change's description:
> Use runtime enabled features API to enable dual stream mode
> 
> Bug: webrtc:8287
> Change-Id: I1a366d959a8b7f2a704baa7ea8ace64c1c398d52
> Reviewed-on: https://webrtc-review.googlesource.com/39008
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21661}

TBR=phoglund@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org,philipel@webrtc.org

Change-Id: I0af406066231b67dd0b8eb6808bdc3e3f77560b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8287
Reviewed-on: https://webrtc-review.googlesource.com/40321
Reviewed-by: Lu Liu <lliuu@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21663}
2018-01-17 19:45:48 +00:00
Ilya Nikolaevskiy
6f011dfdd4 Use runtime enabled features API to enable dual stream mode
Bug: webrtc:8287
Change-Id: I1a366d959a8b7f2a704baa7ea8ace64c1c398d52
Reviewed-on: https://webrtc-review.googlesource.com/39008
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21661}
2018-01-17 16:29:37 +00:00
Fredrik Solenberg
a8b7c7f4c6 Move remaining traces of VoiceEngine
- Move files from voice_engine/ to audio/.
- Rename voice_engine/utility.* to remix_resample.* since there are no other
  utilities in those files.
- Move test/mock_voe_channel_proxy.h to audio/.
- Removed voe_channel_id from Audio[Receive|Send]Stream::Config.
- Remove VoiceEngine* from AudioState::Config.
- Fix a few cpplint complaints which showed when moving files.

NOPRESUBMIT=true

Bug: webrtc:4690
Change-Id: Id266c822d956625c358fa5e193e6f4837164aef8
Reviewed-on: https://webrtc-review.googlesource.com/39268
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21657}
2018-01-17 13:27:47 +00:00
Jonas Oreland
e662d0ecf0 Extend Android SDK to enable adding custom PortAllocator
This patch exposes the network_thread so that
a custom PortAllocator can use it instead of e.g
creating own thread.

Bug: webrtc:8640
Change-Id: I705629e4f1a4d0a4fed7d53a774ba9564ba076fe
Reviewed-on: https://webrtc-review.googlesource.com/39925
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21643}
2018-01-16 14:52:14 +00:00
Sami Kalliomäki
6f247e944c Add a method for getting the native factory from PeerConnectionFactory.
Bug: webrtc:8662
Change-Id: Icfe09e82737e1b700e469afde00c4f0923bbeb42
Reviewed-on: https://webrtc-review.googlesource.com/39516
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21628}
2018-01-16 08:43:12 +00:00
Sami Kalliomäki
c4f18fed26 Expose peerconnection_jni publicly until we have a proper NDK.
Bug: webrtc:8662
Change-Id: I9ed6664d76d1ef65b2c907970aef64b69d7bec8b
Reviewed-on: https://webrtc-review.googlesource.com/39513
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21627}
2018-01-16 08:41:32 +00:00
Oleh Prypin
e78824ecd0 Suppress ErrorProne StringSplitter warnings
Bug: webrtc:8750
Change-Id: I1ff1bae680659f804c72eab5d14cf9c8c5046b90
Reviewed-on: https://webrtc-review.googlesource.com/39660
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21625}
2018-01-16 08:14:42 +00:00
Sami Kalliomäki
ce5c19add1 Move ownership of PeerConnectionObserver from Java to C++.
New OwnedPeerConnection takes ownership of the observer. This is done
to allow NativePeerConnectionFactory to return a capsulated object.

Bug: webrtc:8662
Change-Id: Ie876f7b9a1a17ebcfbe51537f712a32ab1a7cbfb
Reviewed-on: https://webrtc-review.googlesource.com/35300
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21610}
2018-01-15 09:52:38 +00:00
Mirko Bonadei
75baa498fa Stop using public_deps in media/.
Bug: webrtc:8603
Change-Id: I7a6dad323ac298dc784feb5aa1fdc2ae5876cb5c
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/33180
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21591}
2018-01-12 08:15:01 +00:00
Sami Kalliomäki
02879f9990 Reland "Make freeNativePeerConnectionObserver generic."
This is a reland of 046f78cae6
Original change's description:
> Make freeNativePeerConnectionObserver generic.
> 
> Previously, it was only possible to free PeerConnectionObserverJni
> objects using this method. Now it is generic and can free any
> PeerConnectionObserver.
> 
> Bug: webrtc:8662
> Change-Id: I619ca5ed88a0c2553fa6d19ce41e510947d5bd44
> Reviewed-on: https://webrtc-review.googlesource.com/35222
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21411}

Bug: webrtc:8662
Change-Id: Iba64d613f7b434260a0d7b762ca67d49b295a84f
Reviewed-on: https://webrtc-review.googlesource.com/38901
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21587}
2018-01-11 15:26:11 +00:00
Sam Zackrisson
aa6b24f23c Delete DefaultAudioProcessingFactory in the Java layer
This removes the DefaultAudioProcessingFactory, PostProcessingFactory and DefaultAudioProcessingFactoryTest classes and leaves the interface AudioProcessingFactory without any default implementation (as the default APM is already created by the PeerConnectionFactory JNI).

Bug: webrtc:8701
Change-Id: I259108afbc5b24cab5161485f45af4236f775c18
Reviewed-on: https://webrtc-review.googlesource.com/37220
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21577}
2018-01-11 12:51:01 +00:00
Per Kjellander
a7f2d84ad1 Revert "Revert "GN rtc_* templates: Set default visibility to webrtc_root + "/*"""
This reverts commit c73e1f4378.

Reason for revert: 
The problem with failed deps in chrome content/renderer had already been fixed in https://webrtc-review.googlesource.com/c/src/+/38660

Original change's description:
> Revert "GN rtc_* templates: Set default visibility to webrtc_root + "/*""
> 
> This reverts commit 588c548657.
> 
> Reason for revert: 
> 
> Breaks Chrome FYI:
> 
> /b/c/b/Linux_Builder/src/buildtools/linux64/gn gen //out/Release --check
>   -> returned 1
> ERROR at //build/split_static_library.gni:12:5: Dependency not allowed.
>     static_library(target_name) {
>     ^----------------------------
> The item //content/renderer:renderer
> can not depend on //third_party/webrtc/media:rtc_internal_video_codecs
> because it is not in //third_party/webrtc/media:rtc_internal_video_codecs's visibility list: [
>   //third_party/webrtc/*
>   //third_party/webrtc_overrides/*
> ]
> 
>  https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.webrtc.fyi%2FLinux_Builder%2F23560%2F%2B%2Frecipes%2Fsteps%2Fgenerate_build_files%2F0%2Fstdout
> 
> Original change's description:
> > GN rtc_* templates: Set default visibility to webrtc_root + "/*"
> > 
> > This means that by default, targets are visible to everything under
> > the WebRTC root, but not visible to anything else.
> > 
> > API targets are manually tagged with visibility "*", so that targets
> > outside the WebRTC tree can see them.
> > 
> > BUG=webrtc:8254
> > 
> > Change-Id: Icdbee6e0d22d93240ff2fb530c8f9dc48e351509
> > Reviewed-on: https://webrtc-review.googlesource.com/24140
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#21548}
> 
> TBR=mbonadei@webrtc.org,kwiberg@webrtc.org
> 
> Change-Id: I06620ce3d6f67482935c22efa231dd6cab91625a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8254
> Reviewed-on: https://webrtc-review.googlesource.com/38760
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Commit-Queue: Per Kjellander <perkj@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21555}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,perkj@webrtc.org

Change-Id: I6f720078ce21bd172e0a6471bae8c4c011e4a657
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8254
Reviewed-on: https://webrtc-review.googlesource.com/38860
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21558}
2018-01-10 15:55:04 +00:00
Yura Yaroshevich
77a47e0081 Handle any exception in Camera.setPreviewTexture.
On Meizu devices (and maybe on other devices too) when camera is
disallowed in settings `android.hardware.Camera.open` returns
non-null Camera instance, but when any method is invoked on `Camera`
instance the `RuntimeException` is thrown. It claims that Camera
instance is used after `release()` was invoked on that instance.
`Camera1Session.open` didn't handle that case and crashed whole
application when returned Camera instance was already released or
more likely was not even properly initialized during `Camera.open`.

Bug: webrtc:8685
Change-Id: I5cda397a599e87971bf9a4bd3faf6fc4a0d198f3
Reviewed-on: https://webrtc-review.googlesource.com/36300
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21556}
2018-01-10 15:15:57 +00:00
Per Kjellander
c73e1f4378 Revert "GN rtc_* templates: Set default visibility to webrtc_root + "/*""
This reverts commit 588c548657.

Reason for revert: 

Breaks Chrome FYI:

/b/c/b/Linux_Builder/src/buildtools/linux64/gn gen //out/Release --check
  -> returned 1
ERROR at //build/split_static_library.gni:12:5: Dependency not allowed.
    static_library(target_name) {
    ^----------------------------
The item //content/renderer:renderer
can not depend on //third_party/webrtc/media:rtc_internal_video_codecs
because it is not in //third_party/webrtc/media:rtc_internal_video_codecs's visibility list: [
  //third_party/webrtc/*
  //third_party/webrtc_overrides/*
]

 https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.webrtc.fyi%2FLinux_Builder%2F23560%2F%2B%2Frecipes%2Fsteps%2Fgenerate_build_files%2F0%2Fstdout

Original change's description:
> GN rtc_* templates: Set default visibility to webrtc_root + "/*"
> 
> This means that by default, targets are visible to everything under
> the WebRTC root, but not visible to anything else.
> 
> API targets are manually tagged with visibility "*", so that targets
> outside the WebRTC tree can see them.
> 
> BUG=webrtc:8254
> 
> Change-Id: Icdbee6e0d22d93240ff2fb530c8f9dc48e351509
> Reviewed-on: https://webrtc-review.googlesource.com/24140
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21548}

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

Change-Id: I06620ce3d6f67482935c22efa231dd6cab91625a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8254
Reviewed-on: https://webrtc-review.googlesource.com/38760
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21555}
2018-01-10 15:14:54 +00:00
Karl Wiberg
588c548657 GN rtc_* templates: Set default visibility to webrtc_root + "/*"
This means that by default, targets are visible to everything under
the WebRTC root, but not visible to anything else.

API targets are manually tagged with visibility "*", so that targets
outside the WebRTC tree can see them.

BUG=webrtc:8254

Change-Id: Icdbee6e0d22d93240ff2fb530c8f9dc48e351509
Reviewed-on: https://webrtc-review.googlesource.com/24140
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21548}
2018-01-10 13:08:11 +00:00
Sami Kalliomäki
84804b08fd Make getNativePeerConnection public.
Bug: webrtc:8662
Change-Id: Id23b5e047a2c479bef1c4dd7985c3199c6310eb6
Reviewed-on: https://webrtc-review.googlesource.com/35720
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21547}
2018-01-10 13:04:11 +00:00
Ivo Creusen
62337e59dd Use AudioProcessingBuilder everywhere AudioProcessing is created.
The AudioProcessingBuilder was recently introduced in https://webrtc-review.googlesource.com/c/src/+/34651 to make it easier to create APM instances. This CL replaces all calls to the old Create methods with the new AudioProcessingBuilder.

Bug: webrtc:8668
Change-Id: Ibb5f0fc0dbcc85fcf3355b01bec916f20fe0eb67
Reviewed-on: https://webrtc-review.googlesource.com/36082
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21534}
2018-01-09 13:45:20 +00:00
Patrik Höglund
99175c6eb3 Add untracked headers to video_coding.
This creates a new target for pure defines and interfaces. I think
that makes sense (though include/ makes it harder to see when .cc and
.h files should live together).

Bug: webrtc:7620
Change-Id: Ifb0f50faf99166202836c0446feed3443eb52c6e
Reviewed-on: https://webrtc-review.googlesource.com/34657
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21516}
2018-01-08 11:51:52 +00:00
Anders Carlsson
a114c88e78 Reland "Reland "Reland "Put internal video codec factories into separate target"""
This is a reland of 727b7d0470
Original change's description:
> Reland "Reland "Put internal video codec factories into separate target""
> 
> This is a reland of 0efd1e8b7e
> Original change's description:
> > Reland "Put internal video codec factories into separate target"
> > 
> > This is a reland of 51698aefd4
> > Original change's description:
> > > Put internal video codec factories into separate target
> > > 
> > > The purpose is to start splitting out the dependencies to the built-in
> > > SW video codecs, so that clients can decide to not depend on them and
> > > get a reduction in binary size.
> > > 
> > > Replaces https://webrtc-review.googlesource.com/c/src/+/29101
> > > 
> > > Bug: webrtc:7925
> > > Change-Id: I46b95aaf42ead70ba78776de60600b8a66a1fe0c
> > > Reviewed-on: https://webrtc-review.googlesource.com/33420
> > > Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21381}
> > 
> > Bug: webrtc:7925
> > Change-Id: I105287fd41ec3ee5bd964b94efcc9c7b3ecdb842
> > Reviewed-on: https://webrtc-review.googlesource.com/35261
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#21389}
> 
> Bug: webrtc:7925
> Change-Id: Id1c7f270676e9e4ca57ca8aa1305cf5554290754
> Reviewed-on: https://webrtc-review.googlesource.com/35501
> Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21464}

Bug: webrtc:7925
Change-Id: I0b3b5e03d29dadbcbe13cb7ce5369299bb6c0454
Reviewed-on: https://webrtc-review.googlesource.com/37000
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21513}
2018-01-08 09:29:52 +00:00
Mirko Bonadei
f641687a80 Forward fixing WebRTC to compile with Android NDK r16.
Starting from Chromium Roll [1], WebRTC should start to use NDK r16
for Android builds. The roll cannot be completed because of three
compilation errors:

../../sdk/android/src/jni/pc/androidnetworkmonitor.cc:15:9: error: 'RTLD_NOLOAD' macro redefined [-Werror,-Wmacro-redefined]
        ^
../../third_party/android_tools/ndk/sysroot/usr/include/dlfcn.h:62:9: note: previous definition is here

../../modules/audio_device/android/audio_record_jni.cc:251:41: error: format specifies type 'long long' but the argument has type 'jlong' (aka 'long') [-Werror,-Wformat]
  ALOGD("direct buffer capacity: %lld", capacity);

../../modules/audio_device/android/audio_track_jni.cc:229:41: error: format specifies type 'long long' but the argument has type 'jlong' (aka 'long') [-Werror,-Wformat]
  ALOGD("direct buffer capacity: %lld", capacity);

This CL forward fixes these errors in order to fix the Chromium Roll
into WebRTC.

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

Bug: webrtc:8710
Change-Id: I5bc64e73919eee7c9e965a442a386b5e1897b56a
Reviewed-on: https://webrtc-review.googlesource.com/37640
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21510}
2018-01-08 07:27:32 +00:00
Patrik Höglund
be214a26f8 Move videosinkinterface.h to common_video to solve a circular dep.
I updated some dependency enforcement rules to allow examples and pc
to depend on common_video. I reckoned depending on common_video is
not controversial when they already dependend on media/base, which
is a lower-level abstraction.

Bug: webrtc:6828
Change-Id: I77dbeb10187b4e70dda1d873a29994fa76070758
Reviewed-on: https://webrtc-review.googlesource.com/34187
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21495}
2018-01-04 13:19:49 +00:00
Honghai Zhang
0e894c3889 Update NetworkMonitor so that it can be started from java code.
BUG=b/69623057

Change-Id: I30e0d23e82f5feeadc05e5fc9a4b87e7d3e2da8c
Reviewed-on: https://webrtc-review.googlesource.com/31752
Commit-Queue: Honghai Zhang <honghaiz@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21473}
2018-01-02 15:59:30 +00:00
Anders Carlsson
0942b36af1 Revert "Reland "Reland "Put internal video codec factories into separate target"""
This reverts commit 727b7d0470.

Reason for revert: Breaks build

Original change's description:
> Reland "Reland "Put internal video codec factories into separate target""
> 
> This is a reland of 0efd1e8b7e
> Original change's description:
> > Reland "Put internal video codec factories into separate target"
> > 
> > This is a reland of 51698aefd4
> > Original change's description:
> > > Put internal video codec factories into separate target
> > > 
> > > The purpose is to start splitting out the dependencies to the built-in
> > > SW video codecs, so that clients can decide to not depend on them and
> > > get a reduction in binary size.
> > > 
> > > Replaces https://webrtc-review.googlesource.com/c/src/+/29101
> > > 
> > > Bug: webrtc:7925
> > > Change-Id: I46b95aaf42ead70ba78776de60600b8a66a1fe0c
> > > Reviewed-on: https://webrtc-review.googlesource.com/33420
> > > Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21381}
> > 
> > Bug: webrtc:7925
> > Change-Id: I105287fd41ec3ee5bd964b94efcc9c7b3ecdb842
> > Reviewed-on: https://webrtc-review.googlesource.com/35261
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#21389}
> 
> Bug: webrtc:7925
> Change-Id: Id1c7f270676e9e4ca57ca8aa1305cf5554290754
> Reviewed-on: https://webrtc-review.googlesource.com/35501
> Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21464}

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

Change-Id: I8a0621eb91f9ce4835f012e74b6a1da9bf740963
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7925
Reviewed-on: https://webrtc-review.googlesource.com/36940
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21465}
2018-01-02 09:54:12 +00:00
Anders Carlsson
727b7d0470 Reland "Reland "Put internal video codec factories into separate target""
This is a reland of 0efd1e8b7e
Original change's description:
> Reland "Put internal video codec factories into separate target"
> 
> This is a reland of 51698aefd4
> Original change's description:
> > Put internal video codec factories into separate target
> > 
> > The purpose is to start splitting out the dependencies to the built-in
> > SW video codecs, so that clients can decide to not depend on them and
> > get a reduction in binary size.
> > 
> > Replaces https://webrtc-review.googlesource.com/c/src/+/29101
> > 
> > Bug: webrtc:7925
> > Change-Id: I46b95aaf42ead70ba78776de60600b8a66a1fe0c
> > Reviewed-on: https://webrtc-review.googlesource.com/33420
> > Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#21381}
> 
> Bug: webrtc:7925
> Change-Id: I105287fd41ec3ee5bd964b94efcc9c7b3ecdb842
> Reviewed-on: https://webrtc-review.googlesource.com/35261
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21389}

Bug: webrtc:7925
Change-Id: Id1c7f270676e9e4ca57ca8aa1305cf5554290754
Reviewed-on: https://webrtc-review.googlesource.com/35501
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21464}
2018-01-02 09:44:51 +00:00
Alex Loiko
97cb448d25 Update Webrtc to new AudioProcessing API.
webrtc::PostProcessor changed to webrtc::CustomProcessor and one APM
factory method has been deprecated.

The APM API changed in this cl: https://webrtc-review.googlesource.com/c/src/+/29201

TBR=henrik.lundin@webrtc.org, sakal@webrtc.org

Bug: webrtc:8665
Change-Id: I76dfc7831575d4dfce7e60cbe22007bd2a50e946
Reviewed-on: https://webrtc-review.googlesource.com/34381
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21451}
2017-12-27 09:03:59 +00:00
Oleh Prypin
1e53f8ad04 Roll chromium_revision 747cb1afa7..a3e55aafc0 (525640:525714) + Android fix
Adapt Android build rule usages according to upstream change
https://chromium-review.googlesource.com/c/chromium/src/+/833158

Change log: 747cb1afa7..a3e55aafc0
Full diff: 747cb1afa7..a3e55aafc0

Changed dependencies:
* src/base: 37d45f196a..058c173308
* src/build: 5e68daf0b2..86d9760b0c
* src/ios: a1e00fa91e..34051b405b
* src/testing: f514237b80..f471a14790
* src/third_party: 4ff31643cf..2ce24f00db
* src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/a0b20a4892..436908b7d2
* src/tools: 753234bdb4..0b61011efa
DEPS diff: 747cb1afa7..a3e55aafc0/DEPS

Clang version changed 318667:321204
Details: 747cb1afa7..a3e55aafc0/tools/clang/scripts/update.py

TBR=sakal@webrtc.org
BUG=None
CQ_INCLUDE_TRYBOTS=master.internal.tryserver.corp.webrtc:linux_internal

Change-Id: I086df695fb2f279bfe49d539acfaf13e43559167
Reviewed-on: https://webrtc-review.googlesource.com/35940
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21422}
2017-12-22 09:31:13 +00:00
Sami Kalliomäki
b96d62dbf2 Revert "Make freeNativePeerConnectionObserver generic."
This reverts commit 046f78cae6.

Reason for revert: Breaks chromium.webrtc.fyi tree

Original change's description:
> Make freeNativePeerConnectionObserver generic.
> 
> Previously, it was only possible to free PeerConnectionObserverJni
> objects using this method. Now it is generic and can free any
> PeerConnectionObserver.
> 
> Bug: webrtc:8662
> Change-Id: I619ca5ed88a0c2553fa6d19ce41e510947d5bd44
> Reviewed-on: https://webrtc-review.googlesource.com/35222
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21411}

TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org

Change-Id: I4490945ca3d9a25d5ed5795bc7954dc1044bdd22
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8662
Reviewed-on: https://webrtc-review.googlesource.com/35781
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21413}
2017-12-21 13:09:01 +00:00
Sami Kalliomäki
046f78cae6 Make freeNativePeerConnectionObserver generic.
Previously, it was only possible to free PeerConnectionObserverJni
objects using this method. Now it is generic and can free any
PeerConnectionObserver.

Bug: webrtc:8662
Change-Id: I619ca5ed88a0c2553fa6d19ce41e510947d5bd44
Reviewed-on: https://webrtc-review.googlesource.com/35222
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21411}
2017-12-21 12:36:20 +00:00
Lu Liu
6552695e35 Revert "Reland "Put internal video codec factories into separate target""
This reverts commit 0efd1e8b7e.

Reason for revert: Breaking internal builds

Original change's description:
> Reland "Put internal video codec factories into separate target"
> 
> This is a reland of 51698aefd4
> Original change's description:
> > Put internal video codec factories into separate target
> > 
> > The purpose is to start splitting out the dependencies to the built-in
> > SW video codecs, so that clients can decide to not depend on them and
> > get a reduction in binary size.
> > 
> > Replaces https://webrtc-review.googlesource.com/c/src/+/29101
> > 
> > Bug: webrtc:7925
> > Change-Id: I46b95aaf42ead70ba78776de60600b8a66a1fe0c
> > Reviewed-on: https://webrtc-review.googlesource.com/33420
> > Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#21381}
> 
> Bug: webrtc:7925
> Change-Id: I105287fd41ec3ee5bd964b94efcc9c7b3ecdb842
> Reviewed-on: https://webrtc-review.googlesource.com/35261
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21389}

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

Change-Id: I8d3b788cc9e43261b3ed6d3d52427b5e26bc827e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7925
Reviewed-on: https://webrtc-review.googlesource.com/35187
Reviewed-by: Lu Liu <lliuu@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21393}
2017-12-20 18:08:48 +00:00
Anders Carlsson
0efd1e8b7e Reland "Put internal video codec factories into separate target"
This is a reland of 51698aefd4
Original change's description:
> Put internal video codec factories into separate target
> 
> The purpose is to start splitting out the dependencies to the built-in
> SW video codecs, so that clients can decide to not depend on them and
> get a reduction in binary size.
> 
> Replaces https://webrtc-review.googlesource.com/c/src/+/29101
> 
> Bug: webrtc:7925
> Change-Id: I46b95aaf42ead70ba78776de60600b8a66a1fe0c
> Reviewed-on: https://webrtc-review.googlesource.com/33420
> Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21381}

Bug: webrtc:7925
Change-Id: I105287fd41ec3ee5bd964b94efcc9c7b3ecdb842
Reviewed-on: https://webrtc-review.googlesource.com/35261
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21389}
2017-12-20 16:26:46 +00:00
Magnus Jedvert
84d8ae5df7 Android: Use scoped java refs
We currently use raw jobject in our code mixed with sporadic
ScopedLocalRefFrame. This CL moves every jobject into a scoped object,
either local, global, or a parameter. Also, this CL uses the JNI
generation script to generate declaration stubs for the Java->C++
functions so that it no longer becomes possible to mistype them
without getting compilation errors.

TBR=brandt@webrtc.org

Bug: webrtc:8278,webrtc:6969
Change-Id: Ic7bac74a89c11180177d65041086d7db1cdfb516
Reviewed-on: https://webrtc-review.googlesource.com/34655
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21387}
2017-12-20 15:46:06 +00:00
Anders Carlsson
bb298acac8 Revert "Put internal video codec factories into separate target"
This reverts commit 51698aefd4.

Reason for revert: Breaks builds because badly formatted deps

Original change's description:
> Put internal video codec factories into separate target
> 
> The purpose is to start splitting out the dependencies to the built-in
> SW video codecs, so that clients can decide to not depend on them and
> get a reduction in binary size.
> 
> Replaces https://webrtc-review.googlesource.com/c/src/+/29101
> 
> Bug: webrtc:7925
> Change-Id: I46b95aaf42ead70ba78776de60600b8a66a1fe0c
> Reviewed-on: https://webrtc-review.googlesource.com/33420
> Commit-Queue: Anders Carlsson <andersc@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21381}

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

Change-Id: Ib85f77fea756f4beb6a95b45cb132cbdc424ef00
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7925
Reviewed-on: https://webrtc-review.googlesource.com/35260
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21383}
2017-12-20 13:45:27 +00:00
Anders Carlsson
51698aefd4 Put internal video codec factories into separate target
The purpose is to start splitting out the dependencies to the built-in
SW video codecs, so that clients can decide to not depend on them and
get a reduction in binary size.

Replaces https://webrtc-review.googlesource.com/c/src/+/29101

Bug: webrtc:7925
Change-Id: I46b95aaf42ead70ba78776de60600b8a66a1fe0c
Reviewed-on: https://webrtc-review.googlesource.com/33420
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21381}
2017-12-20 13:31:26 +00:00
Magnus Jedvert
1212f1e227 Android: One JNI file per Java file
This CL does the following:
 * Split out MediaStream JNI code from peerconnection.cc to mediastream.h/mediastream.cc.
 * Split out RtpSender JNI code from peerconnection.cc to rtpsender.h/rtpsender.cc.
 * Split out TurnCustomizer JNI code from peerconnection.cc to turncustomizer.h/turncustomizer.cc.
 * Add missing instanceof function to WrappedNativeVideoDecoder.java.
 * Move some PeerConnectionFactory JNI declarations from pc/video.cc to peerconnectionfactory.cc.
 * Add declaration to video.h for the JNI functions that depend on EglBase14_jni.h.
 * Use a scoped object to store the global Java MediaStream objects that also call dispose.

Bug: webrtc:8278
Change-Id: I3c56a599b8bcbc8f34e5c5a7b9c9fe1d192ff3f3
Reviewed-on: https://webrtc-review.googlesource.com/34645
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21380}
2017-12-20 11:30:26 +00:00
Sami Kalliomäki
1ece1edddc Android: Allow injecting native PeerConnection.
This allows application to construct PeerConnection object in JNI and
pass that to Android API. API for wrapping Java PeerConnection Observers
is exposed for convenience.

Bug: webrtc:8662
Change-Id: Id110b92e6bb5ab00661cd50616d05c3e18a1697d
Reviewed-on: https://webrtc-review.googlesource.com/34520
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21379}
2017-12-20 11:27:56 +00:00
Sami Kalliomäki
e8b26cd86b Android: Deprecate peerconnection constraints.
C++ API allows passing all configuration through RTCConfiguration
object. This adds all values previously passed through PC constraints
to Java RTCConfiguration object and deprecates API that takes PC
contraints.

Using the deprecated API overrides the values in RTCConfigration
object.

Bug: webrtc:8663, webrtc:8662
Change-Id: I128432c3caba74403513fb1347ff58830c643885
Reviewed-on: https://webrtc-review.googlesource.com/33460
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21357}
2017-12-19 12:23:20 +00:00
Yura Yaroshevich
5a7508ab24 Fixed NPE inside org.webrtc.Camera1Session.create
On some devices `android.hardware.Camera.open` returns null
instead of raising exception. It causes `NPE` inside
`Camera1Session.create` when method `setPreviewTexture` is
invoked on local variable `camera`, which is `null`.

Bug: webrtc:8658
Change-Id: Ic65b4aef2c0b8b65735a9db02433b536bfe92ddd
Reviewed-on: https://webrtc-review.googlesource.com/33620
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21352}
2017-12-19 10:01:20 +00:00
Patrik Höglund
3e113438b1 Fix circular dependencies in webrtc_common.
One reason for the circular deps is that common_types.h is a
historical dumping ground for various structs and defines that
are believed to be generally useful. I tried moving things out
that did not appear to be used downstream (StreamCounters,
RtpCounters etc) and moved the things that seemed used
(RtpHeader + supporting structs) to a new file api/rtp_headers.h.
This makes their place in the api more clear while moving out
the things that don't belong in the API in the first place.

I had to extract out typedefs.h from webrtc_common to resolve
another circular dependency. I believe checks includes typedefs,
but common depends on checks.

Bug: webrtc:7745
Change-Id: I725d49616b1ec0cdc8b74be7c078f7a4d46f084b
Reviewed-on: https://webrtc-review.googlesource.com/33001
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21295}
2017-12-15 14:33:26 +00:00
Mirko Bonadei
401d056891 Removing $rtc_libyuv_dir and removing useless dependencies on libyuv.
This CL removes the following GN variables: rtc_build_libyuv,
rtc_libyuv_dir (as requested in webrtc:7906).
It also removes some unneeded dependencies on //third_party/libyuv.

WebRTC targets were using public_deps to depend on //third_party/libyuv
and this created a build graph where targets that were depending on
//third_party/libyuv were not declaring the dependency to GN because
they were somehow getting it from another target that was exposing
//third_party/libyuv header files even if it wasn't directly depending
on it.

Bug: webrtc:8605, webrtc:7906
Change-Id: If71f7988fd80421dc2ad887cf94c2ac66366c3fb
Reviewed-on: https://webrtc-review.googlesource.com/32201
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21275}
2017-12-14 11:18:33 +00:00
Patrik Höglund
a8005cfd8b Fix circular dependencies between optional, array_view, and rtc_base.
This splits things out of rtc_base and makes dependencies explicit.

Bug: webrtc:6828
Change-Id: Id521896c3c43595349021c857bec216e429a0c8d
Reviewed-on: https://webrtc-review.googlesource.com/32780
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21264}
2017-12-14 06:49:11 +00:00
Patrik Höglund
d37709b659 Revert "Fix circular dependencies between optional, array_view, and rtc_base."
This reverts commit a9e0924fa7.

Reason for revert: Breaks because of RTC_LAST_SYSTEM_ERROR

Original change's description:
> Fix circular dependencies between optional, array_view, and rtc_base.
> 
> This splits things out of rtc_base and makes dependencies explicit.
> 
> Bug: webrtc:6828
> Change-Id: Ib813c7bd9e4de7ab015acb917bc09ee7204ba7bd
> Reviewed-on: https://webrtc-review.googlesource.com/31940
> Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21245}

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

Change-Id: I1a5dcf2223f00ae7c46f9f2a12b990ab3a84397d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:6828
Reviewed-on: https://webrtc-review.googlesource.com/32760
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21251}
2017-12-13 14:56:33 +00:00
Patrik Höglund
a9e0924fa7 Fix circular dependencies between optional, array_view, and rtc_base.
This splits things out of rtc_base and makes dependencies explicit.

Bug: webrtc:6828
Change-Id: Ib813c7bd9e4de7ab015acb917bc09ee7204ba7bd
Reviewed-on: https://webrtc-review.googlesource.com/31940
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21245}
2017-12-13 13:44:21 +00:00
Sami Kalliomäki
20b294c28e Android: Re-enable videoprocessor integration tests.
The problem was that the encoder was feeded with frames that had 0 as
a timestamp. This confused the encoder. H264 high profile support
clause was also wrong and is corrected.

Bug: webrtc:8601
Change-Id: Ic5a893b4b7573e694f865b63620843b2c9aa489f
Reviewed-on: https://webrtc-review.googlesource.com/32300
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21234}
2017-12-13 08:59:30 +00:00
Magnus Jedvert
9060eb1528 Android: Generate JNI code for remaining classes in sdk/android
Bug: webrtc:8278
Change-Id: I20a4388ab347d8745d0edde808f7a0b610f077f9
Reviewed-on: https://webrtc-review.googlesource.com/31484
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21227}
2017-12-12 12:36:17 +00:00
Mirko Bonadei
654320666d Including libyuv headers using fully qualified paths.
Using fully qualified paths to include libyuv headers allows WebRTC to
avoid to rely on the //third_party/libyuv:libyuv_config target to
set the -I compiler flag.

Today some WebRTC targets depend on //third_party/libyuv only to
include //third_party/libyuv:libyuv_config but with fully qualified
paths this should not be needed anymore.

A follow-up CL will remove //third_party/libyuv from some targets that
don't need it because they are not including libyuv headers.

Bug: webrtc:8605
Change-Id: Icec707ca761aaf2ea8088e7f7a05ddde0de2619a
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/28220
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21209}
2017-12-11 15:51:26 +00:00
Magnus Jedvert
655e1967ea Android: Generate JNI code for MediaCodecVideoEncoder/Decoder
Bug: webrtc:8278
Change-Id: I19cff18b5d110720ea50d16254ddc4377adc3dbe
Reviewed-on: https://webrtc-review.googlesource.com/31261
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21204}
2017-12-11 12:38:15 +00:00
Magnus Jedvert
de5afcfcbf Android: Merge peerconnectionobserver_jni and peerconnection_jni
The generated JNI files are actually implementation files that can only
be included from one place. For generating JNI code for
PeerConnection.java, this means we need to collect all JNI
PeerConnection code into one place. This CL moves
peerconnectionobserver_jni.h to peerconnection.h, and merges
peerconnectionobserver_jni.cc and peerconnection_jni.cc. It also moves
converter functions JavaToNativeIceServers and
JavaToNativeRTCConfiguration to peerconnection.h since they are also
related to PeerConnection.java.

This CL does not contain anything else than a pure code move.

TBR=sakal@webrtc.org

Bug: webrtc:8278
Change-Id: I31c696c1aab495e09f95e5ba5d79f95df7c34a0e
Reviewed-on: https://webrtc-review.googlesource.com/31483
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21200}
2017-12-11 10:17:05 +00:00
Sami Kalliomäki
28c3571ed0 Roll chromium_revision 5d9089080e..fb396f70fd (522183:522378)
Changes to java8_dist_jar unblock the roll.

Change log: 5d9089080e..fb396f70fd
Full diff: 5d9089080e..fb396f70fd

Changed dependencies:
* src/base: ea8d608e8e..028bc777a2
* src/build: 379d3331d1..a487899ea8
* src/ios: 7796ebdb5c..277bfb566d
* src/testing: 50b6577a3d..7c055df753
* src/third_party: caec3c432a..d8cd44fcb7
* src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/307c9f954d..db654910e3
* src/tools: c98f4e3e61..a626dcf509
* src/tools/swarming_client: 6fd3c7b6eb..4bd9152f8a
DEPS diff: 5d9089080e..fb396f70fd/DEPS

No update to Clang.

TBR=buildbot@webrtc.org,
BUG=None
CQ_INCLUDE_TRYBOTS=master.internal.tryserver.corp.webrtc:linux_internal

Change-Id: I0cae8d49c169f77c63ef85eb1ca9d4a5898bbbc4
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/30680
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21161}
2017-12-08 11:53:09 +00:00
Steve Anton
a3a92c264b Replace string type with SdpType enum
This moves all WebRTC internal code from using
SessionDescriptionInterface::type() which returns a string and
from using CreateSessionDescription with a string type parameter.

Bug: webrtc:8613
Change-Id: I1cdd93dc4b26dec157e22476fdac569d5da2810a
Reviewed-on: https://webrtc-review.googlesource.com/29500
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21147}
2017-12-07 19:08:47 +00:00
Magnus Jedvert
3863153267 Android: Generate JNI code for jni_helper, RtpSender, and VideoEncoderFactory
Bug: webrtc:8278
Change-Id: I6111e562cc5a8fe6c595fcb8dfd5202d46a08806
Reviewed-on: https://webrtc-review.googlesource.com/28622
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21140}
2017-12-07 15:18:57 +00:00
Mirko Bonadei
e51f785043 Stop using public_deps in pc/.
TBR=phoglund@webrtc.org

Bug: webrtc:8603
Change-Id: If18e5a4d212392bbd9b4e1f9c2f00ee79a2ab348
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/29864
Reviewed-by: Edward Lemur <ehmaldonado@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21139}
2017-12-07 13:57:57 +00:00
Mirko Bonadei
a498ae83ac Stop using public_deps in system_wrappers.
TBR=phoglund@webrtc.org

Bug: webrtc:8603
Change-Id: I5e515f0e4dc955a01460d69ba4e21bdfdf152d20
Reviewed-on: https://webrtc-review.googlesource.com/29104
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Edward Lemur <ehmaldonado@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21112}
2017-12-06 08:56:52 +00:00
Mirko Bonadei
0250be51be Stop using public_deps to depend on libyuv.
A lot of WebRTC targets were depending on //third_party/libyuv using
public_deps instead of deps. This causes issues because a the
inclusion of libyuv headers is not declared to the build system and
this creates hidden dependencies that put the modularity of the project
at risk.

Bug: webrtc:8603
Change-Id: Ide0ceb84eb5640ae664dc782f3a722b55c3b601a
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/28120
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21039}
2017-12-04 14:16:08 +00:00
Magnus Jedvert
ba700f642b Android: Generate JNI code for RtpReceiver and PeerConnection.Observer
Bug: webrtc:8278
Change-Id: Ief62c37dd6820c2eb1ce94e37e0a61dd8726caae
Reviewed-on: https://webrtc-review.googlesource.com/28621
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21035}
2017-12-04 13:29:59 +00:00
Sami Kalliomäki
b9f3f9bdd7 Make EglBase an interface.
Bug: webrtc:8084
Change-Id: I50f57f81fe7148e2ed262e0672d5ab3a4f0f251e
Reviewed-on: https://webrtc-review.googlesource.com/26960
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21026}
2017-12-04 08:41:38 +00:00
Oskar Sundbom
51907f641b Optional: Use nullopt and implicit construction in /sdk/android/src/jni/pc
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

Bug: None
Change-Id: Idf275495910f651ec35f641611926e62414daa9a
Reviewed-on: https://webrtc-review.googlesource.com/23610
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20972}
2017-12-01 10:22:01 +00:00
Magnus Jedvert
bba8e9eb85 Reland "Android: Generate JNI code for stats"
This reverts commit 43d069a2cd.

Reason for revert: Include fix for local reference overflow.

Original change's description:
> Revert "Android: Generate JNI code for stats"
>
> This reverts commit aede67a199.
>
> Reason for revert: Causes error:
> JNI ERROR (app bug): local reference table overflow (max=512)'
>
> Original change's description:
> > Android: Generate JNI code for stats
> >
> > This CL also unifies the functions for converting from C++ to Java, and
> > generates the boiler plate for converting C++ vectors to Java arrays.
> >
> > Bug: webrtc:8278
> > Change-Id: I262e9162beae8a64ba0e8b6a27e1081207b03961
> > Reviewed-on: https://webrtc-review.googlesource.com/26020
> > Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20918}
>
> TBR=magjed@webrtc.org,sakal@webrtc.org
>
> Change-Id: Ieb26ed8577bd489a4dd4f7542d16a7d0e11f409f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8278
> Reviewed-on: https://webrtc-review.googlesource.com/26900
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20926}

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

Change-Id: I6f7097f308098e7922fbf0bed577bd69da4e1c61
Bug: webrtc:8278
Reviewed-on: https://webrtc-review.googlesource.com/26901
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20951}
2017-11-30 11:40:51 +00:00
Magnus Jedvert
43d069a2cd Revert "Android: Generate JNI code for stats"
This reverts commit aede67a199.

Reason for revert: Causes error:
JNI ERROR (app bug): local reference table overflow (max=512)'

Original change's description:
> Android: Generate JNI code for stats
> 
> This CL also unifies the functions for converting from C++ to Java, and
> generates the boiler plate for converting C++ vectors to Java arrays.
> 
> Bug: webrtc:8278
> Change-Id: I262e9162beae8a64ba0e8b6a27e1081207b03961
> Reviewed-on: https://webrtc-review.googlesource.com/26020
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20918}

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

Change-Id: Ieb26ed8577bd489a4dd4f7542d16a7d0e11f409f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8278
Reviewed-on: https://webrtc-review.googlesource.com/26900
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20926}
2017-11-29 10:09:10 +00:00
Magnus Jedvert
aede67a199 Android: Generate JNI code for stats
This CL also unifies the functions for converting from C++ to Java, and
generates the boiler plate for converting C++ vectors to Java arrays.

Bug: webrtc:8278
Change-Id: I262e9162beae8a64ba0e8b6a27e1081207b03961
Reviewed-on: https://webrtc-review.googlesource.com/26020
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20918}
2017-11-28 17:27:58 +00:00
Magnus Jedvert
4fa5da54d5 Android: Generate JNI code for MediaStreamTrack
Bug: webrtc:8278
Change-Id: Id5ac6ecd4f65bed4ae4b2953ef58ebc390508d21
Reviewed-on: https://webrtc-review.googlesource.com/25963
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20910}
2017-11-28 13:14:08 +00:00
Magnus Jedvert
6a0345b3b0 Android: Generate JNI code for MediaStream
Bug: webrtc:8278
Change-Id: I48d0615f3db3f22e7179a2d7c59b970a33678ada
Reviewed-on: https://webrtc-review.googlesource.com/25962
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20891}
2017-11-27 11:58:32 +00:00