mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge changes from topic "nativehandle"
* changes: *common: create current API dump *common: use package as name graphics common: fix AIDL BufferUsage calculation Add AIDL type for HardwareBuffer
This commit is contained in:
21
common/aidl/Android.bp
Normal file
21
common/aidl/Android.bp
Normal file
@@ -0,0 +1,21 @@
|
||||
aidl_interface {
|
||||
name: "android.hardware.common",
|
||||
host_supported: true,
|
||||
vendor_available: true,
|
||||
vndk: {
|
||||
enabled: true,
|
||||
support_system_process: true,
|
||||
},
|
||||
srcs: [
|
||||
"android/hardware/common/*.aidl",
|
||||
],
|
||||
stability: "vintf",
|
||||
backend: {
|
||||
java: {
|
||||
enabled: false,
|
||||
},
|
||||
cpp: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
|
||||
// edit this file. It looks like you are doing that because you have modified
|
||||
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
|
||||
// from an interface or a field from a parcelable and it broke the build. That
|
||||
// breakage is intended.
|
||||
//
|
||||
// You must not make a backward incompatible changes to the AIDL files built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.common;
|
||||
@VintfStability
|
||||
parcelable NativeHandle {
|
||||
ParcelFileDescriptor[] fds;
|
||||
int[] ints;
|
||||
}
|
||||
26
common/aidl/android/hardware/common/NativeHandle.aidl
Normal file
26
common/aidl/android/hardware/common/NativeHandle.aidl
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.common;
|
||||
|
||||
/**
|
||||
* Representation of a native handle.
|
||||
*/
|
||||
@VintfStability
|
||||
parcelable NativeHandle {
|
||||
ParcelFileDescriptor[] fds;
|
||||
int[] ints;
|
||||
}
|
||||
24
graphics/common/aidl/Android.bp
Normal file
24
graphics/common/aidl/Android.bp
Normal file
@@ -0,0 +1,24 @@
|
||||
aidl_interface {
|
||||
name: "android.hardware.graphics.common",
|
||||
host_supported: true,
|
||||
vendor_available: true,
|
||||
vndk: {
|
||||
enabled: true,
|
||||
support_system_process: true,
|
||||
},
|
||||
srcs: [
|
||||
"android/hardware/graphics/common/*.aidl",
|
||||
],
|
||||
stability: "vintf",
|
||||
imports: [
|
||||
"android.hardware.common",
|
||||
],
|
||||
backend: {
|
||||
java: {
|
||||
enabled: false,
|
||||
},
|
||||
cpp: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
|
||||
// edit this file. It looks like you are doing that because you have modified
|
||||
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
|
||||
// from an interface or a field from a parcelable and it broke the build. That
|
||||
// breakage is intended.
|
||||
//
|
||||
// You must not make a backward incompatible changes to the AIDL files built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
@Backing(type="long") @VintfStability
|
||||
enum BufferUsage {
|
||||
CPU_READ_MASK = 15,
|
||||
CPU_READ_NEVER = 0,
|
||||
CPU_READ_RARELY = 2,
|
||||
CPU_READ_OFTEN = 3,
|
||||
CPU_WRITE_MASK = 240,
|
||||
CPU_WRITE_NEVER = 0,
|
||||
CPU_WRITE_RARELY = 32,
|
||||
CPU_WRITE_OFTEN = 48,
|
||||
GPU_TEXTURE = 256,
|
||||
GPU_RENDER_TARGET = 512,
|
||||
COMPOSER_OVERLAY = 2048,
|
||||
COMPOSER_CLIENT_TARGET = 4096,
|
||||
PROTECTED = 16384,
|
||||
COMPOSER_CURSOR = 32768,
|
||||
VIDEO_ENCODER = 65536,
|
||||
CAMERA_OUTPUT = 131072,
|
||||
CAMERA_INPUT = 262144,
|
||||
RENDERSCRIPT = 1048576,
|
||||
VIDEO_DECODER = 4194304,
|
||||
SENSOR_DIRECT_DATA = 8388608,
|
||||
GPU_CUBE_MAP = 33554432,
|
||||
GPU_MIPMAP_COMPLETE = 67108864,
|
||||
HW_IMAGE_ENCODER = 134217728,
|
||||
GPU_DATA_BUFFER = 16777216,
|
||||
VENDOR_MASK = -268435456,
|
||||
VENDOR_MASK_HI = -281474976710656,
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
|
||||
// edit this file. It looks like you are doing that because you have modified
|
||||
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
|
||||
// from an interface or a field from a parcelable and it broke the build. That
|
||||
// breakage is intended.
|
||||
//
|
||||
// You must not make a backward incompatible changes to the AIDL files built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
@VintfStability
|
||||
parcelable HardwareBuffer {
|
||||
android.hardware.graphics.common.HardwareBufferDescription description;
|
||||
android.hardware.common.NativeHandle handle;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
|
||||
// edit this file. It looks like you are doing that because you have modified
|
||||
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
|
||||
// from an interface or a field from a parcelable and it broke the build. That
|
||||
// breakage is intended.
|
||||
//
|
||||
// You must not make a backward incompatible changes to the AIDL files built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
@VintfStability
|
||||
parcelable HardwareBufferDescription {
|
||||
int width;
|
||||
int height;
|
||||
int layers;
|
||||
android.hardware.graphics.common.PixelFormat format;
|
||||
android.hardware.graphics.common.BufferUsage usage;
|
||||
int stride;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
|
||||
// edit this file. It looks like you are doing that because you have modified
|
||||
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
|
||||
// from an interface or a field from a parcelable and it broke the build. That
|
||||
// breakage is intended.
|
||||
//
|
||||
// You must not make a backward incompatible changes to the AIDL files built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum PixelFormat {
|
||||
UNSPECIFIED = 0,
|
||||
RGBA_8888 = 1,
|
||||
RGBX_8888 = 2,
|
||||
RGB_888 = 3,
|
||||
RGB_565 = 4,
|
||||
BGRA_8888 = 5,
|
||||
YCBCR_422_SP = 16,
|
||||
YCRCB_420_SP = 17,
|
||||
YCBCR_422_I = 20,
|
||||
RGBA_FP16 = 22,
|
||||
RAW16 = 32,
|
||||
BLOB = 33,
|
||||
IMPLEMENTATION_DEFINED = 34,
|
||||
YCBCR_420_888 = 35,
|
||||
RAW_OPAQUE = 36,
|
||||
RAW10 = 37,
|
||||
RAW12 = 38,
|
||||
RGBA_1010102 = 43,
|
||||
Y8 = 538982489,
|
||||
Y16 = 540422489,
|
||||
YV12 = 842094169,
|
||||
DEPTH_16 = 48,
|
||||
DEPTH_24 = 49,
|
||||
DEPTH_24_STENCIL_8 = 50,
|
||||
DEPTH_32F = 51,
|
||||
DEPTH_32F_STENCIL_8 = 52,
|
||||
STENCIL_8 = 53,
|
||||
YCBCR_P010 = 54,
|
||||
HSV_888 = 55,
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
|
||||
/**
|
||||
* Buffer usage definitions.
|
||||
*/
|
||||
@VintfStability
|
||||
@Backing(type="long")
|
||||
enum BufferUsage {
|
||||
/** bit 0-3 is an enum */
|
||||
CPU_READ_MASK = 0xf,
|
||||
/** buffer is never read by CPU */
|
||||
CPU_READ_NEVER = 0,
|
||||
/** buffer is rarely read by CPU */
|
||||
CPU_READ_RARELY = 2,
|
||||
/** buffer is often read by CPU */
|
||||
CPU_READ_OFTEN = 3,
|
||||
|
||||
/** bit 4-7 is an enum */
|
||||
CPU_WRITE_MASK = 0xf << 4,
|
||||
/** buffer is never written by CPU */
|
||||
CPU_WRITE_NEVER = 0 << 4,
|
||||
/** buffer is rarely written by CPU */
|
||||
CPU_WRITE_RARELY = 2 << 4,
|
||||
/** buffer is often written by CPU */
|
||||
CPU_WRITE_OFTEN = 3 << 4,
|
||||
|
||||
/** buffer is used as a GPU texture */
|
||||
GPU_TEXTURE = 1 << 8,
|
||||
|
||||
/** buffer is used as a GPU render target */
|
||||
GPU_RENDER_TARGET = 1 << 9,
|
||||
|
||||
/** bit 10 must be zero */
|
||||
|
||||
/** buffer is used as a composer HAL overlay layer */
|
||||
COMPOSER_OVERLAY = 1 << 11,
|
||||
/** buffer is used as a composer HAL client target */
|
||||
COMPOSER_CLIENT_TARGET = 1 << 12,
|
||||
|
||||
/** bit 13 must be zero */
|
||||
|
||||
/**
|
||||
* Buffer is allocated with hardware-level protection against copying the
|
||||
* contents (or information derived from the contents) into unprotected
|
||||
* memory.
|
||||
*/
|
||||
PROTECTED = 1 << 14,
|
||||
|
||||
/** buffer is used as a hwcomposer HAL cursor layer */
|
||||
COMPOSER_CURSOR = 1 << 15,
|
||||
|
||||
/** buffer is used as a video encoder input */
|
||||
VIDEO_ENCODER = 1 << 16,
|
||||
|
||||
/** buffer is used as a camera HAL output */
|
||||
CAMERA_OUTPUT = 1 << 17,
|
||||
|
||||
/** buffer is used as a camera HAL input */
|
||||
CAMERA_INPUT = 1 << 18,
|
||||
|
||||
/** bit 19 must be zero */
|
||||
|
||||
/** buffer is used as a renderscript allocation */
|
||||
RENDERSCRIPT = 1 << 20,
|
||||
|
||||
/** bit 21 must be zero */
|
||||
|
||||
/** buffer is used as a video decoder output */
|
||||
VIDEO_DECODER = 1 << 22,
|
||||
|
||||
/** buffer is used as a sensor direct report output */
|
||||
SENSOR_DIRECT_DATA = 1 << 23,
|
||||
|
||||
/** buffer is used as a cube map texture */
|
||||
GPU_CUBE_MAP = 1 << 25,
|
||||
|
||||
/** buffer contains a complete mipmap hierarchy */
|
||||
GPU_MIPMAP_COMPLETE = 1 << 26,
|
||||
|
||||
/**
|
||||
* Buffer is used as input for HEIC encoder.
|
||||
*/
|
||||
HW_IMAGE_ENCODER = 1 << 27,
|
||||
|
||||
/**
|
||||
* buffer is used as as an OpenGL shader storage or uniform
|
||||
* buffer object
|
||||
*/
|
||||
GPU_DATA_BUFFER = 1 << 24,
|
||||
|
||||
/** bits 25-27 must be zero and are reserved for future versions */
|
||||
/** bits 28-31 are reserved for vendor extensions */
|
||||
VENDOR_MASK = 0xf << 28,
|
||||
|
||||
/** bits 32-47 must be zero and are reserved for future versions */
|
||||
/** bits 48-63 are reserved for vendor extensions */
|
||||
VENDOR_MASK_HI = (1L * 0xffff) << 48,
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
|
||||
import android.hardware.common.NativeHandle;
|
||||
import android.hardware.graphics.common.HardwareBufferDescription;
|
||||
|
||||
/**
|
||||
* Stable AIDL counterpart of AHardwareBuffer.
|
||||
*
|
||||
* @note This is different from the public HardwareBuffer.
|
||||
* @sa +ndk libnativewindow#AHardwareBuffer
|
||||
*/
|
||||
@VintfStability
|
||||
parcelable HardwareBuffer {
|
||||
HardwareBufferDescription description;
|
||||
NativeHandle handle;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
|
||||
import android.hardware.graphics.common.BufferUsage;
|
||||
import android.hardware.graphics.common.PixelFormat;
|
||||
|
||||
/**
|
||||
* Stable AIDL counterpart of AHardwareBuffer_Desc.
|
||||
*
|
||||
* @sa +ndk libnativewindow#AHardwareBuffer_Desc
|
||||
*/
|
||||
@VintfStability
|
||||
parcelable HardwareBufferDescription {
|
||||
int width;
|
||||
int height;
|
||||
int layers;
|
||||
PixelFormat format;
|
||||
BufferUsage usage;
|
||||
int stride;
|
||||
}
|
||||
@@ -0,0 +1,516 @@
|
||||
/*
|
||||
* Copyright 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.graphics.common;
|
||||
|
||||
/**
|
||||
* Pixel formats for graphics buffers.
|
||||
*/
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
enum PixelFormat {
|
||||
/**
|
||||
* This value may be used in an operation where the format is optional.
|
||||
*/
|
||||
UNSPECIFIED = 0,
|
||||
/**
|
||||
* 32-bit format that has 8-bit R, G, B, and A components, in that order,
|
||||
* from the lowest memory address to the highest memory address.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
RGBA_8888 = 0x1,
|
||||
|
||||
/**
|
||||
* 32-bit format that has 8-bit R, G, B, and unused components, in that
|
||||
* order, from the lowest memory address to the highest memory address.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
RGBX_8888 = 0x2,
|
||||
|
||||
/**
|
||||
* 24-bit format that has 8-bit R, G, and B components, in that order,
|
||||
* from the lowest memory address to the highest memory address.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
RGB_888 = 0x3,
|
||||
|
||||
/**
|
||||
* 16-bit packed format that has 5-bit R, 6-bit G, and 5-bit B components,
|
||||
* in that order, from the most-sigfinicant bits to the least-significant
|
||||
* bits.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
RGB_565 = 0x4,
|
||||
|
||||
/**
|
||||
* 32-bit format that has 8-bit B, G, R, and A components, in that order,
|
||||
* from the lowest memory address to the highest memory address.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
BGRA_8888 = 0x5,
|
||||
|
||||
/**
|
||||
* Legacy formats deprecated in favor of YCBCR_420_888.
|
||||
*/
|
||||
YCBCR_422_SP = 0x10, // NV16
|
||||
YCRCB_420_SP = 0x11, // NV21
|
||||
YCBCR_422_I = 0x14, // YUY2
|
||||
|
||||
/**
|
||||
* 64-bit format that has 16-bit R, G, B, and A components, in that order,
|
||||
* from the lowest memory address to the highest memory address.
|
||||
*
|
||||
* The component values are signed floats, whose interpretation is defined
|
||||
* by the dataspace.
|
||||
*/
|
||||
RGBA_FP16 = 0x16,
|
||||
|
||||
/**
|
||||
* RAW16 is a single-channel, 16-bit, little endian format, typically
|
||||
* representing raw Bayer-pattern images from an image sensor, with minimal
|
||||
* processing.
|
||||
*
|
||||
* The exact pixel layout of the data in the buffer is sensor-dependent, and
|
||||
* needs to be queried from the camera device.
|
||||
*
|
||||
* Generally, not all 16 bits are used; more common values are 10 or 12
|
||||
* bits. If not all bits are used, the lower-order bits are filled first.
|
||||
* All parameters to interpret the raw data (black and white points,
|
||||
* color space, etc) must be queried from the camera device.
|
||||
*
|
||||
* This format assumes
|
||||
* - an even width
|
||||
* - an even height
|
||||
* - a horizontal stride multiple of 16 pixels
|
||||
* - a vertical stride equal to the height
|
||||
* - strides are specified in pixels, not in bytes
|
||||
*
|
||||
* size = stride * height * 2
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::CAMERA_*
|
||||
* - BufferUsage::CPU_*
|
||||
* - BufferUsage::RENDERSCRIPT
|
||||
*
|
||||
* The mapping of the dataspace to buffer contents for RAW16 is as
|
||||
* follows:
|
||||
*
|
||||
* Dataspace value | Buffer contents
|
||||
* -------------------------------+-----------------------------------------
|
||||
* Dataspace::ARBITRARY | Raw image sensor data, layout is as
|
||||
* | defined above.
|
||||
* Dataspace::DEPTH | Unprocessed implementation-dependent raw
|
||||
* | depth measurements, opaque with 16 bit
|
||||
* | samples.
|
||||
* Other | Unsupported
|
||||
*/
|
||||
RAW16 = 0x20,
|
||||
|
||||
/**
|
||||
* BLOB is used to carry task-specific data which does not have a standard
|
||||
* image structure. The details of the format are left to the two
|
||||
* endpoints.
|
||||
*
|
||||
* A typical use case is for transporting JPEG-compressed images from the
|
||||
* Camera HAL to the framework or to applications.
|
||||
*
|
||||
* Buffers of this format must have a height of 1, and width equal to their
|
||||
* size in bytes.
|
||||
*
|
||||
* The mapping of the dataspace to buffer contents for BLOB is as
|
||||
* follows:
|
||||
*
|
||||
* Dataspace value | Buffer contents
|
||||
* -------------------------------+-----------------------------------------
|
||||
* Dataspace::JFIF | An encoded JPEG image
|
||||
* Dataspace::DEPTH | An android_depth_points buffer
|
||||
* Dataspace::SENSOR | Sensor event data.
|
||||
* Other | Unsupported
|
||||
*/
|
||||
BLOB = 0x21,
|
||||
|
||||
/**
|
||||
* A format indicating that the choice of format is entirely up to the
|
||||
* allocator.
|
||||
*
|
||||
* The allocator should examine the usage bits passed in when allocating a
|
||||
* buffer with this format, and it should derive the pixel format from
|
||||
* those usage flags. This format must never be used with any of the
|
||||
* BufferUsage::CPU_* usage flags.
|
||||
*
|
||||
* Even when the internally chosen format has an alpha component, the
|
||||
* clients must assume the alpha vlaue to be 1.0.
|
||||
*
|
||||
* The interpretation of the component values is defined by the dataspace.
|
||||
*/
|
||||
IMPLEMENTATION_DEFINED = 0x22,
|
||||
|
||||
/**
|
||||
* This format allows platforms to use an efficient YCbCr/YCrCb 4:2:0
|
||||
* buffer layout, while still describing the general format in a
|
||||
* layout-independent manner. While called YCbCr, it can be used to
|
||||
* describe formats with either chromatic ordering, as well as
|
||||
* whole planar or semiplanar layouts.
|
||||
*
|
||||
* This format must be accepted by the allocator when BufferUsage::CPU_*
|
||||
* are set.
|
||||
*
|
||||
* Buffers with this format must be locked with IMapper::lockYCbCr.
|
||||
* Locking with IMapper::lock must return an error.
|
||||
*
|
||||
* The interpretation of the component values is defined by the dataspace.
|
||||
*/
|
||||
YCBCR_420_888 = 0x23,
|
||||
|
||||
/**
|
||||
* RAW_OPAQUE is a format for unprocessed raw image buffers coming from an
|
||||
* image sensor. The actual structure of buffers of this format is
|
||||
* implementation-dependent.
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::CAMERA_*
|
||||
* - BufferUsage::CPU_*
|
||||
* - BufferUsage::RENDERSCRIPT
|
||||
*
|
||||
* The mapping of the dataspace to buffer contents for RAW_OPAQUE is as
|
||||
* follows:
|
||||
*
|
||||
* Dataspace value | Buffer contents
|
||||
* -------------------------------+-----------------------------------------
|
||||
* Dataspace::ARBITRARY | Raw image sensor data.
|
||||
* Other | Unsupported
|
||||
*/
|
||||
RAW_OPAQUE = 0x24,
|
||||
|
||||
/**
|
||||
* RAW10 is a single-channel, 10-bit per pixel, densely packed in each row,
|
||||
* unprocessed format, usually representing raw Bayer-pattern images coming from
|
||||
* an image sensor.
|
||||
*
|
||||
* In an image buffer with this format, starting from the first pixel of each
|
||||
* row, each 4 consecutive pixels are packed into 5 bytes (40 bits). Each one
|
||||
* of the first 4 bytes contains the top 8 bits of each pixel, The fifth byte
|
||||
* contains the 2 least significant bits of the 4 pixels, the exact layout data
|
||||
* for each 4 consecutive pixels is illustrated below (Pi[j] stands for the jth
|
||||
* bit of the ith pixel):
|
||||
*
|
||||
* bit 7 bit 0
|
||||
* =====|=====|=====|=====|=====|=====|=====|=====|
|
||||
* Byte 0: |P0[9]|P0[8]|P0[7]|P0[6]|P0[5]|P0[4]|P0[3]|P0[2]|
|
||||
* |-----|-----|-----|-----|-----|-----|-----|-----|
|
||||
* Byte 1: |P1[9]|P1[8]|P1[7]|P1[6]|P1[5]|P1[4]|P1[3]|P1[2]|
|
||||
* |-----|-----|-----|-----|-----|-----|-----|-----|
|
||||
* Byte 2: |P2[9]|P2[8]|P2[7]|P2[6]|P2[5]|P2[4]|P2[3]|P2[2]|
|
||||
* |-----|-----|-----|-----|-----|-----|-----|-----|
|
||||
* Byte 3: |P3[9]|P3[8]|P3[7]|P3[6]|P3[5]|P3[4]|P3[3]|P3[2]|
|
||||
* |-----|-----|-----|-----|-----|-----|-----|-----|
|
||||
* Byte 4: |P3[1]|P3[0]|P2[1]|P2[0]|P1[1]|P1[0]|P0[1]|P0[0]|
|
||||
* ===============================================
|
||||
*
|
||||
* This format assumes
|
||||
* - a width multiple of 4 pixels
|
||||
* - an even height
|
||||
* - a vertical stride equal to the height
|
||||
* - strides are specified in bytes, not in pixels
|
||||
*
|
||||
* size = stride * height
|
||||
*
|
||||
* When stride is equal to width * (10 / 8), there will be no padding bytes at
|
||||
* the end of each row, the entire image data is densely packed. When stride is
|
||||
* larger than width * (10 / 8), padding bytes will be present at the end of each
|
||||
* row (including the last row).
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::CAMERA_*
|
||||
* - BufferUsage::CPU_*
|
||||
* - BufferUsage::RENDERSCRIPT
|
||||
*
|
||||
* The mapping of the dataspace to buffer contents for RAW10 is as
|
||||
* follows:
|
||||
*
|
||||
* Dataspace value | Buffer contents
|
||||
* -------------------------------+-----------------------------------------
|
||||
* Dataspace::ARBITRARY | Raw image sensor data.
|
||||
* Other | Unsupported
|
||||
*/
|
||||
RAW10 = 0x25,
|
||||
|
||||
/**
|
||||
* RAW12 is a single-channel, 12-bit per pixel, densely packed in each row,
|
||||
* unprocessed format, usually representing raw Bayer-pattern images coming from
|
||||
* an image sensor.
|
||||
*
|
||||
* In an image buffer with this format, starting from the first pixel of each
|
||||
* row, each two consecutive pixels are packed into 3 bytes (24 bits). The first
|
||||
* and second byte contains the top 8 bits of first and second pixel. The third
|
||||
* byte contains the 4 least significant bits of the two pixels, the exact layout
|
||||
* data for each two consecutive pixels is illustrated below (Pi[j] stands for
|
||||
* the jth bit of the ith pixel):
|
||||
*
|
||||
* bit 7 bit 0
|
||||
* ======|======|======|======|======|======|======|======|
|
||||
* Byte 0: |P0[11]|P0[10]|P0[ 9]|P0[ 8]|P0[ 7]|P0[ 6]|P0[ 5]|P0[ 4]|
|
||||
* |------|------|------|------|------|------|------|------|
|
||||
* Byte 1: |P1[11]|P1[10]|P1[ 9]|P1[ 8]|P1[ 7]|P1[ 6]|P1[ 5]|P1[ 4]|
|
||||
* |------|------|------|------|------|------|------|------|
|
||||
* Byte 2: |P1[ 3]|P1[ 2]|P1[ 1]|P1[ 0]|P0[ 3]|P0[ 2]|P0[ 1]|P0[ 0]|
|
||||
* =======================================================
|
||||
*
|
||||
* This format assumes:
|
||||
* - a width multiple of 4 pixels
|
||||
* - an even height
|
||||
* - a vertical stride equal to the height
|
||||
* - strides are specified in bytes, not in pixels
|
||||
*
|
||||
* size = stride * height
|
||||
*
|
||||
* When stride is equal to width * (12 / 8), there will be no padding bytes at
|
||||
* the end of each row, the entire image data is densely packed. When stride is
|
||||
* larger than width * (12 / 8), padding bytes will be present at the end of
|
||||
* each row (including the last row).
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::CAMERA_*
|
||||
* - BufferUsage::CPU_*
|
||||
* - BufferUsage::RENDERSCRIPT
|
||||
*
|
||||
* The mapping of the dataspace to buffer contents for RAW12 is as
|
||||
* follows:
|
||||
*
|
||||
* Dataspace value | Buffer contents
|
||||
* -------------------------------+-----------------------------------------
|
||||
* Dataspace::ARBITRARY | Raw image sensor data.
|
||||
* Other | Unsupported
|
||||
*/
|
||||
RAW12 = 0x26,
|
||||
|
||||
/** 0x27 to 0x2A are reserved for flexible formats */
|
||||
|
||||
/**
|
||||
* 32-bit packed format that has 2-bit A, 10-bit B, G, and R components,
|
||||
* in that order, from the most-sigfinicant bits to the least-significant
|
||||
* bits.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
RGBA_1010102 = 0x2B,
|
||||
|
||||
/**
|
||||
* 0x100 - 0x1FF
|
||||
*
|
||||
* This range is reserved for vendor extensions. Formats in this range
|
||||
* must support BufferUsage::GPU_TEXTURE. Clients must assume they do not
|
||||
* have an alpha component.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Y8 is a YUV planar format comprised of a WxH Y plane, with each pixel
|
||||
* being represented by 8 bits. It is equivalent to just the Y plane from
|
||||
* YV12.
|
||||
*
|
||||
* This format assumes
|
||||
* - an even width
|
||||
* - an even height
|
||||
* - a horizontal stride multiple of 16 pixels
|
||||
* - a vertical stride equal to the height
|
||||
*
|
||||
* size = stride * height
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::CAMERA_*
|
||||
* - BufferUsage::CPU_*
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
Y8 = 0x20203859,
|
||||
|
||||
/**
|
||||
* Y16 is a YUV planar format comprised of a WxH Y plane, with each pixel
|
||||
* being represented by 16 bits. It is just like Y8, but has double the
|
||||
* bits per pixel (little endian).
|
||||
*
|
||||
* This format assumes
|
||||
* - an even width
|
||||
* - an even height
|
||||
* - a horizontal stride multiple of 16 pixels
|
||||
* - a vertical stride equal to the height
|
||||
* - strides are specified in pixels, not in bytes
|
||||
*
|
||||
* size = stride * height * 2
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::CAMERA_*
|
||||
* - BufferUsage::CPU_*
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace. When the dataspace is
|
||||
* Dataspace::DEPTH, each pixel is a distance value measured by a depth
|
||||
* camera, plus an associated confidence value.
|
||||
*/
|
||||
Y16 = 0x20363159,
|
||||
|
||||
/**
|
||||
* YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed
|
||||
* by (W/2) x (H/2) Cr and Cb planes.
|
||||
*
|
||||
* This format assumes
|
||||
* - an even width
|
||||
* - an even height
|
||||
* - a horizontal stride multiple of 16 pixels
|
||||
* - a vertical stride equal to the height
|
||||
*
|
||||
* y_size = stride * height
|
||||
* c_stride = ALIGN(stride/2, 16)
|
||||
* c_size = c_stride * height/2
|
||||
* size = y_size + c_size * 2
|
||||
* cr_offset = y_size
|
||||
* cb_offset = y_size + c_size
|
||||
*
|
||||
* This range is reserved for vendor extensions. Formats in this range
|
||||
* must support BufferUsage::GPU_TEXTURE. Clients must assume they do not
|
||||
* have an alpha component.
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::CAMERA_*
|
||||
* - BufferUsage::CPU_*
|
||||
* - BufferUsage::GPU_TEXTURE
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
YV12 = 0x32315659, // YCrCb 4:2:0 Planar
|
||||
|
||||
/**
|
||||
* 16-bit format that has a single 16-bit depth component.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
DEPTH_16 = 0x30,
|
||||
|
||||
/**
|
||||
* 32-bit format that has a single 24-bit depth component and, optionally,
|
||||
* 8 bits that are unused.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
DEPTH_24 = 0x31,
|
||||
|
||||
/**
|
||||
* 32-bit format that has a 24-bit depth component and an 8-bit stencil
|
||||
* component packed into 32-bits.
|
||||
*
|
||||
* The depth component values are unsigned normalized to the range [0, 1],
|
||||
* whose interpretation is defined by the dataspace. The stencil values are
|
||||
* unsigned integers, whose interpretation is defined by the dataspace.
|
||||
*/
|
||||
DEPTH_24_STENCIL_8 = 0x32,
|
||||
|
||||
/**
|
||||
* 32-bit format that has a single 32-bit depth component.
|
||||
*
|
||||
* The component values are signed floats, whose interpretation is defined
|
||||
* by the dataspace.
|
||||
*/
|
||||
DEPTH_32F = 0x33,
|
||||
|
||||
/**
|
||||
* Two-component format that has a 32-bit depth component, an 8-bit stencil
|
||||
* component, and optionally 24-bits unused.
|
||||
*
|
||||
* The depth component values are signed floats, whose interpretation is
|
||||
* defined by the dataspace. The stencil bits are unsigned integers, whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
DEPTH_32F_STENCIL_8 = 0x34,
|
||||
|
||||
/**
|
||||
* 8-bit format that has a single 8-bit stencil component.
|
||||
*
|
||||
* The component values are unsigned integers, whose interpretation is
|
||||
* defined by the dataspace.
|
||||
*/
|
||||
STENCIL_8 = 0x35,
|
||||
|
||||
/**
|
||||
* P010 is a 4:2:0 YCbCr semiplanar format comprised of a WxH Y plane
|
||||
* followed immediately by a Wx(H/2) CbCr plane. Each sample is
|
||||
* represented by a 16-bit little-endian value, with the lower 6 bits set
|
||||
* to zero.
|
||||
*
|
||||
* This format assumes
|
||||
* - an even height
|
||||
* - a vertical stride equal to the height
|
||||
*
|
||||
* stride_in_bytes = stride * 2
|
||||
* y_size = stride_in_bytes * height
|
||||
* cbcr_size = stride_in_bytes * (height / 2)
|
||||
* cb_offset = y_size
|
||||
* cr_offset = cb_offset + 2
|
||||
*
|
||||
* This format must be accepted by the allocator when used with the
|
||||
* following usage flags:
|
||||
*
|
||||
* - BufferUsage::VIDEO_*
|
||||
* - BufferUsage::CPU_*
|
||||
* - BufferUsage::GPU_TEXTURE
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*
|
||||
* This format is appropriate for 10bit video content.
|
||||
*
|
||||
* Buffers with this format must be locked with IMapper::lockYCbCr
|
||||
* or with IMapper::lock.
|
||||
*/
|
||||
YCBCR_P010 = 0x36,
|
||||
|
||||
/**
|
||||
* 24-bit format that has 8-bit H, S, and V components, in that order,
|
||||
* from the lowest memory address to the highest memory address.
|
||||
*
|
||||
* The component values are unsigned normalized to the range [0, 1], whose
|
||||
* interpretation is defined by the dataspace.
|
||||
*/
|
||||
HSV_888 = 0x37,
|
||||
}
|
||||
Reference in New Issue
Block a user