PROTOCOLS
Control
Defined in fuchsia.camera/camera.fidl
These are the original interfaces, which are being used for compatibility. The names are preserved from the ones in camera.h for porting ease.
CreateStream
Sent by the client to indicate desired stream characteristics.
If setting the format is successful, the stream request will be honored.
The stream token is used to provide additional control over the interface from the
Camera Manager. The driver provides the guarantee that:
1) If the stream token receives the PEER_CLOSED
event, the driver will close
the stream.
2) If the Stream interface is closed, the driver will close the eventpair.
Request
Name | Type |
---|---|
buffer_collection |
fuchsia.sysmem/BufferCollectionInfo
|
rate |
FrameRate
|
stream |
server_end:Stream
|
stream_token |
handle<eventpair>
|
GetDeviceInfo
Request
<EMPTY>
Response
Name | Type |
---|---|
device_info |
DeviceInfo
|
GetFormats
Get the available format types for this device
NOTE: The formats are paginated to MAX_FORMATS_PER_RESPONSE
, multiple
GetFormats need to be issued until total_format_count are received
Request
Name | Type |
---|---|
index |
uint32
|
Response
Name | Type |
---|---|
formats |
vector<VideoFormat>
|
total_format_count |
uint32
|
status |
zx/Status
|
Manager
Defined in fuchsia.camera/manager.fidl
The Camera Manager grants access to individual or sets of cameras
- You request the list of cameras, which gives you camera descriptions
- You request the list of formats available for the camera to which you wish to connect.
- You request a Stream interface using CreateStream.
CreateStream
Create a Stream with the specified access rights. This may not succeed.
If it does succeed, the Stream will have the rights indicated.
buffer_info
contains a set of buffers to be used with the Stream.
This is being deprecated - please use CreateStreamV2.
Request
Name | Type |
---|---|
request |
VideoStream
|
buffer_info |
fuchsia.sysmem/BufferCollectionInfo
|
stream |
server_end:Stream
|
client_token |
handle<eventpair>
|
CreateStreamV2
Create a Stream with the specified access rights. This may not succeed.
If it does succeed, the Stream will have the rights indicated.
buffer_info
contains a set of buffers to be used with the Stream.
Request
Name | Type |
---|---|
request |
VideoStreamV2
|
buffer_info |
fuchsia.sysmem/BufferCollectionInfo
|
stream |
server_end:Stream
|
client_token |
handle<eventpair>
|
GetDevices
Returns a list of all the video devices that are currently plugged in and enumerated. The camera_id field of the DeviceInfo is used to specify a device in GetFormats, GetStream and GetStreamAndBufferCollection.
Request
<EMPTY>
Response
Name | Type |
---|---|
descriptions |
vector<DeviceInfo>
|
GetFormats
Get all the available formats for a camera.
camera_id
is obtained from a DeviceInfo returned by GetDevices.
Request
Name | Type |
---|---|
camera_id |
uint64
|
index |
uint32
|
Response
Name | Type |
---|---|
formats |
vector<VideoFormat>
|
total_format_count |
uint32
|
Stream
Defined in fuchsia.camera/camera.fidl
OnFrameAvailable
Sent by the driver to the client when a frame is available for processing, or an error occurred.
Response
Name | Type |
---|---|
frame |
FrameAvailableEvent
|
ReleaseFrame
Unlocks the specified frame, allowing the driver to reuse the memory.
Request
Name | Type |
---|---|
buffer_id |
uint32
|
Start
Starts the streaming of frames.
Request
<EMPTY>
Stop
Stops the streaming of frames.
Request
<EMPTY>
STRUCTS
DeviceInfo
Defined in fuchsia.camera/camera.fidl
Identifying information about the device.
Field | Type | Description | Default |
---|---|---|---|
camera_id |
uint64
|
No default | |
vendor_id |
uint16
|
No default | |
vendor_name |
string
|
No default | |
product_id |
uint16
|
No default | |
product_name |
string
|
No default | |
max_stream_count |
uint16
|
The maximum number of stream interfaces that the device can support simultaneously. |
No default |
output_capabilities |
uint32
|
No default |
FrameAvailableEvent
Defined in fuchsia.camera/camera.fidl
Sent by the driver to the client when a frame is available for processing, or an error occurred.
Field | Type | Description | Default |
---|---|---|---|
frame_status |
FrameStatus
|
Non zero if an error occurred. |
No default |
buffer_id |
uint32
|
The index of the buffer in the buffer collection. |
No default |
metadata |
Metadata
|
No default |
FrameRate
Defined in fuchsia.camera/camera.fidl
Field | Type | Description | Default |
---|---|---|---|
frames_per_sec_numerator |
uint32
|
The frame rate is frames_per_sec_numerator / frames_per_sec_denominator. |
No default |
frames_per_sec_denominator |
uint32
|
No default |
Metadata
Defined in fuchsia.camera/camera.fidl
Field | Type | Description | Default |
---|---|---|---|
timestamp |
int64
|
No default | |
data_size |
uint32
|
Added: 11
|
No default |
VideoFormat
Defined in fuchsia.camera/camera.fidl
Field | Type | Description | Default |
---|---|---|---|
format |
fuchsia.sysmem/ImageFormat
|
No default | |
rate |
FrameRate
|
No default |
VideoStream
Defined in fuchsia.camera/manager.fidl
A stream that the camera manager can provide. Video streams reference a a camera, but may have additional hardware and bandwidth restrictions from and ISP or other processing units. This is being deprecated - please use VideoStreamV2 (below).
Field | Type | Description | Default |
---|---|---|---|
camera_id |
uint64
|
The camera_id corresponds to the camera_id that is given in the DeviceInfo received from GetDevices. |
No default |
format |
VideoFormat
|
The requested video format. Note that this is field is necessary to set The frame rate, even when calling CreateStream. When calling CreateStream, format.format should match buffer_info.format. |
No default |
VideoStreamV2
Defined in fuchsia.camera/manager.fidl
Preferred version of stream. A version of stream that relies on definition of VideoFormat coming out of fuchsia.hardware.camera. Streams reference a camera, but may have additional hardware and bandwidth restrictions from an ISP or other processing units. New code should depend on this as the other version will be deprecated when dependencies are removed.
Field | Type | Description | Default |
---|---|---|---|
camera_id |
uint64
|
The camera_id corresponds to the camera_id that is given in DeviceInfo received from GetDevices. |
No default |
format |
VideoFormat
|
The requested video format. Note that this field is necessary to set the frame rate, even when calling CreateStream. When calling CreateStream format.format should match buffer_info.format. |
No default |
ENUMS
FrameStatus strict
Type: uint32
Defined in fuchsia.camera/camera.fidl
Status to be set when a frame is signalled available.
Name | Value | Description |
---|---|---|
OK |
0 |
|
ERROR_FRAME |
1 |
An error occurred during the production of a frame. No data will be available in the data buffer corresponding to this notification. |
ERROR_BUFFER_FULL |
2 |
No space was available in the data buffer, resulting in a dropped frame. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
CAMERA_OUTPUT_BURST |
2
|
uint32 |
|
CAMERA_OUTPUT_DEPTH |
16
|
uint32 |
|
CAMERA_OUTPUT_HDR |
8
|
uint32 |
|
CAMERA_OUTPUT_STEREO |
32
|
uint32 |
|
CAMERA_OUTPUT_STILL_IMAGE |
1
|
uint32 |
|
CAMERA_OUTPUT_STREAM |
4
|
uint32 |
|
CAMERA_OUTPUT_UNKNOWN |
0
|
uint32 |
A coarse set of capabilities. This struct is used in the camera description to help filter out cameras which will not have the needed capabilities. This set of declarations would be the bitfield: CameraOutputCapabilities. |
MAX_FORMATS_PER_RESPONSE |
16
|
uint32 |