pub struct Config<'d> {
pub formats: &'d [Format<'d>],
pub max_packet_size: u16,
pub transport: StreamTransport,
pub processing_controls: ProcessingControls,
pub camera_controls: CameraControls,
pub still: Option<StillConfig<'d>>,
}Expand description
Everything the camera advertises to the host.
Fields§
§formats: &'d [Format<'d>]The formats the camera streams, at least one and at most 16. The host numbers them from one, in this order. The first is the default.
max_packet_size: u16Packet size of the VideoStreaming endpoint in bytes, including the payload header.
transport: StreamTransportVideoStreaming transport (Isochronous by default).
processing_controls: ProcessingControlsOptional Processing Unit (VC_PROCESSING_UNIT) controls.
camera_controls: CameraControlsOptional Camera Terminal (ITT_CAMERA) controls.
still: Option<StillConfig<'d>>Optional Method 2 still image capture configuration.
Implementations§
Source§impl<'d> Config<'d>
impl<'d> Config<'d>
Sourcepub const fn new(formats: &'d [Format<'d>], speed: UsbDeviceSpeed) -> Self
pub const fn new(formats: &'d [Format<'d>], speed: UsbDeviceSpeed) -> Self
Creates an isochronous UVC 1.5 camera configuration with the largest packet size for speed.
Sourcepub const fn bulk(formats: &'d [Format<'d>], speed: UsbDeviceSpeed) -> Self
pub const fn bulk(formats: &'d [Format<'d>], speed: UsbDeviceSpeed) -> Self
Creates a bulk UVC 1.5 camera configuration with the largest bulk packet size for speed.
Sourcepub const fn with_transport(
formats: &'d [Format<'d>],
transport: StreamTransport,
speed: UsbDeviceSpeed,
) -> Self
pub const fn with_transport( formats: &'d [Format<'d>], transport: StreamTransport, speed: UsbDeviceSpeed, ) -> Self
Creates a UVC 1.5 camera configuration for the given transport and speed.
Sourcepub const fn with_processing_controls(
self,
controls: ProcessingControls,
) -> Self
pub const fn with_processing_controls( self, controls: ProcessingControls, ) -> Self
Configures Processing Unit (VC_PROCESSING_UNIT) controls.
Sourcepub const fn with_camera_controls(self, controls: CameraControls) -> Self
pub const fn with_camera_controls(self, controls: CameraControls) -> Self
Configures Camera Terminal (ITT_CAMERA) controls.
Sourcepub const fn with_still(self, still: StillConfig<'d>) -> Self
pub const fn with_still(self, still: StillConfig<'d>) -> Self
Enables Method 2 still image capture.