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

Unified Diff: talk/app/webrtc/java/jni/androidvideocapturer_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 | « no previous file | talk/app/webrtc/java/jni/native_handle_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
diff --git a/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc b/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
index 6d4891ee596672bd50e37c4f87148a9169a7e995..45396b6e8375a305681ec6ef51eaae5d83826fe1 100644
--- a/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
+++ b/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
@@ -33,6 +33,34 @@
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
namespace webrtc_jni {
+
+namespace {
+
+class CameraTextureBuffer : public webrtc::NativeHandleBuffer {
+ public:
+ CameraTextureBuffer(int width, int height,
+ const NativeHandleImpl& native_handle,
+ const rtc::Callback0<void>& no_longer_used)
+ : webrtc::NativeHandleBuffer(&native_handle_, width, height),
+ native_handle_(native_handle),
+ no_longer_used_cb_(no_longer_used) {}
+
+ ~CameraTextureBuffer() {
+ no_longer_used_cb_();
+ }
+
+ rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override {
+ RTC_NOTREACHED()
+ << "CameraTextureBuffer::NativeToI420Buffer not implemented.";
+ return nullptr;
+ }
+
+ private:
+ NativeHandleImpl native_handle_;
+ rtc::Callback0<void> no_longer_used_cb_;
+};
+
+} // anonymous namespace
jobject AndroidVideoCapturerJni::application_context_ = nullptr;
@@ -185,7 +213,7 @@
int64_t timestamp_ns,
const NativeHandleImpl& handle) {
rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer(
- new rtc::RefCountedObject<AndroidTextureBuffer>(
+ new rtc::RefCountedObject<CameraTextureBuffer>(
width, height, handle,
rtc::Bind(&AndroidVideoCapturerJni::ReturnBuffer, this,
timestamp_ns)));
« no previous file with comments | « no previous file | talk/app/webrtc/java/jni/native_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698