Chromium Code Reviews

Side by Side 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.
Jump to:
View unified diff |
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "third_party/libyuv/include/libyuv/convert_argb.h"
12 #include "webrtc/api/android/jni/classreferenceholder.h"
13
14 namespace webrtc_jni {
15
16 JOW(void, EglRenderer_nativeABGRToARGB)
17 (JNIEnv* jni, jclass, jintArray j_array, jint width, jint height) {
18 jint* array = jni->GetIntArrayElements(j_array, NULL);
19 jint len = jni->GetArrayLength(j_array);
20 static_assert(sizeof(jint) == 4,
21 "EglRenderer.nativeABGRToARGB assumes sizeof(jint) == 4.");
22 libyuv::ABGRToARGB(reinterpret_cast<uint8_t*>(array), width * 4,
23 reinterpret_cast<uint8_t*>(array), width * 4, width,
24 height);
25 jni->ReleaseIntArrayElements(j_array, array, 0);
26 }
27
28 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine