commit | f706c8ae914da976f16205ff13d15b1a28ead8fd | [log] [tgz] |
---|---|---|
author | Magnus Jedvert <magjed@webrtc.org> | Wed Sep 23 12:01:28 2015 +0200 |
committer | Magnus Jedvert <magjed@webrtc.org> | Wed Sep 23 10:01:40 2015 +0000 |
tree | 6fb91fa85cc56072836cd43320e0205ea0fc615a | |
parent | a81a42f584baa0d93a4b93da9632415e8922450c [diff] |
VideoCapturerAndroid: Fix threading issues 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}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others. This page is maintained by the Google Chrome team.
See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.