Delete EglBase.ConfigType, instead pass arrays of attributes, and define
constant arrays for the common cases.
Both in progress NativeToI420 and extending GlRectDrawer to other shapes (with alpha) needs this.
BUG=b/25694445
Review URL: https://codereview.webrtc.org/1498003002
Cr-Commit-Position: refs/heads/master@{#10908}
and make it configurable from the app.
Changed the decision on whether a connection is pingable:
1.Check whether a connection is a backup connection. A connection is considered as a backup connection only if the channel is complete, the connection is active and it is not the best connection.
2. Ping a non-backup connection if it is active and for backup connection, ping it at a slower rate.
Note the default behavior is the same as before.
Also cached the channel state since we are accessing it more often.
BUG=webrtc:5034
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1455033004 .
Cr-Commit-Position: refs/heads/master@{#10900}
Dropping the first frame intended to fix a problem when switching cameras on N6 when we are capturing to textures but due to a silly bug fixed in this cl the frame was not dropped...
BUG=webrtc:5262
TBR=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1489363002
Cr-Commit-Position: refs/heads/master@{#10867}
The reason we want to use EGL14 is to be able to use EGLExt.eglPresentationTimeANDROID when writing textures to MediaEncoder.
BUG=webrtc:4993
TBR=glaznew@webrtc.org
Review URL: https://codereview.webrtc.org/1461083002
Cr-Commit-Position: refs/heads/master@{#10864}
The callback keeps a reference to an object until the callback goes out of scope.
Review URL: https://codereview.webrtc.org/1487493002
Cr-Commit-Position: refs/heads/master@{#10847}
Insted of using a fixed frame rate, we allow the camera to use a lower frame rate. The camera will choose depending on lightning condition.
TESTED= In a room with low light on N5, N6 N7, Galaxy 4.
BUG=webrtc:5262
R=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1479563004 .
Cr-Commit-Position: refs/heads/master@{#10807}
This cl make it possible for the hw video encoder to downscale a texture image before encoding. The purpose is to allow downscaling if the quality is too bad at the current resolution.
BUG=webrtc:4993
R=magjed@webrtc.org, pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1470043002 .
Cr-Commit-Position: refs/heads/master@{#10804}
SurfaceViewRenderer currently stores widthSpec/heightSpec internally, and triggers requestLayout() from renderFrameOnRenderThread()->checkConsistentLayout() when it detects a change using widthSpec/heightSpec. This is not reliable, because onMeasure() might be called several times during the layout process negotiation. For example it might look like this:
-> onMeasure(at most 1920, at most 1080)
<- setMeasuredDimension(1080, 1080)
-> onMeasure(exactly 1080, exactly 1080)
<- setMeasuredDimension(1080, 1080)
Then we store (exactly 1080, exactly 1080) even though we are allowed to be bigger than this, and requestLayout() will never be triggered.
This CL moves the requestLayout() trigger to updateFrameDimensionsAndReportEvents() when the frame size changes.
Other small changes in this CL are:
* Replace with/height variables with Point.
* Add logging in updateFrameDimensionsAndReportEvents() even when rendererEvents is null.
* Use Math.round() in RendererCommon.getDisplaySize() instead of integer cast.
R=hbos@webrtc.org
Review URL: https://codereview.webrtc.org/1453413005 .
Cr-Commit-Position: refs/heads/master@{#10774}
eglCreateSurface() calls are posted to the render thread from both init() and surfaceCreated(). If the render thread does not process the eglCreateSurface() message from init() before surfaceCreated() is called, eglCreateSurface() will be called twice resulting in a crash.
This CL makes sure eglCreateSurface() is only called once.
BUG=b/25815604
R=hbos@webrtc.org
Review URL: https://codereview.webrtc.org/1466133002 .
Cr-Commit-Position: refs/heads/master@{#10769}
This method should be used when the SurfaceTextureHelper is created to use a specific handler.
This now guarantee that the looper used by handler is destroyed after a frame has been returned.
Review URL: https://codereview.webrtc.org/1465163003
Cr-Commit-Position: refs/heads/master@{#10767}
It do the following:
The SurfaceTexture.updateTexImage() calls are moved from the video renderers into MediaCodecVideoDecoder, and the destructor of the texture frames will signal MediaCodecVideoDecoder that the frame has returned. This CL also removes the SurfaceTexture from the native handle and only exposes the texture matrix instead, because only the video source should access the SurfaceTexture.
It moves the responsibility of calculating the decode time to Java.
Patchset2 Refactor MediaCodecVideoDecoder to drop frames if a texture is not released.
R=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1440343002 .
Cr-Commit-Position: refs/heads/master@{#10706}
This makes it clearer this code not meant to be used as an API.
I could not find any use of this in downstream code.
BUG=webrtc:5095
TESTED=git cl try -c --bot=android_compile_rel --bot=linux_compile_rel --bot=win_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
R=stefan@webrtc.orgTBR=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1440873005 .
Cr-Commit-Position: refs/heads/master@{#10699}
Not fully tested yet. Verified in test loopback application
with fake VP9 codec factory.
Assume that encoder generates bitstream in non flexible mode with
one temporal and one spatial layers.
R=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1451953002 .
Cr-Commit-Position: refs/heads/master@{#10695}
To avoid breaking downstream, the "interface" directories were copied
into a new "common_video/include" dir. The old headers got pragma
warnings added about deprecation (a very short deprecation since I plan
to remove them as soon downstream is updated).
The header guards are also identical to avoid mixing them up in the transition.
BUG=webrtc:5095
TESTED=Passing compile-trybots with --clobber flag:
git cl try --clobber --bot=win_compile_rel --bot=linux_compile_rel --bot=android_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
Review URL: https://codereview.webrtc.org/1418913006
Cr-Commit-Position: refs/heads/master@{#10659}
The original purpose with keeping one pending frame in SurfaceViewRenderer was to reduce latency for the first rendered frame when we are waiting for the Surface to be created. However, it is very dangerous to hold a pending frame indefinitely when used with a SurfaceTexture, because the SurfaceTexture only has one frame and thus holding a frame in the renderer will freeze everything and typically cause timeout crashes.
Review URL: https://codereview.webrtc.org/1435413006
Cr-Commit-Position: refs/heads/master@{#10638}
Reason for revert:
Causes fallback to SW decoder if a renderer is put in the background.
Original issue's description:
> Patchset 1 is a pure
> revert of "Revert of "Android MediaCodecVideoDecoder: Manage lifetime of texture frames" https://codereview.webrtc.org/1378033003/
>
> Following patchsets move the responsibility of calculating the decode time to Java.
>
> TESTED= Apprtc loopback using H264 and VP8 on N5, N6, N7, S5
>
> Committed: https://crrev.com/9cb8982e64f08d3d630bf7c3d2bcc78c10db88e2
> Cr-Commit-Position: refs/heads/master@{#10597}
TBR=magjed@webrtc.org,glaznev@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
Review URL: https://codereview.webrtc.org/1441363002 .
Cr-Commit-Position: refs/heads/master@{#10637}
This CL attempts to annotate accesses on >16 API levels using as
small scopes as possible. The TargetApi notations mean "yes, I know
I'm accessing a higher API and I take responsibility for gating the
call on Android API level". The Encoder/Decoder classes are annotated
on the whole class, but they're only accessed through JNI; we should
annotate on method level otherwise and preferably on private methods.
This patch also fixes some compiler-level deprecation warnings (i.e.
-Xlint:deprecation), but probably not all of them.
BUG=webrtc:5063
R=henrika@webrtc.org, kjellander@webrtc.org, magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1412673008 .
Cr-Commit-Position: refs/heads/master@{#10624}
This reverts commit 12f680214e28dc5f0a13ac8afc0d1445f89e67e6.
Original cl in https://codereview.webrtc.org/1396073003/
Prepare MediaCodecVideoEncoder for surface textures.
This refactors MediaVideoEncoder to prepare for adding support to encode from textures. The C++ layer does not have any functional changes.
- Moves ResetEncoder to always work on the codec thread
- Adds use of ThreadChecker.
- Change Java MediaEncoder.Init to return true or false and introduce method getInputBuffers.
- Add simple unit test for Java MediaCodecVideoEncoder.
The pure revert of the revert is in patchset 1.
Patchset 2, moves getting the input buffer to before storing pending timestamps etc to fix b/24984012.
BUG=webrtc:4993 b/24984012
Review URL: https://codereview.webrtc.org/1406203002
Cr-Commit-Position: refs/heads/master@{#10622}
This make sure that the texture copy is syncronized.
To reproduce the problem I:
Reverted "Revert of "Android MediaCodecVideoDecoder: Manage lifetime of texture frames" https://codereview.webrtc.org/1378033003/"
commit 543b6ca30a43eeb069c699291460ce6bacc7959d.
Reverted "Enable SurfaceViewRenderer for AppRTCDemo"
commit 7076729c57c27aa813760d2038be02c36f4d7649.
and ran ApprtDemo in loopback and changed the orientation a couple of times.
TBR=glaznev@webrtc.org
Review URL: https://codereview.webrtc.org/1437823002
Cr-Commit-Position: refs/heads/master@{#10598}
revert of "Revert of "Android MediaCodecVideoDecoder: Manage lifetime of texture frames" https://codereview.webrtc.org/1378033003/
Following patchsets move the responsibility of calculating the decode time to Java.
TESTED= Apprtc loopback using H264 and VP8 on N5, N6, N7, S5
Review URL: https://codereview.webrtc.org/1422963003
Cr-Commit-Position: refs/heads/master@{#10597}
Add resource name to log outputs to distinguish local renderer from remote renderer.
This Cl also adds some thread checks and factors out a small helper function makeBlack().
Review URL: https://codereview.webrtc.org/1420203003
Cr-Commit-Position: refs/heads/master@{#10596}
This change VideoCapturerAndroid to attempt 3 times with a period of 300ms to open the camera if it fails.
This is so that if another application have it already opened, it would have more time to release it.
BUG=b/25190234
Review URL: https://codereview.webrtc.org/1422023007
Cr-Commit-Position: refs/heads/master@{#10559}
If SurfaceViewRenderer can't keep up with the stream of incoming frames it has to drop frames. Currently, new frames are dropped until the old pending frame is rendered. This CL drops the old pending frame instead.
Review URL: https://codereview.webrtc.org/1417063005
Cr-Commit-Position: refs/heads/master@{#10558}
Also distinguish between camera failures and failures due to that buffers has not been returned.
Adds unit tests for making sure CameraEventHandler.onError is triggered if frames are not returned.
BUG=b/25514149
Review URL: https://codereview.webrtc.org/1415013006
Cr-Commit-Position: refs/heads/master@{#10555}
JNI already has jstring<->UTF8 string conversion, so using that should
save ~1mb off android binaries (ICU is *large*), probably around
300-400k after compression.
BUG=
Review URL: https://codereview.webrtc.org/1430023005
Cr-Commit-Position: refs/heads/master@{#10545}
MediaCodec.stop() call may hang in some rear cases. To avoid
application hang this call need to be done on separate thread and
possible error reported back to application.
Application may elect to continue executing and use another codec
instance for encoding/decoding or stop the call and exit.
BUG=b/24339249
R=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1425143005 .
Cr-Commit-Position: refs/heads/master@{#10467}
Plus log first few decoder frames in and out events.
BUG=b/25287910
Review URL: https://codereview.webrtc.org/1423843005
Cr-Commit-Position: refs/heads/master@{#10439}