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

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: Addressing hbos@s comments 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 unified diff | Download patch
« no previous file with comments | « talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 100 RTC_DCHECK(thread_checker_.CalledOnValidThread());
97 { 101 {
98 rtc::CritScope cs(&capturer_lock_); 102 rtc::CritScope cs(&capturer_lock_);
99 RTC_CHECK(capturer_ == nullptr); 103 RTC_CHECK(capturer_ == nullptr);
100 RTC_CHECK(invoker_.get() == nullptr); 104 RTC_CHECK(invoker_.get() == nullptr);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 240
237 JOW(void, VideoCapturerAndroid_00024NativeObserver_nativeOnOutputFormatRequest) 241 JOW(void, VideoCapturerAndroid_00024NativeObserver_nativeOnOutputFormatRequest)
238 (JNIEnv* jni, jclass, jlong j_capturer, jint j_width, jint j_height, 242 (JNIEnv* jni, jclass, jlong j_capturer, jint j_width, jint j_height,
239 jint j_fps) { 243 jint j_fps) {
240 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest"; 244 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest";
241 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest( 245 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest(
242 j_width, j_height, j_fps); 246 j_width, j_height, j_fps);
243 } 247 }
244 248
245 } // namespace webrtc_jni 249 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698