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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 | 1192 |
1193 JOW(void, PeerConnectionFactory_stopInternalTracingCapture)( | 1193 JOW(void, PeerConnectionFactory_stopInternalTracingCapture)( |
1194 JNIEnv* jni, jclass) { | 1194 JNIEnv* jni, jclass) { |
1195 rtc::tracing::StopInternalCapture(); | 1195 rtc::tracing::StopInternalCapture(); |
1196 } | 1196 } |
1197 | 1197 |
1198 JOW(void, PeerConnectionFactory_shutdownInternalTracer)(JNIEnv* jni, jclass) { | 1198 JOW(void, PeerConnectionFactory_shutdownInternalTracer)(JNIEnv* jni, jclass) { |
1199 rtc::tracing::ShutdownInternalTracer(); | 1199 rtc::tracing::ShutdownInternalTracer(); |
1200 } | 1200 } |
1201 | 1201 |
| 1202 JOW(void, AudioSource_nativeSetVolume) |
| 1203 (JNIEnv*, jclass, jlong j_p, jdouble volume) { |
| 1204 reinterpret_cast<AudioSourceInterface*>(j_p)->SetVolume(volume); |
| 1205 } |
| 1206 |
| 1207 JOW(jobject, AudioTrack_nativeGetSource)(JNIEnv* jni, jclass, jlong j_p) { |
| 1208 rtc::scoped_refptr<AudioSourceInterface> source( |
| 1209 reinterpret_cast<AudioTrackInterface*>(j_p)->GetSource()); |
| 1210 |
| 1211 jlong nativePointer = jlongFromPointer(source.get()); |
| 1212 jclass j_audio_source_class = FindClass(jni, "org/webrtc/AudioSource"); |
| 1213 jmethodID j_audio_source_ctor = |
| 1214 GetMethodID(jni, j_audio_source_class, "<init>", "(J)V"); |
| 1215 jobject j_audio_source = |
| 1216 jni->NewObject(j_audio_source_class, j_audio_source_ctor, nativePointer); |
| 1217 CHECK_EXCEPTION(jni) << "error during NewObject"; |
| 1218 return j_audio_source; |
| 1219 } |
| 1220 |
1202 // Helper struct for working around the fact that CreatePeerConnectionFactory() | 1221 // Helper struct for working around the fact that CreatePeerConnectionFactory() |
1203 // comes in two flavors: either entirely automagical (constructing its own | 1222 // comes in two flavors: either entirely automagical (constructing its own |
1204 // threads and deleting them on teardown, but no external codec factory support) | 1223 // threads and deleting them on teardown, but no external codec factory support) |
1205 // or entirely manual (requires caller to delete threads after factory | 1224 // or entirely manual (requires caller to delete threads after factory |
1206 // teardown). This struct takes ownership of its ctor's arguments to present a | 1225 // teardown). This struct takes ownership of its ctor's arguments to present a |
1207 // single thing for Java to hold and eventually free. | 1226 // single thing for Java to hold and eventually free. |
1208 class OwnedFactoryAndThreads { | 1227 class OwnedFactoryAndThreads { |
1209 public: | 1228 public: |
1210 OwnedFactoryAndThreads(std::unique_ptr<Thread> network_thread, | 1229 OwnedFactoryAndThreads(std::unique_ptr<Thread> network_thread, |
1211 std::unique_ptr<Thread> worker_thread, | 1230 std::unique_ptr<Thread> worker_thread, |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) | 2746 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) |
2728 ->inter_tone_gap(); | 2747 ->inter_tone_gap(); |
2729 } | 2748 } |
2730 | 2749 |
2731 JOW(void, DtmfSender_free) | 2750 JOW(void, DtmfSender_free) |
2732 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { | 2751 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { |
2733 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release(); | 2752 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release(); |
2734 } | 2753 } |
2735 | 2754 |
2736 } // namespace webrtc_jni | 2755 } // namespace webrtc_jni |
OLD | NEW |