fuchsia.camera3

PROTOCOLS

Device

Defined in fuchsia.camera3/device.fidl

A Device represents a unique physical camera present in the system. Only one client may connect to an unbound physical camera, however the "Rebind" method can be used to create multiple connections to it to be used by a coordinated set of clients.

GetIdentifier

Returns an identifier for the camera. If present, identical devices on different systems will have the same identifier. Clients may use this to determine if additional semantics known a priori for a given device apply to the current camera.

Request

NameType

Response

NameType
identifier string[256]?

GetConfigurations

Returns a list of configurations supported by the camera. All cameras will have at least one configuration. The values returned are immutable - they will not change for the lifetime of the client's connection to the Camera.

Request

NameType

Response

NameType
configurations vector<Configuration>[256]

WatchCurrentConfiguration

Returns the index of the current configuration when it has changed from a previously returned configuration, or is called by a client for the first time.

Request

NameType

Response

NameType
index uint32

SetCurrentConfiguration

Sets the configuration using the provided index. Calling this method disconnects any existing Stream clients associated with this camera.

Request

NameType
index uint32

WatchMuteState

Returns the camera's current mute state when it has changed from a previously returned state, or is called by a client for the first time. A camera may be muted using SetSoftwareMuteState or by a physical switch. If either muted mode is active, stream clients associated with this physical camera will stop receiving new frames.

Request

NameType

Response

NameType
software_muted bool
hardware_muted bool

SetSoftwareMuteState

Sets the current camera's software mute state. When transitioning to the muted state, this method returns when the camera has successfully ceased sending new frames to stream clients. When transitioning to the unmuted state, this method returns immediately.

Request

NameType
muted bool

Response

NameType

ConnectToStream

Connects to the Stream at the provided stream, using the provided token to negotiate buffers. If any clients already exist for this stream, the request is closed with the ZX_ERR_ALREADY_BOUND epitaph.

Request

NameType
index uint32
token fuchsia.sysmem/BufferCollectionToken
request request<Stream>

Rebind

Request another connection to this Device. This allows a client to delegate different operations to different coordinated clients.

Request

NameType
request request<Device>

DeviceWatcher

Defined in fuchsia.camera3/device_watcher.fidl

The DeviceWatcher provides clients a mechanism to discover camera devices present on the system. This is a temporary mechanism intended to be replaced by go/drivers-as-components, which will allow multiple instances of the same protocol to exist side-by-side. Clients are not required to maintain a connection to the Watcher in order to use established Camera connections.

WatchDevices

Returns a list of available camera IDs when it has changed from the previously returned list of IDs, or when it is called by a client for the first time. The returned list may be empty, indicating no cameras are available. The IDs returned to the client will remain consistent with respect to the physical devices they represent for the duration of the client's connection. Events will be sorted first by event type - |existing|, |added|, |removed|. Within each event type range, IDs will be provided in ascending order. Events are coalesced by the server, so a given ID will only appear once in each list of events.

Request

NameType

Response

NameType
events vector<WatchDevicesEvent>[256]

ConnectToDevice

Acquires a camera interface for the given ID. If any clients already exist for this camera, the request is closed with the ZX_ERR_ALREADY_BOUND epitaph.

Request

NameType
id DeviceId
request request<Device>

Stream

Defined in fuchsia.camera3/stream.fidl

A Stream represents timing, sequencing, and other camera-specific properties that apply to a set of buffers.

SetCropRegion

Sets the Stream's crop region to the provided region, with the top-left of the image represented by (0,0) and the bottom-right of the image represented by (1,1). The resulting content is subsequently scaled to fill the output buffer. If the implementation does not precisely support the provided value, it will be expanded to the minimum region that covers the provided region. If region is set to null, the crop region is unset, which is equivalent to specifying a region covering the entire image. Upon initial connection, the region is unset. Frames requested after calling this method will return with the new region, however previously sent frames may still be in flight using the previous region. If the stream does not support crop region, the connection is closed with the ZX_ERR_NOT_SUPPORTED epitaph.

Request

NameType
region fuchsia.math/RectF?

WatchCropRegion

Returns the crop region if it has changed from a previously returned value, or is called by a client for the first time. Frame callbacks received after receiving this callback reflect the use of the new region. See SetCropRegion for a description of the region parameter.

Request

NameType

Response

NameType
region fuchsia.math/RectF?

SetResolution

Sets the resolution of the stream to the provided index. Frames requested after calling this method will return with the new resolution, however previously sent frames may still be in flight using the previous resolution. Upon initial connection, the resolution used is index 0.

Request

NameType
index uint32

WatchResolution

Returns the resolution index if it has changed from a previously returned value, or is called by a client for the first time. Frame callbacks received after receiving this callback reflect the new resolution.

Request

NameType

Response

NameType
index uint32

GetNextFrame

Request the next available frame for this stream. Returns when the stream has completed populating the buffer and may be read by the client, provided the number of unreleased buffers held by the client is less than the count provided in the buffer collection token used to connect to this stream.

Request

NameType

Response

NameType
info FrameInfo

Rebind

Request another connection to this Stream. This allows a client to delegate different operations to different coordinated clients.

Request

NameType
request request<Stream>

STRUCTS

SomeLongAnonymousPrefix1

generated

anonymous struct

NameTypeDescriptionDefault
identifier string[256]? No default

SomeLongAnonymousPrefix3

generated

anonymous struct

NameTypeDescriptionDefault
configurations vector<Configuration>[256] No default

SomeLongAnonymousPrefix5

generated

anonymous struct

NameTypeDescriptionDefault
index uint32 No default

SomeLongAnonymousPrefix6

generated

anonymous struct

NameTypeDescriptionDefault
index uint32 No default

SomeLongAnonymousPrefix8

generated

anonymous struct

NameTypeDescriptionDefault
software_muted bool No default
hardware_muted bool No default

SomeLongAnonymousPrefix9

generated

anonymous struct

NameTypeDescriptionDefault
muted bool No default

SomeLongAnonymousPrefix11

generated

anonymous struct

NameTypeDescriptionDefault
index uint32 No default
token fuchsia.sysmem/BufferCollectionToken No default
request request<Stream> No default

SomeLongAnonymousPrefix12

generated

anonymous struct

NameTypeDescriptionDefault
request request<Device> No default

Configuration

Defined in fuchsia.camera3/device.fidl

Describes a distinct configuration for the camera.

NameTypeDescriptionDefault
streams vector<StreamProperties>[256]

Descriptions of streams that are concurrently available in the configuration.

No default

SomeLongAnonymousPrefix14

generated

anonymous struct

NameTypeDescriptionDefault
events vector<WatchDevicesEvent>[256] No default

SomeLongAnonymousPrefix15

generated

anonymous struct

NameTypeDescriptionDefault
id DeviceId No default
request request<Device> No default

SomeLongAnonymousPrefix16

generated

anonymous struct

NameTypeDescriptionDefault
region fuchsia.math/RectF? No default

SomeLongAnonymousPrefix18

generated

anonymous struct

NameTypeDescriptionDefault
region fuchsia.math/RectF? No default

SomeLongAnonymousPrefix19

generated

anonymous struct

NameTypeDescriptionDefault
index uint32 No default

SomeLongAnonymousPrefix21

generated

anonymous struct

NameTypeDescriptionDefault
index uint32 No default

SomeLongAnonymousPrefix23

generated

anonymous struct

NameTypeDescriptionDefault
info FrameInfo No default

SomeLongAnonymousPrefix24

generated

anonymous struct

NameTypeDescriptionDefault
request request<Stream> No default

FrameInfo

Defined in fuchsia.camera3/stream.fidl

Metadata concerning a given frame.

NameTypeDescriptionDefault
buffer_index uint32

The buffer index of the associated buffer collection.

No default
frame_counter uint64

A monotonically increasing counter indicating the number of frames written to buffers associated with this stream's buffer collection. Clients can use this to detect dropped frames, or generate nominal timestamps using the associated stream's framerate.

No default
timestamp zx/time

The value of the system monotonic clock, measured at the time the hardware completed populating the buffer.

No default
release_fence handle<eventpair>

The client must close this when it has completed reading from the buffer.

No default

Resolution

Defined in fuchsia.camera3/stream.fidl

Properties describing image data in a buffer.

NameTypeDescriptionDefault
coded_size fuchsia.math/Size

Extents of the image in pixels.

No default
bytes_per_row uint32

The number of bytes between each row in the image. This may be larger than the value implied by the image width.

No default

FrameRate

Defined in fuchsia.camera3/stream.fidl

The frequency at which a Stream produces frames. The value is |numerator| / |denominator|, with units of frames-per-second (Hz). The representation is not necessarily an irreducible fraction.

NameTypeDescriptionDefault
numerator uint32

Fraction numerator.

No default
denominator uint32

Fraction denominator. This value will not be zero.

No default

StreamProperties

Defined in fuchsia.camera3/stream.fidl

Describes the properties of a given stream.

NameTypeDescriptionDefault
image_format fuchsia.sysmem/ImageFormat_2

Describes the image format used by a stream. The resolution indicated has the same values as the first element of supported_resolutions (below).

No default
frame_rate FrameRate

Describes the framerate used by a stream.

No default
supported_resolutions vector<Resolution>[1024]

Describes the supported resolutions of a stream. Elements are provided in decreasing order of total coded pixels (i.e. width * height). All streams will have at least one supported resolution, and that resolution will match that specified by image_format.

No default
supports_crop_region bool

Indicates whether a stream supports the SetCropRegion method.

No default

UNIONS

WatchDevicesEvent

Defined in fuchsia.camera3/device_watcher.fidl

NameTypeDescription
existing DeviceId

Indicates an existing camera with the provided ID is still available.

added DeviceId

Indicates a new camera with the provided ID is now available.

removed DeviceId

Indicates an existing camera with the provided ID is no longer available.

CONSTANTS

NameValueTypeDescription
MAX_IDENTIFIER_LENGTH 256 uint32
MAX_CONFIGURATIONS_PER_CAMERA 256 uint32
MAX_STREAMS_PER_CONFIGURATION 256 uint32
MAX_RESOLUTIONS_PER_STREAM 1024 uint32
MAX_WATCH_DEVICES_EVENTS 256 uint32

TYPE ALIASES

NameValueDescription
DeviceId uint64