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

Unified Diff: talk/app/webrtc/java/jni/jni_onload.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 side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/java/jni/jni_onload.cc
diff --git a/talk/app/webrtc/objc/RTCAVFoundationVideoSource+Internal.h b/talk/app/webrtc/java/jni/jni_onload.cc
similarity index 66%
copy from talk/app/webrtc/objc/RTCAVFoundationVideoSource+Internal.h
copy to talk/app/webrtc/java/jni/jni_onload.cc
index ffa6629c41cabb77005d43a929adcb9d49cb34a9..62a31a1d511aa49f96c2baf3c0c9a54d2e60d185 100644
--- a/talk/app/webrtc/objc/RTCAVFoundationVideoSource+Internal.h
+++ b/talk/app/webrtc/java/jni/jni_onload.cc
@@ -25,12 +25,30 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "RTCAVFoundationVideoSource.h"
+#include <jni.h>
+#undef JNIEXPORT
+#define JNIEXPORT __attribute__((visibility("default")))
-#include "avfoundationvideocapturer.h"
+#include "talk/app/webrtc/java/jni/classreferenceholder.h"
+#include "talk/app/webrtc/java/jni/jni_helpers.h"
+#include "webrtc/base/ssladapter.h"
-@interface RTCAVFoundationVideoSource ()
+namespace webrtc_jni {
-@property(nonatomic, readonly) webrtc::AVFoundationVideoCapturer* capturer;
+extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
+ jint ret = InitGlobalJniVariables(jvm);
+ if (ret < 0)
+ return -1;
-@end
+ RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
tommi 2015/12/13 14:02:55 Dcheck that ret is 0 first?
perkj_webrtc 2015/12/14 07:22:21 Done.
+ LoadGlobalClassReferenceHolder();
+
+ return ret;
+}
+
+extern "C" void JNIEXPORT JNICALL JNI_OnUnLoad(JavaVM *jvm, void *reserved) {
+ FreeGlobalClassReferenceHolder();
+ RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
+}
+
+} // namespace webrtc_jni
« no previous file with comments | « no previous file | talk/app/webrtc/java/jni/peerconnection_jni.cc » ('j') | talk/app/webrtc/test/androidtestinitializer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698