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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return init; | 153 return init; |
154 } | 154 } |
155 | 155 |
156 class ConstraintsWrapper; | 156 class ConstraintsWrapper; |
157 | 157 |
158 // Adapter between the C++ PeerConnectionObserver interface and the Java | 158 // Adapter between the C++ PeerConnectionObserver interface and the Java |
159 // PeerConnection.Observer interface. Wraps an instance of the Java interface | 159 // PeerConnection.Observer interface. Wraps an instance of the Java interface |
160 // and dispatches C++ callbacks to Java. | 160 // and dispatches C++ callbacks to Java. |
161 class PCOJava : public PeerConnectionObserver { | 161 class PCOJava : public PeerConnectionObserver { |
162 public: | 162 public: |
| 163 // We need these using declarations because there are two versions of each of |
| 164 // the below methods and we only override one of them. |
| 165 // TODO(deadbeef): Remove once there's only one version of the methods. |
| 166 using PeerConnectionObserver::OnAddStream; |
| 167 using PeerConnectionObserver::OnRemoveStream; |
| 168 using PeerConnectionObserver::OnDataChannel; |
| 169 |
163 PCOJava(JNIEnv* jni, jobject j_observer) | 170 PCOJava(JNIEnv* jni, jobject j_observer) |
164 : j_observer_global_(jni, j_observer), | 171 : j_observer_global_(jni, j_observer), |
165 j_observer_class_(jni, GetObjectClass(jni, *j_observer_global_)), | 172 j_observer_class_(jni, GetObjectClass(jni, *j_observer_global_)), |
166 j_media_stream_class_(jni, FindClass(jni, "org/webrtc/MediaStream")), | 173 j_media_stream_class_(jni, FindClass(jni, "org/webrtc/MediaStream")), |
167 j_media_stream_ctor_(GetMethodID( | 174 j_media_stream_ctor_(GetMethodID( |
168 jni, *j_media_stream_class_, "<init>", "(J)V")), | 175 jni, *j_media_stream_class_, "<init>", "(J)V")), |
169 j_audio_track_class_(jni, FindClass(jni, "org/webrtc/AudioTrack")), | 176 j_audio_track_class_(jni, FindClass(jni, "org/webrtc/AudioTrack")), |
170 j_audio_track_ctor_(GetMethodID( | 177 j_audio_track_ctor_(GetMethodID( |
171 jni, *j_audio_track_class_, "<init>", "(J)V")), | 178 jni, *j_audio_track_class_, "<init>", "(J)V")), |
172 j_video_track_class_(jni, FindClass(jni, "org/webrtc/VideoTrack")), | 179 j_video_track_class_(jni, FindClass(jni, "org/webrtc/VideoTrack")), |
(...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2278 return JavaStringFromStdString( | 2285 return JavaStringFromStdString( |
2279 jni, | 2286 jni, |
2280 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2287 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
2281 } | 2288 } |
2282 | 2289 |
2283 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2290 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
2284 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2291 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
2285 } | 2292 } |
2286 | 2293 |
2287 } // namespace webrtc_jni | 2294 } // namespace webrtc_jni |
OLD | NEW |