[+] load错误问题解决
This commit is contained in:
@@ -182,8 +182,8 @@ public class MainActivity extends AppCompatActivity implements Serializable {
|
||||
}
|
||||
this.threadHandler.post(() -> {
|
||||
// 进入房间
|
||||
// Taoyao.taoyao.roomEnter("91f81c0a-0556-4087-b9a4-5889fac36fb6", null);
|
||||
Taoyao.taoyao.sessionCall("taoyao");
|
||||
Taoyao.taoyao.roomEnter("4ca4b920-a422-473d-9954-660df424270f", null);
|
||||
// Taoyao.taoyao.sessionCall("taoyao");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "Log.hpp"
|
||||
#include "mediasoupclient.hpp"
|
||||
|
||||
#include "sdk/android/src/jni/jvm.h"
|
||||
|
||||
namespace acgist {
|
||||
|
||||
}
|
||||
@@ -2,8 +2,21 @@
|
||||
|
||||
namespace acgist {
|
||||
|
||||
/**
|
||||
* 非常重要
|
||||
* 如果没有配置很多方法莫名其妙报错
|
||||
*
|
||||
* @param env JNIEnv
|
||||
*/
|
||||
void initWebrtcJni(JNIEnv* env) {
|
||||
JavaVM* javaVM;
|
||||
env->GetJavaVM(&javaVM);
|
||||
webrtc::jni::InitGlobalJniVariables(javaVM);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_com_acgist_taoyao_media_MediaManager_nativeInit(JNIEnv* env, jobject me) {
|
||||
initWebrtcJni(env);
|
||||
std::string version = mediasoupclient::Version();
|
||||
LOG_I("加载MediasoupClient", version.data());
|
||||
mediasoupclient::Initialize();
|
||||
|
||||
@@ -360,11 +360,10 @@ namespace acgist {
|
||||
jlong factoryPointer, jobject jRtcConfiguration
|
||||
) {
|
||||
Room* room = (Room*) nativeRoomPointer;
|
||||
webrtc::PeerConnectionInterface::RTCConfiguration rtcConfiguration(webrtc::PeerConnectionInterface::RTCConfigurationType::kSafe);
|
||||
// webrtc::jni::JavaToNativeMediaConstraints();
|
||||
// webrtc::PeerConnectionInterface::RTCConfiguration rtcConfiguration(webrtc::PeerConnectionInterface::RTCConfigurationType::kAggressive);
|
||||
// TODO:为什么不能转换?测试是否因为stun配置问题
|
||||
webrtc::JavaParamRef<jobject> jRtcConfigurationRef(jRtcConfiguration);
|
||||
// webrtc::PeerConnectionInterface::RTCConfiguration rtcConfiguration(webrtc::PeerConnectionInterface::RTCConfigurationType::kSafe);
|
||||
webrtc::PeerConnectionInterface::RTCConfiguration rtcConfiguration(webrtc::PeerConnectionInterface::RTCConfigurationType::kAggressive);
|
||||
webrtc::JavaParamRef<jobject> jRtcConfigurationRef(env, jRtcConfiguration);
|
||||
// 注意
|
||||
webrtc::jni::JavaToNativeRTCConfiguration(env, jRtcConfigurationRef, &rtcConfiguration);
|
||||
const char* rtpCapabilities = env->GetStringUTFChars(jRtpCapabilities, nullptr);
|
||||
room->enterRoom(
|
||||
|
||||
Reference in New Issue
Block a user