| OLD | NEW |
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // call. In this file this is done in CHECK_EXCEPTION, making for much easier | 50 // call. In this file this is done in CHECK_EXCEPTION, making for much easier |
| 51 // debugging in case of failure (the alternative is to wait for control to | 51 // debugging in case of failure (the alternative is to wait for control to |
| 52 // return to the Java frame that called code in this file, at which point it's | 52 // return to the Java frame that called code in this file, at which point it's |
| 53 // impossible to tell which JNI call broke). | 53 // impossible to tell which JNI call broke). |
| 54 | 54 |
| 55 #include <jni.h> | 55 #include <jni.h> |
| 56 #undef JNIEXPORT | 56 #undef JNIEXPORT |
| 57 #define JNIEXPORT __attribute__((visibility("default"))) | 57 #define JNIEXPORT __attribute__((visibility("default"))) |
| 58 | 58 |
| 59 #include <limits> | 59 #include <limits> |
| 60 #include <utility> |
| 60 | 61 |
| 61 #include "talk/app/webrtc/java/jni/classreferenceholder.h" | 62 #include "talk/app/webrtc/java/jni/classreferenceholder.h" |
| 62 #include "talk/app/webrtc/java/jni/jni_helpers.h" | 63 #include "talk/app/webrtc/java/jni/jni_helpers.h" |
| 63 #include "talk/app/webrtc/java/jni/native_handle_impl.h" | 64 #include "talk/app/webrtc/java/jni/native_handle_impl.h" |
| 64 #include "talk/app/webrtc/dtlsidentitystore.h" | 65 #include "talk/app/webrtc/dtlsidentitystore.h" |
| 65 #include "talk/app/webrtc/mediaconstraintsinterface.h" | 66 #include "talk/app/webrtc/mediaconstraintsinterface.h" |
| 66 #include "talk/app/webrtc/peerconnectioninterface.h" | 67 #include "talk/app/webrtc/peerconnectioninterface.h" |
| 67 #include "talk/app/webrtc/rtpreceiverinterface.h" | 68 #include "talk/app/webrtc/rtpreceiverinterface.h" |
| 68 #include "talk/app/webrtc/rtpsenderinterface.h" | 69 #include "talk/app/webrtc/rtpsenderinterface.h" |
| 69 #include "talk/app/webrtc/videosourceinterface.h" | 70 #include "talk/app/webrtc/videosourceinterface.h" |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 jfieldID j_key_type_id = GetFieldID(jni, j_rtc_config_class, "keyType", | 1625 jfieldID j_key_type_id = GetFieldID(jni, j_rtc_config_class, "keyType", |
| 1625 "Lorg/webrtc/PeerConnection$KeyType;"); | 1626 "Lorg/webrtc/PeerConnection$KeyType;"); |
| 1626 jobject j_key_type = GetObjectField(jni, j_rtc_config, j_key_type_id); | 1627 jobject j_key_type = GetObjectField(jni, j_rtc_config, j_key_type_id); |
| 1627 | 1628 |
| 1628 // Create ECDSA certificate. | 1629 // Create ECDSA certificate. |
| 1629 if (JavaKeyTypeToNativeType(jni, j_key_type) == rtc::KT_ECDSA) { | 1630 if (JavaKeyTypeToNativeType(jni, j_key_type) == rtc::KT_ECDSA) { |
| 1630 scoped_ptr<rtc::SSLIdentity> ssl_identity( | 1631 scoped_ptr<rtc::SSLIdentity> ssl_identity( |
| 1631 rtc::SSLIdentity::Generate(webrtc::kIdentityName, rtc::KT_ECDSA)); | 1632 rtc::SSLIdentity::Generate(webrtc::kIdentityName, rtc::KT_ECDSA)); |
| 1632 if (ssl_identity.get()) { | 1633 if (ssl_identity.get()) { |
| 1633 rtc_config.certificates.push_back( | 1634 rtc_config.certificates.push_back( |
| 1634 rtc::RTCCertificate::Create(ssl_identity.Pass())); | 1635 rtc::RTCCertificate::Create(std::move(ssl_identity))); |
| 1635 LOG(LS_INFO) << "ECDSA certificate created."; | 1636 LOG(LS_INFO) << "ECDSA certificate created."; |
| 1636 } else { | 1637 } else { |
| 1637 // Failing to create certificate should not abort peer connection | 1638 // Failing to create certificate should not abort peer connection |
| 1638 // creation. Instead default encryption (currently RSA) will be used. | 1639 // creation. Instead default encryption (currently RSA) will be used. |
| 1639 LOG(LS_WARNING) << | 1640 LOG(LS_WARNING) << |
| 1640 "Failed to generate SSLIdentity. Default encryption will be used."; | 1641 "Failed to generate SSLIdentity. Default encryption will be used."; |
| 1641 } | 1642 } |
| 1642 } | 1643 } |
| 1643 | 1644 |
| 1644 PCOJava* observer = reinterpret_cast<PCOJava*>(observer_p); | 1645 PCOJava* observer = reinterpret_cast<PCOJava*>(observer_p); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2156 return JavaStringFromStdString( | 2157 return JavaStringFromStdString( |
| 2157 jni, | 2158 jni, |
| 2158 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2159 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
| 2159 } | 2160 } |
| 2160 | 2161 |
| 2161 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2162 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
| 2162 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2163 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
| 2163 } | 2164 } |
| 2164 | 2165 |
| 2165 } // namespace webrtc_jni | 2166 } // namespace webrtc_jni |
| OLD | NEW |