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

Side by Side Diff: talk/app/webrtc/java/jni/androidvideocapturer_jni.cc

Issue 1350863002: VideoCapturerAndroid: Fix threading issues (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 jni(), *j_video_capturer_class_, "init", "(Ljava/lang/String;)Z")); 81 jni(), *j_video_capturer_class_, "init", "(Ljava/lang/String;)Z"));
82 if (!jni()->CallBooleanMethod(*j_capturer_global_, m, device_name)) { 82 if (!jni()->CallBooleanMethod(*j_capturer_global_, m, device_name)) {
83 return false; 83 return false;
84 } 84 }
85 CHECK_EXCEPTION(jni()) << "error during CallVoidMethod"; 85 CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
86 return true; 86 return true;
87 } 87 }
88 88
89 AndroidVideoCapturerJni::~AndroidVideoCapturerJni() { 89 AndroidVideoCapturerJni::~AndroidVideoCapturerJni() {
90 LOG(LS_INFO) << "AndroidVideoCapturerJni dtor"; 90 LOG(LS_INFO) << "AndroidVideoCapturerJni dtor";
91 jni()->CallVoidMethod(
92 *j_capturer_global_,
93 GetMethodID(jni(), *j_video_capturer_class_, "release", "()V"));
94 CHECK_EXCEPTION(jni()) << "error during VideoCapturerAndroid.release()";
91 } 95 }
92 96
93 void AndroidVideoCapturerJni::Start(int width, int height, int framerate, 97 void AndroidVideoCapturerJni::Start(int width, int height, int framerate,
94 webrtc::AndroidVideoCapturer* capturer) { 98 webrtc::AndroidVideoCapturer* capturer) {
95 LOG(LS_INFO) << "AndroidVideoCapturerJni start"; 99 LOG(LS_INFO) << "AndroidVideoCapturerJni start";
96 DCHECK(thread_checker_.CalledOnValidThread()); 100 DCHECK(thread_checker_.CalledOnValidThread());
97 { 101 {
98 rtc::CritScope cs(&capturer_lock_); 102 rtc::CritScope cs(&capturer_lock_);
99 CHECK(capturer_ == nullptr); 103 CHECK(capturer_ == nullptr);
100 CHECK(invoker_.get() == nullptr); 104 CHECK(invoker_.get() == nullptr);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 239
236 JOW(void, VideoCapturerAndroid_00024NativeObserver_nativeOnOutputFormatRequest) 240 JOW(void, VideoCapturerAndroid_00024NativeObserver_nativeOnOutputFormatRequest)
237 (JNIEnv* jni, jclass, jlong j_capturer, jint j_width, jint j_height, 241 (JNIEnv* jni, jclass, jlong j_capturer, jint j_width, jint j_height,
238 jint j_fps) { 242 jint j_fps) {
239 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest"; 243 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest";
240 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest( 244 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest(
241 j_width, j_height, j_fps); 245 j_width, j_height, j_fps);
242 } 246 }
243 247
244 } // namespace webrtc_jni 248 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698