| 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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 JOW(jlong, PeerConnectionFactory_nativeCreateLocalMediaStream)( | 1205 JOW(jlong, PeerConnectionFactory_nativeCreateLocalMediaStream)( |
| 1206 JNIEnv* jni, jclass, jlong native_factory, jstring label) { | 1206 JNIEnv* jni, jclass, jlong native_factory, jstring label) { |
| 1207 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( | 1207 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( |
| 1208 factoryFromJava(native_factory)); | 1208 factoryFromJava(native_factory)); |
| 1209 rtc::scoped_refptr<MediaStreamInterface> stream( | 1209 rtc::scoped_refptr<MediaStreamInterface> stream( |
| 1210 factory->CreateLocalMediaStream(JavaToStdString(jni, label))); | 1210 factory->CreateLocalMediaStream(JavaToStdString(jni, label))); |
| 1211 return (jlong)stream.release(); | 1211 return (jlong)stream.release(); |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 JOW(jlong, PeerConnectionFactory_nativeCreateVideoSource)( | 1214 JOW(jlong, PeerConnectionFactory_nativeCreateVideoSource)( |
| 1215 JNIEnv* jni, jclass, jlong native_factory, jobject j_video_capturer, | 1215 JNIEnv* jni, jclass, jlong native_factory, jobject j_egl_context, |
| 1216 jobject j_constraints) { | 1216 jobject j_video_capturer, jobject j_constraints) { |
| 1217 // Create a cricket::VideoCapturer from |j_video_capturer|. | 1217 // Create a cricket::VideoCapturer from |j_video_capturer|. |
| 1218 jobject j_surface_texture_helper = jni->CallObjectMethod( | |
| 1219 j_video_capturer, | |
| 1220 GetMethodID(jni, FindClass(jni, "org/webrtc/VideoCapturer"), | |
| 1221 "getSurfaceTextureHelper", | |
| 1222 "()Lorg/webrtc/SurfaceTextureHelper;")); | |
| 1223 rtc::scoped_refptr<webrtc::AndroidVideoCapturerDelegate> delegate = | 1218 rtc::scoped_refptr<webrtc::AndroidVideoCapturerDelegate> delegate = |
| 1224 new rtc::RefCountedObject<AndroidVideoCapturerJni>( | 1219 new rtc::RefCountedObject<AndroidVideoCapturerJni>( |
| 1225 jni, j_video_capturer, j_surface_texture_helper); | 1220 jni, j_video_capturer, j_egl_context); |
| 1226 rtc::scoped_ptr<cricket::VideoCapturer> capturer( | 1221 rtc::scoped_ptr<cricket::VideoCapturer> capturer( |
| 1227 new webrtc::AndroidVideoCapturer(delegate)); | 1222 new webrtc::AndroidVideoCapturer(delegate)); |
| 1228 // Create a webrtc::VideoTrackSourceInterface from the cricket::VideoCapturer, | 1223 // Create a webrtc::VideoTrackSourceInterface from the cricket::VideoCapturer, |
| 1229 // native factory and constraints. | 1224 // native factory and constraints. |
| 1230 scoped_ptr<ConstraintsWrapper> constraints( | 1225 scoped_ptr<ConstraintsWrapper> constraints( |
| 1231 new ConstraintsWrapper(jni, j_constraints)); | 1226 new ConstraintsWrapper(jni, j_constraints)); |
| 1232 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( | 1227 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( |
| 1233 factoryFromJava(native_factory)); | 1228 factoryFromJava(native_factory)); |
| 1234 rtc::scoped_refptr<VideoTrackSourceInterface> source( | 1229 rtc::scoped_refptr<VideoTrackSourceInterface> source( |
| 1235 factory->CreateVideoSource(capturer.release(), constraints.get())); | 1230 factory->CreateVideoSource(capturer.release(), constraints.get())); |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 return JavaStringFromStdString( | 2033 return JavaStringFromStdString( |
| 2039 jni, | 2034 jni, |
| 2040 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2035 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
| 2041 } | 2036 } |
| 2042 | 2037 |
| 2043 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2038 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
| 2044 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2039 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
| 2045 } | 2040 } |
| 2046 | 2041 |
| 2047 } // namespace webrtc_jni | 2042 } // namespace webrtc_jni |
| OLD | NEW |