Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: webrtc/sdk/android/src/jni/peerconnection_jni.cc

Issue 2710683009: Added support for changing the volume of AudioTrack as discussed in BUG=webrtc:6533 (Closed)
Patch Set: added period at end of sentence Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, AudioTrack_nativeSetVolume)
1203 (JNIEnv*, jclass, jlong j_p, jdouble volume) {
1204 rtc::scoped_refptr<AudioSourceInterface> source(
1205 reinterpret_cast<AudioTrackInterface*>(j_p)->GetSource());
1206
1207 jlong nativePointer = jlongFromPointer(source.get());
magjed_webrtc 2017/04/05 19:14:00 It looks like you are converting AudioSourceInterf
1208
1209 reinterpret_cast<AudioSourceInterface*>(nativePointer)->SetVolume(volume);
1210 }
1211
1202 // Helper struct for working around the fact that CreatePeerConnectionFactory() 1212 // Helper struct for working around the fact that CreatePeerConnectionFactory()
1203 // comes in two flavors: either entirely automagical (constructing its own 1213 // comes in two flavors: either entirely automagical (constructing its own
1204 // threads and deleting them on teardown, but no external codec factory support) 1214 // threads and deleting them on teardown, but no external codec factory support)
1205 // or entirely manual (requires caller to delete threads after factory 1215 // or entirely manual (requires caller to delete threads after factory
1206 // teardown). This struct takes ownership of its ctor's arguments to present a 1216 // teardown). This struct takes ownership of its ctor's arguments to present a
1207 // single thing for Java to hold and eventually free. 1217 // single thing for Java to hold and eventually free.
1208 class OwnedFactoryAndThreads { 1218 class OwnedFactoryAndThreads {
1209 public: 1219 public:
1210 OwnedFactoryAndThreads(std::unique_ptr<Thread> network_thread, 1220 OwnedFactoryAndThreads(std::unique_ptr<Thread> network_thread,
1211 std::unique_ptr<Thread> worker_thread, 1221 std::unique_ptr<Thread> worker_thread,
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
2727 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) 2737 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)
2728 ->inter_tone_gap(); 2738 ->inter_tone_gap();
2729 } 2739 }
2730 2740
2731 JOW(void, DtmfSender_free) 2741 JOW(void, DtmfSender_free)
2732 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { 2742 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) {
2733 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release(); 2743 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release();
2734 } 2744 }
2735 2745
2736 } // namespace webrtc_jni 2746 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698