blob: 606be25b00d9473647ef3a369cbd991bed529fc3 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.camera
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## Control {#Control}
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=83)*
<p>These are the original interfaces, which are being used for compatibility.
The names are preserved from the ones in camera.h for porting ease.</p>
### CreateStream {#Control.CreateStream}
<p>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 <code>PEER_CLOSED</code> event, the driver will close
the stream.
2) If the Stream interface is closed, the driver will close the eventpair.</p>
#### Request {#Control.CreateStream_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>buffer_collection</code></td>
<td>
<code><a class='link' href='../fuchsia.sysmem/'>fuchsia.sysmem</a>/<a class='link' href='../fuchsia.sysmem/#BufferCollectionInfo'>BufferCollectionInfo</a></code>
</td>
</tr>
<tr>
<td><code>rate</code></td>
<td>
<code><a class='link' href='#FrameRate'>FrameRate</a></code>
</td>
</tr>
<tr>
<td><code>stream</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Stream'>Stream</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>stream_token</code></td>
<td>
<code>handle&lt;eventpair&gt;</code>
</td>
</tr>
</table>
### GetDeviceInfo {#Control.GetDeviceInfo}
#### Request {#Control.GetDeviceInfo_Request}
&lt;EMPTY&gt;
#### Response {#Control.GetDeviceInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>device_info</code></td>
<td>
<code><a class='link' href='#DeviceInfo'>DeviceInfo</a></code>
</td>
</tr>
</table>
### GetFormats {#Control.GetFormats}
<p>Get the available format types for this device
NOTE: The formats are paginated to <code>MAX_FORMATS_PER_RESPONSE</code>, multiple
GetFormats need to be issued until total_format_count are received</p>
#### Request {#Control.GetFormats_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>index</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
#### Response {#Control.GetFormats_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>formats</code></td>
<td>
<code>vector&lt;<a class='link' href='#VideoFormat'>VideoFormat</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>total_format_count</code></td>
<td>
<code>uint32</code>
</td>
</tr>
<tr>
<td><code>status</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
## Manager {#Manager}
*Defined in [fuchsia.camera/manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/manager.fidl;l=45)*
<p>The Camera Manager grants access to individual or sets of cameras</p>
<ol>
<li>You request the list of cameras, which gives you camera descriptions</li>
<li>You request the list of formats available for the camera to which you
wish to connect.</li>
<li>You request a Stream interface using CreateStream.</li>
</ol>
### CreateStream {#Manager.CreateStream}
<p>Create a Stream with the specified access rights. This may not succeed.
If it does succeed, the Stream will have the rights indicated.
<code>buffer_info</code> contains a set of buffers to be used with the Stream.
This is being deprecated - please use CreateStreamV2.</p>
#### Request {#Manager.CreateStream_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#VideoStream'>VideoStream</a></code>
</td>
</tr>
<tr>
<td><code>buffer_info</code></td>
<td>
<code><a class='link' href='../fuchsia.sysmem/'>fuchsia.sysmem</a>/<a class='link' href='../fuchsia.sysmem/#BufferCollectionInfo'>BufferCollectionInfo</a></code>
</td>
</tr>
<tr>
<td><code>stream</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Stream'>Stream</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>client_token</code></td>
<td>
<code>handle&lt;eventpair&gt;</code>
</td>
</tr>
</table>
### CreateStreamV2 {#Manager.CreateStreamV2}
<p>Create a Stream with the specified access rights. This may not succeed.
If it does succeed, the Stream will have the rights indicated.
<code>buffer_info</code> contains a set of buffers to be used with the Stream.</p>
#### Request {#Manager.CreateStreamV2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#VideoStreamV2'>VideoStreamV2</a></code>
</td>
</tr>
<tr>
<td><code>buffer_info</code></td>
<td>
<code><a class='link' href='../fuchsia.sysmem/'>fuchsia.sysmem</a>/<a class='link' href='../fuchsia.sysmem/#BufferCollectionInfo'>BufferCollectionInfo</a></code>
</td>
</tr>
<tr>
<td><code>stream</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Stream'>Stream</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>client_token</code></td>
<td>
<code>handle&lt;eventpair&gt;</code>
</td>
</tr>
</table>
### GetDevices {#Manager.GetDevices}
<p>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.</p>
#### Request {#Manager.GetDevices_Request}
&lt;EMPTY&gt;
#### Response {#Manager.GetDevices_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>descriptions</code></td>
<td>
<code>vector&lt;<a class='link' href='#DeviceInfo'>DeviceInfo</a>&gt;</code>
</td>
</tr>
</table>
### GetFormats {#Manager.GetFormats}
<p>Get all the available formats for a camera.
<code>camera_id</code> is obtained from a DeviceInfo returned by GetDevices.</p>
#### Request {#Manager.GetFormats_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>camera_id</code></td>
<td>
<code>uint64</code>
</td>
</tr>
<tr>
<td><code>index</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
#### Response {#Manager.GetFormats_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>formats</code></td>
<td>
<code>vector&lt;<a class='link' href='#VideoFormat'>VideoFormat</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>total_format_count</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
## Stream {#Stream}
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=114)*
### OnFrameAvailable {#Stream.OnFrameAvailable}
<p>Sent by the driver to the client when a frame is available for processing,
or an error occurred.</p>
#### Response {#Stream.OnFrameAvailable_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>frame</code></td>
<td>
<code><a class='link' href='#FrameAvailableEvent'>FrameAvailableEvent</a></code>
</td>
</tr>
</table>
### ReleaseFrame {#Stream.ReleaseFrame}
<p>Unlocks the specified frame, allowing the driver to reuse the memory.</p>
#### Request {#Stream.ReleaseFrame_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>buffer_id</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
### Start {#Stream.Start}
<p>Starts the streaming of frames.</p>
#### Request {#Stream.Start_Request}
&lt;EMPTY&gt;
### Stop {#Stream.Stop}
<p>Stops the streaming of frames.</p>
#### Request {#Stream.Stop_Request}
&lt;EMPTY&gt;
## **STRUCTS**
### DeviceInfo {#DeviceInfo data-text="DeviceInfo"}
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=26)*
<p>Identifying information about the device.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="DeviceInfo.camera_id">
<td><code>camera_id</code></td>
<td>
<code>uint64</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="DeviceInfo.vendor_id">
<td><code>vendor_id</code></td>
<td>
<code>uint16</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="DeviceInfo.vendor_name">
<td><code>vendor_name</code></td>
<td>
<code>string</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="DeviceInfo.product_id">
<td><code>product_id</code></td>
<td>
<code>uint16</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="DeviceInfo.product_name">
<td><code>product_name</code></td>
<td>
<code>string</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="DeviceInfo.max_stream_count">
<td><code>max_stream_count</code></td>
<td>
<code>uint16</code>
</td>
<td><p>The maximum number of stream interfaces that the device can support
simultaneously.</p>
</td>
<td>No default</td>
</tr>
<tr id="DeviceInfo.output_capabilities">
<td><code>output_capabilities</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### FrameAvailableEvent {#FrameAvailableEvent data-text="FrameAvailableEvent"}
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=59)*
<p>Sent by the driver to the client when a frame is available for processing,
or an error occurred.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="FrameAvailableEvent.frame_status">
<td><code>frame_status</code></td>
<td>
<code><a class='link' href='#FrameStatus'>FrameStatus</a></code>
</td>
<td><p>Non zero if an error occurred.</p>
</td>
<td>No default</td>
</tr>
<tr id="FrameAvailableEvent.buffer_id">
<td><code>buffer_id</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The index of the buffer in the buffer collection.</p>
</td>
<td>No default</td>
</tr>
<tr id="FrameAvailableEvent.metadata">
<td><code>metadata</code></td>
<td>
<code><a class='link' href='#Metadata'>Metadata</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### FrameRate {#FrameRate data-text="FrameRate"}
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=69)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="FrameRate.frames_per_sec_numerator">
<td><code>frames_per_sec_numerator</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The frame rate is frames_per_sec_numerator / frames_per_sec_denominator.</p>
</td>
<td>No default</td>
</tr>
<tr id="FrameRate.frames_per_sec_denominator">
<td><code>frames_per_sec_denominator</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### Metadata {#Metadata data-text="Metadata"}
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=51)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Metadata.timestamp">
<td><code>timestamp</code></td>
<td>
<code>int64</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="Metadata.data_size">
<td><code>data_size</code></td>
<td>
<code>uint32</code>
</td>
<td><div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 11</span></div>
</td>
<td>No default</td>
</tr>
</table>
### VideoFormat {#VideoFormat data-text="VideoFormat"}
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=75)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="VideoFormat.format">
<td><code>format</code></td>
<td>
<code><a class='link' href='../fuchsia.sysmem/'>fuchsia.sysmem</a>/<a class='link' href='../fuchsia.sysmem/#ImageFormat'>ImageFormat</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="VideoFormat.rate">
<td><code>rate</code></td>
<td>
<code><a class='link' href='#FrameRate'>FrameRate</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### VideoStream {#VideoStream data-text="VideoStream"}
*Defined in [fuchsia.camera/manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/manager.fidl;l=13)*
<p>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).</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="VideoStream.camera_id">
<td><code>camera_id</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The camera_id corresponds to the camera_id that is given in the DeviceInfo
received from GetDevices.</p>
</td>
<td>No default</td>
</tr>
<tr id="VideoStream.format">
<td><code>format</code></td>
<td>
<code><a class='link' href='#VideoFormat'>VideoFormat</a></code>
</td>
<td><p>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.</p>
</td>
<td>No default</td>
</tr>
</table>
### VideoStreamV2 {#VideoStreamV2 data-text="VideoStreamV2"}
*Defined in [fuchsia.camera/manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/manager.fidl;l=29)*
<p>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.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="VideoStreamV2.camera_id">
<td><code>camera_id</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The camera_id corresponds to the camera_id that is given in DeviceInfo
received from GetDevices.</p>
</td>
<td>No default</td>
</tr>
<tr id="VideoStreamV2.format">
<td><code>format</code></td>
<td>
<code><a class='link' href='#VideoFormat'>VideoFormat</a></code>
</td>
<td><p>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.</p>
</td>
<td>No default</td>
</tr>
</table>
## **ENUMS**
### FrameStatus [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#FrameStatus data-text="FrameStatus"}
Type: <code>uint32</code>
*Defined in [fuchsia.camera/camera.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=40)*
<p>Status to be set when a frame is signalled available.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="FrameStatus.OK">
<td><h3 id="FrameStatus.OK" class="add-link hide-from-toc">OK</h3></td>
<td><code>0</code></td>
<td></td>
</tr>
<tr id="FrameStatus.ERROR_FRAME">
<td><h3 id="FrameStatus.ERROR_FRAME" class="add-link hide-from-toc">ERROR_FRAME</h3></td>
<td><code>1</code></td>
<td><p>An error occurred during the production of a frame.
No data will be available in the data buffer corresponding to this
notification.</p>
</td>
</tr>
<tr id="FrameStatus.ERROR_BUFFER_FULL">
<td><h3 id="FrameStatus.ERROR_BUFFER_FULL" class="add-link hide-from-toc">ERROR_BUFFER_FULL</h3></td>
<td><code>2</code></td>
<td><p>No space was available in the data buffer, resulting in a dropped frame.</p>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="CAMERA_OUTPUT_BURST">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=19">CAMERA_OUTPUT_BURST</a></td>
<td>
<code>2</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="CAMERA_OUTPUT_DEPTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=22">CAMERA_OUTPUT_DEPTH</a></td>
<td>
<code>16</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="CAMERA_OUTPUT_HDR">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=21">CAMERA_OUTPUT_HDR</a></td>
<td>
<code>8</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="CAMERA_OUTPUT_STEREO">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=23">CAMERA_OUTPUT_STEREO</a></td>
<td>
<code>32</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="CAMERA_OUTPUT_STILL_IMAGE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=18">CAMERA_OUTPUT_STILL_IMAGE</a></td>
<td>
<code>1</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="CAMERA_OUTPUT_STREAM">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=20">CAMERA_OUTPUT_STREAM</a></td>
<td>
<code>4</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="CAMERA_OUTPUT_UNKNOWN">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=17">CAMERA_OUTPUT_UNKNOWN</a></td>
<td>
<code>0</code>
</td>
<td><code>uint32</code></td>
<td><p>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.</p>
</td>
</tr>
<tr id="MAX_FORMATS_PER_RESPONSE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera/camera.fidl;l=12">MAX_FORMATS_PER_RESPONSE</a></td>
<td>
<code>16</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
</table>