Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc

Issue 1389283003: Revert of Android: Put common native VideoFrameBuffer implementation in androidvideocapturer_jni (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/java/jni/surfacetexturehelper_jni.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7b242a4e6e6a9bed912fe866106f236d954834be..93dc4e64f9a30f00d0576095611ff703c1294664 100644
--- a/talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc
+++ b/talk/app/webrtc/java/jni/surfacetexturehelper_jni.cc
@@ -30,10 +30,34 @@
#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)
@@ -70,9 +94,8 @@
rtc::scoped_refptr<webrtc::VideoFrameBuffer>
SurfaceTextureHelper::CreateTextureFrame(int width, int height,
const NativeHandleImpl& native_handle) {
- return new rtc::RefCountedObject<AndroidTextureBuffer>(
- width, height, native_handle,
- rtc::Bind(&SurfaceTextureHelper::ReturnTextureFrame, this));
+ return new rtc::RefCountedObject<TextureBuffer>(
+ width, height, this, native_handle);
}
} // namespace webrtc_jni
« no previous file with comments | « talk/app/webrtc/java/jni/surfacetexturehelper_jni.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698