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

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

Issue 2800353002: Removing unnecessary parameters from initializeAndroidGlobals. (Closed)
Patch Set: Change type of "context" to an actual Android context. 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
« no previous file with comments | « webrtc/sdk/android/src/jni/DEPS ('k') | webrtc/voice_engine/include/voe_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "webrtc/base/logging.h" 56 #include "webrtc/base/logging.h"
57 #include "webrtc/base/logsinks.h" 57 #include "webrtc/base/logsinks.h"
58 #include "webrtc/base/messagequeue.h" 58 #include "webrtc/base/messagequeue.h"
59 #include "webrtc/base/networkmonitor.h" 59 #include "webrtc/base/networkmonitor.h"
60 #include "webrtc/base/rtccertificategenerator.h" 60 #include "webrtc/base/rtccertificategenerator.h"
61 #include "webrtc/base/ssladapter.h" 61 #include "webrtc/base/ssladapter.h"
62 #include "webrtc/base/stringutils.h" 62 #include "webrtc/base/stringutils.h"
63 #include "webrtc/media/base/videocapturer.h" 63 #include "webrtc/media/base/videocapturer.h"
64 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" 64 #include "webrtc/media/engine/webrtcvideodecoderfactory.h"
65 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" 65 #include "webrtc/media/engine/webrtcvideoencoderfactory.h"
66 #include "webrtc/modules/utility/include/jvm_android.h"
66 #include "webrtc/system_wrappers/include/field_trial.h" 67 #include "webrtc/system_wrappers/include/field_trial.h"
67 #include "webrtc/pc/webrtcsdp.h" 68 #include "webrtc/pc/webrtcsdp.h"
68 #include "webrtc/sdk/android/src/jni/androidmediadecoder_jni.h" 69 #include "webrtc/sdk/android/src/jni/androidmediadecoder_jni.h"
69 #include "webrtc/sdk/android/src/jni/androidmediaencoder_jni.h" 70 #include "webrtc/sdk/android/src/jni/androidmediaencoder_jni.h"
70 #include "webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.h" 71 #include "webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.h"
71 #include "webrtc/sdk/android/src/jni/androidvideotracksource.h" 72 #include "webrtc/sdk/android/src/jni/androidvideotracksource.h"
72 #include "webrtc/sdk/android/src/jni/classreferenceholder.h" 73 #include "webrtc/sdk/android/src/jni/classreferenceholder.h"
73 #include "webrtc/sdk/android/src/jni/jni_helpers.h" 74 #include "webrtc/sdk/android/src/jni/jni_helpers.h"
74 #include "webrtc/sdk/android/src/jni/native_handle_impl.h" 75 #include "webrtc/sdk/android/src/jni/native_handle_impl.h"
75 #include "webrtc/system_wrappers/include/field_trial_default.h" 76 #include "webrtc/system_wrappers/include/field_trial_default.h"
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 1125
1125 JOW(void, MediaStream_free)(JNIEnv*, jclass, jlong j_p) { 1126 JOW(void, MediaStream_free)(JNIEnv*, jclass, jlong j_p) {
1126 CHECK_RELEASE(reinterpret_cast<MediaStreamInterface*>(j_p)); 1127 CHECK_RELEASE(reinterpret_cast<MediaStreamInterface*>(j_p));
1127 } 1128 }
1128 1129
1129 JOW(jlong, PeerConnectionFactory_nativeCreateObserver)( 1130 JOW(jlong, PeerConnectionFactory_nativeCreateObserver)(
1130 JNIEnv * jni, jclass, jobject j_observer) { 1131 JNIEnv * jni, jclass, jobject j_observer) {
1131 return (jlong)new PCOJava(jni, j_observer); 1132 return (jlong)new PCOJava(jni, j_observer);
1132 } 1133 }
1133 1134
1134 JOW(jboolean, PeerConnectionFactory_initializeAndroidGlobals) 1135 JOW(void, PeerConnectionFactory_initializeAndroidGlobals)
1135 (JNIEnv* jni, 1136 (JNIEnv* jni,
1136 jclass, 1137 jclass,
1137 jobject context, 1138 jobject context,
1138 jboolean initialize_audio,
1139 jboolean initialize_video,
1140 jboolean video_hw_acceleration) { 1139 jboolean video_hw_acceleration) {
1141 bool failure = false;
1142 video_hw_acceleration_enabled = video_hw_acceleration; 1140 video_hw_acceleration_enabled = video_hw_acceleration;
1143 AndroidNetworkMonitor::SetAndroidContext(jni, context); 1141 AndroidNetworkMonitor::SetAndroidContext(jni, context);
1144 if (!factory_static_initialized) { 1142 if (!factory_static_initialized) {
1145 RTC_DCHECK(j_application_context == nullptr); 1143 RTC_DCHECK(j_application_context == nullptr);
1146 j_application_context = NewGlobalRef(jni, context); 1144 j_application_context = NewGlobalRef(jni, context);
1147 1145 webrtc::JVM::Initialize(GetJVM(), context);
1148 if (initialize_audio)
1149 failure |= webrtc::VoiceEngine::SetAndroidObjects(GetJVM(), context);
1150 factory_static_initialized = true; 1146 factory_static_initialized = true;
1151 } 1147 }
1152 return !failure;
1153 } 1148 }
1154 1149
1155 JOW(void, PeerConnectionFactory_initializeFieldTrials)( 1150 JOW(void, PeerConnectionFactory_initializeFieldTrials)(
1156 JNIEnv* jni, jclass, jstring j_trials_init_string) { 1151 JNIEnv* jni, jclass, jstring j_trials_init_string) {
1157 field_trials_init_string = NULL; 1152 field_trials_init_string = NULL;
1158 if (j_trials_init_string != NULL) { 1153 if (j_trials_init_string != NULL) {
1159 const char* init_string = 1154 const char* init_string =
1160 jni->GetStringUTFChars(j_trials_init_string, NULL); 1155 jni->GetStringUTFChars(j_trials_init_string, NULL);
1161 int init_string_length = jni->GetStringUTFLength(j_trials_init_string); 1156 int init_string_length = jni->GetStringUTFLength(j_trials_init_string);
1162 field_trials_init_string = new char[init_string_length + 1]; 1157 field_trials_init_string = new char[init_string_length + 1];
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2727 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer) 2722 return reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)
2728 ->inter_tone_gap(); 2723 ->inter_tone_gap();
2729 } 2724 }
2730 2725
2731 JOW(void, DtmfSender_free) 2726 JOW(void, DtmfSender_free)
2732 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) { 2727 (JNIEnv* jni, jclass, jlong j_dtmf_sender_pointer) {
2733 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release(); 2728 reinterpret_cast<DtmfSenderInterface*>(j_dtmf_sender_pointer)->Release();
2734 } 2729 }
2735 2730
2736 } // namespace webrtc_jni 2731 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « webrtc/sdk/android/src/jni/DEPS ('k') | webrtc/voice_engine/include/voe_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698