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

Unified Diff: webrtc/api/android/jni/eglrenderer_jni.cc

Issue 2456873002: Android EglRenderer: Add Bitmap frame listener functionality (Closed)
Patch Set: Add spaces. Created 4 years, 1 month 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/api/android/jni/eglrenderer_jni.cc
diff --git a/webrtc/api/android/jni/eglrenderer_jni.cc b/webrtc/api/android/jni/eglrenderer_jni.cc
new file mode 100644
index 0000000000000000000000000000000000000000..95b91c3daedfab5bb3d30dd5e88977d0b39f0e04
--- /dev/null
+++ b/webrtc/api/android/jni/eglrenderer_jni.cc
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "third_party/libyuv/include/libyuv/convert_argb.h"
+#include "webrtc/api/android/jni/classreferenceholder.h"
+
+namespace webrtc_jni {
+
+JOW(void, EglRenderer_nativeABGRToARGB)
+(JNIEnv* jni, jclass, jintArray j_array, jint width, jint height) {
+ jint* array = jni->GetIntArrayElements(j_array, NULL);
+ jint len = jni->GetArrayLength(j_array);
+ static_assert(sizeof(jint) == 4,
+ "EglRenderer.nativeABGRToARGB assumes sizeof(jint) == 4.");
+ libyuv::ABGRToARGB(reinterpret_cast<uint8_t*>(array), width * 4,
+ reinterpret_cast<uint8_t*>(array), width * 4, width,
+ height);
+ jni->ReleaseIntArrayElements(j_array, array, 0);
+}
+
+} // namespace webrtc_jni

Powered by Google App Engine
This is Rietveld 408576698