This cl adds a C++ counterpart of the Java SurfaceTextureHandler. It can be used for creating a webrtc::VideoFrames from a native handle and also guarantee that the Java SurfaceTexture is notified when the VideoFrame is no longer in use.
BUG=webrtc:4993
R=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1366413003 .
Cr-Commit-Position: refs/heads/master@{#10084}
Android hardware H.264 seems to keep a steady high-QP flow instead of
dropping frames, so framedrops aren't sufficient to detect a bad state
where downscaling would be beneficial.
BUG=webrtc:4968
R=magjed@webrtc.org, stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1364253002 .
Cr-Commit-Position: refs/heads/master@{#10078}
Reason for revert:
Broke FYI bots because SetConfiguration is pure virtual and MockPeerConnectionImpl doesn't implement it. Need to reland with SetConfiguration not pure virtual.
Original issue's description:
> Adding PeerConnectionInterface::SetConfiguration method.
>
> Also updated the JNI and Objective-C bindings. Later, will have a CL to
> remove UpdateIce, which this method effectively replaces.
>
> BUG=webrtc:4945
>
> Committed: https://crrev.com/70702afbcb8418fe93747e7ed63bcbf5e56b90e9
> Cr-Commit-Position: refs/heads/master@{#10040}
TBR=guoweis@webrtc.org,pthatcher@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4945
Review URL: https://codereview.webrtc.org/1361263002
Cr-Commit-Position: refs/heads/master@{#10041}
Also updated the JNI and Objective-C bindings. Later, will have a CL to
remove UpdateIce, which this method effectively replaces.
BUG=webrtc:4945
Review URL: https://codereview.webrtc.org/1317353005
Cr-Commit-Position: refs/heads/master@{#10040}
This CL makes the following changes:
* Instead of creating a new thread per startCapture()/stopCapture() cycle, VideoCapturerAndroid has a single thread that is initialized in the constructor and kept during the lifetime of the instance. This is more convenient because then it is always possible to post runnables without if-checks. This way, a lot of synchronize statements can be removed. Also, when the camera thread is preserved after stopCapture() it is possible to post late returnBuffer() calls to the correct thread.
* FramePool now enforces single thread use and returnBuffer() calls are posted to the camera thread. This is important because the camera should only be used from one thread, and we call camera.addCallbackBuffer() in returnBuffer().
* switchCamera() no longer returns false on failure, but instead signals the result via the callback.
* Update the test testCaptureAndAsyncRender() - it's not a valid use case to have outstanding frames when calling PeerConnectionFactory.dispose(). Instead, the renderer implementations should have release() functions that block until all frames are returned. The release() functions need to be called in the correct order with PeerConnectionFactory.dispose() last.
BUG=webrtc:4909
R=hbos@webrtc.org, perkj@webrtc.org
Review URL: https://codereview.webrtc.org/1350863002 .
Cr-Commit-Position: refs/heads/master@{#10025}
The Android camera api requires a surface to be set in order work. In https://codereview.webrtc.org/1354683004/ this surfaceTexture was removed as a member but it turns out that can lead to camera freezes when the device is rotated. This cl re-adds the surface as a member.
BUG= webrtc:5021, webrtc:5003
R=magjed@webrtc.org
Review URL: https://codereview.webrtc.org/1349433003 .
Cr-Commit-Position: refs/heads/master@{#9999}
This change the PeerConnectionTest.doTest wait for at least one ice candidate and also make sure the list of candidates in gotIceCandidates is synchronized.
BUG=webrtc:5010
Review URL: https://codereview.webrtc.org/1354913002
Cr-Commit-Position: refs/heads/master@{#9997}
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1335923002
Cr-Commit-Position: refs/heads/master@{#9964}
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
* DISALLOW_ASSIGN -> RTC_DISALLOW_ASSIGN
* DISALLOW_COPY_AND_ASSIGN -> RTC_DISALLOW_COPY_AND_ASSIGN
* DISALLOW_IMPLICIT_CONSTRUCTORS -> RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
Related CL: https://codereview.webrtc.org/1335923002/
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1345433002
Cr-Commit-Position: refs/heads/master@{#9953}
This CL should not do any functional changes. It removes some redundant arguments and unnecessary error checking.
BUG=webrtc:4993
R=glaznev@webrtc.org
Review URL: https://codereview.webrtc.org/1338943003 .
Cr-Commit-Position: refs/heads/master@{#9950}
Reason for revert:
Breaks goma (??!??!?)
Original issue's description:
> Bailing out if pc factory fails to get created.
>
> This prevents us from continuing if we fail initialization.
> The failure will happen closer to its source, rather than
> when we try to create the first peer connection.
>
> BUG=None
> R=glaznev@webrtc.org
>
> Committed: https://crrev.com/6eb75d9e67f02c256436eb96f3c77026486561a1
> Cr-Commit-Position: refs/heads/master@{#9948}
TBR=glaznev@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=None
Review URL: https://codereview.webrtc.org/1344363002
Cr-Commit-Position: refs/heads/master@{#9949}
This prevents us from continuing if we fail initialization.
The failure will happen closer to its source, rather than
when we try to create the first peer connection.
BUG=None
R=glaznev@webrtc.org
Review URL: https://codereview.webrtc.org/1339923004 .
Cr-Commit-Position: refs/heads/master@{#9948}
Need to figure out the best way to initialize native logging system
while peer connection factory is not created yet.
R=jiayl@webrtc.org
Review URL: https://codereview.webrtc.org/1343163003 .
Cr-Commit-Position: refs/heads/master@{#9947}
Currently disposing Java peer connection object will result in auto
release of media streams and media tracks added to peer connection.
Add an option to allow application to own video track so it can be
kept after peer connection is destroyed.
R=jiayl@webrtc.org, wzh@webrtc.org
Review URL: https://codereview.webrtc.org/1333363002 .
Cr-Commit-Position: refs/heads/master@{#9946}
Add new helper class to create and synchronize access to SurfaceTextures. The plan is replace the SurfaceTexture in MediaCodecVideoDecoder in a follow-up CL and remove the SurfaceTexture.updateTexImage() call in VideoRendererGui.
BUG=webrtc:4993
R=hbos@webrtc.org
Review URL: https://codereview.webrtc.org/1342713003 .
Cr-Commit-Position: refs/heads/master@{#9938}
Future log messages should all be sent to org.webrtc.Logging as well.
BUG=
Review URL: https://codereview.webrtc.org/1338033003
Cr-Commit-Position: refs/heads/master@{#9936}
It is possible that cameraThreadHandler is null upon calling
switchCamera(). This CL adds a guard against that.
Review URL: https://codereview.webrtc.org/1325333003
Cr-Commit-Position: refs/heads/master@{#9925}
Enumerating using android.hardware.camera2 is 10x faster than enumerating using android.hardware.camera, but they don't list exactly the same formats. android.hardware.camera2 support higher resolutions for some cameras, and also different framerates.
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1321893003 .
Cr-Commit-Position: refs/heads/master@{#9861}
The purpose with this CL is to remove some code bloat. A subtle change is that GL_TEXTURE_MIN_FILTER in MediaCodecVideoDecoder is changed from GL_NEAREST to GL_LINEAR. This may lead to slightly worse performance when the decoded video is rendered minified, but with better visual quality. After reading https://crbug.com/351458 and the fix https://codereview.chromium.org/713603002 I think this is the right choice.
BUG=webrtc:4742
R=hbos@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1303373005 .
Cr-Commit-Position: refs/heads/master@{#9845}
of decoder factory class.
- Add new Peer connection factory method to initialize shared
EGL context.
This provides an option to use single peer connection factory
in the application and create peer connections from the same
factory and reinitialize shared EGL context for video
decoding HW acceleration.
R=wzh@webrtc.org
Review URL: https://codereview.webrtc.org/1304063011 .
Cr-Commit-Position: refs/heads/master@{#9838}
Enumerating camera capabilities in the deprecated android.hardware.Camera interface is really slow because of the need to open and release the camera. By making getSupportedFormats() an interface, we allow apps the opportunity to inject their own implementation, such as storing the supported formats offline in the device's internal storage. It will also be possible to add an implementation of getSupportedFormats() using the new android.hardware.Camera2 interface in a follow-up CL.
R=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1321903002 .
Cr-Commit-Position: refs/heads/master@{#9819}
This CL makes the Java render interface asynchronous by requiring every call to renderFrame() to be followed by an explicit renderFrameDone() call. In JNI, this is implemented with cricket::VideoFrame::Copy() before calling renderFrame(), and a corresponding call to delete in renderFrameDone(). This CL is primarily done to prepare for a new renderer implementation.
BUG=webrtc:4742, webrtc:4909
R=glaznev@webrtc.org
Review URL: https://codereview.webrtc.org/1313563002 .
Cr-Commit-Position: refs/heads/master@{#9814}
This is handled by Android itself and may result in GL errors
when trying to release shaders when Activity is destroyed.
R=wzh@webrtc.org
Review URL: https://codereview.webrtc.org/1322703004 .
Cr-Commit-Position: refs/heads/master@{#9811}