| Craig Donner | c7e8dae | 2017-01-03 10:24:58 -0800 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) 2017 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 | /** | 
| Krzysztof Kosiński | 22fb2ff | 2019-05-14 19:22:59 -0700 | [diff] [blame] | 18 |  * @addtogroup AHardwareBuffer | 
 | 19 |  * @{ | 
 | 20 |  */ | 
 | 21 |  | 
 | 22 | /** | 
| Craig Donner | c7e8dae | 2017-01-03 10:24:58 -0800 | [diff] [blame] | 23 |  * @file hardware_buffer_jni.h | 
| Krzysztof Kosiński | 22fb2ff | 2019-05-14 19:22:59 -0700 | [diff] [blame] | 24 |  * @brief JNI glue for native hardware buffers. | 
| Craig Donner | c7e8dae | 2017-01-03 10:24:58 -0800 | [diff] [blame] | 25 |  */ | 
 | 26 |  | 
 | 27 | #ifndef ANDROID_HARDWARE_BUFFER_JNI_H | 
 | 28 | #define ANDROID_HARDWARE_BUFFER_JNI_H | 
 | 29 |  | 
 | 30 | #include <sys/cdefs.h> | 
 | 31 |  | 
 | 32 | #include <android/hardware_buffer.h> | 
 | 33 |  | 
 | 34 | #include <jni.h> | 
 | 35 |  | 
 | 36 | __BEGIN_DECLS | 
 | 37 |  | 
 | 38 | /** | 
| Krzysztof Kosiński | 22fb2ff | 2019-05-14 19:22:59 -0700 | [diff] [blame] | 39 |  * Return the AHardwareBuffer wrapped by a Java HardwareBuffer object. | 
 | 40 |  * | 
 | 41 |  * This method does not acquire any additional reference to the AHardwareBuffer | 
 | 42 |  * that is returned. To keep the AHardwareBuffer live after the Java | 
 | 43 |  * HardwareBuffer object got garbage collected, be sure to use AHardwareBuffer_acquire() | 
 | 44 |  * to acquire an additional reference. | 
| Craig Donner | c7e8dae | 2017-01-03 10:24:58 -0800 | [diff] [blame] | 45 |  */ | 
 | 46 | AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer(JNIEnv* env, | 
| Krzysztof Kosiński | 22fb2ff | 2019-05-14 19:22:59 -0700 | [diff] [blame] | 47 |         jobject hardwareBufferObj) __INTRODUCED_IN(26); | 
| Craig Donner | c7e8dae | 2017-01-03 10:24:58 -0800 | [diff] [blame] | 48 |  | 
 | 49 | /** | 
 | 50 |  * Return a new Java HardwareBuffer object that wraps the passed native | 
 | 51 |  * AHardwareBuffer object. | 
 | 52 |  */ | 
 | 53 | jobject AHardwareBuffer_toHardwareBuffer(JNIEnv* env, | 
| Krzysztof Kosiński | 22fb2ff | 2019-05-14 19:22:59 -0700 | [diff] [blame] | 54 |         AHardwareBuffer* hardwareBuffer) __INTRODUCED_IN(26); | 
| Craig Donner | c7e8dae | 2017-01-03 10:24:58 -0800 | [diff] [blame] | 55 |  | 
 | 56 | __END_DECLS | 
 | 57 |  | 
 | 58 | #endif // ANDROID_HARDWARE_BUFFER_JNI_H | 
| Krzysztof Kosiński | 22fb2ff | 2019-05-14 19:22:59 -0700 | [diff] [blame] | 59 |  | 
 | 60 | /** @} */ |