duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
api.h File Reference

Complete C ABI for duvc-ctl with comprehensive API coverage. More...

#include <stddef.h>
#include <stdint.h>
Include dependency graph for api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  duvc_prop_setting_t
 Property setting with value and mode. More...
 
struct  duvc_prop_range_t
 Property range information. More...
 
struct  duvc_vendor_property_t
 Vendor property container. More...
 

Macros

#define DUVC_VERSION_MAJOR   1
 
#define DUVC_VERSION_MINOR   0
 
#define DUVC_VERSION_PATCH   0
 
#define DUVC_ABI_VERSION    ((DUVC_VERSION_MAJOR << 16) | (DUVC_VERSION_MINOR << 8) | DUVC_VERSION_PATCH)
 
#define DUVC_LOG_DEBUG(msg)   duvc_log_debug(msg)
 
#define DUVC_LOG_INFO(msg)   duvc_log_info(msg)
 
#define DUVC_LOG_WARNING(msg)   duvc_log_warning(msg)
 
#define DUVC_LOG_ERROR(msg)   duvc_log_error(msg)
 
#define DUVC_LOG_CRITICAL(msg)   duvc_log_critical(msg)
 

Typedefs

typedef struct duvc_device_t duvc_device_t
 Opaque device handle.
 
typedef struct duvc_connection_t duvc_connection_t
 Opaque camera connection handle.
 
typedef struct duvc_device_capabilities_t duvc_device_capabilities_t
 Opaque device capabilities handle.
 
typedef void(* duvc_log_callback) (duvc_log_level_t level, const char *message, void *user_data)
 Log message callback.
 
typedef void(* duvc_device_change_callback) (int added, const char *device_path, void *user_data)
 Device hotplug callback.
 

Enumerations

enum  duvc_result_t {
  DUVC_SUCCESS = 0 , DUVC_ERROR_NOT_IMPLEMENTED , DUVC_ERROR_INVALID_ARGUMENT , DUVC_ERROR_DEVICE_NOT_FOUND ,
  DUVC_ERROR_DEVICE_BUSY , DUVC_ERROR_PROPERTY_NOT_SUPPORTED , DUVC_ERROR_INVALID_VALUE , DUVC_ERROR_PERMISSION_DENIED ,
  DUVC_ERROR_SYSTEM_ERROR , DUVC_ERROR_CONNECTION_FAILED , DUVC_ERROR_TIMEOUT , DUVC_ERROR_BUFFER_TOO_SMALL
}
 Result codes for duvc operations. More...
 
enum  duvc_cam_prop_t {
  DUVC_CAM_PROP_PAN = 0 , DUVC_CAM_PROP_TILT , DUVC_CAM_PROP_ROLL , DUVC_CAM_PROP_ZOOM ,
  DUVC_CAM_PROP_EXPOSURE , DUVC_CAM_PROP_IRIS , DUVC_CAM_PROP_FOCUS , DUVC_CAM_PROP_SCAN_MODE ,
  DUVC_CAM_PROP_PRIVACY , DUVC_CAM_PROP_PAN_RELATIVE , DUVC_CAM_PROP_TILT_RELATIVE , DUVC_CAM_PROP_ROLL_RELATIVE ,
  DUVC_CAM_PROP_ZOOM_RELATIVE , DUVC_CAM_PROP_EXPOSURE_RELATIVE , DUVC_CAM_PROP_IRIS_RELATIVE , DUVC_CAM_PROP_FOCUS_RELATIVE ,
  DUVC_CAM_PROP_PAN_TILT , DUVC_CAM_PROP_PAN_TILT_RELATIVE , DUVC_CAM_PROP_FOCUS_SIMPLE , DUVC_CAM_PROP_DIGITAL_ZOOM ,
  DUVC_CAM_PROP_DIGITAL_ZOOM_RELATIVE , DUVC_CAM_PROP_BACKLIGHT_COMPENSATION , DUVC_CAM_PROP_LAMP
}
 Camera control properties. More...
 
enum  duvc_vid_prop_t {
  DUVC_VID_PROP_BRIGHTNESS = 0 , DUVC_VID_PROP_CONTRAST , DUVC_VID_PROP_HUE , DUVC_VID_PROP_SATURATION ,
  DUVC_VID_PROP_SHARPNESS , DUVC_VID_PROP_GAMMA , DUVC_VID_PROP_COLOR_ENABLE , DUVC_VID_PROP_WHITE_BALANCE ,
  DUVC_VID_PROP_BACKLIGHT_COMPENSATION , DUVC_VID_PROP_GAIN
}
 Video processing properties. More...
 
enum  duvc_cam_mode_t { DUVC_CAM_MODE_AUTO = 0 , DUVC_CAM_MODE_MANUAL }
 Camera control modes. More...
 
enum  duvc_log_level_t {
  DUVC_LOG_DEBUG = 0 , DUVC_LOG_INFO , DUVC_LOG_WARNING , DUVC_LOG_ERROR ,
  DUVC_LOG_CRITICAL
}
 Log levels. More...
 
enum  duvc_logitech_prop_t {
  DUVC_LOGITECH_PROP_RIGHT_LIGHT = 1 , DUVC_LOGITECH_PROP_RIGHT_SOUND , DUVC_LOGITECH_PROP_FACE_TRACKING , DUVC_LOGITECH_PROP_LED_INDICATOR ,
  DUVC_LOGITECH_PROP_PROCESSOR_USAGE , DUVC_LOGITECH_PROP_RAW_DATA_BITS , DUVC_LOGITECH_PROP_FOCUS_ASSIST , DUVC_LOGITECH_PROP_VIDEO_STANDARD ,
  DUVC_LOGITECH_PROP_DIGITAL_ZOOM_ROI , DUVC_LOGITECH_PROP_TILT_PAN
}
 Logitech vendor-specific properties. More...
 

Functions

uint32_t duvc_get_version (void)
 Get library version.
 
const char * duvc_get_version_string (void)
 Get library version string.
 
int duvc_check_abi_compatibility (uint32_t compiled_version)
 Check ABI compatibility.
 
duvc_result_t duvc_initialize (void)
 Initialize library.
 
void duvc_shutdown (void)
 Shutdown library.
 
int duvc_is_initialized (void)
 Check if library is initialized.
 
duvc_result_t duvc_set_log_callback (duvc_log_callback callback, void *user_data)
 Set log callback.
 
duvc_result_t duvc_set_log_level (duvc_log_level_t level)
 Set minimum log level.
 
duvc_result_t duvc_get_log_level (duvc_log_level_t *level)
 Get current log level.
 
duvc_result_t duvc_log_message (duvc_log_level_t level, const char *message)
 Log message at specific level.
 
duvc_result_t duvc_log_debug (const char *message)
 Log debug message.
 
duvc_result_t duvc_log_info (const char *message)
 Log info message.
 
duvc_result_t duvc_log_warning (const char *message)
 Log warning message.
 
duvc_result_t duvc_log_error (const char *message)
 Log error message.
 
duvc_result_t duvc_log_critical (const char *message)
 Log critical message.
 
duvc_result_t duvc_list_devices (duvc_device_t ***devices, size_t *count)
 List all connected devices.
 
duvc_result_t duvc_find_device_by_path (const char *device_path_utf8, duvc_device_t **device)
 Find device by unique Windows device path.
 
void duvc_free_device_list (duvc_device_t **devices, size_t count)
 Free device list.
 
duvc_result_t duvc_is_device_connected (const duvc_device_t *device, int *connected)
 Check if device is connected.
 
duvc_result_t duvc_get_device_name (const duvc_device_t *device, char *buffer, size_t buffer_size, size_t *required)
 Get device name.
 
duvc_result_t duvc_get_device_path (const duvc_device_t *device, char *buffer, size_t buffer_size, size_t *required)
 Get device path.
 
duvc_result_t duvc_get_device_id (const duvc_device_t *device, char *buffer, size_t buffer_size, size_t *required)
 Get device ID.
 
duvc_result_t duvc_device_is_valid (const duvc_device_t *device, int *valid)
 Check if device is valid.
 
duvc_result_t duvc_register_device_change_callback (duvc_device_change_callback callback, void *user_data)
 Register device change callback.
 
void duvc_unregister_device_change_callback (void)
 Unregister device change callback.
 
duvc_result_t duvc_open_camera_by_index (int device_index, duvc_connection_t **conn)
 Open camera by device index.
 
duvc_result_t duvc_open_camera (const duvc_device_t *device, duvc_connection_t **conn)
 Open camera by device handle.
 
void duvc_close_camera (duvc_connection_t *conn)
 Close camera connection.
 
int duvc_camera_is_valid (const duvc_connection_t *conn)
 Check if camera connection is valid.
 
duvc_result_t duvc_get_camera_property (duvc_connection_t *conn, duvc_cam_prop_t prop, duvc_prop_setting_t *setting)
 Get camera property value.
 
duvc_result_t duvc_set_camera_property (duvc_connection_t *conn, duvc_cam_prop_t prop, const duvc_prop_setting_t *setting)
 Set camera property value.
 
duvc_result_t duvc_get_camera_property_range (duvc_connection_t *conn, duvc_cam_prop_t prop, duvc_prop_range_t *range)
 Get camera property range.
 
duvc_result_t duvc_get_video_property (duvc_connection_t *conn, duvc_vid_prop_t prop, duvc_prop_setting_t *setting)
 Get video property value.
 
duvc_result_t duvc_set_video_property (duvc_connection_t *conn, duvc_vid_prop_t prop, const duvc_prop_setting_t *setting)
 Set video property value.
 
duvc_result_t duvc_get_video_property_range (duvc_connection_t *conn, duvc_vid_prop_t prop, duvc_prop_range_t *range)
 Get video property range.
 
duvc_result_t duvc_get_multiple_camera_properties (duvc_connection_t *conn, const duvc_cam_prop_t *props, duvc_prop_setting_t *settings, size_t count)
 Get multiple camera properties.
 
duvc_result_t duvc_set_multiple_camera_properties (duvc_connection_t *conn, const duvc_cam_prop_t *props, const duvc_prop_setting_t *settings, size_t count)
 Set multiple camera properties.
 
duvc_result_t duvc_get_multiple_video_properties (duvc_connection_t *conn, const duvc_vid_prop_t *props, duvc_prop_setting_t *settings, size_t count)
 Get multiple video properties.
 
duvc_result_t duvc_set_multiple_video_properties (duvc_connection_t *conn, const duvc_vid_prop_t *props, const duvc_prop_setting_t *settings, size_t count)
 Set multiple video properties.
 
duvc_result_t duvc_quick_get_camera_property (const duvc_device_t *device, duvc_cam_prop_t prop, duvc_prop_setting_t *setting)
 Quick get camera property (creates temporary connection)
 
duvc_result_t duvc_quick_set_camera_property (const duvc_device_t *device, duvc_cam_prop_t prop, const duvc_prop_setting_t *setting)
 Quick set camera property (creates temporary connection)
 
duvc_result_t duvc_quick_get_camera_property_range (const duvc_device_t *device, duvc_cam_prop_t prop, duvc_prop_range_t *range)
 Quick get camera property range.
 
duvc_result_t duvc_quick_get_video_property (const duvc_device_t *device, duvc_vid_prop_t prop, duvc_prop_setting_t *setting)
 Quick get video property.
 
duvc_result_t duvc_quick_set_video_property (const duvc_device_t *device, duvc_vid_prop_t prop, const duvc_prop_setting_t *setting)
 Quick set video property.
 
duvc_result_t duvc_quick_get_video_property_range (const duvc_device_t *device, duvc_vid_prop_t prop, duvc_prop_range_t *range)
 Quick get video property range.
 
duvc_result_t duvc_get_device_capabilities (const duvc_device_t *device, duvc_device_capabilities_t **caps)
 Get device capabilities snapshot.
 
duvc_result_t duvc_get_device_capabilities_by_index (int device_index, duvc_device_capabilities_t **caps)
 Get device capabilities by index.
 
void duvc_free_device_capabilities (duvc_device_capabilities_t *caps)
 Free device capabilities.
 
duvc_result_t duvc_refresh_device_capabilities (duvc_device_capabilities_t *caps)
 Refresh capabilities snapshot.
 
duvc_result_t duvc_get_camera_capability (const duvc_device_capabilities_t *caps, duvc_cam_prop_t prop, duvc_prop_range_t *range, duvc_prop_setting_t *current)
 Get camera property capability.
 
duvc_result_t duvc_get_video_capability (const duvc_device_capabilities_t *caps, duvc_vid_prop_t prop, duvc_prop_range_t *range, duvc_prop_setting_t *current)
 Get video property capability.
 
duvc_result_t duvc_supports_camera_property (const duvc_device_capabilities_t *caps, duvc_cam_prop_t prop, int *supported)
 Check if camera property is supported.
 
duvc_result_t duvc_supports_video_property (const duvc_device_capabilities_t *caps, duvc_vid_prop_t prop, int *supported)
 Check if video property is supported.
 
duvc_result_t duvc_get_supported_camera_properties (const duvc_device_capabilities_t *caps, duvc_cam_prop_t *props, size_t max_count, size_t *actual_count)
 Get list of supported camera properties.
 
duvc_result_t duvc_get_supported_video_properties (const duvc_device_capabilities_t *caps, duvc_vid_prop_t *props, size_t max_count, size_t *actual_count)
 Get list of supported video properties.
 
duvc_result_t duvc_capabilities_is_device_accessible (const duvc_device_capabilities_t *caps, int *accessible)
 Check if device is accessible.
 
duvc_result_t duvc_prop_range_is_valid (const duvc_prop_range_t *range, int32_t value, int *valid)
 Check if value is valid for range.
 
duvc_result_t duvc_prop_range_clamp (const duvc_prop_range_t *range, int32_t value, int32_t *clamped_value)
 Clamp value to valid range.
 
duvc_result_t duvc_prop_capability_supports_auto (const duvc_prop_range_t *range, int *supports_auto)
 Check if property supports auto mode.
 
duvc_result_t duvc_get_vendor_property (const duvc_device_t *device, const char *property_set_guid, uint32_t property_id, void *data, size_t data_size, size_t *bytes_returned)
 Get vendor-specific property.
 
duvc_result_t duvc_set_vendor_property (const duvc_device_t *device, const char *property_set_guid, uint32_t property_id, const void *data, size_t data_size)
 Set vendor-specific property.
 
duvc_result_t duvc_query_vendor_property_support (const duvc_device_t *device, const char *property_set_guid, uint32_t property_id, int *supported)
 Query vendor property support.
 
duvc_result_t duvc_get_logitech_property (const duvc_device_t *device, duvc_logitech_prop_t prop, void *data, size_t data_size, size_t *bytes_returned)
 Get Logitech vendor property.
 
duvc_result_t duvc_set_logitech_property (const duvc_device_t *device, duvc_logitech_prop_t prop, const void *data, size_t data_size)
 Set Logitech vendor property.
 
duvc_result_t duvc_supports_logitech_properties (const duvc_device_t *device, int *supported)
 Check Logitech vendor property support.
 
const char * duvc_cam_prop_to_string (duvc_cam_prop_t prop)
 Convert camera property to string.
 
const char * duvc_vid_prop_to_string (duvc_vid_prop_t prop)
 Convert video property to string.
 
const char * duvc_cam_mode_to_string (duvc_cam_mode_t mode)
 Convert camera mode to string.
 
const char * duvc_error_code_to_string (duvc_result_t code)
 Convert error code to string.
 
const char * duvc_log_level_to_string (duvc_log_level_t level)
 Convert log level to string.
 
duvc_result_t duvc_cam_prop_to_wstring (duvc_cam_prop_t prop, wchar_t *buffer, size_t buffer_size, size_t *required)
 Convert camera property to wide string.
 
duvc_result_t duvc_vid_prop_to_wstring (duvc_vid_prop_t prop, wchar_t *buffer, size_t buffer_size, size_t *required)
 Convert video property to wide string.
 
duvc_result_t duvc_cam_mode_to_wstring (duvc_cam_mode_t mode, wchar_t *buffer, size_t buffer_size, size_t *required)
 Convert camera mode to wide string.
 
duvc_result_t duvc_get_last_error_details (char *buffer, size_t buffer_size, size_t *required_size)
 Get last error details.
 
duvc_result_t duvc_get_diagnostic_info (char *buffer, size_t buffer_size, size_t *required_size)
 Get diagnostic information.
 
int duvc_is_device_error (duvc_result_t result)
 Check if error is device-related.
 
int duvc_is_permission_error (duvc_result_t result)
 Check if error is permission-related.
 
void duvc_clear_last_error (void)
 Clear last error information.
 
duvc_result_t duvc_decode_system_error (unsigned long error_code, char *buffer, size_t buffer_size, size_t *required)
 Decode system error code to string.
 
duvc_result_t duvc_decode_hresult (int32_t hr, char *buffer, size_t buffer_size, size_t *required)
 Decode HRESULT to string.
 
duvc_result_t duvc_get_hresult_details (int32_t hr, char *buffer, size_t buffer_size, size_t *required)
 Get detailed HRESULT information.
 
int duvc_is_hresult_device_error (int32_t hr)
 Check if HRESULT indicates device error.
 
int duvc_is_hresult_permission_error (int32_t hr)
 Check if HRESULT indicates permission error.
 
duvc_result_t duvc_has_camera_permissions (int *has_permissions)
 Check if current process has camera permissions.
 
duvc_result_t duvc_get_platform_info (char *buffer, size_t buffer_size, size_t *required)
 Get platform information.
 

Variables

const char DUVC_LOGITECH_PROPERTY_SET_GUID [39]
 Logitech property set GUID string.
 

Detailed Description

Complete C ABI for duvc-ctl with comprehensive API coverage.

Provides stable interface for C and language bindings with full functionality matching the modern C++ core API with Result-based error handling.

Definition in file api.h.

Macro Definition Documentation

◆ DUVC_ABI_VERSION

#define DUVC_ABI_VERSION    ((DUVC_VERSION_MAJOR << 16) | (DUVC_VERSION_MINOR << 8) | DUVC_VERSION_PATCH)

Definition at line 21 of file api.h.

Referenced by duvc_get_version().

◆ DUVC_LOG_CRITICAL

#define DUVC_LOG_CRITICAL ( msg)    duvc_log_critical(msg)

Definition at line 1078 of file api.h.

Referenced by duvc_log_critical(), and duvc_log_level_to_string().

◆ DUVC_LOG_DEBUG

#define DUVC_LOG_DEBUG ( msg)    duvc_log_debug(msg)

◆ DUVC_LOG_ERROR

◆ DUVC_LOG_INFO

#define DUVC_LOG_INFO ( msg)    duvc_log_info(msg)

◆ DUVC_LOG_WARNING

#define DUVC_LOG_WARNING ( msg)    duvc_log_warning(msg)

Definition at line 1076 of file api.h.

Referenced by duvc_log_level_to_string(), and duvc_log_warning().

◆ DUVC_VERSION_MAJOR

#define DUVC_VERSION_MAJOR   1

Definition at line 18 of file api.h.

◆ DUVC_VERSION_MINOR

#define DUVC_VERSION_MINOR   0

Definition at line 19 of file api.h.

◆ DUVC_VERSION_PATCH

#define DUVC_VERSION_PATCH   0

Definition at line 20 of file api.h.

Typedef Documentation

◆ duvc_connection_t

Opaque camera connection handle.

Definition at line 167 of file api.h.

◆ duvc_device_capabilities_t

Opaque device capabilities handle.

Definition at line 172 of file api.h.

◆ duvc_device_change_callback

typedef void(* duvc_device_change_callback) (int added, const char *device_path, void *user_data)

Device hotplug callback.

Parameters
added1 if device was added, 0 if removed
device_pathNull-terminated device path string
user_dataUser-provided context data

Definition at line 192 of file api.h.

◆ duvc_device_t

typedef struct duvc_device_t duvc_device_t

Opaque device handle.

Definition at line 162 of file api.h.

◆ duvc_log_callback

typedef void(* duvc_log_callback) (duvc_log_level_t level, const char *message, void *user_data)

Log message callback.

Parameters
levelLog level of the message
messageNull-terminated log message string
user_dataUser-provided context data

Definition at line 183 of file api.h.

Enumeration Type Documentation

◆ duvc_cam_mode_t

Camera control modes.

Enumerator
DUVC_CAM_MODE_AUTO 

Automatic control by camera.

DUVC_CAM_MODE_MANUAL 

Manual control by application.

Definition at line 94 of file api.h.

◆ duvc_cam_prop_t

Camera control properties.

Enumerator
DUVC_CAM_PROP_PAN 

Horizontal camera rotation.

DUVC_CAM_PROP_TILT 

Vertical camera rotation.

DUVC_CAM_PROP_ROLL 

Camera roll rotation.

DUVC_CAM_PROP_ZOOM 

Optical zoom level.

DUVC_CAM_PROP_EXPOSURE 

Exposure time.

DUVC_CAM_PROP_IRIS 

Aperture/iris setting.

DUVC_CAM_PROP_FOCUS 

Focus position.

DUVC_CAM_PROP_SCAN_MODE 

Scan mode (progressive/interlaced)

DUVC_CAM_PROP_PRIVACY 

Privacy mode on/off.

DUVC_CAM_PROP_PAN_RELATIVE 

Relative pan movement.

DUVC_CAM_PROP_TILT_RELATIVE 

Relative tilt movement.

DUVC_CAM_PROP_ROLL_RELATIVE 

Relative roll movement.

DUVC_CAM_PROP_ZOOM_RELATIVE 

Relative zoom movement.

DUVC_CAM_PROP_EXPOSURE_RELATIVE 

Relative exposure adjustment.

DUVC_CAM_PROP_IRIS_RELATIVE 

Relative iris adjustment.

DUVC_CAM_PROP_FOCUS_RELATIVE 

Relative focus adjustment.

DUVC_CAM_PROP_PAN_TILT 

Combined pan/tilt control.

DUVC_CAM_PROP_PAN_TILT_RELATIVE 

Relative pan/tilt movement.

DUVC_CAM_PROP_FOCUS_SIMPLE 

Simple focus control.

DUVC_CAM_PROP_DIGITAL_ZOOM 

Digital zoom level.

DUVC_CAM_PROP_DIGITAL_ZOOM_RELATIVE 

Relative digital zoom.

DUVC_CAM_PROP_BACKLIGHT_COMPENSATION 

Backlight compensation.

DUVC_CAM_PROP_LAMP 

Camera lamp/flash control.

Definition at line 49 of file api.h.

◆ duvc_log_level_t

Log levels.

Enumerator
DUVC_LOG_DEBUG 

Debug information.

DUVC_LOG_INFO 

Informational messages.

DUVC_LOG_WARNING 

Warning messages.

DUVC_LOG_ERROR 

Error messages.

DUVC_LOG_CRITICAL 

Critical errors.

Definition at line 102 of file api.h.

◆ duvc_logitech_prop_t

Logitech vendor-specific properties.

Enumerator
DUVC_LOGITECH_PROP_RIGHT_LIGHT 

RightLight auto-exposure.

DUVC_LOGITECH_PROP_RIGHT_SOUND 

RightSound audio processing.

DUVC_LOGITECH_PROP_FACE_TRACKING 

Face tracking enable/disable.

DUVC_LOGITECH_PROP_LED_INDICATOR 

LED indicator control.

DUVC_LOGITECH_PROP_PROCESSOR_USAGE 

Processor usage optimization.

DUVC_LOGITECH_PROP_RAW_DATA_BITS 

Raw data bit depth.

DUVC_LOGITECH_PROP_FOCUS_ASSIST 

Focus assist beam.

DUVC_LOGITECH_PROP_VIDEO_STANDARD 

Video standard selection.

DUVC_LOGITECH_PROP_DIGITAL_ZOOM_ROI 

Digital zoom region of interest.

DUVC_LOGITECH_PROP_TILT_PAN 

Combined tilt/pan control.

Definition at line 113 of file api.h.

◆ duvc_result_t

Result codes for duvc operations.

Enumerator
DUVC_SUCCESS 

Operation completed successfully.

DUVC_ERROR_NOT_IMPLEMENTED 

Feature not implemented on this platform.

DUVC_ERROR_INVALID_ARGUMENT 

Invalid function argument provided.

DUVC_ERROR_DEVICE_NOT_FOUND 

Device not found or disconnected.

DUVC_ERROR_DEVICE_BUSY 

Device is busy or in use by another process.

DUVC_ERROR_PROPERTY_NOT_SUPPORTED 

Property not supported by device.

DUVC_ERROR_INVALID_VALUE 

Property value out of valid range.

DUVC_ERROR_PERMISSION_DENIED 

Insufficient permissions to access device.

DUVC_ERROR_SYSTEM_ERROR 

System/platform error occurred.

DUVC_ERROR_CONNECTION_FAILED 

Failed to establish device connection.

DUVC_ERROR_TIMEOUT 

Operation timed out.

DUVC_ERROR_BUFFER_TOO_SMALL 

Provided buffer is too small for data.

Definition at line 30 of file api.h.

◆ duvc_vid_prop_t

Video processing properties.

Enumerator
DUVC_VID_PROP_BRIGHTNESS 

Image brightness level.

DUVC_VID_PROP_CONTRAST 

Image contrast level.

DUVC_VID_PROP_HUE 

Color hue adjustment.

DUVC_VID_PROP_SATURATION 

Color saturation level.

DUVC_VID_PROP_SHARPNESS 

Image sharpness level.

DUVC_VID_PROP_GAMMA 

Gamma correction value.

DUVC_VID_PROP_COLOR_ENABLE 

Color vs.

monochrome mode

DUVC_VID_PROP_WHITE_BALANCE 

White balance adjustment.

DUVC_VID_PROP_BACKLIGHT_COMPENSATION 

Backlight compensation level.

DUVC_VID_PROP_GAIN 

Sensor gain level.

Definition at line 78 of file api.h.

Function Documentation

◆ duvc_cam_mode_to_string()

const char * duvc_cam_mode_to_string ( duvc_cam_mode_t mode)

Convert camera mode to string.

Parameters
modeCamera mode to convert
Returns
Null-terminated mode name string (statically allocated)

Definition at line 381 of file api.cpp.

References duvc::to_string().

Here is the call graph for this function:

◆ duvc_cam_mode_to_wstring()

duvc_result_t duvc_cam_mode_to_wstring ( duvc_cam_mode_t mode,
wchar_t * buffer,
size_t buffer_size,
size_t * required )

Convert camera mode to wide string.

Parameters
modeCamera mode to convert
[out]bufferBuffer to receive wide string
buffer_sizeSize of buffer in wide characters
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_cam_prop_to_string()

const char * duvc_cam_prop_to_string ( duvc_cam_prop_t prop)

Convert camera property to string.

Parameters
propCamera property to convert
Returns
Null-terminated property name string (statically allocated)

Definition at line 372 of file api.cpp.

References duvc::to_string().

Here is the call graph for this function:

◆ duvc_cam_prop_to_wstring()

duvc_result_t duvc_cam_prop_to_wstring ( duvc_cam_prop_t prop,
wchar_t * buffer,
size_t buffer_size,
size_t * required )

Convert camera property to wide string.

Parameters
propCamera property to convert
[out]bufferBuffer to receive wide string
buffer_sizeSize of buffer in wide characters
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_camera_is_valid()

int duvc_camera_is_valid ( const duvc_connection_t * conn)

Check if camera connection is valid.

Parameters
connConnection to check
Returns
1 if valid, 0 if not

Definition at line 854 of file api.cpp.

◆ duvc_capabilities_is_device_accessible()

duvc_result_t duvc_capabilities_is_device_accessible ( const duvc_device_capabilities_t * caps,
int * accessible )

Check if device is accessible.

Parameters
capsDevice capabilities handle
[out]accessible1 if accessible, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1718 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::DeviceCapabilities::is_device_accessible().

Here is the call graph for this function:

◆ duvc_check_abi_compatibility()

int duvc_check_abi_compatibility ( uint32_t compiled_version)

Check ABI compatibility.

Parameters
compiled_versionVersion the application was compiled with (use DUVC_ABI_VERSION)
Returns
1 if compatible, 0 if incompatible

Definition at line 238 of file api.cpp.

References duvc_get_version().

Here is the call graph for this function:

◆ duvc_clear_last_error()

void duvc_clear_last_error ( void )

Clear last error information.

Note
Clears any stored error details from previous operations

Definition at line 1845 of file api.cpp.

◆ duvc_close_camera()

void duvc_close_camera ( duvc_connection_t * conn)

Close camera connection.

Parameters
connConnection to close

Definition at line 838 of file api.cpp.

◆ duvc_decode_hresult()

duvc_result_t duvc_decode_hresult ( int32_t hr,
char * buffer,
size_t buffer_size,
size_t * required )

Decode HRESULT to string.

Parameters
hrHRESULT value to decode
[out]bufferBuffer to receive error description
buffer_sizeSize of buffer in bytes
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_decode_system_error()

duvc_result_t duvc_decode_system_error ( unsigned long error_code,
char * buffer,
size_t buffer_size,
size_t * required )

Decode system error code to string.

Parameters
error_codeWindows system error code
[out]bufferBuffer to receive error description
buffer_sizeSize of buffer in bytes
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_device_is_valid()

duvc_result_t duvc_device_is_valid ( const duvc_device_t * device,
int * valid )

Check if device is valid.

Parameters
deviceDevice to check
[out]valid1 if valid, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 690 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::Device::is_valid().

Here is the call graph for this function:

◆ duvc_error_code_to_string()

const char * duvc_error_code_to_string ( duvc_result_t code)

Convert error code to string.

Parameters
codeError code to convert
Returns
Null-terminated error description string (statically allocated)

Definition at line 341 of file api.cpp.

References DUVC_ERROR_BUFFER_TOO_SMALL, DUVC_ERROR_CONNECTION_FAILED, DUVC_ERROR_DEVICE_BUSY, DUVC_ERROR_DEVICE_NOT_FOUND, DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_INVALID_VALUE, DUVC_ERROR_NOT_IMPLEMENTED, DUVC_ERROR_PERMISSION_DENIED, DUVC_ERROR_PROPERTY_NOT_SUPPORTED, DUVC_ERROR_SYSTEM_ERROR, DUVC_ERROR_TIMEOUT, and DUVC_SUCCESS.

Referenced by duvc_get_error_statistics(), and duvc_suggest_error_resolution().

Here is the caller graph for this function:

◆ duvc_find_device_by_path()

duvc_result_t duvc_find_device_by_path ( const char * device_path_utf8,
duvc_device_t ** device )

Find device by unique Windows device path.

Parameters
device_path_utf8UTF-8 encoded Windows device path
[out]devicePointer to receive found device handle
Returns
DUVC_SUCCESS on success, DUVC_ERROR_DEVICE_NOT_FOUND if not found

Provides precise device selection when multiple cameras share names/VID/PID. The device path format is: USB\VID_XXXX&PID_XXXX&MI_XX#...#{GUID}

Note
Device is managed by library - do not free manually
See also
duvc_list_devices() to obtain device paths
duvc_get_device_path() to extract path from device

Definition at line 556 of file api.cpp.

References DUVC_ERROR_DEVICE_NOT_FOUND, DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc::find_device_by_path(), and duvc::to_wstring().

Here is the call graph for this function:

◆ duvc_free_device_capabilities()

void duvc_free_device_capabilities ( duvc_device_capabilities_t * caps)

Free device capabilities.

Parameters
capsCapabilities handle to free

Definition at line 1477 of file api.cpp.

◆ duvc_free_device_list()

void duvc_free_device_list ( duvc_device_t ** devices,
size_t count )

Free device list.

Parameters
devicesDevice array to free
countNumber of devices in array

Definition at line 590 of file api.cpp.

◆ duvc_get_camera_capability()

duvc_result_t duvc_get_camera_capability ( const duvc_device_capabilities_t * caps,
duvc_cam_prop_t prop,
duvc_prop_range_t * range,
duvc_prop_setting_t * current )

Get camera property capability.

Parameters
capsDevice capabilities handle
propCamera property to query
[out]rangeProperty range (can be NULL if not needed)
[out]currentCurrent property value (can be NULL if not needed)
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1525 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_PROPERTY_NOT_SUPPORTED, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::DeviceCapabilities::get_camera_capability().

Here is the call graph for this function:

◆ duvc_get_camera_property()

duvc_result_t duvc_get_camera_property ( duvc_connection_t * conn,
duvc_cam_prop_t prop,
duvc_prop_setting_t * setting )

Get camera property value.

Parameters
connCamera connection
propCamera property to query
[out]settingProperty setting (value and mode)
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 875 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.

◆ duvc_get_camera_property_range()

duvc_result_t duvc_get_camera_property_range ( duvc_connection_t * conn,
duvc_cam_prop_t prop,
duvc_prop_range_t * range )

Get camera property range.

Parameters
connCamera connection
propCamera property to query
[out]rangeProperty range information
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 935 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.

◆ duvc_get_device_capabilities()

duvc_result_t duvc_get_device_capabilities ( const duvc_device_t * device,
duvc_device_capabilities_t ** caps )

Get device capabilities snapshot.

Parameters
deviceDevice to analyze
[out]capsPointer to receive capabilities handle
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1412 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::get_device_capabilities().

Here is the call graph for this function:

◆ duvc_get_device_capabilities_by_index()

duvc_result_t duvc_get_device_capabilities_by_index ( int device_index,
duvc_device_capabilities_t ** caps )

Get device capabilities by index.

Parameters
device_indexDevice index from duvc_list_devices()
[out]capsPointer to receive capabilities handle
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1446 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::get_device_capabilities().

Here is the call graph for this function:

◆ duvc_get_device_id()

duvc_result_t duvc_get_device_id ( const duvc_device_t * device,
char * buffer,
size_t buffer_size,
size_t * required )

Get device ID.

Parameters
deviceDevice to query
[out]bufferBuffer to receive ID
buffer_sizeSize of buffer in bytes
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

Definition at line 668 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, duvc::Device::name, and duvc::Device::path.

◆ duvc_get_device_name()

duvc_result_t duvc_get_device_name ( const duvc_device_t * device,
char * buffer,
size_t buffer_size,
size_t * required )

Get device name.

Parameters
deviceDevice to query
[out]bufferBuffer to receive name
buffer_sizeSize of buffer in bytes
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

Definition at line 626 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::Device::name.

◆ duvc_get_device_path()

duvc_result_t duvc_get_device_path ( const duvc_device_t * device,
char * buffer,
size_t buffer_size,
size_t * required )

Get device path.

Parameters
deviceDevice to query
[out]bufferBuffer to receive path
buffer_sizeSize of buffer in bytes
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

Definition at line 647 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::Device::path.

◆ duvc_get_diagnostic_info()

duvc_result_t duvc_get_diagnostic_info ( char * buffer,
size_t buffer_size,
size_t * required_size )

Get diagnostic information.

Parameters
[out]bufferBuffer to receive diagnostic info
buffer_sizeSize of buffer in bytes
[out]required_sizeRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_get_hresult_details()

duvc_result_t duvc_get_hresult_details ( int32_t hr,
char * buffer,
size_t buffer_size,
size_t * required )

Get detailed HRESULT information.

Parameters
hrHRESULT value to analyze
[out]bufferBuffer to receive detailed information
buffer_sizeSize of buffer in bytes
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_get_last_error_details()

duvc_result_t duvc_get_last_error_details ( char * buffer,
size_t buffer_size,
size_t * required_size )

Get last error details.

Parameters
[out]bufferBuffer to receive error details
buffer_sizeSize of buffer in bytes
[out]required_sizeRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

Definition at line 1839 of file api.cpp.

◆ duvc_get_log_level()

duvc_result_t duvc_get_log_level ( duvc_log_level_t * level)

Get current log level.

Parameters
[out]levelCurrent minimum log level
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 449 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::get_log_level().

Here is the call graph for this function:

◆ duvc_get_logitech_property()

duvc_result_t duvc_get_logitech_property ( const duvc_device_t * device,
duvc_logitech_prop_t prop,
void * data,
size_t data_size,
size_t * bytes_returned )

Get Logitech vendor property.

Parameters
deviceTarget device
propLogitech property to get
[out]dataBuffer to receive property data
data_sizeSize of data buffer
[out]bytes_returnedActual bytes returned
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_get_multiple_camera_properties()

duvc_result_t duvc_get_multiple_camera_properties ( duvc_connection_t * conn,
const duvc_cam_prop_t * props,
duvc_prop_setting_t * settings,
size_t count )

Get multiple camera properties.

Parameters
connCamera connection
propsArray of camera properties to query
[out]settingsArray to receive property settings
countNumber of properties in arrays
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1063 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::Camera::get().

Here is the call graph for this function:

◆ duvc_get_multiple_video_properties()

duvc_result_t duvc_get_multiple_video_properties ( duvc_connection_t * conn,
const duvc_vid_prop_t * props,
duvc_prop_setting_t * settings,
size_t count )

Get multiple video properties.

Parameters
connCamera connection
propsArray of video properties to query
[out]settingsArray to receive property settings
countNumber of properties in arrays
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1138 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::Camera::get().

Here is the call graph for this function:

◆ duvc_get_platform_info()

duvc_result_t duvc_get_platform_info ( char * buffer,
size_t buffer_size,
size_t * required )

Get platform information.

Parameters
[out]bufferBuffer to receive platform info
buffer_sizeSize of buffer in bytes
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_get_supported_camera_properties()

duvc_result_t duvc_get_supported_camera_properties ( const duvc_device_capabilities_t * caps,
duvc_cam_prop_t * props,
size_t max_count,
size_t * actual_count )

Get list of supported camera properties.

Parameters
capsDevice capabilities handle
[out]propsArray to receive supported properties
max_countMaximum number of properties that can be stored
[out]actual_countActual number of supported properties
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if array too small

Definition at line 1648 of file api.cpp.

References DUVC_ERROR_BUFFER_TOO_SMALL, DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::DeviceCapabilities::supported_camera_properties().

Here is the call graph for this function:

◆ duvc_get_supported_video_properties()

duvc_result_t duvc_get_supported_video_properties ( const duvc_device_capabilities_t * caps,
duvc_vid_prop_t * props,
size_t max_count,
size_t * actual_count )

Get list of supported video properties.

Parameters
capsDevice capabilities handle
[out]propsArray to receive supported properties
max_countMaximum number of properties that can be stored
[out]actual_countActual number of supported properties
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if array too small

Definition at line 1683 of file api.cpp.

References DUVC_ERROR_BUFFER_TOO_SMALL, DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::DeviceCapabilities::supported_video_properties().

Here is the call graph for this function:

◆ duvc_get_vendor_property()

duvc_result_t duvc_get_vendor_property ( const duvc_device_t * device,
const char * property_set_guid,
uint32_t property_id,
void * data,
size_t data_size,
size_t * bytes_returned )

Get vendor-specific property.

Parameters
deviceTarget device
property_set_guidProperty set GUID as string
property_idProperty ID within set
[out]dataBuffer to receive property data
data_sizeSize of data buffer
[out]bytes_returnedActual bytes returned
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

◆ duvc_get_version()

uint32_t duvc_get_version ( void )

Get library version.

Returns
Combined version number as returned by DUVC_ABI_VERSION macro

Definition at line 234 of file api.cpp.

References DUVC_ABI_VERSION.

◆ duvc_get_version_string()

const char * duvc_get_version_string ( void )

Get library version string.

Returns
Null-terminated version string (e.g., "1.0.0")
Note
Returned string is statically allocated and should not be freed

Definition at line 236 of file api.cpp.

References DUVC_ABI_VERSION_STRING.

◆ duvc_get_video_capability()

duvc_result_t duvc_get_video_capability ( const duvc_device_capabilities_t * caps,
duvc_vid_prop_t prop,
duvc_prop_range_t * range,
duvc_prop_setting_t * current )

Get video property capability.

Parameters
capsDevice capabilities handle
propVideo property to query
[out]rangeProperty range (can be NULL if not needed)
[out]currentCurrent property value (can be NULL if not needed)
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1563 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_PROPERTY_NOT_SUPPORTED, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::DeviceCapabilities::get_video_capability().

Here is the call graph for this function:

◆ duvc_get_video_property()

duvc_result_t duvc_get_video_property ( duvc_connection_t * conn,
duvc_vid_prop_t prop,
duvc_prop_setting_t * setting )

Get video property value.

Parameters
connCamera connection
propVideo property to query
[out]settingProperty setting (value and mode)
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 967 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.

◆ duvc_get_video_property_range()

duvc_result_t duvc_get_video_property_range ( duvc_connection_t * conn,
duvc_vid_prop_t prop,
duvc_prop_range_t * range )

Get video property range.

Parameters
connCamera connection
propVideo property to query
[out]rangeProperty range information
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1027 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.

◆ duvc_has_camera_permissions()

duvc_result_t duvc_has_camera_permissions ( int * has_permissions)

Check if current process has camera permissions.

Parameters
[out]has_permissions1 if has permissions, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

◆ duvc_initialize()

duvc_result_t duvc_initialize ( void )

Initialize library.

Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 261 of file api.cpp.

References DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc::Info, duvc::log_info(), and duvc::set_log_level().

Here is the call graph for this function:

◆ duvc_is_device_connected()

duvc_result_t duvc_is_device_connected ( const duvc_device_t * device,
int * connected )

Check if device is connected.

Parameters
deviceDevice to check
[out]connected1 if connected, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 600 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::is_device_connected().

Here is the call graph for this function:

◆ duvc_is_device_error()

int duvc_is_device_error ( duvc_result_t result)

Check if error is device-related.

Parameters
resultError code to check
Returns
1 if device-related error, 0 if not

◆ duvc_is_hresult_device_error()

int duvc_is_hresult_device_error ( int32_t hr)

Check if HRESULT indicates device error.

Parameters
hrHRESULT value to check
Returns
1 if device-related error, 0 if not

◆ duvc_is_hresult_permission_error()

int duvc_is_hresult_permission_error ( int32_t hr)

Check if HRESULT indicates permission error.

Parameters
hrHRESULT value to check
Returns
1 if permission-related error, 0 if not

◆ duvc_is_initialized()

int duvc_is_initialized ( void )

Check if library is initialized.

Returns
1 if initialized, 0 if not

Definition at line 335 of file api.cpp.

◆ duvc_is_permission_error()

int duvc_is_permission_error ( duvc_result_t result)

Check if error is permission-related.

Parameters
resultError code to check
Returns
1 if permission-related error, 0 if not

◆ duvc_list_devices()

duvc_result_t duvc_list_devices ( duvc_device_t *** devices,
size_t * count )

List all connected devices.

Parameters
[out]devicesPointer to receive device array
[out]countNumber of devices found
Returns
DUVC_SUCCESS on success, error code on failure
Note
Caller must free with duvc_free_device_list()

Definition at line 510 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::list_devices().

Here is the call graph for this function:

◆ duvc_log_critical()

duvc_result_t duvc_log_critical ( const char * message)

Log critical message.

Parameters
messageCritical message to log
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 502 of file api.cpp.

References DUVC_LOG_CRITICAL, and duvc_log_message().

Here is the call graph for this function:

◆ duvc_log_debug()

duvc_result_t duvc_log_debug ( const char * message)

Log debug message.

Parameters
messageDebug message to log
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 486 of file api.cpp.

References DUVC_LOG_DEBUG, and duvc_log_message().

Here is the call graph for this function:

◆ duvc_log_error()

duvc_result_t duvc_log_error ( const char * message)

Log error message.

Parameters
messageError message to log
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 498 of file api.cpp.

References DUVC_LOG_ERROR, and duvc_log_message().

Here is the call graph for this function:

◆ duvc_log_info()

duvc_result_t duvc_log_info ( const char * message)

Log info message.

Parameters
messageInfo message to log
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 490 of file api.cpp.

References DUVC_LOG_INFO, and duvc_log_message().

Here is the call graph for this function:

◆ duvc_log_level_to_string()

const char * duvc_log_level_to_string ( duvc_log_level_t level)

Convert log level to string.

Parameters
levelLog level to convert
Returns
Null-terminated log level name string (statically allocated)

Definition at line 385 of file api.cpp.

References DUVC_LOG_CRITICAL, DUVC_LOG_DEBUG, DUVC_LOG_ERROR, DUVC_LOG_INFO, and DUVC_LOG_WARNING.

◆ duvc_log_message()

duvc_result_t duvc_log_message ( duvc_log_level_t level,
const char * message )

Log message at specific level.

Parameters
levelLog level
messageMessage to log
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 467 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::log_message().

Referenced by duvc_log_critical(), duvc_log_debug(), duvc_log_error(), duvc_log_info(), and duvc_log_warning().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ duvc_log_warning()

duvc_result_t duvc_log_warning ( const char * message)

Log warning message.

Parameters
messageWarning message to log
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 494 of file api.cpp.

References duvc_log_message(), and DUVC_LOG_WARNING.

Here is the call graph for this function:

◆ duvc_open_camera()

duvc_result_t duvc_open_camera ( const duvc_device_t * device,
duvc_connection_t ** conn )

Open camera by device handle.

Parameters
deviceDevice to connect to
[out]connPointer to receive connection handle
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 806 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_open_camera_by_index()

duvc_result_t duvc_open_camera_by_index ( int device_index,
duvc_connection_t ** conn )

Open camera by device index.

Parameters
device_indexIndex from duvc_list_devices()
[out]connPointer to receive connection handle
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 775 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_prop_capability_supports_auto()

duvc_result_t duvc_prop_capability_supports_auto ( const duvc_prop_range_t * range,
int * supports_auto )

Check if property supports auto mode.

Parameters
rangeProperty range to check
[out]supports_auto1 if auto mode supported, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1818 of file api.cpp.

References duvc_prop_range_t::default_mode, DUVC_CAM_MODE_AUTO, DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.

◆ duvc_prop_range_clamp()

duvc_result_t duvc_prop_range_clamp ( const duvc_prop_range_t * range,
int32_t value,
int32_t * clamped_value )

Clamp value to valid range.

Parameters
rangeProperty range to clamp to
valueValue to clamp
[out]clamped_valueClamped value within range
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1774 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc_prop_range_t::max, duvc_prop_range_t::min, and duvc_prop_range_t::step.

◆ duvc_prop_range_is_valid()

duvc_result_t duvc_prop_range_is_valid ( const duvc_prop_range_t * range,
int32_t value,
int * valid )

Check if value is valid for range.

Parameters
rangeProperty range to check against
valueValue to validate
[out]valid1 if valid, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1743 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc_prop_range_t::max, duvc_prop_range_t::min, and duvc_prop_range_t::step.

◆ duvc_query_vendor_property_support()

duvc_result_t duvc_query_vendor_property_support ( const duvc_device_t * device,
const char * property_set_guid,
uint32_t property_id,
int * supported )

Query vendor property support.

Parameters
deviceTarget device
property_set_guidProperty set GUID as string
property_idProperty ID within set
[out]supported1 if supported, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

◆ duvc_quick_get_camera_property()

duvc_result_t duvc_quick_get_camera_property ( const duvc_device_t * device,
duvc_cam_prop_t prop,
duvc_prop_setting_t * setting )

Quick get camera property (creates temporary connection)

Parameters
deviceDevice to query
propCamera property to get
[out]settingProperty setting (value and mode)
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1217 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_quick_get_camera_property_range()

duvc_result_t duvc_quick_get_camera_property_range ( const duvc_device_t * device,
duvc_cam_prop_t prop,
duvc_prop_range_t * range )

Quick get camera property range.

Parameters
deviceDevice to query
propCamera property to query
[out]rangeProperty range information
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1280 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_quick_get_video_property()

duvc_result_t duvc_quick_get_video_property ( const duvc_device_t * device,
duvc_vid_prop_t prop,
duvc_prop_setting_t * setting )

Quick get video property.

Parameters
deviceDevice to query
propVideo property to get
[out]settingProperty setting (value and mode)
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1313 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_quick_get_video_property_range()

duvc_result_t duvc_quick_get_video_property_range ( const duvc_device_t * device,
duvc_vid_prop_t prop,
duvc_prop_range_t * range )

Quick get video property range.

Parameters
deviceDevice to query
propVideo property to query
[out]rangeProperty range information
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1375 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_quick_set_camera_property()

duvc_result_t duvc_quick_set_camera_property ( const duvc_device_t * device,
duvc_cam_prop_t prop,
const duvc_prop_setting_t * setting )

Quick set camera property (creates temporary connection)

Parameters
deviceDevice to modify
propCamera property to set
settingProperty setting to apply
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1251 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_quick_set_video_property()

duvc_result_t duvc_quick_set_video_property ( const duvc_device_t * device,
duvc_vid_prop_t prop,
const duvc_prop_setting_t * setting )

Quick set video property.

Parameters
deviceDevice to modify
propVideo property to set
settingProperty setting to apply
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1347 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::open_camera().

Here is the call graph for this function:

◆ duvc_refresh_device_capabilities()

duvc_result_t duvc_refresh_device_capabilities ( duvc_device_capabilities_t * caps)

Refresh capabilities snapshot.

Parameters
capsCapabilities handle to refresh
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1500 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::DeviceCapabilities::refresh().

Here is the call graph for this function:

◆ duvc_register_device_change_callback()

duvc_result_t duvc_register_device_change_callback ( duvc_device_change_callback callback,
void * user_data )

Register device change callback.

Parameters
callbackCallback function to register
user_dataUser data to pass to callback
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 715 of file api.cpp.

References DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc::register_device_change_callback(), and duvc::to_utf8().

Here is the call graph for this function:

◆ duvc_set_camera_property()

duvc_result_t duvc_set_camera_property ( duvc_connection_t * conn,
duvc_cam_prop_t prop,
const duvc_prop_setting_t * setting )

Set camera property value.

Parameters
connCamera connection
propCamera property to set
settingProperty setting to apply
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 907 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, and DUVC_ERROR_SYSTEM_ERROR.

◆ duvc_set_log_callback()

duvc_result_t duvc_set_log_callback ( duvc_log_callback callback,
void * user_data )

Set log callback.

Parameters
callbackLog callback function (NULL to disable logging)
user_dataUser data passed to callback
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 406 of file api.cpp.

References DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::set_log_callback().

Here is the call graph for this function:

◆ duvc_set_log_level()

duvc_result_t duvc_set_log_level ( duvc_log_level_t level)

Set minimum log level.

Parameters
levelMinimum level to log
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 432 of file api.cpp.

References DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::set_log_level().

Here is the call graph for this function:

◆ duvc_set_logitech_property()

duvc_result_t duvc_set_logitech_property ( const duvc_device_t * device,
duvc_logitech_prop_t prop,
const void * data,
size_t data_size )

Set Logitech vendor property.

Parameters
deviceTarget device
propLogitech property to set
dataProperty data to set
data_sizeSize of property data
Returns
DUVC_SUCCESS on success, error code on failure

◆ duvc_set_multiple_camera_properties()

duvc_result_t duvc_set_multiple_camera_properties ( duvc_connection_t * conn,
const duvc_cam_prop_t * props,
const duvc_prop_setting_t * settings,
size_t count )

Set multiple camera properties.

Parameters
connCamera connection
propsArray of camera properties to set
settingsArray of property settings to apply
countNumber of properties in arrays
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1101 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc::Camera::get(), and duvc::Camera::set().

Here is the call graph for this function:

◆ duvc_set_multiple_video_properties()

duvc_result_t duvc_set_multiple_video_properties ( duvc_connection_t * conn,
const duvc_vid_prop_t * props,
const duvc_prop_setting_t * settings,
size_t count )

Set multiple video properties.

Parameters
connCamera connection
propsArray of video properties to set
settingsArray of property settings to apply
countNumber of properties in arrays
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1176 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc::Camera::get(), and duvc::Camera::set().

Here is the call graph for this function:

◆ duvc_set_vendor_property()

duvc_result_t duvc_set_vendor_property ( const duvc_device_t * device,
const char * property_set_guid,
uint32_t property_id,
const void * data,
size_t data_size )

Set vendor-specific property.

Parameters
deviceTarget device
property_set_guidProperty set GUID as string
property_idProperty ID within set
dataProperty data to set
data_sizeSize of property data
Returns
DUVC_SUCCESS on success, error code on failure

◆ duvc_set_video_property()

duvc_result_t duvc_set_video_property ( duvc_connection_t * conn,
duvc_vid_prop_t prop,
const duvc_prop_setting_t * setting )

Set video property value.

Parameters
connCamera connection
propVideo property to set
settingProperty setting to apply
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 999 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, and DUVC_ERROR_SYSTEM_ERROR.

◆ duvc_shutdown()

void duvc_shutdown ( void )

Shutdown library.

Note
Cleans up all resources and connections

Definition at line 293 of file api.cpp.

References duvc_unregister_device_change_callback().

Here is the call graph for this function:

◆ duvc_supports_camera_property()

duvc_result_t duvc_supports_camera_property ( const duvc_device_capabilities_t * caps,
duvc_cam_prop_t prop,
int * supported )

Check if camera property is supported.

Parameters
capsDevice capabilities handle
propCamera property to check
[out]supported1 if supported, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1602 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::DeviceCapabilities::supports_camera_property().

Here is the call graph for this function:

◆ duvc_supports_logitech_properties()

duvc_result_t duvc_supports_logitech_properties ( const duvc_device_t * device,
int * supported )

Check Logitech vendor property support.

Parameters
deviceTarget device
[out]supported1 if Logitech properties supported, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

◆ duvc_supports_video_property()

duvc_result_t duvc_supports_video_property ( const duvc_device_capabilities_t * caps,
duvc_vid_prop_t prop,
int * supported )

Check if video property is supported.

Parameters
capsDevice capabilities handle
propVideo property to check
[out]supported1 if supported, 0 if not
Returns
DUVC_SUCCESS on success, error code on failure

Definition at line 1625 of file api.cpp.

References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::DeviceCapabilities::supports_video_property().

Here is the call graph for this function:

◆ duvc_unregister_device_change_callback()

void duvc_unregister_device_change_callback ( void )

Unregister device change callback.

Note
Stops monitoring device changes and cleans up resources

Definition at line 752 of file api.cpp.

References duvc::unregister_device_change_callback().

Referenced by duvc_shutdown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ duvc_vid_prop_to_string()

const char * duvc_vid_prop_to_string ( duvc_vid_prop_t prop)

Convert video property to string.

Parameters
propVideo property to convert
Returns
Null-terminated property name string (statically allocated)

Definition at line 377 of file api.cpp.

References duvc::to_string().

Here is the call graph for this function:

◆ duvc_vid_prop_to_wstring()

duvc_result_t duvc_vid_prop_to_wstring ( duvc_vid_prop_t prop,
wchar_t * buffer,
size_t buffer_size,
size_t * required )

Convert video property to wide string.

Parameters
propVideo property to convert
[out]bufferBuffer to receive wide string
buffer_sizeSize of buffer in wide characters
[out]requiredRequired buffer size (including null terminator)
Returns
DUVC_SUCCESS on success, DUVC_ERROR_BUFFER_TOO_SMALL if buffer too small

Variable Documentation

◆ DUVC_LOGITECH_PROPERTY_SET_GUID

const char DUVC_LOGITECH_PROPERTY_SET_GUID[39]
extern

Logitech property set GUID string.