Commit Graph

61 Commits

Author SHA1 Message Date
55b9544290 Add camera start/stop time stats to VideoCapturerAndroid.
BUG=webrtc:6302

Review-Url: https://codereview.webrtc.org/2395433003
Cr-Commit-Position: refs/heads/master@{#14548}
2016-10-06 09:59:50 +00:00
f156bddbc6 Add onCameraDisconnected camera event.
BUG=webrtc:6334

Review-Url: https://codereview.webrtc.org/2381343002
Cr-Commit-Position: refs/heads/master@{#14540}
2016-10-06 07:59:18 +00:00
62b1c35d30 Android: Move layout measure code from SurfaceViewRenderer to RendererCommon
BUG=webrtc:6470
R=sakal@webrtc.org

Review URL: https://codereview.webrtc.org/2386253003 .

Cr-Commit-Position: refs/heads/master@{#14526}
2016-10-05 13:56:17 +00:00
8f741e953c Change Camera1Enumerator to create a Camera1Capturer instead of VideoCapturerAndroid.
BUG=webrtc:6148

Review-Url: https://codereview.webrtc.org/2356073003
Cr-Commit-Position: refs/heads/master@{#14478}
2016-10-03 15:06:05 +00:00
b6760f9e44 Format all Java in WebRTC.
BUG=webrtc:6419
TBR=henrika@webrtc.org

Review-Url: https://codereview.webrtc.org/2377003002
Cr-Commit-Position: refs/heads/master@{#14432}
2016-09-29 11:12:51 +00:00
ff9793c600 Android: Remove onOutputFormatRequest from the VideoCapturer interface
Remove onOutputFormatRequest from the VideoCapturer interface and from
all implementations of that interface. Apps should now use
VideoSource.adaptOutputFormat() instead.

BUG=webrtc:6391

Review-Url: https://codereview.webrtc.org/2373353002
Cr-Commit-Position: refs/heads/master@{#14428}
2016-09-29 09:14:39 +00:00
e87d6734ea Return texture frame when dropping frames in CameraCapturer.
BUG=webrtc:6411,b/31686979

Review-Url: https://codereview.webrtc.org/2363043002
Cr-Commit-Position: refs/heads/master@{#14365}
2016-09-23 08:27:38 +00:00
893a7eeecb Support more QCOM specific color formats for Android HW decoder.
BUG=b/31483393

Review-Url: https://codereview.webrtc.org/2349843002
Cr-Commit-Position: refs/heads/master@{#14359}
2016-09-22 17:44:34 +00:00
1c6d3f7eae Add new Camera2Enumerator.isSupported with Context parameter.
The old method is marked deprecated and will be removed soon. The new
method checks if all cameras on the device support better than legacy
implementation of the camera2 API.

BUG=webrtc:6390

Review-Url: https://codereview.webrtc.org/2354883002
Cr-Commit-Position: refs/heads/master@{#14350}
2016-09-22 12:52:13 +00:00
772bd0d40b Log supported camera preview resolutions.
BUG=b/29935437
R=sakal@webrtc.org

Review URL: https://codereview.webrtc.org/2356563002 .

Cr-Commit-Position: refs/heads/master@{#14336}
2016-09-21 19:17:15 +00:00
28d5bc68c3 Fix deadlock issue in CameraCapturer.stopCapture.
BUG=webrtc:6404
NOTRY=True

Review-Url: https://codereview.webrtc.org/2357213002
Cr-Commit-Position: refs/heads/master@{#14333}
2016-09-21 14:44:55 +00:00
7640fcf6ed Android VideoSource: Add adaptOutputFormat function
The Java VideoSource class wraps the C++ AndroidVideoTrackSource.
AndroidVideoTrackSource is the object actually owning the VideoAdapter.
We currently control the VideoAdapter through the Java VideoCapturer,
but it is more natural and direct to control it through the Java
VideoSource class. This CL adds the necessary function to do this, and
the function in VideoCapturer is deprecated.

BUG=webrtc:6391
R=sakal@webrtc.org

Review URL: https://codereview.webrtc.org/2350933006 .

Cr-Commit-Position: refs/heads/master@{#14332}
2016-09-21 14:20:16 +00:00
0cb8828bce Reland of lease camera statistics after switching camera on CameraCapturer. (patchset #1 id:1 of https://codereview.webrtc.org/2353163003/ )
Reason for revert:
Fix bugs causing the new code to fail.

Original issue's description:
> Revert of Release camera statistics after switching camera on CameraCapturer. (patchset #1 id:1 of https://codereview.webrtc.org/2353263002/ )
>
> Reason for revert:
> Breaks bots.
>
> Original issue's description:
> > Release camera statistics after switching camera on CameraCapturer.
> >
> > BUG=webrtc:6397
> > TBR=magjed@webrtc.org
> > NOTRY=True
> >
> > Committed: https://crrev.com/d5e9237b303e5fe253dc6530fbcf939921f4eaed
> > Cr-Commit-Position: refs/heads/master@{#14323}
>
> TBR=magjed@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6397
>
> Committed: https://crrev.com/ad5d65845f5c859d0564811a4eea68e1efdb8450
> Cr-Commit-Position: refs/heads/master@{#14324}

TBR=magjed@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6397

Review-Url: https://codereview.webrtc.org/2357893002
Cr-Commit-Position: refs/heads/master@{#14330}
2016-09-21 13:08:59 +00:00
ad5d65845f Revert of Release camera statistics after switching camera on CameraCapturer. (patchset #1 id:1 of https://codereview.webrtc.org/2353263002/ )
Reason for revert:
Breaks bots.

Original issue's description:
> Release camera statistics after switching camera on CameraCapturer.
>
> BUG=webrtc:6397
> TBR=magjed@webrtc.org
> NOTRY=True
>
> Committed: https://crrev.com/d5e9237b303e5fe253dc6530fbcf939921f4eaed
> Cr-Commit-Position: refs/heads/master@{#14323}

TBR=magjed@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6397

Review-Url: https://codereview.webrtc.org/2353163003
Cr-Commit-Position: refs/heads/master@{#14324}
2016-09-21 10:51:15 +00:00
d5e9237b30 Release camera statistics after switching camera on CameraCapturer.
BUG=webrtc:6397
TBR=magjed@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2353263002
Cr-Commit-Position: refs/heads/master@{#14323}
2016-09-21 10:15:53 +00:00
3442579fd7 Session based capturing for Camera1Capturer.
BUG=webrtc:6148

Review-Url: https://codereview.webrtc.org/2187293002
Cr-Commit-Position: refs/heads/master@{#14318}
2016-09-21 08:35:01 +00:00
be22d51307 Enable auto-focus on Camera2.
BUG=webrtc:6357

Review-Url: https://codereview.webrtc.org/2347823002
Cr-Commit-Position: refs/heads/master@{#14288}
2016-09-19 13:01:59 +00:00
dd0c7f0ea4 Events refactor in Android session based capturing.
In the new implementation session reports all events through
CameraSession.Events interface. CameraCapturer passes these events
forward.

BUG=webrtc:6325

Review-Url: https://codereview.webrtc.org/2331343010
Cr-Commit-Position: refs/heads/master@{#14286}
2016-09-19 11:37:22 +00:00
227c3c125e Enable stabilization on Camera2.
BUG=webrtc:6357

Review-Url: https://codereview.webrtc.org/2345213002
Cr-Commit-Position: refs/heads/master@{#14285}
2016-09-19 10:08:21 +00:00
232c56ba9a Add logging available fps ranges to Camera2Session.
R=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2340283002
Cr-Commit-Position: refs/heads/master@{#14242}
2016-09-15 19:31:21 +00:00
4ed5b9f62d Android SurfaceViewRenderer: Create EGL context on render thread
This CL avoids eglMakeCurrent failing on some problematic Marvel based
Jelly Bean devices.

BUG=webrtc:6350
R=perkj@webrtc.org, sakal@webrtc.org

Review URL: https://codereview.webrtc.org/2339573002 .

Cr-Commit-Position: refs/heads/master@{#14234}
2016-09-15 13:30:29 +00:00
bc18fc07be Change onCameraOpening to take camera name as a parameter instead of camera id.
Camera id doesn't really exist for Camera2. Changing onCameraOpening to
take a string instead removes ugly code.

BUG=webrtc:6325
R=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2331013002
Cr-Commit-Position: refs/heads/master@{#14212}
2016-09-14 12:36:26 +00:00
b471d1cffb Android EglBase: Include EGL error code in exceptions
This CL appends the EGL error code in exceptions after an EGL function
fails. This information is helpful when debugging.

BUG=webrtc:6350

Review-Url: https://codereview.webrtc.org/2338033002
Cr-Commit-Position: refs/heads/master@{#14208}
2016-09-14 09:40:58 +00:00
b3f7876a95 Add printStackTrace method to CameraCapturer.
The method can be used to print the stack trace of the camera thread in
error conditions.

BUG=webrtc:6148

Review-Url: https://codereview.webrtc.org/2332693002
Cr-Commit-Position: refs/heads/master@{#14187}
2016-09-12 14:35:21 +00:00
1a0533dc3d Add statistics for the time it takes to start and stop the camera on Camera2.
BUG=webrtc:6302

Review-Url: https://codereview.webrtc.org/2326483003
Cr-Commit-Position: refs/heads/master@{#14180}
2016-09-12 08:05:28 +00:00
961168a6db Add sakal as an OWNER to some Android files.
I have written a large part of the code in these files and I feel I
should be an OWNER of them.

NOTRY=True

Review-Url: https://codereview.webrtc.org/2322983002
Cr-Commit-Position: refs/heads/master@{#14148}
2016-09-09 07:22:33 +00:00
2a5f371df3 Make UMA stats creation available in the Java interface.
Only has counts stats right now but enumeration stats can easily be added in the future if needed.

BUG=webrtc:6313

Review-Url: https://codereview.webrtc.org/2320473002
Cr-Commit-Position: refs/heads/master@{#14146}
2016-09-09 07:11:54 +00:00
cfaca03b4b Add dynamic bitrate tracker and adjustment for Exynos VP8 HW encoder.
Exynos VP8 HW encoder may generate a bitrate which deviates too
much from target value causing frame drops and fps reduction or
BWE stuck at low values.

Add one more option to bitrate adjustment in HW encoder wrapper
which allows to track and dynamicaly scale bitrate used for
codec configuration.

BUG=b/30951236
R=wzh@webrtc.org

Review URL: https://codereview.webrtc.org/2308843002 .

Cr-Commit-Position: refs/heads/master@{#14095}
2016-09-06 21:08:27 +00:00
c55c39ddf7 Limit initial fps value used in Android HW encoder initialization.
BUG=b/30951236
R=magjed@webrtc.org, wzh@webrtc.org

Review URL: https://codereview.webrtc.org/2303893002 .

Cr-Commit-Position: refs/heads/master@{#14054}
2016-09-02 19:16:39 +00:00
504e838be2 Move getSupportedFormats from capturer interface to camera enumerator.
R=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2308493002
Cr-Commit-Position: refs/heads/master@{#14047}
2016-09-02 12:58:15 +00:00
4b2be9739b Remove VideoSource.stop() and VideoSource.restart() from the Java API.
These methods are not used by the new AndroidVideoTrackSource API.

Review-Url: https://codereview.webrtc.org/2280873002
Cr-Commit-Position: refs/heads/master@{#14036}
2016-09-02 08:10:39 +00:00
8a2098cb8d Fix a race condition where Camera2Session forgot to return the texture frame when closing the camera.
BUG=b/31201445

Review-Url: https://codereview.webrtc.org/2289303005
Cr-Commit-Position: refs/heads/master@{#14015}
2016-09-01 09:07:09 +00:00
b75f2541c9 Create Android screen capturer.
Review-Url: https://codereview.webrtc.org/2276593003
Cr-Commit-Position: refs/heads/master@{#14010}
2016-09-01 01:51:01 +00:00
9e4a3040ed Reland of move the old AndroidVideoCapturer stack code. (patchset #1 id:1 of https://codereview.webrtc.org/2291583002/ )
Reason for revert:
Downstream apps should now be fixed.

Original issue's description:
> Revert of Remove the old AndroidVideoCapturer stack code. (patchset #2 id:20001 of https://codereview.webrtc.org/2235893003/ )
>
> Reason for revert:
> Breaks downstream.
>
> Original issue's description:
> > Remove the old AndroidVideoCapturer stack code.
> >
> > This code is no longer needed. Apps should be using the new API introduced here: https://codereview.webrtc.org/2127893002/
> >
> > Committed: https://crrev.com/1b365a8db070f9cdcbf35ec871f758dcd909e51d
> > Cr-Commit-Position: refs/heads/master@{#13950}
>
> TBR=magjed@webrtc.org,glaznev@webrtc.org,kjellander@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://crrev.com/e39f251dacf66e50153bcda615f06b7c59e5856b
> Cr-Commit-Position: refs/heads/master@{#13958}

TBR=magjed@webrtc.org,glaznev@webrtc.org,kjellander@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.

Review-Url: https://codereview.webrtc.org/2298063003
Cr-Commit-Position: refs/heads/master@{#13988}
2016-08-31 09:53:54 +00:00
e39f251dac Revert of Remove the old AndroidVideoCapturer stack code. (patchset #2 id:20001 of https://codereview.webrtc.org/2235893003/ )
Reason for revert:
Breaks downstream.

Original issue's description:
> Remove the old AndroidVideoCapturer stack code.
>
> This code is no longer needed. Apps should be using the new API introduced here: https://codereview.webrtc.org/2127893002/
>
> Committed: https://crrev.com/1b365a8db070f9cdcbf35ec871f758dcd909e51d
> Cr-Commit-Position: refs/heads/master@{#13950}

TBR=magjed@webrtc.org,glaznev@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.webrtc.org/2291583002
Cr-Commit-Position: refs/heads/master@{#13958}
2016-08-29 14:31:31 +00:00
1b365a8db0 Remove the old AndroidVideoCapturer stack code.
This code is no longer needed. Apps should be using the new API introduced here: https://codereview.webrtc.org/2127893002/

Review-Url: https://codereview.webrtc.org/2235893003
Cr-Commit-Position: refs/heads/master@{#13950}
2016-08-29 09:20:26 +00:00
294fb050a0 Add a timeout for starting the camera on CameraCapturer.
This allows to at least get a camera error back if the camera thread freezes. Application can use this as a signal to restart the program.

R=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2257123002
Cr-Commit-Position: refs/heads/master@{#13830}
2016-08-19 10:02:44 +00:00
869dab775c Disable Intel VP8 HW encoder.
Need to investigate dequeueOutputBuffer failure on Asus
Zenfones before re-enabling back.

BUG=b/30890961
R=jiayl@chromium.org

Review URL: https://codereview.webrtc.org/2249743007 .

Cr-Commit-Position: refs/heads/master@{#13805}
2016-08-17 22:41:22 +00:00
7c0f8ee67a Avoid null pointer exception if Android getCameraInfo fails.
BUG=b/30890971
R=magjed@webrtc.org, sakal@webrtc.org

Review URL: https://codereview.webrtc.org/2250283002 .

Cr-Commit-Position: refs/heads/master@{#13803}
2016-08-17 22:18:27 +00:00
92c09509bd Make CameraCapturer.switchCamera try again if session is still opening.
R=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2238263002
Cr-Commit-Position: refs/heads/master@{#13747}
2016-08-15 13:19:40 +00:00
d30e0ad3e7 Session based capturing for Camera2Capturer.
BUG=webrtc:6148
TBR=tommi@webrtc.org

Review-Url: https://codereview.webrtc.org/2186253002
Cr-Commit-Position: refs/heads/master@{#13723}
2016-08-11 08:00:43 +00:00
0060c56b22 Catch exceptions thrown by getCodecInfoAt() and getCapabilitiesForType().
BUG=b/30715199
R=jiayl@chromium.org

Review URL: https://codereview.webrtc.org/2225073003 .

Cr-Commit-Position: refs/heads/master@{#13678}
2016-08-08 19:27:37 +00:00
d3235f0cd9 Re-order and remove unused Java imports.
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/2203723002 .

Cr-Commit-Position: refs/heads/master@{#13608}
2016-08-02 13:44:19 +00:00
7fbe2ee224 Make EGL10 class public.
To allow accessing its function for 3rd party apps.

BUG=b/30502777
R=jiayl@chromium.org

Review URL: https://codereview.webrtc.org/2203483002 .

Cr-Commit-Position: refs/heads/master@{#13595}
2016-08-01 20:31:42 +00:00
c980062242 Use a new method (android_setsocknetwork) to bind socket to network in Android M and later.
The old method (setNetworkForSocket) is not supported in Android-N.

BUG=
R=glaznev@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2189753002 .

Cr-Commit-Position: refs/heads/master@{#13591}
2016-08-01 16:27:43 +00:00
43e15bb9f0 Android Camera2Enumerator: Remove CameraAccessException to avoid VerifyError
Apparently, a class will fail with VerifyError if it contains catch
statements with an Exception from a newer API, even if the code is never
executed. This happens only on Android versions before 4.4.2 and is a
bug. See https://code.google.com/p/android/issues/detail?id=209129 for
more info.

BUG=b/30376736

Review-Url: https://codereview.webrtc.org/2185833003
Cr-Commit-Position: refs/heads/master@{#13542}
2016-07-27 15:25:13 +00:00
81031d6dca Cleanup code in Camera2.
BUG=b/30423446
NOTRY=True

Review-Url: https://codereview.webrtc.org/2189473003
Cr-Commit-Position: refs/heads/master@{#13540}
2016-07-27 12:25:49 +00:00
f22d3c48fa Filter to formats that match device sensor array aspect ratio on pre-LMR1 devices offering only legacy camera2 support.
There is a bug on pre LMR1 devices that only support legacy
implementation of camera2 API where aspect ratio of the camera is
incorrect if the output format doesn't match the aspect ratio of the
sensor array. On these devices, we want to disable the output formats that
have different aspect ratio.

Review-Url: https://codereview.webrtc.org/2181803003
Cr-Commit-Position: refs/heads/master@{#13538}
2016-07-27 08:28:51 +00:00
63d3f8390e Fix a bug where Camera2 tried to start on FPS ranges multiplied by 1000.
This bug caused Camera2Capturer to not work on Samsung Galaxy S7.

BUG=b/30349906
R=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2174343002
Cr-Commit-Position: refs/heads/master@{#13529}
2016-07-26 12:43:39 +00:00
2fa14623cc Convert Android camera tests to use the new createVideoSource API.
Review-Url: https://codereview.webrtc.org/2171023003
Cr-Commit-Position: refs/heads/master@{#13528}
2016-07-26 12:41:43 +00:00