Commit Graph

131 Commits

Author SHA1 Message Date
9bc599f6da Remove static/default interface method usage.
BUG=webrtc:8217

Review-Url: https://codereview.webrtc.org/3010233002
Cr-Commit-Position: refs/heads/master@{#19741}
2017-09-08 11:46:33 +00:00
07a3bd7c4b Bindings for injectable Java video encoders.
BUG=webrtc:7760

Review-Url: https://codereview.webrtc.org/3003873002
Cr-Commit-Position: refs/heads/master@{#19651}
2017-09-04 10:57:21 +00:00
e172d89f73 Change capture time format to nanoseconds in EncodedImage.
The millisecond field is deprecated and will be removed once the
dependencies have been updated.

BUG=webrtc:7760

Review-Url: https://codereview.webrtc.org/3010623002
Cr-Commit-Position: refs/heads/master@{#19622}
2017-08-31 09:37:28 +00:00
05ea2b39e0 Deprecate IceServer constructors and update dependencies
Bug: webrtc:8176
Change-Id: I2ebc0edf1776c49c202a181d7597099e9242c0e7
Reviewed-on: https://chromium-review.googlesource.com/642710
Commit-Queue: Diogo Real <diogor@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19621}
2017-08-31 07:40:55 +00:00
1dca9d513a Support a user-provided string for the TLS ALPN extension.
Fix source formatting
Add TLS ALPN extension.

Bug: webrtc:8086
Change-Id: I1f28ccd78760d3415e465f734744d2c2f93845e2
Reviewed-on: https://chromium-review.googlesource.com/611150
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Justin Uberti <juberti@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Diogo Real <diogor@google.com>
Cr-Commit-Position: refs/heads/master@{#19588}
2017-08-29 20:11:16 +00:00
160e32c34f Add support for RGB frames in MediaCodecVideoEncoder.
BUG=webrtc:7749

Review-Url: https://codereview.webrtc.org/3002263002
Cr-Commit-Position: refs/heads/master@{#19554}
2017-08-28 09:41:38 +00:00
b1c7453bfa Android: Add common function for adding/releasing native reference
This CL introduces common functions for adding and releasing
native references to reduce the number of JNI functions.

BUG=webrtc:8043

Review-Url: https://codereview.webrtc.org/3003213002
Cr-Commit-Position: refs/heads/master@{#19547}
2017-08-27 20:47:20 +00:00
4781552f60 Android: Expose EglBase.swapBuffers with presentation time
This function is currently only available in EglBase14, which is not in
the api. This CL adds the swapBuffer method to the public EglBase
interface. For EglBase10, the presentation time is just ignored.

BUG=webrtc:8155

Review-Url: https://codereview.webrtc.org/3003843002
Cr-Commit-Position: refs/heads/master@{#19518}
2017-08-25 13:28:00 +00:00
91073ae78f Add a field trial to produce VideoFrames in camera capturers.
The field trials enables producing new VideoFrames in camera classes.
This field trial should be enabled if VideoSinks are used.

BUG=webrtc:7749, webrtc:7760

Review-Url: https://codereview.webrtc.org/2984633002
Cr-Commit-Position: refs/heads/master@{#19467}
2017-08-23 15:50:23 +00:00
c614823fa3 Remove unnecessary release call in EglRenderer.
VideoSink is not assumed to take ownership of the frame, so it is not
necessary to release it unless it is retained for future use.

BUG=webrtc:7749

Review-Url: https://codereview.webrtc.org/3003563002
Cr-Commit-Position: refs/heads/master@{#19440}
2017-08-22 07:21:48 +00:00
2fe9dfae20 Android: Fix synchronization problems in VideoFrame release.
Also fixes a small bug in EglRenderer where if it was passed a custom
frame, it would leak a reference.

BUG=b/64887218

Review-Url: https://codereview.webrtc.org/3003533002
Cr-Commit-Position: refs/heads/master@{#19432}
2017-08-21 15:02:58 +00:00
257baf139a Fix a bug where listener custom drawer was ignored in EglRenderer.
BUG=b/64808682

Review-Url: https://codereview.webrtc.org/2995223002
Cr-Commit-Position: refs/heads/master@{#19416}
2017-08-18 18:38:32 +00:00
2238441654 Explicitly specify the onFrameAvailable() thread.
We are already asserting in tryDeliverTextureFrame() that we are on the
SurfaceTextureHelper handler thread, but this behavior isn't guaranteed
by Android.

Also updated docs for OnTextureFrameAvailableListener, since other
classes (e.g. capturers) were also asserting that they were called on
the SurfaceTextureHelper thread.

Bug: webrtc:8087, b/64609528
Change-Id: I47148c452f66f24477e438b06ef124a96965853d
Reviewed-on: https://chromium-review.googlesource.com/610495
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Jonathan Yu <yujo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#19398}
2017-08-18 00:37:11 +00:00
7c206b5b6c Fix a reference leak when converting I420 VideoFrame to I420Frame.
BUG=webrtc:7760
NOTRY=True

Review-Url: https://codereview.webrtc.org/2999143002
Cr-Commit-Position: refs/heads/master@{#19380}
2017-08-17 10:56:58 +00:00
6bdcefce80 Add VideoSink interface to SurfaceViewRenderer.
BUG=webrtc:7749, webrtc:7760

Review-Url: https://codereview.webrtc.org/3002563002
Cr-Commit-Position: refs/heads/master@{#19347}
2017-08-15 08:56:02 +00:00
0ba43b5a20 Add support for adding VideoSinks to VideoTracks.
VideoSinks receive the new kind of VideoFrames and will replace
VideoRenderers. Converting from old texture frames to VideoFrames will
involve conversion to I420 so it is not recommended to use VideoSinks
before all sources produce VideoFrames.

BUG=webrtc:7749, webrtc:7760

Review-Url: https://codereview.webrtc.org/3002553002
Cr-Commit-Position: refs/heads/master@{#19335}
2017-08-14 12:17:49 +00:00
bf08060971 Update EglRenderer to use lambdas.
BUG=webrtc:8084

Review-Url: https://codereview.webrtc.org/3002433002
Cr-Commit-Position: refs/heads/master@{#19321}
2017-08-11 08:42:43 +00:00
be910460e0 Add support for capturers to capture VideoFrames.
BUG=webrtc:7749, webrtc:7760

Review-Url: https://codereview.webrtc.org/2982213002
Cr-Commit-Position: refs/heads/master@{#19318}
2017-08-11 07:26:05 +00:00
b5f5bdc5cb Support Java VideoFrames in MediaCodecVideoEncoder.
BUG=webrtc:7760

Review-Url: https://codereview.webrtc.org/2997663002
Cr-Commit-Position: refs/heads/master@{#19304}
2017-08-10 11:15:42 +00:00
71a62b9a19 Fix a crash in I420Frame.toString for texture frames.
BUG=webrtc:8073
R=kthelgason

Review-Url: https://codereview.webrtc.org/2997693002
Cr-Commit-Position: refs/heads/master@{#19302}
2017-08-10 09:12:24 +00:00
7a24688f6f Adding comments explaining Java createSender and setTrack methods.
This has been a frequent source of confusion, especially since the
method names don't match anything in the standard exactly.

BUG=None
NOTRY=True

Review-Url: https://codereview.webrtc.org/2994733002
Cr-Commit-Position: refs/heads/master@{#19290}
2017-08-09 15:40:10 +00:00
d89b0bcc8a JNI wrapper for PeerConnection::SetBitrate.
BUG=webrtc:7395

Review-Url: https://codereview.webrtc.org/2868413004
Cr-Commit-Position: refs/heads/master@{#19243}
2017-08-03 18:11:40 +00:00
836f60cda1 Move matrix from VideoFrame to TextureBuffer.
Previously, the matrix in VideoFrame was used to crop and scale the
frame. This caused complications because webrtc::VideoFrame doesn't
include a matrix. cropAndScale method is added to VideoBuffer class for
cropping and scaling instead.

BUG=webrtc:7749, webrtc:7760

Review-Url: https://codereview.webrtc.org/2990583002
Cr-Commit-Position: refs/heads/master@{#19179}
2017-07-28 14:12:23 +00:00
28e2919cfd Adding Android binding for RTCConfiguration::max_ipv6_networks.
BUG=webrtc:7703

Review-Url: https://codereview.webrtc.org/2984863002
Cr-Commit-Position: refs/heads/master@{#19172}
2017-07-27 16:14:38 +00:00
54c721541d Fix issues with NetworkMonitor singleton when used by multiple clients.
When you create multiple "PeerConnectionFactory"s, they end up using
the same NetworkMonitor singleton. But the second one's
"AndroidNetworkMonitor" class (in C++) wasn't getting the expected
network list update, and as a result it wasn't binding sockets to
networks successfully, acting as if the networks didn't exist.

The solution is just to move "updateActiveNetworkList" to
"startMonitoring". This CL also does some other minor
cleanup/refactoring, and fixes a more corner-casey issue where, if the
first PeerConnection is destroyed, the second one would stop receiving
network updates.

BUG=webrtc:7946

Review-Url: https://codereview.webrtc.org/2990693002
Cr-Commit-Position: refs/heads/master@{#19156}
2017-07-26 18:56:49 +00:00
0cf9a4a482 Add texture support to HardwareVideoEncoder.
HardwareVideoEncoderFactory can now take an EglBase.Context on creation.
When it does, it creates video encoders in texture mode.  It uses the
COLOR_FormatSurface colorFormat.  It passes the EglBase.Context to the
HardwareVideoEncoder.

The HardwareVideoEncoder sets up an input surface for its codec and handles
incoming frames by drawing them onto the input surface.

BUG=webrtc:7760
R=pthatcher@webrtc.org, sakal@webrtc.org

Review-Url: https://codereview.webrtc.org/2977153003 .
Cr-Commit-Position: refs/heads/master@{#19083}
2017-07-18 20:19:27 +00:00
8fb23618d8 Add texture support to HardwareVideoDecoder.
HardwareVideoDecoder is now a listener for SurfaceTextureHelper.  It takes a
SurfaceTextureHelper on construction.  If it is non-null, it operates in texture
mode instead of byte-buffer mode.

When in texture mode, the HardwareVideoDecoder renders output frames to a Surface,
listens for the texture frame to become available, wraps it in a VideoFrame, and
pushes it to the decoder callback.

As in MediaCodecVideoDecoder, it may queue up to three buffers while waiting for
the surface to become available for rendering.  If more buffers are queued, it will
drop the oldest.

This change also implements the VideoFrame.TextureBuffer and reorganizes code
for wrapping an existing ByteBuffer into an I420Buffer.  This makes it easier
to implement the texture buffer's ToI420() method.

BUG=webrtc:7760
R=pthatcher@webrtc.org, sakal@webrtc.org

Review-Url: https://codereview.webrtc.org/2977643002 .
Cr-Commit-Position: refs/heads/master@{#19081}
2017-07-18 18:33:44 +00:00
fcf97c3b75 Fix fullscreen scaling in AppRTCMobile.
The surface view renderer size was set to match parent so it couldn't
adjust based on the frame size. The size is now set to wrap_content
which allows the renderer to adjust. The root element of the call
activity is changed to FrameLayout to allow the renderer to center.

requestLayout is added to SurfaceView setScalingType so onMeasure gets
called again.

BUG=webrtc:7901

Review-Url: https://codereview.webrtc.org/2978173002
Cr-Commit-Position: refs/heads/master@{#19073}
2017-07-18 12:01:08 +00:00
d960a0c7d1 Android bindings for ice_regather_interval_range RTCConfiguration option
Bug: webrtc:7969
Change-Id: I3fbb723d35fa6cc4c7b92aa1e155b974e9fb0b55
Reviewed-on: https://chromium-review.googlesource.com/567698
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@chromium.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19062}
2017-07-17 20:09:43 +00:00
ff7acb19a1 Reset isFirstFrameRendered on init of SurfaceViewRenderer
If a SurfaceViewRenderer is reinitialized, the onFirstFrameRendered
callback is not fired.

Ensure that we reset the flag when the SurfaceViewRenderer is
initialized.

BUG=webrtc:7985

Review-Url: https://codereview.webrtc.org/2981793002
Cr-Commit-Position: refs/heads/master@{#19016}
2017-07-14 09:35:53 +00:00
eaaae9e91b base->rtc_base: Update .c, .mm and .java files.
TBR=kwiberg@webrtc.org
BUG=webrtc:7634

Review-Url: https://codereview.webrtc.org/2974613003
Cr-Commit-Position: refs/heads/master@{#18926}
2017-07-07 10:09:51 +00:00
6aa95117d8 Fix null ref in NetworkMonitorAutoDetect if Connectivity Manager service is unavailable
BUG=webrtc:7917
TBR=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2963363002
Cr-Commit-Position: refs/heads/master@{#18906}
2017-07-05 16:55:09 +00:00
06b47c520d Listen for Wifi-Direct networks and include them in the network list
BUG=webrtc:7708
TBR=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2951803003
Cr-Commit-Position: refs/heads/master@{#18839}
2017-06-29 15:57:01 +00:00
372e587ea8 Fix samplingMatrix for I420Frames converted from VideoFrame.
The conversion code was wrong because it assumed the 3x3 matrix is a
XYZ-matrix when it really is XYW-matrix. We have to override the matrix
for I420 frames to flip the vertically before rendering.

R=magjed@webrtc.org

Bug: webrtc:7760
Change-Id: I1f08c1a929bf5721706e2a902701100cf7a9c31d
Reviewed-on: https://chromium-review.googlesource.com/541346
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18801}
2017-06-28 07:58:42 +00:00
471f63559f Allow passing in decoder factory to PeerConnectionFactory.
Bug: webrtc:7760
Change-Id: I8509de8f0170f1f60f917992b5806b926a8bb392
Reviewed-on: https://chromium-review.googlesource.com/535561
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18787}
2017-06-27 15:31:13 +00:00
38145241a2 Create VideoDecoderFactory interface and implementation.
The implementation creates an Android hardware video decoder.  It is built
around the same patterns as the HardwareVideoEncoderFactory.

This change pulls some shared code and constants into a common "utils" class.

Finally, adds an instrumentation test for the HardwareVideoDecoder.

BUG=webrtc:7760

Change-Id: Iea6eaae7727925743cb54f7c3153a6c07d62f55d
Reviewed-on: https://chromium-review.googlesource.com/536254
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18686}
2017-06-20 18:37:30 +00:00
b080b46df4 Create a hardware VideoDecoder implementation using Android MediaCodec.
BUG=webrtc:7760

Change-Id: Ieae3852d22cadf24cf4184ae985062918a85f02c
Reviewed-on: https://chromium-review.googlesource.com/536237
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18685}
2017-06-20 18:04:08 +00:00
dab1d2d34e Enable SNI in ssl adapter.
Bug: webrtc:6973
Change-Id: I13d28cf41c586880bd7fea523005233921794cdf
Reviewed-on: https://chromium-review.googlesource.com/523024
Reviewed-by: Zeke Chin <tkchin@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Justin Uberti <juberti@chromium.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Emad Omara <emadomara@google.com>
Cr-Commit-Position: refs/heads/master@{#18640}
2017-06-16 23:30:48 +00:00
9fbbdc2fef Create the VideoEncoderFactory and implement it.
Adds the VideoEncoderFactory interface and implements it for use with HardwareVideoEncoder.  This uses MediaCodecVideoEncoder's initialization code as an example.

BUG=webrtc:7760

Change-Id: I9fbc93ce9ac4ad866750a4386c4f15e800a3073e
Reviewed-on: https://chromium-review.googlesource.com/530063
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18636}
2017-06-16 16:46:30 +00:00
bc061b4280 Create AndroidVideoBuffer and allow renderers to consume it.
Bug: webrtc:7760
Change-Id: I3e3fddf48090ae27b226c65ddbb51f2c3d8dc544
Reviewed-on: https://chromium-review.googlesource.com/535638
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18624}
2017-06-16 08:31:37 +00:00
3fc2350ef9 Support H.264 high profile encoding on Exynos devices.
Guarded by field trial - similar to high profile encoder.
If high profile is requested, but device do not support it
then fallback to baseline profile.

BUG=b/34816463

Review-Url: https://codereview.webrtc.org/2936313002
Cr-Commit-Position: refs/heads/master@{#18619}
2017-06-15 23:24:37 +00:00
cca0f6cc68 Support H.264 high profile decoding on Exynos devices.
Tested on Galaxy S5, S6, S7 and S8

BUG=b/34816463

Review-Url: https://codereview.webrtc.org/2942463002
Cr-Commit-Position: refs/heads/master@{#18596}
2017-06-14 17:20:54 +00:00
26ecfcc1c1 Remove timeStampMs from EncodedImage.
This field shouldn't have been in the class in the first place.

Bug: webrtc:7760
Change-Id: If3c1d24f18a643249da1ed072bdfe06a37a7da12
Reviewed-on: https://chromium-review.googlesource.com/535539
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18593}
2017-06-14 14:23:46 +00:00
5c4eebb62b Implement org.webrtc.VideoEncoder using the android MediaCodec.
BUG=webrtc:7760

Change-Id: I22134fe616d5c5b77148c80f01f1ea1119ae786c
Reviewed-on: https://chromium-review.googlesource.com/526074
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18573}
2017-06-13 16:07:29 +00:00
e2410e9ab4 Interfaces for injectable video codecs.
These interfaces will be used by the future refactoring that will
allow clients to provide custom codec implementations.

Change-Id: If199bc2807e1c27094c05983c62fa43d2eec5700
Bug: webrtc:7760
Reviewed-on: https://chromium-review.googlesource.com/522065
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18441}
2017-06-05 07:49:47 +00:00
6fac429d81 Use correct bitrate adjustment for Exynos VP9 HW encoder.
BUG=b/62302810

Review-Url: https://codereview.webrtc.org/2922693003
Cr-Commit-Position: refs/heads/master@{#18425}
2017-06-03 03:18:54 +00:00
84ee5c64d3 Force keyframe for Qualcomm HW VP8 Encoder on Android L as well, reduce forced keyframe interval on Android M.
Color distortion also happens on Android L. Tested on the Mi 4.

BUG=webrtc:7681

Review-Url: https://codereview.webrtc.org/2894643003
Cr-Commit-Position: refs/heads/master@{#18423}
2017-06-03 00:36:32 +00:00
58c742ce7d Call VideoCapturer.initialize directly from Java.
Passing the call through JNI is unnecessary.

Bug: webrtc:7730
Change-Id: Icf1ecd7e2ea54033342120311c70d47b4a4f7c9a
Reviewed-on: https://chromium-review.googlesource.com/521050
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18408}
2017-06-02 11:27:36 +00:00
5522021b45 Android: Add VideoFrame class
This new VideoFrame class closesly matches the C++ webrtc::VideoFrame
and webrtc::VideoFrameBuffer classes. It's supposed to replace the
existing VideoRenderer.I420Frame. The purpose is to clean up the code
and support more frame formats.

BUG=webrtc:7749

Review-Url: https://codereview.webrtc.org/2915083002
Cr-Commit-Position: refs/heads/master@{#18404}
2017-06-02 09:45:56 +00:00
3afb899655 Remove passing Android context to NetworkMonitor.
Instead NetworkMonitor calls ContextUtils.getApplicationContext when needed.

Bug: webrtc:7730
Change-Id: I312781da4222f7107ea1bf57099f17709fec2385
Reviewed-on: https://chromium-review.googlesource.com/517792
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18382}
2017-06-01 13:29:01 +00:00