-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2023.12.1' into main
- Loading branch information
Showing
7 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
#include "sora/java_context.h" | ||
|
||
#ifdef SORA_CPP_SDK_ANDROID | ||
#include <modules/utility/include/jvm_android.h> | ||
#include <sdk/android/native_api/jni/jvm.h> | ||
#include <sdk/android/src/jni/jvm.h> | ||
#endif | ||
|
||
namespace sora { | ||
|
||
void* GetJNIEnv() { | ||
#ifdef SORA_CPP_SDK_ANDROID | ||
// webrtc::JVM::Initialize を呼んでおかないと | ||
// libwebrtc の内部関数で落ちることがあるので設定しておく | ||
static bool jvm_initialized = false; | ||
if (!jvm_initialized) { | ||
webrtc::JVM::Initialize(webrtc::jni::GetJVM()); | ||
jvm_initialized = true; | ||
} | ||
return webrtc::AttachCurrentThreadIfNeeded(); | ||
#else | ||
return nullptr; | ||
#endif | ||
} | ||
|
||
} | ||
} // namespace sora |