OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 WebRtcVideoDecoderFactory* decoder_factory_; | 1071 WebRtcVideoDecoderFactory* decoder_factory_; |
1072 rtc::NetworkMonitorFactory* network_monitor_factory_; | 1072 rtc::NetworkMonitorFactory* network_monitor_factory_; |
1073 PeerConnectionFactoryInterface* factory_; // Const after ctor except dtor. | 1073 PeerConnectionFactoryInterface* factory_; // Const after ctor except dtor. |
1074 }; | 1074 }; |
1075 | 1075 |
1076 void OwnedFactoryAndThreads::JavaCallbackOnFactoryThreads() { | 1076 void OwnedFactoryAndThreads::JavaCallbackOnFactoryThreads() { |
1077 JNIEnv* jni = AttachCurrentThreadIfNeeded(); | 1077 JNIEnv* jni = AttachCurrentThreadIfNeeded(); |
1078 ScopedLocalRefFrame local_ref_frame(jni); | 1078 ScopedLocalRefFrame local_ref_frame(jni); |
1079 jclass j_factory_class = FindClass(jni, "org/webrtc/PeerConnectionFactory"); | 1079 jclass j_factory_class = FindClass(jni, "org/webrtc/PeerConnectionFactory"); |
1080 jmethodID m = nullptr; | 1080 jmethodID m = nullptr; |
1081 if (Thread::Current() == worker_thread_) { | 1081 if (Thread::Current() == worker_thread_.get()) { |
1082 LOG(LS_INFO) << "Worker thread JavaCallback"; | 1082 LOG(LS_INFO) << "Worker thread JavaCallback"; |
1083 m = GetStaticMethodID(jni, j_factory_class, "onWorkerThreadReady", "()V"); | 1083 m = GetStaticMethodID(jni, j_factory_class, "onWorkerThreadReady", "()V"); |
1084 } | 1084 } |
1085 if (Thread::Current() == signaling_thread_) { | 1085 if (Thread::Current() == signaling_thread_.get()) { |
1086 LOG(LS_INFO) << "Signaling thread JavaCallback"; | 1086 LOG(LS_INFO) << "Signaling thread JavaCallback"; |
1087 m = GetStaticMethodID( | 1087 m = GetStaticMethodID( |
1088 jni, j_factory_class, "onSignalingThreadReady", "()V"); | 1088 jni, j_factory_class, "onSignalingThreadReady", "()V"); |
1089 } | 1089 } |
1090 if (m != nullptr) { | 1090 if (m != nullptr) { |
1091 jni->CallStaticVoidMethod(j_factory_class, m); | 1091 jni->CallStaticVoidMethod(j_factory_class, m); |
1092 CHECK_EXCEPTION(jni) << "error during JavaCallback::CallStaticVoidMethod"; | 1092 CHECK_EXCEPTION(jni) << "error during JavaCallback::CallStaticVoidMethod"; |
1093 } | 1093 } |
1094 } | 1094 } |
1095 | 1095 |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2138 return JavaStringFromStdString( | 2138 return JavaStringFromStdString( |
2139 jni, | 2139 jni, |
2140 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2140 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
2141 } | 2141 } |
2142 | 2142 |
2143 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2143 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
2144 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2144 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
2145 } | 2145 } |
2146 | 2146 |
2147 } // namespace webrtc_jni | 2147 } // namespace webrtc_jni |
OLD | NEW |