| // Copyright 2021 The Fuchsia Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| @available(added=HEAD) | |
| library fuchsia.camera.test.virtualcamera; | |
| // Set of possible errors for methods on the |VirtualCameraDevice| protocol. | |
| type Error = strict enum { | |
| // Occurs when |AddToDeviceWatcher| is called and the device has already been added. | |
| ALREADY_ADDED_TO_DEVICE_WATCHER = 1; | |
| }; | |
| // Parameters that can be set for a stream created with |AddStreamConfig|. | |
| type StreamConfig = table { | |
| 1: width uint32; | |
| 2: height uint32; | |
| }; | |
| /// This interface provides a way for test clients to set up fake streams | |
| /// using the 'virtual' camera. | |
| @discoverable | |
| closed protocol VirtualCameraDevice { | |
| // Makes the virtual camera available to the |DeviceWatcher| agent. | |
| // This allows the fake streams to be picked up by other components | |
| // in the system. Must be called before proceeding with tests otherwise | |
| // the virtual camera won't be available to camera clients. | |
| strict AddToDeviceWatcher() -> () error Error; | |
| // Adds a |StreamConfig| at the given |index|. |index| is used to refer | |
| // to the config in future operations. If this is called multiple times | |
| // with the same |index|, the older value will be overwritten. | |
| strict AddStreamConfig(struct { | |
| index uint64; | |
| config StreamConfig; | |
| }); | |
| }; |