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 |