Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4728fc48 authored by Austin Borger's avatar Austin Borger
Browse files

Create API for reporting color space support to Camera2 framework consumers.

Test: Ran CtsCameraTestCases.
Test: Ran VtsAidlHalCameraProvider_TargetTest.
Test: Created app to test display P3 camera, switching between color spaces
Bug: 238359088
Change-Id: I382dea5d13582817959001246240141e83d8172d
parent c8074521
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -15,9 +15,9 @@ aidl_interface {
    imports: [
        "android.hardware.common-V2",
        "android.hardware.common.fmq-V1",
        "android.hardware.camera.common",
        "android.hardware.camera.metadata",
        "android.hardware.graphics.common",
        "android.hardware.camera.common-V1",
        "android.hardware.camera.metadata-V2",
        "android.hardware.graphics.common-V3",
    ],
    backend: {
        cpp: {
+1 −0
Original line number Diff line number Diff line
@@ -48,4 +48,5 @@ parcelable Stream {
  android.hardware.camera.metadata.SensorPixelMode[] sensorPixelModesUsed;
  android.hardware.camera.metadata.RequestAvailableDynamicRangeProfilesMap dynamicRangeProfile;
  android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase;
  int colorSpace;
}
+22 −3
Original line number Diff line number Diff line
@@ -98,14 +98,18 @@ parcelable Stream {
     *
     * For most formats, dataSpace defines the color space of the image data.
     * In addition, for some formats, dataSpace indicates whether image- or
     * depth-based data is requested. See
     * android.hardware.graphics.common@1.0::types for details of formats and
     * valid dataSpace values for each format.
     * depth-based data is requested. For others, it merely describes an encoding
     * scheme. See android.hardware.graphics.common@1.0::types for details of formats
     * and valid dataSpace values for each format.
     *
     * The HAL must use this dataSpace to configure the stream to the correct
     * colorspace, or to select between color and depth outputs if
     * supported. The dataspace values are set using the V0 dataspace
     * definitions.
     *
     * The color space implied by dataSpace should be overridden by colorSpace if
     * the device supports the REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES
     * capability.
     */
    android.hardware.graphics.common.Dataspace dataSpace;

@@ -222,4 +226,19 @@ parcelable Stream {
     * DEFAULT.
     */
    android.hardware.camera.metadata.ScalerAvailableStreamUseCases useCase;

    /**
     * The color space of the stream.
     *
     * A client may not specify a color space. In this case, the value will be
     * ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED, and the color space
     * implied by dataSpace should be used instead.
     *
     * When specified, this field is the ultimate authority over the color space of the stream,
     * regardless of dataSpace. The purpose of this field is to support specifying wide gamut
     * color spaces for dataSpace values such as JFIF and HEIF.
     *
     * Possible values are the ordinals of the ColorSpace.Named enum in the public-facing API.
     */
    int colorSpace;
}
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ enum CameraMetadataTag {
  ANDROID_REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION = 786450,
  ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = 786451,
  ANDROID_REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE = 786452,
  ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP = 786453,
  ANDROID_SCALER_CROP_REGION = 851968,
  ANDROID_SCALER_AVAILABLE_FORMATS = 851969,
  ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS = 851970,
+1 −0
Original line number Diff line number Diff line
@@ -58,4 +58,5 @@ enum RequestAvailableCapabilities {
  ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING = 17,
  ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT = 18,
  ANDROID_REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE = 19,
  ANDROID_REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES = 20,
}
Loading