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

Side by Side Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1511633002: Add APK targets to build libjingle tests for Android. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reverted <gtest of libjingle_media_unittests and p2p. Created 5 years 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 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 // Field trials initialization string 136 // Field trials initialization string
137 static char *field_trials_init_string = NULL; 137 static char *field_trials_init_string = NULL;
138 138
139 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) 139 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
140 // Set in PeerConnectionFactory_initializeAndroidGlobals(). 140 // Set in PeerConnectionFactory_initializeAndroidGlobals().
141 static bool factory_static_initialized = false; 141 static bool factory_static_initialized = false;
142 static bool video_hw_acceleration_enabled = true; 142 static bool video_hw_acceleration_enabled = true;
143 #endif 143 #endif
144 144
145 extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
146 jint ret = InitGlobalJniVariables(jvm);
147 if (ret < 0)
148 return -1;
149
150 RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
151 LoadGlobalClassReferenceHolder();
152
153 return ret;
154 }
155
156 extern "C" void JNIEXPORT JNICALL JNI_OnUnLoad(JavaVM *jvm, void *reserved) {
157 FreeGlobalClassReferenceHolder();
158 RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
159 }
160
161 // Return the (singleton) Java Enum object corresponding to |index|; 145 // Return the (singleton) Java Enum object corresponding to |index|;
162 // |state_class_fragment| is something like "MediaSource$State". 146 // |state_class_fragment| is something like "MediaSource$State".
163 static jobject JavaEnumFromIndex( 147 static jobject JavaEnumFromIndex(
164 JNIEnv* jni, const std::string& state_class_fragment, int index) { 148 JNIEnv* jni, const std::string& state_class_fragment, int index) {
165 const std::string state_class = "org/webrtc/" + state_class_fragment; 149 const std::string state_class = "org/webrtc/" + state_class_fragment;
166 return JavaEnumFromIndex(jni, FindClass(jni, state_class.c_str()), 150 return JavaEnumFromIndex(jni, FindClass(jni, state_class.c_str()),
167 state_class, index); 151 state_class, index);
168 } 152 }
169 153
170 static DataChannelInit JavaDataChannelInitToNative( 154 static DataChannelInit JavaDataChannelInitToNative(
(...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 return JavaStringFromStdString( 2162 return JavaStringFromStdString(
2179 jni, 2163 jni,
2180 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2164 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2181 } 2165 }
2182 2166
2183 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2167 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2184 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2168 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2185 } 2169 }
2186 2170
2187 } // namespace webrtc_jni 2171 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698