Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.camera.sensor

PROTOCOLS

CameraSensor2

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

Exposes a product-agnostic interface to the camera's sensor. Allows clients to get and set sensor constraints, sensor mode, and its dynamic operating state.

Most methods provide a zx.status return value. This can be: ZX_OK - The operation was successful. ZX_ERR_INTERNAL - The sensor has not been initialized or has encountered an otherwise unspecified error. ZX_ERR_NOT_SUPPORTED - The operation is not supported on the current device. ZX_ERR_INVALID_ARGS - Invalid args for this operation. ZX_ERR_OUT_OF_RANGE - Args fall outside of min/max constraints. ZX_ERR_BUFFER_TOO_SMALL - Buffer provided cannot hold all required data. ZX_ERR_IO_NOT_PRESENT - There is no sensor device present or bound.

DeInit

De-Initializes the sensor.

Request

NameType

Response

NameType

GetAnalogGain

Retrieve analog gain value.

Request

NameType

Response

NameType
s zx/status
gain float32

GetAvailableModes

Retrieve a vector of available modes.

Request

NameType

Response

NameType
s zx/status
modes vector<OperatingMode>

GetDigitalGain

Retrieve digital gain value.

Request

NameType

Response

NameType
s zx/status
gain float32

GetExtensionValue

This subset of the API provides implementers with the flexibility to provide custom endpoints for elements not otherwise included. Retrieves the specified element. The caller must reference the implementer's ID list.

Request

NameType
id uint64

Response

NameType
s zx/status
value ExtensionValueDataType

GetIntegrationTime

Retrieve integration time value.

Request

NameType

Response

NameType
s zx/status
int_time float32

GetOtpData

Retrieve the specified amount of OTP data at the offset and write them to the provided vmo.

Request

NameType
byte_count uint32
offset uint32

Response

NameType
s zx/status
otp_data handle<vmo>

GetOtpSize

Retrieve the total size of the data stored in the OTP module.

Request

NameType

Response

NameType
s zx/status
size uint32

GetSensorId

Retrieves the sensor's ID.

Request

NameType

Response

NameType
s zx/status
id uint32

GetTestCursorData

Retrieves the test cursor data being used.

Request

NameType

Response

NameType
s zx/status
data fuchsia.hardware.camera/Rect

GetTestPatternData

Retrieves the test pattern data being used.

Request

NameType

Response

NameType
s zx/status
data fuchsia.hardware.camera/ColorVal

GetTestPatternMode

Retrieves the test pattern mode the sensor is set to. 0 – No pattern (default) 1 – Solid colour 2 – 100% colour bars 3 – Fade to grey’ colour bars 4 - PN9 5-255 - Reserved 256-65535 – Manufacturer specific

Request

NameType

Response

NameType
s zx/status
value uint16

Init

Initializes the sensor.

Request

NameType

Response

NameType
s zx/status

SetAnalogGain

Changes analog gain value.

Request

NameType
gain float32

Response

NameType
s zx/status
gain float32

SetDigitalGain

Changes digital gain value.

Request

NameType
gain float32

Response

NameType
s zx/status
gain float32

SetExtensionValue

This subset of the API provides implementers with the flexibility to provide custom endpoints for elements not otherwise included. Changes the specified element. The caller must reference the implementer's ID list.

Request

NameType
id uint64
value ExtensionValueDataType

Response

NameType
s zx/status
value ExtensionValueDataType

SetIntegrationTime

Changes Integration Time.

Request

NameType
int_time float32

Response

NameType
s zx/status
int_time float32

SetMode

Use a specific mode for the initialization sequence.

Request

NameType
mode uint32

Response

NameType
s zx/status

SetTestCursorData

Changes the sensor's cursor-related parameters.

Request

NameType
data fuchsia.hardware.camera/Rect

Response

NameType
s zx/status

SetTestPatternData

Changes data used by the test pattern. Only used by certain modes.

Request

NameType
data fuchsia.hardware.camera/ColorVal

Response

NameType
s zx/status

SetTestPatternMode

Changes the sensor's test pattern mode.

Request

NameType
mode uint16

Response

NameType
s zx/status

StartStreaming

Start streaming. Is safe to call this if streaming is already started.

Request

NameType

Response

NameType
s zx/status

StopStreaming

Stop streaming. It is safe to call this if streaming is already stopped.

Request

NameType

Response

NameType

Update

Update the sensor with new parameters.

Request

NameType

Response

NameType
s zx/status

STRUCTS

FrameRateInfo

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

This structure maps the sensor's frame rates to coarse max integration time.

NameTypeDescriptionDefault
frame_rate fuchsia.hardware.camera/FrameRate No default
max_coarse_integration_time uint32 No default

OperatingMode

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

A sensor can support several different predefined modes. This structure keeps all necessary information about a mode.

NameTypeDescriptionDefault
idx uint8

This mode's index.

No default
identifier string

This mode's identifying string.

No default
fps uint32

Maximum frames per second.

No default
resolution_in fuchsia.hardware.camera/Dimensions

Input resolution, where |x| is pixel width and |y| is pixel height.

No default
resolution_out fuchsia.hardware.camera/Dimensions

Output resolution, where |x| is pixel width and |y| is pixel height.

No default
exposures uint8

How many exposures this mode supports.

No default
dr_mode DynamicRangeMode

A mode that reflects what dynamic range technique is being used.

No default
pixel_type PixelType

The pixel type (e.g. whether the output is in RAW8, RAW10, etc. format).

No default
lanes uint8

Lane count.

No default
mbps uint32

MBps per lane.

No default
line_time float32

Line time.

No default
frame_time float32

Frame time.

No default
readout ReadoutConfig

A structure containing information on binning, skipping, and scaling operations carried out on frame data.

No default

ReadoutConfig

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

NameTypeDescriptionDefault
sampling_x SamplingParams

Describes sampling parameters for the x plane.

No default
sampling_y SamplingParams

Describes sampling parameters for the y plane.

No default
scaler_crop fuchsia.hardware.camera/Rect

The x and y offset as well as the width and height for cropping.

No default

SamplingParams

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

NameTypeDescriptionDefault
mode BinningMode No default
bin_amount uint32 No default
skip_amount uint32 No default

ENUMS

BinningMode

Type: uint8

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

NameValueDescription
NONE 1
ADDITIVE 2
AVERAGE 3

DynamicRangeMode

Type: uint8

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

NameValueDescription
LINEAR 1
WIDE 2

PixelType

Type: uint8

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

NameValueDescription
RAW8 1
RAW10 2
RAW12 3

UNIONS

ExtensionValueDataType

Defined in fuchsia.hardware.camera.sensor/camera-sensor.fidl

A type used to distinguish extension parameters.

NameTypeDescription
int_value int32
uint_value uint32
byte_array_value uint8[32]
dimension_value fuchsia.hardware.camera/Dimensions
constraints_value fuchsia.hardware.camera/MinMaxConstraints
frame_rate_info_value [32]

CONSTANTS

NameValueTypeDescription
EXTENSION_VALUE_ARRAY_LEN 32 uint32