Android: Replace webrtc_jni namespace with nested jni namespace
This CL replaces:
namespace webrtc_jni {
with:
namespace webrtc {
namespace jni {
The main benefit is that we don't have to use the webrtc:: qualifier
inside the jni namespace so we can reduce some clutter.
BUG=None
Review-Url: https://codereview.webrtc.org/3009613002
Cr-Commit-Position: refs/heads/master@{#19569}
diff --git a/webrtc/examples/unityplugin/classreferenceholder.cc b/webrtc/examples/unityplugin/classreferenceholder.cc
index 8814699..b009ce4 100644
--- a/webrtc/examples/unityplugin/classreferenceholder.cc
+++ b/webrtc/examples/unityplugin/classreferenceholder.cc
@@ -36,12 +36,12 @@
void LoadGlobalClassReferenceHolder() {
RTC_CHECK(g_class_reference_holder == nullptr);
- g_class_reference_holder = new ClassReferenceHolder(webrtc_jni::GetEnv());
+ g_class_reference_holder = new ClassReferenceHolder(webrtc::jni::GetEnv());
}
void FreeGlobalClassReferenceHolder() {
g_class_reference_holder->FreeReferences(
- webrtc_jni::AttachCurrentThreadIfNeeded());
+ webrtc::jni::AttachCurrentThreadIfNeeded());
delete g_class_reference_holder;
g_class_reference_holder = nullptr;
}
diff --git a/webrtc/examples/unityplugin/classreferenceholder.h b/webrtc/examples/unityplugin/classreferenceholder.h
index a3f83e8..7d9a71b 100644
--- a/webrtc/examples/unityplugin/classreferenceholder.h
+++ b/webrtc/examples/unityplugin/classreferenceholder.h
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-// This is a supplement of webrtc_jni::ClassReferenceHolder.
+// This is a supplement of webrtc::jni::ClassReferenceHolder.
// The purpose of this ClassReferenceHolder is to load the example
// specific java class into JNI c++ side, so that our c++ code can
// call those java functions.
diff --git a/webrtc/examples/unityplugin/jni_onload.cc b/webrtc/examples/unityplugin/jni_onload.cc
index b8b4adf..558dcfb 100644
--- a/webrtc/examples/unityplugin/jni_onload.cc
+++ b/webrtc/examples/unityplugin/jni_onload.cc
@@ -17,7 +17,8 @@
#include "webrtc/sdk/android/src/jni/classreferenceholder.h"
#include "webrtc/sdk/android/src/jni/jni_helpers.h"
-namespace webrtc_jni {
+namespace webrtc {
+namespace jni {
extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved) {
jint ret = InitGlobalJniVariables(jvm);
@@ -38,4 +39,5 @@
RTC_CHECK(rtc::CleanupSSL()) << "Failed to CleanupSSL()";
}
-} // namespace webrtc_jni
+} // namespace jni
+} // namespace webrtc
diff --git a/webrtc/examples/unityplugin/simple_peer_connection.cc b/webrtc/examples/unityplugin/simple_peer_connection.cc
index 57ab885..3f3f3fb 100644
--- a/webrtc/examples/unityplugin/simple_peer_connection.cc
+++ b/webrtc/examples/unityplugin/simple_peer_connection.cc
@@ -164,10 +164,10 @@
#if defined(WEBRTC_ANDROID)
if (g_camera) {
- JNIEnv* env = webrtc_jni::GetEnv();
+ JNIEnv* env = webrtc::jni::GetEnv();
jclass pc_factory_class =
unity_plugin::FindClass(env, "org/webrtc/UnityUtility");
- jmethodID stop_camera_method = webrtc_jni::GetStaticMethodID(
+ jmethodID stop_camera_method = webrtc::jni::GetStaticMethodID(
env, pc_factory_class, "StopCamera", "(Lorg/webrtc/VideoCapturer;)V");
env->CallStaticVoidMethod(pc_factory_class, stop_camera_method, g_camera);
@@ -409,10 +409,10 @@
if (!audio_only) {
#if defined(WEBRTC_ANDROID)
- JNIEnv* env = webrtc_jni::GetEnv();
+ JNIEnv* env = webrtc::jni::GetEnv();
jclass pc_factory_class =
unity_plugin::FindClass(env, "org/webrtc/UnityUtility");
- jmethodID load_texture_helper_method = webrtc_jni::GetStaticMethodID(
+ jmethodID load_texture_helper_method = webrtc::jni::GetStaticMethodID(
env, pc_factory_class, "LoadSurfaceTextureHelper",
"()Lorg/webrtc/SurfaceTextureHelper;");
jobject texture_helper = env->CallStaticObjectMethod(
@@ -421,15 +421,15 @@
RTC_DCHECK(texture_helper != nullptr)
<< "Cannot get the Surface Texture Helper.";
- rtc::scoped_refptr<webrtc::AndroidVideoTrackSource> source(
- new rtc::RefCountedObject<webrtc::AndroidVideoTrackSource>(
+ rtc::scoped_refptr<AndroidVideoTrackSource> source(
+ new rtc::RefCountedObject<AndroidVideoTrackSource>(
g_signaling_thread.get(), env, texture_helper, false));
rtc::scoped_refptr<webrtc::VideoTrackSourceProxy> proxy_source =
webrtc::VideoTrackSourceProxy::Create(g_signaling_thread.get(),
g_worker_thread.get(), source);
// link with VideoCapturer (Camera);
- jmethodID link_camera_method = webrtc_jni::GetStaticMethodID(
+ jmethodID link_camera_method = webrtc::jni::GetStaticMethodID(
env, pc_factory_class, "LinkCamera",
"(JLorg/webrtc/SurfaceTextureHelper;)Lorg/webrtc/VideoCapturer;");
jobject camera_tmp =