Index: talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc |
diff --git a/talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc b/talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc |
index 93dc4e64f9a30f00d0576095611ff703c1294664..7b242a4e6e6a9bed912fe866106f236d954834be 100644 |
--- a/talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc |
+++ b/talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc |
@@ -30,35 +30,11 @@ |
#include "talk/app/webrtc/java/jni/surfacetexturehelper_jni.h" |
#include "talk/app/webrtc/java/jni/classreferenceholder.h" |
+#include "webrtc/base/bind.h" |
#include "webrtc/base/checks.h" |
namespace webrtc_jni { |
-class SurfaceTextureHelper::TextureBuffer : public webrtc::NativeHandleBuffer { |
- public: |
- TextureBuffer(int width, |
- int height, |
- const rtc::scoped_refptr<SurfaceTextureHelper>& pool, |
- const NativeHandleImpl& native_handle) |
- : webrtc::NativeHandleBuffer(&native_handle_, width, height), |
- native_handle_(native_handle), |
- pool_(pool) {} |
- |
- ~TextureBuffer() { |
- pool_->ReturnTextureFrame(); |
- } |
- |
- rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override { |
- RTC_NOTREACHED() |
- << "SurfaceTextureHelper::NativeToI420Buffer not implemented."; |
- return nullptr; |
- } |
- |
- private: |
- NativeHandleImpl native_handle_; |
- const rtc::scoped_refptr<SurfaceTextureHelper> pool_; |
-}; |
- |
SurfaceTextureHelper::SurfaceTextureHelper(JNIEnv* jni, |
jobject egl_shared_context) |
: j_surface_texture_helper_class_( |
@@ -94,8 +70,9 @@ void SurfaceTextureHelper::ReturnTextureFrame() const { |
rtc::scoped_refptr<webrtc::VideoFrameBuffer> |
SurfaceTextureHelper::CreateTextureFrame(int width, int height, |
const NativeHandleImpl& native_handle) { |
- return new rtc::RefCountedObject<TextureBuffer>( |
- width, height, this, native_handle); |
+ return new rtc::RefCountedObject<AndroidTextureBuffer>( |
+ width, height, native_handle, |
+ rtc::Bind(&SurfaceTextureHelper::ReturnTextureFrame, this)); |
} |
} // namespace webrtc_jni |