Android: Fix frame dropping for texture frames

A bug was introduced in https://codereview.webrtc.org/1973873003 that
doesn't return texture frames when they are dropped.

BUG=webrtc:5682

Review-Url: https://codereview.webrtc.org/2012773004
Cr-Commit-Position: refs/heads/master@{#12922}
This commit is contained in:
magjed 2016-05-26 08:34:40 -07:00 committed by Commit bot
parent b4ff7a7a8b
commit 77405b2794
2 changed files with 4 additions and 3 deletions

View File

@ -264,6 +264,7 @@ void AndroidVideoCapturerJni::OnTextureFrame(int width,
if (!capturer_->AdaptFrame(width, height, timestamp_ns,
&adapted_width, &adapted_height,
&crop_width, &crop_height, &crop_x, &crop_y)) {
surface_texture_helper_->ReturnTextureFrame();
return;
}

View File

@ -49,14 +49,14 @@ class SurfaceTextureHelper : public rtc::RefCountInterface {
int height,
const NativeHandleImpl& native_handle);
// May be called on arbitrary thread.
void ReturnTextureFrame() const;
protected:
~SurfaceTextureHelper();
SurfaceTextureHelper(JNIEnv* jni, jobject j_surface_texture_helper);
private:
// May be called on arbitrary thread.
void ReturnTextureFrame() const;
const ScopedGlobalRef<jobject> j_surface_texture_helper_;
const jmethodID j_return_texture_method_;
};