blob: 67e3a9ff425419f592bb49275bc1d7571c41d477 [file] [log] [blame]
Bo Liu10205862022-09-15 16:24:36 -04001/*
2 * Copyright 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/**
18 * @addtogroup NativeActivity Native Activity
19 * @{
20 */
21
22/**
23 * @file surface_control_jni.h
24 */
25
26#ifndef ANDROID_SURFACE_CONTROL_JNI_H
27#define ANDROID_SURFACE_CONTROL_JNI_H
28
29#include <jni.h>
30#include <sys/cdefs.h>
31
32#include <android/surface_control.h>
33
34__BEGIN_DECLS
35
36/**
37 * Return the ASurfaceControl wrapped by a Java SurfaceControl object.
38 *
39 * This method does not acquire any additional reference to the ASurfaceControl
40 * that is returned. To keep the ASurfaceControl alive after the Java
41 * SurfaceControl object is closed, explicitly or by the garbage collector, be
42 * sure to use ASurfaceControl_acquire() to acquire an additional reference.
43 *
44 * Available since API level 34.
45 */
46ASurfaceControl* _Nullable ASurfaceControl_fromSurfaceControl(JNIEnv* _Nonnull env,
47 jobject _Nonnull surfaceControlObj) __INTRODUCED_IN(__ANDROID_API_U__);
48
49/**
50 * Return the ASurfaceTransaction wrapped by a Java Transaction object.
51 *
52 * The returned ASurfaceTransaction is still owned by the Java Transaction object is only
53 * valid while the Java Transaction object is alive. In particular, the returned transaction
54 * must NOT be deleted with ASurfaceTransaction_delete.
55 * May return nullptr on error.
56 *
57 * Available since API level 34.
58 */
59ASurfaceTransaction* _Nullable ASurfaceTransaction_fromTransaction(JNIEnv* _Nonnull env,
60 jobject _Nonnull transactionObj) __INTRODUCED_IN(__ANDROID_API_U__);
61
62__END_DECLS
63
64#endif // ANDROID_SURFACE_CONTROL_JNI_H
65/** @} */