• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 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 #ifndef ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H
18 #define ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H
19 
20 // vndk is a superset of the NDK
21 #include <android/hardware_buffer.h>
22 
23 #include <cutils/native_handle.h>
24 
25 __BEGIN_DECLS
26 
27 const native_handle_t* AHardwareBuffer_getNativeHandle(const AHardwareBuffer* buffer);
28 
29 
30 /**
31  * Buffer pixel formats.
32  */
33 enum {
34     /* for future proofing, keep these in sync with system/graphics-base.h */
35 
36     /* same as HAL_PIXEL_FORMAT_BGRA_8888 */
37     AHARDWAREBUFFER_FORMAT_B8G8R8A8_UNORM           = 5,
38     /* same as HAL_PIXEL_FORMAT_YV12 */
39     AHARDWAREBUFFER_FORMAT_YV12                     = 0x32315659,
40     /* same as HAL_PIXEL_FORMAT_Y8 */
41     AHARDWAREBUFFER_FORMAT_Y8                       = 0x20203859,
42     /* same as HAL_PIXEL_FORMAT_Y16 */
43     AHARDWAREBUFFER_FORMAT_Y16                      = 0x20363159,
44     /* same as HAL_PIXEL_FORMAT_RAW16 */
45     AHARDWAREBUFFER_FORMAT_RAW16                    = 0x20,
46     /* same as HAL_PIXEL_FORMAT_RAW10 */
47     AHARDWAREBUFFER_FORMAT_RAW10                    = 0x25,
48     /* same as HAL_PIXEL_FORMAT_RAW12 */
49     AHARDWAREBUFFER_FORMAT_RAW12                    = 0x26,
50     /* same as HAL_PIXEL_FORMAT_RAW_OPAQUE */
51     AHARDWAREBUFFER_FORMAT_RAW_OPAQUE               = 0x24,
52     /* same as HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED */
53     AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED   = 0x22,
54     /* same as HAL_PIXEL_FORMAT_YCBCR_420_888 */
55     AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420             = 0x23,
56     /* same as HAL_PIXEL_FORMAT_YCBCR_422_888 */
57     AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_422             = 0x27,
58     /* same as HAL_PIXEL_FORMAT_YCBCR_444_888 */
59     AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_444             = 0x28,
60     /* same as HAL_PIXEL_FORMAT_FLEX_RGB_888 */
61     AHARDWAREBUFFER_FORMAT_FLEX_R8G8B8              = 0x29,
62     /* same as HAL_PIXEL_FORMAT_FLEX_RGBA_8888 */
63     AHARDWAREBUFFER_FORMAT_FLEX_R8G8B8A8            = 0x2A,
64     /* same as HAL_PIXEL_FORMAT_YCBCR_422_SP */
65     AHARDWAREBUFFER_FORMAT_YCbCr_422_SP             = 0x10,
66     /* same as HAL_PIXEL_FORMAT_YCRCB_420_SP */
67     AHARDWAREBUFFER_FORMAT_YCrCb_420_SP             = 0x11,
68     /* same as HAL_PIXEL_FORMAT_YCBCR_422_I */
69     AHARDWAREBUFFER_FORMAT_YCbCr_422_I              = 0x14,
70 };
71 
72 __END_DECLS
73 
74 #endif /* ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H */
75