| <link rel="stylesheet" href="../style.css" /> |
| |
| [TOC] |
| # fuchsia.camera2.hal |
| |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div> |
| |
| |
| ## **PROTOCOLS** |
| |
| ## Controller {#Controller} |
| *Defined in [fuchsia.camera2.hal/hal.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera2.hal/hal.fidl;l=46)* |
| <p>This is the interface to the camera driver |
| which allows setting up a given configuration |
| and setting up a stream.</p> |
| |
| |
| ### CreateStream {#Controller.CreateStream} |
| |
| <p>Set a particular configuration and create the requested stream. |
| <code>config_index</code> : Configuration index from the vector which needs to be applied. |
| <code>stream_index</code> : Stream index from the vector of streams provided within a config. |
| <code>stream</code> : Stream channel for the stream requested |
| <code>image_format_index</code> : Image format index which needs to be set up upon creation. |
| If there is already an active configuration which is different than the one |
| which is requested to be set, then the HAL will be closing all existing streams |
| and honor this new setup call. |
| If the new stream requested is already part of the existing running configuration |
| the HAL will just be creating this new stream while the other stream still exists as is.</p> |
| |
| |
| |
| #### Request {#Controller.CreateStream_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>config_index</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>stream_index</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>image_format_index</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>stream</code></td> |
| <td> |
| <code>server_end<<a class='link' href='../fuchsia.camera2/'>fuchsia.camera2</a>/<a class='link' href='../fuchsia.camera2/#Stream'>Stream</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### DisableStreaming {#Controller.DisableStreaming} |
| |
| |
| |
| |
| #### Request {#Controller.DisableStreaming_Request} |
| |
| <EMPTY> |
| |
| |
| ### EnableStreaming {#Controller.EnableStreaming} |
| |
| <p>Enable/Disable Streaming</p> |
| |
| |
| |
| #### Request {#Controller.EnableStreaming_Request} |
| |
| <EMPTY> |
| |
| |
| ### GetDeviceInfo {#Controller.GetDeviceInfo} |
| |
| |
| |
| |
| #### Request {#Controller.GetDeviceInfo_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Controller.GetDeviceInfo_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>info</code></td> |
| <td> |
| <code><a class='link' href='../fuchsia.camera2/'>fuchsia.camera2</a>/<a class='link' href='../fuchsia.camera2/#DeviceInfo'>DeviceInfo</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetNextConfig {#Controller.GetNextConfig} |
| |
| <p>Returns the next available configuration which the camera driver supports. |
| Returns ZX_ERR_STOP if no new configurations are available.</p> |
| |
| |
| |
| #### Request {#Controller.GetNextConfig_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Controller.GetNextConfig_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>config</code></td> |
| <td> |
| <code><a class='link' href='#Config'>Config</a>?</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> |
| |
| |
| ## **STRUCTS** |
| |
| ### Config {#Config data-text="Config"} |
| *Defined in [fuchsia.camera2.hal/hal.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera2.hal/hal.fidl;l=37)* |
| <p>Represents one configuration</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Config.stream_configs"> |
| <td><code>stream_configs</code></td> |
| <td> |
| <code>vector<<a class='link' href='#StreamConfig'>StreamConfig</a>>[64]</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### StreamConfig {#StreamConfig data-text="StreamConfig"} |
| *Defined in [fuchsia.camera2.hal/hal.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera2.hal/hal.fidl;l=18)* |
| <p>Represents one stream within a particular configuration.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="StreamConfig.frame_rate"> |
| <td><code>frame_rate</code></td> |
| <td> |
| <code><a class='link' href='../fuchsia.camera2/'>fuchsia.camera2</a>/<a class='link' href='../fuchsia.camera2/#FrameRate'>FrameRate</a></code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| <tr id="StreamConfig.constraints"> |
| <td><code>constraints</code></td> |
| <td> |
| <code><a class='link' href='../fuchsia.sysmem/'>fuchsia.sysmem</a>/<a class='link' href='../fuchsia.sysmem/#BufferCollectionConstraints'>BufferCollectionConstraints</a></code> |
| </td> |
| <td><p><code>constraints</code> should allow for all the image formats listed in image_formats.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="StreamConfig.properties"> |
| <td><code>properties</code></td> |
| <td> |
| <code><a class='link' href='../fuchsia.camera2/'>fuchsia.camera2</a>/<a class='link' href='../fuchsia.camera2/#StreamProperties'>StreamProperties</a></code> |
| </td> |
| <td><p>Properties of the stream:</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="StreamConfig.image_formats"> |
| <td><code>image_formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='../fuchsia.sysmem/'>fuchsia.sysmem</a>/<a class='link' href='../fuchsia.sysmem/#ImageFormat_2'>ImageFormat_2</a>>[256]</code> |
| </td> |
| <td><p>We need to specify both the constraints & the image formats because |
| there are fixed set of resolutions supported by the Camera Controller |
| so a range within the <code>constraints</code> won't be sufficient. |
| Some streams support multiple resolutions for same configuration |
| We would need to change the resolution runtime, without stopping the |
| streaming. This provides a list of resolutions a stream would be providing. |
| At least one format must be provided.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| |
| |
| |
| |
| |
| ## **CONSTANTS** |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr> |
| <tr id="MAX_CONFIGURATIONS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera2.hal/hal.fidl;l=12">MAX_CONFIGURATIONS</a></td> |
| <td> |
| <code>256</code> |
| </td> |
| <td><code>uint64</code></td> |
| <td><p>Maximum number of configurations per device.</p> |
| </td> |
| </tr> |
| <tr id="MAX_STREAMS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.camera2.hal/hal.fidl;l=15">MAX_STREAMS</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint64</code></td> |
| <td><p>Maximum number of streams per config.</p> |
| </td> |
| </tr> |
| </table> |