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 65% |
copy from talk/app/webrtc/objc/RTCAVFoundationVideoSource+Internal.h |
copy to talk/app/webrtc/java/jni/jni_onload.cc |
index ffa6629c41cabb77005d43a929adcb9d49cb34a9..9664ecdca6b2020f05fc9ca08a82638debb88e7f 100644 |
--- a/talk/app/webrtc/objc/RTCAVFoundationVideoSource+Internal.h |
+++ b/talk/app/webrtc/java/jni/jni_onload.cc |
@@ -25,12 +25,31 @@ |
* 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); |
+ RTC_DCHECK_GE(ret, 0); |
+ if (ret < 0) |
+ return -1; |
-@end |
+ RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()"; |
+ 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 |