Commit graph

393 commits

Author SHA1 Message Date
Sami Kalliomäki
fe68203494 Allow calling SoftwareVideoDecoderFactory#createDecoder(String).
Previously, this would crash with UnsupportedOperationException. Allows
still calling this while the method is deprecated.

Bug: webrtc:9536, webrtc:7925
Change-Id: I7b88cecca7a4e6f505c7211cf2eb576c394973f8
Reviewed-on: https://webrtc-review.googlesource.com/89381
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24025}
2018-07-18 14:50:39 +00:00
Sami Kalliomäki
e6fcf3ff6c Update CameraCapturer to use the new CapturerObserver.
Full path is specified because otherwise the inner class from
VideoCapturer is used instead.

Bug: webrtc:9496
Change-Id: I122e6525101594863d506eb3c12359b5648d935e
Reviewed-on: https://webrtc-review.googlesource.com/89042
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24006}
2018-07-17 13:31:43 +00:00
Ing. Jan Kaláb
e250645ea4 Call callback in IDLE state
In current state, if you want to do something with the capturer (eg. switch to next camera again) it fails with an exception that camera switch is already in progress.

Change-Id: I908eb590b54fdf3346441097b39f1f2a2eb56ce8

Bug: webrtc:9527
Change-Id: I908eb590b54fdf3346441097b39f1f2a2eb56ce8
Reviewed-on: https://webrtc-review.googlesource.com/88700
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23995}
2018-07-17 07:27:37 +00:00
Magnus Jedvert
e26ff4b581 Android: Transform legacy codec factories into VideoCodecFactories
We want to have an easy migration path away from MediaCodecVideoEncoder
and MediaCodecVideoDecoder and remove the special treatment of these
in our JNI code. This CL transforms these video codecs into proper
VideoCodecFactories that can be injected in the PeerConnectionFactory
like any other external factory.

To summarize, this CL:
 * Provides a trivial migration path for external clients.
 * Removes special treatment of the legacy factories in our JNI code.

Bug: webrtc:7925
Change-Id: I7ee8a6b0ce5ac0f3dc9c06d1587b8a9e52e0b684
Reviewed-on: https://webrtc-review.googlesource.com/88442
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23972}
2018-07-13 14:39:05 +00:00
Anders Carlsson
e23feeb34e Don't care about H264 profiles when creating Android decoder.
Fixes problem in Android's legacy video decoder factory.

Bug: b/111416606
Change-Id: Id6f26d559e5055eb7808beb600b9550ebd4ca4b7
Reviewed-on: https://webrtc-review.googlesource.com/88560
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23967}
2018-07-13 11:10:15 +00:00
Magnus Jedvert
026f27fac1 Android: Pass VideoCodecInfo instead of String to createDecoder()
This is in line with the new C++ VideoCodecFactory interface.

Bug: webrtc:7925
Change-Id: Ice51cab61b6498fef1b0483ce1bd4835ef550231
Reviewed-on: https://webrtc-review.googlesource.com/88368
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23966}
2018-07-13 11:03:45 +00:00
Magnus Jedvert
443959b800 Android: Add software fallback wrapper in Default video codec factories
When both SW and HW video codec is available, create a fallback wrapper.
This CL also makes the ctor public for injecting an external HW codec
factory. This will be useful when making the legacy video codecs
injectable.

Bug: webrtc:7925
Change-Id: I250b18f0c2d5123495436ff432c0442755ab0e94
Reviewed-on: https://webrtc-review.googlesource.com/88366
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23961}
2018-07-13 09:02:21 +00:00
Magnus Jedvert
1045af2989 Android: Add helper functions for comparing H264 codecs
These helper functions will be useful when making the legacy video
codecs injectable.

Bug: webrtc:7925
Change-Id: Id5a480666f07eccc3116d2c2e61803cc4daf7c9f
Reviewed-on: https://webrtc-review.googlesource.com/88365
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23954}
2018-07-12 16:41:01 +00:00
Frank Barchard
8da935e2c9 Include libyuv/planar_functions.h for CopyPlane
Missing header added to included for androidmediadecoder

Bug: None
Test: locally built
Change-Id: I2fd1f3a31f559bb5b7390ed800b68ebab387ced2
Reviewed-on: https://webrtc-review.googlesource.com/88081
Reviewed-by: Frank Barchard <fbarchard@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Frank Barchard <fbarchard@google.com>
Cr-Commit-Position: refs/heads/master@{#23937}
2018-07-11 17:43:22 +00:00
Magnus Jedvert
0f0e7a6f18 Android: Remove use of EGLContexts in PeerConnectionFactory
Since the legacy video codecs seem to be around for some time more, we
need to make them injectable and provide a migration path for clients
that still use them so that we can clean up PeerConnectionFactory.

This CL moves the creation of EglContexts into the legacy codec
factories. Clients can then migrate to setEGLContext() instead of using
setVideoHwAccelerationOptions().

Bug: webrtc:9502
Change-Id: I608607b32db73ce3df7704a061e66d9d53946af5
Reviewed-on: https://webrtc-review.googlesource.com/87941
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23934}
2018-07-11 13:46:05 +00:00
Mirko Bonadei
10a473545f Add missing dependency on //third_party/abseil-cpp/absl/memory.
This is a follow-up of:
https://webrtc-review.googlesource.com/c/src/+/88121.

Bug: None
Change-Id: I0a956d1e5c5942ec6a01d944676c24d004747049
Reviewed-on: https://webrtc-review.googlesource.com/88124
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23926}
2018-07-11 09:09:08 +00:00
Mirko Bonadei
879f7881b4 Add missing dependencies on //third_party/abseil-cpp/absl/memory.
Abseil uses -isystem and -imsvc because of some warnings, these two
flags are not used by "gn check", this introduced some regressions.

CL https://chromium-review.googlesource.com/c/chromium/src/+/1124478
will try to switch back absl to -I.

Bug: None
Change-Id: I52e857ef1d11831393c35a1bee09479b83827bad
Reviewed-on: https://webrtc-review.googlesource.com/88121
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23923}
2018-07-11 07:56:07 +00:00
Magnus Jedvert
9ea085a208 Android: Fix QueryVideoEncoder() for H264 High Profile
This CL is a forward fix of
https://webrtc-review.googlesource.com/c/src/+/83729. That CL
implemented QueryVideoEncoder() using |supported_formats_| instead of
|supported_formats_with_h264_hp_|, which means |is_hardware_accelerated|
will incorrectly be set to false for H264 High Profile.

This CL fixes that. Actually, after removing H264 CHP field trial code
in https://webrtc-review.googlesource.com/c/src/+/73242, there is no
need for separate |supported_formats_| and
|supported_formats_with_h264_hp_| so this CL merges them again.

TBR=andersc@webrtc.org

Bug: webrtc:7925
Change-Id: I35a8ef2f76368fe43f984b13f28c6c83a28e98fd
Reviewed-on: https://webrtc-review.googlesource.com/87940
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23912}
2018-07-10 16:07:00 +00:00
Magnus Jedvert
7561c2113a Android: Honor disabling legacy video HW codec acceleration
This CL is a forward fix of
https://webrtc-review.googlesource.com/c/src/+/83729. That CL
accidentally changed the behavior in a specific case when a client would
both explicitly call setEnableVideoHwAcceleration(false) and also not
inject neither a encoder nor a decoder factory.
This CL restores the behavior for that specific case.

Bug: webrtc:7925
Change-Id: I7653453d5dceb2e61fede164216ff2c879d760ed
Reviewed-on: https://webrtc-review.googlesource.com/87847
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23909}
2018-07-10 14:57:30 +00:00
Anders Carlsson
1e06d885dc Migrate legacy Android video codec factories.
Prepare for building without built-in software codecs. When passing
null, inject the new type of factories but wrap them in the built-in
software codecs outside the videoengine.

Bug: webrtc:7925
Change-Id: I7408e6e46e6b9efdf346852954bf51a97e023b5c
Reviewed-on: https://webrtc-review.googlesource.com/83729
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23897}
2018-07-10 08:01:05 +00:00
Mirko Bonadei
4d131e4eec Switch from int64 to int64_t.
The usage of int64 seems unintentional but it works because int64 is
defined here:
https://cs.chromium.org/chromium/src/third_party/libyuv/include/libyuv/basic_types.h?l=33&rcl=e1f6c1c0b57a9210bb95e88080fa171296210296

This CL switches to int64_t and aligns with the rest of the codebase.

Bug: None
Change-Id: I2292974dbca3692b570214d8bc790336219b151e
Reviewed-on: https://webrtc-review.googlesource.com/87700
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23894}
2018-07-10 06:20:01 +00:00
Benjamin Wright
728b9b564d Adds PeerConnectionDependencies to Java API.
This change adds the base PeerConnectionDependencies structure available in the
native API to the Java API. This changelist only adds the API for the
PeerConnection.Observer which is currently the only mandatory parameter. In
a following CL this will be extended to include the SSLCertificateVerifier
allowing java code to provide an implementation of this.

Bug: webrtc:7913
Change-Id: I74c2e46988ed5cb0685ed907c1bff43867f2c48c
Reviewed-on: https://webrtc-review.googlesource.com/86180
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23892}
2018-07-09 23:57:05 +00:00
Rasmus Brandt
5e4ef774de Add unit test for JavaToNativeVideoCodecInfo.
Bug: webrtc:9495
Change-Id: I8f667f81754ed299a99ddc85af8ee73b148a2335
Reviewed-on: https://webrtc-review.googlesource.com/87580
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23885}
2018-07-09 13:26:34 +00:00
Rasmus Brandt
42a2fc9cba Support injecting custom native codecs from Java.
This CL extends our support for injecting native codecs such that
downstream users can create Java codecs that are backed by custom
native codecs.

After this CL, the Java codec interfaces expose
createNativeVideo{En,Decoder}() methods that may return a value
representing a pointer to the backing native codec. Previously,
a similar mechanism was used for the special case of non-public
Java codecs extending from the internal
WrappedNativeVideo{En,De}coder classes.

Tested: AppRTCMobile on Pixel XL and Pixel 2.
Bug: webrtc:9495
Change-Id: I079ff744afc7bf9873ff983e775c136a6667266d
Reviewed-on: https://webrtc-review.googlesource.com/87264
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23883}
2018-07-09 12:07:11 +00:00
Magnus Jedvert
bf7463b88f Android: Update tests to use new SurfaceTextureHelper interface
Bug: webrtc:9412
Change-Id: I17d2f2cb4e1271d07958c6b7f2db47960e4b39ee
Reviewed-on: https://webrtc-review.googlesource.com/87260
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23877}
2018-07-06 15:18:18 +00:00
Sami Kalliomäki
b2daaaacbd Update capturer/test code to use the new interface VideoCapturer.
Bug: webrtc:9496
Change-Id: I9adf2c341b831820bbe71f2511616b629c9e1acc
Reviewed-on: https://webrtc-review.googlesource.com/87306
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23869}
2018-07-06 10:42:11 +00:00
Sami Kalliomäki
05b552f76a Deprecate PeerConnectionFactory#createVideoSource(VideoCapturer).
This is done in preparation of moving VideoCapturer out of
video_api_java. Clients should update to using
createVideoSource(boolean).

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

Bug: webrtc:9496
Change-Id: I3c93f6bc4df553919dcbe05b00ef4c68f2c9ab60
Reviewed-on: https://webrtc-review.googlesource.com/87305
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23868}
2018-07-06 10:35:46 +00:00
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