We currently leak one local reference to MediaCodecVideoEncoder in every call to MediaCodecVideoEncoderFactory::CreateVideoEncoder. After the encoder has been re-initialized 512 times, JNI will crash due to local reference table overflow (max=512). The actual leak is in the member initializer list of MediaCodecVideoEncoder. This CL fixes the leak by adding a ScopedLocalRefFrame outside of the ctor. All JNI code that originate from a C++ thread (i.e. the entry point is not a Java thread) must use a ScopedLocalRefFrame in order to avoid leaking local references. BUG=webrtc:6969,b/34056152 Review-Url: https://codereview.webrtc.org/2627973004 Cr-Commit-Position: refs/heads/master@{#16034}
Name: WebRTC URL: http://www.webrtc.org Version: 90 License: BSD License File: LICENSE Description: WebRTC provides real time voice and video processing functionality to enable the implementation of PeerConnection/MediaStream. Third party code used in this project is described in the file LICENSE_THIRD_PARTY.