| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 LOG(LS_INFO) << "AndroidVideoCapturerJni ctor"; | 45 LOG(LS_INFO) << "AndroidVideoCapturerJni ctor"; |
| 46 thread_checker_.DetachFromThread(); | 46 thread_checker_.DetachFromThread(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 AndroidVideoCapturerJni::~AndroidVideoCapturerJni() { | 49 AndroidVideoCapturerJni::~AndroidVideoCapturerJni() { |
| 50 LOG(LS_INFO) << "AndroidVideoCapturerJni dtor"; | 50 LOG(LS_INFO) << "AndroidVideoCapturerJni dtor"; |
| 51 jni()->CallVoidMethod( | 51 jni()->CallVoidMethod( |
| 52 *j_video_capturer_, | 52 *j_video_capturer_, |
| 53 GetMethodID(jni(), *j_video_capturer_class_, "dispose", "()V")); | 53 GetMethodID(jni(), *j_video_capturer_class_, "dispose", "()V")); |
| 54 CHECK_EXCEPTION(jni()) << "error during VideoCapturer.dispose()"; | 54 CHECK_EXCEPTION(jni()) << "error during VideoCapturer.dispose()"; |
| 55 if (surface_texture_helper_) { | |
| 56 jni()->CallVoidMethod( | |
| 57 surface_texture_helper_->GetJavaSurfaceTextureHelper(), | |
| 58 GetMethodID(jni(), FindClass(jni(), "org/webrtc/SurfaceTextureHelper"), | |
| 59 "dispose", "()V")); | |
| 60 } | |
| 61 CHECK_EXCEPTION(jni()) << "error during SurfaceTextureHelper.dispose()"; | |
| 62 } | 55 } |
| 63 | 56 |
| 64 void AndroidVideoCapturerJni::Start(int width, int height, int framerate, | 57 void AndroidVideoCapturerJni::Start(int width, int height, int framerate, |
| 65 webrtc::AndroidVideoCapturer* capturer) { | 58 webrtc::AndroidVideoCapturer* capturer) { |
| 66 LOG(LS_INFO) << "AndroidVideoCapturerJni start"; | 59 LOG(LS_INFO) << "AndroidVideoCapturerJni start"; |
| 67 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 60 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 68 { | 61 { |
| 69 rtc::CritScope cs(&capturer_lock_); | 62 rtc::CritScope cs(&capturer_lock_); |
| 70 RTC_CHECK(capturer_ == nullptr); | 63 RTC_CHECK(capturer_ == nullptr); |
| 71 RTC_CHECK(invoker_.get() == nullptr); | 64 RTC_CHECK(invoker_.get() == nullptr); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 239 |
| 247 JOW(void, VideoCapturer_00024NativeObserver_nativeOnOutputFormatRequest) | 240 JOW(void, VideoCapturer_00024NativeObserver_nativeOnOutputFormatRequest) |
| 248 (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, |
| 249 jint j_fps) { | 242 jint j_fps) { |
| 250 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest"; | 243 LOG(LS_INFO) << "NativeObserver_nativeOnOutputFormatRequest"; |
| 251 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest( | 244 reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)->OnOutputFormatRequest( |
| 252 j_width, j_height, j_fps); | 245 j_width, j_height, j_fps); |
| 253 } | 246 } |
| 254 | 247 |
| 255 } // namespace webrtc_jni | 248 } // namespace webrtc_jni |
| OLD | NEW |