forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathndk_helpers.h
More file actions
40 lines (31 loc) · 1.32 KB
/
ndk_helpers.h
File metadata and controls
40 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_NDK_HELPERS_H_
#define FLUTTER_SHELL_PLATFORM_ANDROID_NDK_HELPERS_H_
#include "flutter/fml/native_library.h"
#include "flutter/fml/platform/android/jni_util.h"
#include "flutter/impeller/toolkit/egl/egl.h"
#include <android/hardware_buffer.h>
namespace flutter {
// A collection of NDK functions that are available depending on the version of
// the Android SDK we are linked with at runtime.
class NDKHelpers {
public:
// API Version 26
static bool HardwareBufferSupported();
static AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer(
JNIEnv* env,
jobject hardwareBufferObj);
static void AHardwareBuffer_acquire(AHardwareBuffer* buffer);
static void AHardwareBuffer_release(AHardwareBuffer* buffer);
static void AHardwareBuffer_describe(AHardwareBuffer* buffer,
AHardwareBuffer_Desc* desc);
static void AHardwareBuffer_getId(AHardwareBuffer* buffer, uint64_t* outId);
static EGLClientBuffer eglGetNativeClientBufferANDROID(
AHardwareBuffer* buffer);
private:
static void Init();
};
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_NDK_HELPERS_H_