| 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)));
|
|
|