Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: webrtc/sdk/android/src/jni/androidvideotracksource_jni.cc

Issue 3009613002: Android: Replace webrtc_jni namespace with nested jni namespace (Closed)
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/android/src/jni/androidvideotracksource_jni.cc
diff --git a/webrtc/sdk/android/src/jni/androidvideotracksource_jni.cc b/webrtc/sdk/android/src/jni/androidvideotracksource_jni.cc
index dfad301ff5d90efb660c3287bbe5260690af0c95..fc9f3b2bff87a401c78d95664af385b06c0f4b66 100644
--- a/webrtc/sdk/android/src/jni/androidvideotracksource_jni.cc
+++ b/webrtc/sdk/android/src/jni/androidvideotracksource_jni.cc
@@ -14,19 +14,24 @@
#include "webrtc/sdk/android/src/jni/androidvideotracksource.h"
#include "webrtc/sdk/android/src/jni/classreferenceholder.h"
-static webrtc::VideoRotation jintToVideoRotation(jint rotation) {
+namespace webrtc {
+
+namespace {
+
+static VideoRotation jintToVideoRotation(jint rotation) {
RTC_DCHECK(rotation == 0 || rotation == 90 || rotation == 180 ||
rotation == 270);
- return static_cast<webrtc::VideoRotation>(rotation);
+ return static_cast<VideoRotation>(rotation);
}
-namespace webrtc_jni {
+} // namespace
+
+namespace jni {
-static webrtc::AndroidVideoTrackSource* AndroidVideoTrackSourceFromJavaProxy(
+static AndroidVideoTrackSource* AndroidVideoTrackSourceFromJavaProxy(
jlong j_proxy) {
- auto proxy_source = reinterpret_cast<webrtc::VideoTrackSourceProxy*>(j_proxy);
- return reinterpret_cast<webrtc::AndroidVideoTrackSource*>(
- proxy_source->internal());
+ auto proxy_source = reinterpret_cast<VideoTrackSourceProxy*>(j_proxy);
+ return reinterpret_cast<AndroidVideoTrackSource*>(proxy_source->internal());
}
JNI_FUNCTION_DECLARATION(
@@ -41,7 +46,7 @@ JNI_FUNCTION_DECLARATION(
jint height,
jint rotation,
jlong timestamp) {
- webrtc::AndroidVideoTrackSource* source =
+ AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
jbyte* bytes = jni->GetByteArrayElements(j_frame, nullptr);
source->OnByteBufferFrameCaptured(bytes, length, width, height,
@@ -61,7 +66,7 @@ JNI_FUNCTION_DECLARATION(
jfloatArray j_transform_matrix,
jint j_rotation,
jlong j_timestamp) {
- webrtc::AndroidVideoTrackSource* source =
+ AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
source->OnTextureFrameCaptured(
j_width, j_height, jintToVideoRotation(j_rotation), j_timestamp,
@@ -78,7 +83,7 @@ JNI_FUNCTION_DECLARATION(void,
jint j_rotation,
jlong j_timestamp_ns,
jobject j_video_frame_buffer) {
- webrtc::AndroidVideoTrackSource* source =
+ AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
source->OnFrameCaptured(jni, j_width, j_height, j_timestamp_ns,
jintToVideoRotation(j_rotation),
@@ -92,11 +97,10 @@ JNI_FUNCTION_DECLARATION(void,
jlong j_source,
jboolean j_success) {
LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStarted";
- webrtc::AndroidVideoTrackSource* source =
+ AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
- source->SetState(j_success
- ? webrtc::AndroidVideoTrackSource::SourceState::kLive
- : webrtc::AndroidVideoTrackSource::SourceState::kEnded);
+ source->SetState(j_success ? AndroidVideoTrackSource::SourceState::kLive
+ : AndroidVideoTrackSource::SourceState::kEnded);
}
JNI_FUNCTION_DECLARATION(void,
@@ -105,9 +109,9 @@ JNI_FUNCTION_DECLARATION(void,
jclass,
jlong j_source) {
LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStopped";
- webrtc::AndroidVideoTrackSource* source =
+ AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
- source->SetState(webrtc::AndroidVideoTrackSource::SourceState::kEnded);
+ source->SetState(AndroidVideoTrackSource::SourceState::kEnded);
}
JNI_FUNCTION_DECLARATION(void,
@@ -119,9 +123,10 @@ JNI_FUNCTION_DECLARATION(void,
jint j_height,
jint j_fps) {
LOG(LS_INFO) << "VideoSource_nativeAdaptOutputFormat";
- webrtc::AndroidVideoTrackSource* source =
+ AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
source->OnOutputFormatRequest(j_width, j_height, j_fps);
}
-} // namespace webrtc_jni
+} // namespace jni
+} // namespace webrtc
« no previous file with comments | « webrtc/sdk/android/src/jni/androidvideotracksource.cc ('k') | webrtc/sdk/android/src/jni/classreferenceholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698