| Index: webrtc/api/java/jni/androidvideocapturer_jni.cc
|
| diff --git a/webrtc/api/java/jni/androidvideocapturer_jni.cc b/webrtc/api/java/jni/androidvideocapturer_jni.cc
|
| index d22c8b16ba9b88781d54c2f04fbe751c41d68722..3630ac4a0a13745d2c309463d3d1c1846a64decf 100644
|
| --- a/webrtc/api/java/jni/androidvideocapturer_jni.cc
|
| +++ b/webrtc/api/java/jni/androidvideocapturer_jni.cc
|
| @@ -33,7 +33,7 @@ int AndroidVideoCapturerJni::SetAndroidObjects(JNIEnv* jni,
|
| AndroidVideoCapturerJni::AndroidVideoCapturerJni(
|
| JNIEnv* jni,
|
| jobject j_video_capturer,
|
| - jobject j_surface_texture_helper)
|
| + jobject j_egl_context)
|
| : j_video_capturer_(jni, j_video_capturer),
|
| j_video_capturer_class_(
|
| jni, FindClass(jni, "org/webrtc/VideoCapturer")),
|
| @@ -42,7 +42,7 @@ AndroidVideoCapturerJni::AndroidVideoCapturerJni(
|
| FindClass(jni,
|
| "org/webrtc/VideoCapturer$NativeObserver")),
|
| surface_texture_helper_(new rtc::RefCountedObject<SurfaceTextureHelper>(
|
| - jni, j_surface_texture_helper)),
|
| + jni, j_egl_context)),
|
| capturer_(nullptr) {
|
| LOG(LS_INFO) << "AndroidVideoCapturerJni ctor";
|
| thread_checker_.DetachFromThread();
|
| @@ -54,6 +54,11 @@ AndroidVideoCapturerJni::~AndroidVideoCapturerJni() {
|
| *j_video_capturer_,
|
| GetMethodID(jni(), *j_video_capturer_class_, "dispose", "()V"));
|
| CHECK_EXCEPTION(jni()) << "error during VideoCapturer.dispose()";
|
| + jni()->CallVoidMethod(
|
| + surface_texture_helper_->GetJavaSurfaceTextureHelper(),
|
| + GetMethodID(jni(), FindClass(jni(), "org/webrtc/SurfaceTextureHelper"),
|
| + "dispose", "()V"));
|
| + CHECK_EXCEPTION(jni()) << "error during SurfaceTextureHelper.dispose()";
|
| }
|
|
|
| void AndroidVideoCapturerJni::Start(int width, int height, int framerate,
|
| @@ -75,11 +80,12 @@ void AndroidVideoCapturerJni::Start(int width, int height, int framerate,
|
|
|
| jmethodID m = GetMethodID(
|
| jni(), *j_video_capturer_class_, "startCapture",
|
| - "(IIILandroid/content/Context;"
|
| + "(IIILorg/webrtc/SurfaceTextureHelper;Landroid/content/Context;"
|
| "Lorg/webrtc/VideoCapturer$CapturerObserver;)V");
|
| jni()->CallVoidMethod(*j_video_capturer_,
|
| m, width, height,
|
| framerate,
|
| + surface_texture_helper_->GetJavaSurfaceTextureHelper(),
|
| application_context_,
|
| j_frame_observer);
|
| CHECK_EXCEPTION(jni()) << "error during VideoCapturer.startCapture";
|
|
|