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

Unified Diff: webrtc/api/java/jni/androidvideocapturer_jni.cc

Issue 1783793002: VideoCapturer: Update interface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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
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..9d04d1c56b32a9a13d696bbe4c430e4328976da3 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();
@@ -51,6 +51,11 @@ AndroidVideoCapturerJni::AndroidVideoCapturerJni(
AndroidVideoCapturerJni::~AndroidVideoCapturerJni() {
LOG(LS_INFO) << "AndroidVideoCapturerJni dtor";
jni()->CallVoidMethod(
+ surface_texture_helper_->GetJavaSurfaceTextureHelper(),
perkj_webrtc 2016/03/11 15:25:02 nit: should this be in the other order since you i
magjed_webrtc 2016/03/13 11:14:34 Done, I changed the order.
+ GetMethodID(jni(), FindClass(jni(), "org/webrtc/SurfaceTextureHelper"),
+ "dispose", "()V"));
+ CHECK_EXCEPTION(jni()) << "error during SurfaceTextureHelper.dispose()";
+ jni()->CallVoidMethod(
*j_video_capturer_,
GetMethodID(jni(), *j_video_capturer_class_, "dispose", "()V"));
CHECK_EXCEPTION(jni()) << "error during VideoCapturer.dispose()";
@@ -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";

Powered by Google App Engine
This is Rietveld 408576698