Commit graph

228 commits

Author SHA1 Message Date
Jonathan Yu
50f60cb4b3 Rename software codec classes and move them into api/
We want clients to be able to build their own factories around these
codecs.

Bug: webrtc:7925
Change-Id: Ia8f62d5d85e63ac6e3eb402c5996d8b986625615
Reviewed-on: https://webrtc-review.googlesource.com/c/109529
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Jonathan Yu <yujo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#25543}
2018-11-07 12:24:14 +00:00
Magnus Jedvert
361dbc1973 Android: Add option to set presentation timestamp in EglRenderer
Bug: b/119004693
Change-Id: I78b676a4417ac313e7fbbea009c8dd586707b1af
Reviewed-on: https://webrtc-review.googlesource.com/c/109503
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25517}
2018-11-06 12:11:20 +00:00
Bjorn Mellem
a9bbd86849 Add a configuration parameter for using the media transport for data channels.
Adds a field |use_media_transport_for_data_channels| to RTCConfiguration.
PeerConnection requires a media transport factory to be set if this bit
is set.  As with |use_media_transport|, the value may not be modified
after setting the local or remote description.

If either |use_media_transport| or |use_media_transport_for_data_channel| is
set, PeerConnection uses its media transport factory when creating a JSEP
transport controller.

PeerConnection stops unconditionally using media transport in
CreateVoiceChannel, as it may be present only for use in data channels.  It uses
the media transport if it is present and |use_media_transport| is set.

Bug: webrtc:9719
Change-Id: I59d4ce8f7531fd19d9c17eefe033f063f663ebcc
Reviewed-on: https://webrtc-review.googlesource.com/c/109041
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Slatala <psla@webrtc.org>
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25507}
2018-11-05 21:05:22 +00:00
philipel
ee49f7087f Remove VideoEncoder::SetChannelParameters.
The SetChannelParameters function was used when WebRTC supported decoding
with errors, which we no longer do.

This cleanup CL is related to the work tracked by 9946.

Bug: webrtc:9946
Change-Id: Id2d5ed23031388f890c42651bfbe5f79eda701e5
Reviewed-on: https://webrtc-review.googlesource.com/c/108861
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25505}
2018-11-05 17:37:07 +00:00
Lennart Kolmodin
d4a68bd932 Implement Injectable Audio Codecs for the Java SDK.
Support Injectable Audio Codecs from the Java SDK.
The PeerConnectionFactory.Builder defaults to
BuiltinAudio(Encoder|Decoder)Factory, but other implementations are
permitted via the Audio(Encoder|Decoder)FactoryFactory interface.

Bug: webrtc:9916
Change-Id: I61ad4a6e57666bc1be79daf5f40b129e0eacad84
Reviewed-on: https://webrtc-review.googlesource.com/c/107711
Commit-Queue: Lennart Kolmodin <kolmodin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25478}
2018-11-02 08:25:39 +00:00
Magnus Jedvert
06aa209645 Add support to adapt video without preserving aspect ratio
This is implemented by allowing users to set two different aspect
ratios, one for landscape input and one for portrait input. This extra
control might be useful in other scenarios as well.

Bug: webrtc:9903
Change-Id: I91676737f4aa1f5d94cfe79ac51d5f866779945b
Reviewed-on: https://webrtc-review.googlesource.com/c/108086
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25387}
2018-10-26 12:30:32 +00:00
Benjamin Wright
8c27ccac75 Promotoing webrtc::CryptoOptions to RTCConfiguration.
With the expanding use cases for webrtc::CryptoOptions it makes more sense for
it to be be available per peer connection instead of only as a factory option.

To support backwards compatability for now this code will support the factory
method of setting crypto options by default. However it will completely
overwrite these settings if an RTCConfiguration.crypto_options is provided.

Got LGTM offline from Sami, adding him to TBR if he has any further comments.

TBR=sakal@webrtc.org

Bug: webrtc:9891
Change-Id: I86914cab69284ad82afd7285fd84ec5f4f2c4986
Reviewed-on: https://webrtc-review.googlesource.com/c/107029
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25375}
2018-10-25 17:59:48 +00:00
Qingsi Wang
51cc30c124 Fix a null reference bug in NetworkMonitorAutoDetect.getNetworkState.
Bug: webrtc:9168
Change-Id: Ib3e41db9ff347adfca3b12df6c0fd3293c8ea483
Reviewed-on: https://webrtc-review.googlesource.com/c/107220
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#25279}
2018-10-19 21:18:35 +00:00
Sami Kalliomäki
0d26c9944c Set renderThreadHandler to null on uncaught exception in EglRenderer.
This should prevent us from posting and deadlocking if EglRenderer
thread crashes.

Bug: b/117400268
Change-Id: I978738249917cb5194917b0b2b12f67bb2a8642e
Reviewed-on: https://webrtc-review.googlesource.com/c/107043
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25271}
2018-10-19 13:16:41 +00:00
Benjamin Wright
bfb444ce2c Adds new CryptoOption crypto_options.frame.require_frame_encryption.
This change adds a new subcategory to the public native webrtc::CryptoOptions
structure: webrtc::CryptoOptions::Frame.

This new structure has a single off by default property:
crypto_options.frame.require_frame_encryption.

This new flag if set prevents RtpSenders from sending outgoing payloads unless
a frame_encryptor_ is attached and prevents RtpReceivers from receiving
incoming payloads unless a frame_decryptor_ is attached.

This option is important to enforce no unencrypted data can ever leave the
device or be received.

I have also attached bindings for Java and Objective-C.

I have implemented this functionality for E2EE audio but not E2EE video
since the changes are still in review.

Bug: webrtc:9681
Change-Id: Ie184711190e0cdf5ac781f69e9489ceec904736f
Reviewed-on: https://webrtc-review.googlesource.com/c/105540
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25238}
2018-10-17 17:44:19 +00:00
Piotr (Peter) Slatala
09beff2cfd Add UseMediaTransport RTCConfiguration support in Java class
Bug: webrtc:9719
Change-Id: I122657f37377f2c3f4f70bf3d9dd0909e2d97e3d
Reviewed-on: https://webrtc-review.googlesource.com/c/106460
Commit-Queue: Peter Slatala <psla@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25235}
2018-10-17 14:53:51 +00:00
Piotr (Peter) Slatala
4e5074e0d2 Add MediaTransportInterface factory to the Jni bindings
Java apps currently have no way of setting MediaTransportInterface on
the PeerConnectionFactory. This change adds that ability.

Bug: webrtc:9719
Change-Id: I312893a153b5b3d978912cba4db60cd97001c8f3
Reviewed-on: https://webrtc-review.googlesource.com/c/105740
Commit-Queue: Peter Slatala <psla@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25217}
2018-10-16 16:55:49 +00:00
Michael Iedema
0213786b39 Add certificate gen/set functionality to bring Android closer to JS API
The JS API supports two operations which have never been implemented in
the Android counterpart:
 - generate a new certificate
 - use this certificate when creating a new PeerConnection

Both functions are illustrated in the generateCertificate example code:
 - https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/generateCertificate

Currently, on Android, a new certificate is automatically generated for
every PeerConnection with no programmatic way to set a specific
certificate.

A twin of this feature is already underway for iOS here:
 - https://webrtc-review.googlesource.com/c/src/+/87303

Work sponsored by |pipe|

Bug: webrtc:9546
Change-Id: Iac221517df3ae380aef83c18c9e59b028d709a4f
Reviewed-on: https://webrtc-review.googlesource.com/c/89980
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25090}
2018-10-10 13:37:47 +00:00
Sami Kalliomäki
d5806b289f Add checks to HW codecs to ensure unsupported features are not used.
Add checks to ensure encoder is not used below API level 19. Removes
global @TargetApi from MediaCodecUtils since it is also used by the
decoder. Ensures that texture mode is never enabled below API level 18.

Bug: webrtc:9821
Change-Id: I2ca1014bf8995719c970eb1449b0acbf7b3c883e
Reviewed-on: https://webrtc-review.googlesource.com/c/103701
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24990}
2018-10-04 12:33:10 +00:00
Sami Kalliomäki
8db246a6bb Document methods that are only supported on a specific Android version.
R=phensman@webrtc.org

Bug: webrtc:9819
Change-Id: Ifd3da9e1b70d0cfc479777c3a8031f632296be38
Reviewed-on: https://webrtc-review.googlesource.com/c/103680
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24987}
2018-10-04 11:57:19 +00:00
Qingsi Wang
1bb63bb793 Add API level check for the use of ConnectivityManager.getActiveNetwork.
This method is added in API level 23, and is currently used in
NetworkMonitorAutoDetect to determine the underlying type of a VPN
network.

Bug: webrtc:9811
Change-Id: I7277cd9adb5b3d3d9b116f667bf533352f9b3bdf
Reviewed-on: https://webrtc-review.googlesource.com/c/103560
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#24961}
2018-10-03 21:04:22 +00:00
Åsa Persson
23eba22424 Add support for RtpEncodingParameters num_temporal_layers.
Configuring different number of temporal layers per simulcast layer is not supported.

Bug: webrtc:9785
Change-Id: I5709b2235233420e22e68fb0ae512305ae87e36c
Reviewed-on: https://webrtc-review.googlesource.com/c/102120
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24942}
2018-10-03 07:22:51 +00:00
Steve Anton
1dfac060b5 Throw exception if MediaStreamTrack is constructed with a null native track.
Bug: webrtc:7543, webrtc:7566
Change-Id: I71f3ba1d6d77e51a09b0659e35eb30845b9fca91
Reviewed-on: https://webrtc-review.googlesource.com/102410
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24898}
2018-09-28 15:01:00 +00:00
Sami Kalliomäki
ee05e90297 Throw IllegalStateException if native objects are used after dispose.
This makes it easier to debug issues related to double dispose /
use after dispose.

Bug: webrtc:7566, webrtc:8297
Change-Id: I07429b2b794deabb62b5f3ea1cf92eea6f66a149
Reviewed-on: https://webrtc-review.googlesource.com/102540
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24894}
2018-09-28 13:25:43 +00:00
Åsa Persson
4e5342f06a Android: Add maxFramerate to RtpParameters.
Bug: webrtc:9597
Change-Id: I1049b66860abbd69c4822756dee452b0db459ed4
Reviewed-on: https://webrtc-review.googlesource.com/91440
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24789}
2018-09-24 09:18:39 +00:00
Sami Kalliomäki
1417ae8662 Fix memory leak in FileVideoCapturer.
Bug: webrtc:9749
Change-Id: Id5597a82435a38a16f99fb8874c6c67ea279719a
Reviewed-on: https://webrtc-review.googlesource.com/99881
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24719}
2018-09-13 09:01:53 +00:00
Sergey Silkin
9c147ddc91 Revert "Add SSLConfig object to IceServer."
This reverts commit 4f085434b9.

Reason for revert: breaks downstream projects.

Original change's description:
> Add SSLConfig object to IceServer.
> 
> This is a rollforward of https://webrtc-review.googlesource.com/c/src/+/96020,
> with the addition of setting the old tlsCertPolicy, tlsAlpnProtocols and
> tlsEllipticCurves in the RTCIceServer initializer, for backwards compatibility.
> 
> Bug: webrtc:9662
> Change-Id: I28706ed4ff5abe3f7f913f105779f0e5412aeac5
> Reviewed-on: https://webrtc-review.googlesource.com/98762
> Commit-Queue: Diogo Real <diogor@google.com>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24696}

TBR=steveanton@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,kthelgason@webrtc.org,qingsi@webrtc.org,benwright@webrtc.org,diogor@google.com

Change-Id: I1cb64b63fec688b4ac90c2fa368eaf0bc11046af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9662
Reviewed-on: https://webrtc-review.googlesource.com/99880
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24701}
2018-09-12 10:46:04 +00:00
Diogo Real
4f085434b9 Add SSLConfig object to IceServer.
This is a rollforward of https://webrtc-review.googlesource.com/c/src/+/96020,
with the addition of setting the old tlsCertPolicy, tlsAlpnProtocols and
tlsEllipticCurves in the RTCIceServer initializer, for backwards compatibility.

Bug: webrtc:9662
Change-Id: I28706ed4ff5abe3f7f913f105779f0e5412aeac5
Reviewed-on: https://webrtc-review.googlesource.com/98762
Commit-Queue: Diogo Real <diogor@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24696}
2018-09-11 23:28:46 +00:00
Magnus Jedvert
169e04212e Android: Send original texture width/height in TextureBufferImpl
This information is useful for downscaling to avoid sampling artifacts.

Bug: webrtc:9617
Change-Id: I3353e8384354bf400b150bb450b38777f4a7aa86
Reviewed-on: https://webrtc-review.googlesource.com/99100
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24681}
2018-09-11 11:43:12 +00:00
Sami Kalliomäki
3d50a31aad Remove redundant initializers from WebRTC Java code.
Removes redundant field initializers such as null, 0 and false.

Bug: webrtc:9742
Change-Id: I1e54f6c6000885cf95f7af8e2701875a78445497
Reviewed-on: https://webrtc-review.googlesource.com/99481
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24676}
2018-09-11 09:58:10 +00:00
Benjamin Wright
ea8b6f95c7 Adds the Java interface points for FrameEncryptor/FrameDecryptor.
This changes adds the API surface for injecting the FrameEncryptor and FrameDecryptor from Java.
This assumes that the API User will be able to provide native implementations of both the Encryptor
and Decryptor. Optional Java implementations may come later but due to the significant performance
issues around copying every frame across the JNI boundary it doesn't seem like a good idea to support
a non native backed implementation for now.

Bug: webrtc:9681
Change-Id: Ib4471e69fdf0a99705f824de652c621637b92326
Reviewed-on: https://webrtc-review.googlesource.com/96865
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Emad Omara <emadomara@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24610}
2018-09-06 19:41:21 +00:00
Sami Kalliomäki
389d2261c3 Add support for platform software video decoder implementations.
Also enables support for all hardware implementations. Renames
HardwareVideoDecoderFactory to MediaCodecVideoDecoderFactory. Renames
HardwareVideoDecoder to AndroidVideoDecoder.

Bug: webrtc:8538
Change-Id: I9b351f387526af4da61fb07c07fb4285bd833e19
Reviewed-on: https://webrtc-review.googlesource.com/97680
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24586}
2018-09-05 15:15:27 +00:00
Rasmus Brandt
01b8e5d0f8 Remove deprecated VideoEncoder.Settings constructor.
Bug: webrtc:9646
Change-Id: Iac14930653969eed4f7b2207149512bb3fb87cee
Reviewed-on: https://webrtc-review.googlesource.com/96242
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24582}
2018-09-05 14:24:05 +00:00
Sami Kalliomäki
8ccddff6ac Update Android to use limited range YCbCr.
Limited range seems to be more used than full range and many Android
components already use limited range. This includes FileVideoCapturer,
VideoFileRenderer and HW codecs.

Bug: webrtc:9638
Change-Id: Iadd9b2f19020c6a25bde5e43a28e26a6230dde42
Reviewed-on: https://webrtc-review.googlesource.com/94543
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24576}
2018-09-05 11:41:51 +00:00
Ying Wang
1d52d2c24d Revert "Add SSLConfig object to IceServer."
This reverts commit 7f1ffcccce.

Reason for revert: Speculative revert

Original change's description:
> Add SSLConfig object to IceServer.
> 
> This is being added to allow greater configurability to TLS connections.
> tlsAlpnProtocols, tlsEllipticCurves and tlsCertPolicy will be removed from IceServer in a
> follow-up CL.
> 
> Bug: webrtc:9662
> Change-Id: I33cb804b02c26c662ed2a28c76f9a9dc2df40f36
> Reviewed-on: https://webrtc-review.googlesource.com/96020
> Commit-Queue: Diogo Real <diogor@google.com>
> Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> Reviewed-by: Benjamin Wright <benwright@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24559}

TBR=steveanton@webrtc.org,sakal@webrtc.org,kthelgason@webrtc.org,juberti@webrtc.org,emadomara@webrtc.org,qingsi@webrtc.org,benwright@webrtc.org,diogor@google.com

Change-Id: Iae9fc68b77f743876bda36fc2a04f6d791aae8e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9662
Reviewed-on: https://webrtc-review.googlesource.com/98000
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24563}
2018-09-05 08:15:29 +00:00
Diogo Real
7f1ffcccce Add SSLConfig object to IceServer.
This is being added to allow greater configurability to TLS connections.
tlsAlpnProtocols, tlsEllipticCurves and tlsCertPolicy will be removed from IceServer in a
follow-up CL.

Bug: webrtc:9662
Change-Id: I33cb804b02c26c662ed2a28c76f9a9dc2df40f36
Reviewed-on: https://webrtc-review.googlesource.com/96020
Commit-Queue: Diogo Real <diogor@google.com>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24559}
2018-09-04 22:46:19 +00:00
Rasmus Brandt
85f20cbe4a Add VideoEncoder::Settings::numberOfSimulcastStreams.
This helps Java encoders take action if simulcast is enabled or not.

Bug: webrtc:9646
Change-Id: Iad967e237bdc790ff2af111bdec1319f3e661ff7
Reviewed-on: https://webrtc-review.googlesource.com/95651
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24430}
2018-08-24 14:40:04 +00:00
Magnus Jedvert
40de15d9a6 Android PeerConnectionFactory: Build without video codecs by default
This change was announced here:
https://groups.google.com/d/msgid/discuss-webrtc/f264646c-8b8f-4243-8748-d9e957d3186f%40googlegroups.com

Bug: webrtc:7925
Change-Id: I5b4e6e733128f2c498c8e4faa912a4ae1238764b
Reviewed-on: https://webrtc-review.googlesource.com/92384
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24410}
2018-08-23 17:51:45 +00:00
Magnus Jedvert
814f99cf27 Android: Remove deprecated SurfaceTextureHelper methods
This removal was announced here:
https://groups.google.com/d/msgid/discuss-webrtc/4b2cc67f-a39e-444c-9310-d564bf95eaa1%40googlegroups.com

Bug: webrtc:9412
Change-Id: I3bc780d98b9eb5dc54c4d65fcc929f52850762c5
Reviewed-on: https://webrtc-review.googlesource.com/92381
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24342}
2018-08-20 08:47:22 +00:00
Magnus Jedvert
7b87530fcc Android: Allow YuvConverter to be reused
Similar to how GlDrawer and GlTextureFrameBuffer already works, this
CL updates YuvConverter so that it can be reused after release() has
been called. This makes it more convenient to use, it can be stored
in a final variable, and the resources are lazily allocated on first
usage.

Bug: b/112386285
Change-Id: I437c4c3fd414bc8974df75728f33954b28418e3e
Reviewed-on: https://webrtc-review.googlesource.com/93290
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24248}
2018-08-09 12:36:37 +00:00
Sami Kalliomäki
a381871dbf Add unit tests for hardware video codecs.
Bug: webrtc:9594
Change-Id: I4529a5123997e0309bde1b931bb6d99bea8c0dfd
Reviewed-on: https://webrtc-review.googlesource.com/92399
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24223}
2018-08-08 09:57:03 +00:00
Sami Kalliomäki
15f0a12b83 Allow releaseCallback to be null in JavaI420Buffer#wrap.
R=magjed

Bug: None
Change-Id: I3d57198dd0b8e0575af61b0dac439e3753a2360a
Reviewed-on: https://webrtc-review.googlesource.com/92386
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24193}
2018-08-06 11:39:52 +00:00
Magnus Jedvert
0cbe05cc86 Android: Remove custom matrix helper functions in RendererCommon
Bug: webrtc:9487
Change-Id: I2b5720d55cae9684a7ef2b14cabce262a5321ef0
Reviewed-on: https://webrtc-review.googlesource.com/87820
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24183}
2018-08-03 10:57:07 +00:00
Sami Kalliomäki
ae1bceab00 Move cropAndScaleI420 to JavaI420Buffer.
This allows removing JavaI420Buffer from video_api. This is technically
a public method but I don't think anyone is using it so it should be
safe to move.

Bug: webrtc:9048
Change-Id: Id563a3af030497e1a92e09da79ca1ed925e064a3
Reviewed-on: https://webrtc-review.googlesource.com/90250
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24090}
2018-07-25 08:37:47 +00:00
Sami Kalliomäki
903bd4145f Move VideoCapturer to video_api and cleanup.
This should only be landed after clients have been given time to
upgrade to the new interface.

Bug: webrtc:9496, webrtc:9181
Change-Id: Ideb37637d9f0b9a3a9748811879c263c64f81d11
Reviewed-on: https://webrtc-review.googlesource.com/87308
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24080}
2018-07-24 10:38:57 +00:00
Benjamin Wright
8cf30401eb Adds SSLCertificateVerifier to the Java API.
The native API supports setting an SSLCertificateVerifier that can be used
to provide a custom certificate verifier for incoming SSL certificates. This
change provides this functionality to the Java API so that a Java implementation
can also be provided. It is expected this will only be used in specialized
circumstances and most users will not hit this code path.

Bug: webrtc:9541
Change-Id: Id3c75b8f288333b53edc2959bac533e3ec614978
Reviewed-on: https://webrtc-review.googlesource.com/89500
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24057}
2018-07-20 23:11:52 +00:00
Benjamin Wright
702f4da4b9 Adds flag to enable AES_GCM from the Java API.
This changeset allows Java API users to enable or disable AES_GCM from the
PeerConnectionFactory.

Bug: chromium:713701
Change-Id: I8798e4eeb6907f8e16a646bfb8a20db510f960c8
Reviewed-on: https://webrtc-review.googlesource.com/89260
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24030}
2018-07-18 22:20:40 +00:00
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
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
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
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
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
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