|
duvc-ctl 2.0.0
USB Video Class Camera Control Library
|
Complete C ABI implementation for duvc-ctl library. More...
#include "duvc-ctl/c/api.h"#include "duvc-ctl/core/camera.h"#include "duvc-ctl/core/capability.h"#include "duvc-ctl/core/device.h"#include "duvc-ctl/core/result.h"#include "duvc-ctl/core/types.h"#include "duvc-ctl/utils/error_decoder.h"#include "duvc-ctl/utils/logging.h"#include "duvc-ctl/utils/string_conversion.h"#include "duvc-ctl/platform/windows/connection_pool.h"#include <algorithm>#include <atomic>#include <cstring>#include <memory>#include <mutex>#include <string>#include <unordered_map>#include <vector>Go to the source code of this file.
Macros | |
| #define | DUVC_ABI_VERSION_STRING "1.0.0" |
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. | |
| const char * | duvc_error_code_to_string (duvc_result_t code) |
| Convert error code to string. | |
| 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_log_level_to_string (duvc_log_level_t level) |
| Convert log level to string. | |
| 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_last_error_details (char *buffer, size_t buffer_size, size_t *required_size) |
| Get last error details. | |
| void | duvc_clear_last_error (void) |
| Clear last error information. | |
Complete C ABI implementation for duvc-ctl library.
This file implements the comprehensive C ABI interface, providing a stable C-compatible API that bridges to the underlying C++ implementation. All C++ exceptions are caught and converted to appropriate C error codes. Memory management is handled appropriately for C consumers.
Definition in file api.cpp.
| #define DUVC_ABI_VERSION_STRING "1.0.0" |
Definition at line 41 of file api.cpp.
Referenced by duvc_get_version_string().
| const char * duvc_cam_mode_to_string | ( | duvc_cam_mode_t | mode | ) |
Convert camera mode to string.
| mode | Camera mode to convert |
Definition at line 381 of file api.cpp.
References duvc::to_string().
| const char * duvc_cam_prop_to_string | ( | duvc_cam_prop_t | prop | ) |
Convert camera property to string.
| prop | Camera property to convert |
Definition at line 372 of file api.cpp.
References duvc::to_string().
| int duvc_camera_is_valid | ( | const duvc_connection_t * | conn | ) |
| duvc_result_t duvc_capabilities_is_device_accessible | ( | const duvc_device_capabilities_t * | caps, |
| int * | accessible ) |
Check if device is accessible.
| caps | Device capabilities handle | |
| [out] | accessible | 1 if accessible, 0 if not |
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().
| int duvc_check_abi_compatibility | ( | uint32_t | compiled_version | ) |
Check ABI compatibility.
| compiled_version | Version the application was compiled with (use DUVC_ABI_VERSION) |
Definition at line 238 of file api.cpp.
References duvc_get_version().
| void duvc_clear_last_error | ( | void | ) |
| void duvc_close_camera | ( | duvc_connection_t * | conn | ) |
| duvc_result_t duvc_device_is_valid | ( | const duvc_device_t * | device, |
| int * | valid ) |
Check if device is valid.
| device | Device to check | |
| [out] | valid | 1 if valid, 0 if not |
Definition at line 690 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::Device::is_valid().
| const char * duvc_error_code_to_string | ( | duvc_result_t | code | ) |
Convert error code to string.
| code | Error code to convert |
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().
| duvc_result_t duvc_find_device_by_path | ( | const char * | device_path_utf8, |
| duvc_device_t ** | device ) |
Find device by unique Windows device path.
| device_path_utf8 | UTF-8 encoded Windows device path | |
| [out] | device | Pointer to receive found device handle |
Provides precise device selection when multiple cameras share names/VID/PID. The device path format is: USB\VID_XXXX&PID_XXXX&MI_XX#...#{GUID}
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().
| void duvc_free_device_capabilities | ( | duvc_device_capabilities_t * | caps | ) |
| void duvc_free_device_list | ( | duvc_device_t ** | devices, |
| size_t | count ) |
| 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.
| caps | Device capabilities handle | |
| prop | Camera property to query | |
| [out] | range | Property range (can be NULL if not needed) |
| [out] | current | Current property value (can be NULL if not needed) |
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().
| 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.
| conn | Camera connection | |
| prop | Camera property to query | |
| [out] | setting | Property setting (value and mode) |
Definition at line 875 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.
| 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.
| conn | Camera connection | |
| prop | Camera property to query | |
| [out] | range | Property range information |
Definition at line 935 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.
| duvc_result_t duvc_get_device_capabilities | ( | const duvc_device_t * | device, |
| duvc_device_capabilities_t ** | caps ) |
Get device capabilities snapshot.
| device | Device to analyze | |
| [out] | caps | Pointer to receive capabilities handle |
Definition at line 1412 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::get_device_capabilities().
| duvc_result_t duvc_get_device_capabilities_by_index | ( | int | device_index, |
| duvc_device_capabilities_t ** | caps ) |
Get device capabilities by index.
| device_index | Device index from duvc_list_devices() | |
| [out] | caps | Pointer to receive capabilities handle |
Definition at line 1446 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::get_device_capabilities().
| duvc_result_t duvc_get_device_id | ( | const duvc_device_t * | device, |
| char * | buffer, | ||
| size_t | buffer_size, | ||
| size_t * | required ) |
Get device ID.
| device | Device to query | |
| [out] | buffer | Buffer to receive ID |
| buffer_size | Size of buffer in bytes | |
| [out] | required | Required buffer size (including null terminator) |
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_result_t duvc_get_device_name | ( | const duvc_device_t * | device, |
| char * | buffer, | ||
| size_t | buffer_size, | ||
| size_t * | required ) |
Get device name.
| device | Device to query | |
| [out] | buffer | Buffer to receive name |
| buffer_size | Size of buffer in bytes | |
| [out] | required | Required buffer size (including null terminator) |
Definition at line 626 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::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.
| device | Device to query | |
| [out] | buffer | Buffer to receive path |
| buffer_size | Size of buffer in bytes | |
| [out] | required | Required buffer size (including null terminator) |
Definition at line 647 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::Device::path.
| duvc_result_t duvc_get_last_error_details | ( | char * | buffer, |
| size_t | buffer_size, | ||
| size_t * | required_size ) |
Get last error details.
| [out] | buffer | Buffer to receive error details |
| buffer_size | Size of buffer in bytes | |
| [out] | required_size | Required buffer size (including null terminator) |
| duvc_result_t duvc_get_log_level | ( | duvc_log_level_t * | level | ) |
Get current log level.
| [out] | level | Current minimum log level |
Definition at line 449 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::get_log_level().
| 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.
| conn | Camera connection | |
| props | Array of camera properties to query | |
| [out] | settings | Array to receive property settings |
| count | Number of properties in arrays |
Definition at line 1063 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::Camera::get().
| 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.
| conn | Camera connection | |
| props | Array of video properties to query | |
| [out] | settings | Array to receive property settings |
| count | Number of properties in arrays |
Definition at line 1138 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::Camera::get().
| 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.
| caps | Device capabilities handle | |
| [out] | props | Array to receive supported properties |
| max_count | Maximum number of properties that can be stored | |
| [out] | actual_count | Actual number of supported properties |
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().
| 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.
| caps | Device capabilities handle | |
| [out] | props | Array to receive supported properties |
| max_count | Maximum number of properties that can be stored | |
| [out] | actual_count | Actual number of supported properties |
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().
| uint32_t duvc_get_version | ( | void | ) |
Get library version.
Get runtime library version.
Definition at line 234 of file api.cpp.
References DUVC_ABI_VERSION.
Referenced by duvc_check_abi_compatibility().
| const char * duvc_get_version_string | ( | void | ) |
Get library version string.
Get runtime library version string.
Definition at line 236 of file api.cpp.
References DUVC_ABI_VERSION_STRING.
| 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.
| caps | Device capabilities handle | |
| prop | Video property to query | |
| [out] | range | Property range (can be NULL if not needed) |
| [out] | current | Current property value (can be NULL if not needed) |
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().
| 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.
| conn | Camera connection | |
| prop | Video property to query | |
| [out] | setting | Property setting (value and mode) |
Definition at line 967 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.
| 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.
| conn | Camera connection | |
| prop | Video property to query | |
| [out] | range | Property range information |
Definition at line 1027 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.
| duvc_result_t duvc_initialize | ( | void | ) |
Initialize library.
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().
| duvc_result_t duvc_is_device_connected | ( | const duvc_device_t * | device, |
| int * | connected ) |
Check if device is connected.
| device | Device to check | |
| [out] | connected | 1 if connected, 0 if not |
Definition at line 600 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::is_device_connected().
| int duvc_is_initialized | ( | void | ) |
| duvc_result_t duvc_list_devices | ( | duvc_device_t *** | devices, |
| size_t * | count ) |
List all connected devices.
| [out] | devices | Pointer to receive device array |
| [out] | count | Number of devices found |
Definition at line 510 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::list_devices().
| duvc_result_t duvc_log_critical | ( | const char * | message | ) |
Log critical message.
| message | Critical message to log |
Definition at line 502 of file api.cpp.
References DUVC_LOG_CRITICAL, and duvc_log_message().
| duvc_result_t duvc_log_debug | ( | const char * | message | ) |
Log debug message.
| message | Debug message to log |
Definition at line 486 of file api.cpp.
References DUVC_LOG_DEBUG, and duvc_log_message().
| duvc_result_t duvc_log_error | ( | const char * | message | ) |
Log error message.
| message | Error message to log |
Definition at line 498 of file api.cpp.
References DUVC_LOG_ERROR, and duvc_log_message().
| duvc_result_t duvc_log_info | ( | const char * | message | ) |
Log info message.
| message | Info message to log |
Definition at line 490 of file api.cpp.
References DUVC_LOG_INFO, and duvc_log_message().
| const char * duvc_log_level_to_string | ( | duvc_log_level_t | level | ) |
Convert log level to string.
| level | Log level to convert |
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_result_t duvc_log_message | ( | duvc_log_level_t | level, |
| const char * | message ) |
Log message at specific level.
| level | Log level |
| message | Message to log |
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().
| duvc_result_t duvc_log_warning | ( | const char * | message | ) |
Log warning message.
| message | Warning message to log |
Definition at line 494 of file api.cpp.
References duvc_log_message(), and DUVC_LOG_WARNING.
| duvc_result_t duvc_open_camera | ( | const duvc_device_t * | device, |
| duvc_connection_t ** | conn ) |
Open camera by device handle.
| device | Device to connect to | |
| [out] | conn | Pointer to receive connection handle |
Definition at line 806 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().
| duvc_result_t duvc_open_camera_by_index | ( | int | device_index, |
| duvc_connection_t ** | conn ) |
Open camera by device index.
| device_index | Index from duvc_list_devices() | |
| [out] | conn | Pointer to receive connection handle |
Definition at line 775 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().
| duvc_result_t duvc_prop_capability_supports_auto | ( | const duvc_prop_range_t * | range, |
| int * | supports_auto ) |
Check if property supports auto mode.
| range | Property range to check | |
| [out] | supports_auto | 1 if auto mode supported, 0 if not |
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_result_t duvc_prop_range_clamp | ( | const duvc_prop_range_t * | range, |
| int32_t | value, | ||
| int32_t * | clamped_value ) |
Clamp value to valid range.
| range | Property range to clamp to | |
| value | Value to clamp | |
| [out] | clamped_value | Clamped value within range |
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_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.
| range | Property range to check against | |
| value | Value to validate | |
| [out] | valid | 1 if valid, 0 if not |
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_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)
| device | Device to query | |
| prop | Camera property to get | |
| [out] | setting | Property setting (value and mode) |
Definition at line 1217 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().
| 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.
| device | Device to query | |
| prop | Camera property to query | |
| [out] | range | Property range information |
Definition at line 1280 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().
| 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.
| device | Device to query | |
| prop | Video property to get | |
| [out] | setting | Property setting (value and mode) |
Definition at line 1313 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().
| 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.
| device | Device to query | |
| prop | Video property to query | |
| [out] | range | Property range information |
Definition at line 1375 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::open_camera().
| 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)
| device | Device to modify |
| prop | Camera property to set |
| setting | Property setting to apply |
Definition at line 1251 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::open_camera().
| 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.
| device | Device to modify |
| prop | Video property to set |
| setting | Property setting to apply |
Definition at line 1347 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::open_camera().
| duvc_result_t duvc_refresh_device_capabilities | ( | duvc_device_capabilities_t * | caps | ) |
Refresh capabilities snapshot.
| caps | Capabilities handle to refresh |
Definition at line 1500 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, DUVC_ERROR_SYSTEM_ERROR, and duvc::DeviceCapabilities::refresh().
| duvc_result_t duvc_register_device_change_callback | ( | duvc_device_change_callback | callback, |
| void * | user_data ) |
Register device change callback.
| callback | Callback function to register |
| user_data | User data to pass to callback |
Definition at line 715 of file api.cpp.
References DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, duvc::register_device_change_callback(), and duvc::to_utf8().
| 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.
| conn | Camera connection |
| prop | Camera property to set |
| setting | Property setting to apply |
Definition at line 907 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, and DUVC_ERROR_SYSTEM_ERROR.
| duvc_result_t duvc_set_log_callback | ( | duvc_log_callback | callback, |
| void * | user_data ) |
Set log callback.
| callback | Log callback function (NULL to disable logging) |
| user_data | User data passed to callback |
Definition at line 406 of file api.cpp.
References DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::set_log_callback().
| duvc_result_t duvc_set_log_level | ( | duvc_log_level_t | level | ) |
Set minimum log level.
| level | Minimum level to log |
Definition at line 432 of file api.cpp.
References DUVC_ERROR_SYSTEM_ERROR, DUVC_SUCCESS, and duvc::set_log_level().
| 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.
| conn | Camera connection |
| props | Array of camera properties to set |
| settings | Array of property settings to apply |
| count | Number of properties in arrays |
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().
| 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.
| conn | Camera connection |
| props | Array of video properties to set |
| settings | Array of property settings to apply |
| count | Number of properties in arrays |
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().
| 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.
| conn | Camera connection |
| prop | Video property to set |
| setting | Property setting to apply |
Definition at line 999 of file api.cpp.
References DUVC_ERROR_INVALID_ARGUMENT, and DUVC_ERROR_SYSTEM_ERROR.
| void duvc_shutdown | ( | void | ) |
Shutdown library.
Definition at line 293 of file api.cpp.
References duvc_unregister_device_change_callback().
| 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.
| caps | Device capabilities handle | |
| prop | Camera property to check | |
| [out] | supported | 1 if supported, 0 if not |
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().
| 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.
| caps | Device capabilities handle | |
| prop | Video property to check | |
| [out] | supported | 1 if supported, 0 if not |
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().
| void duvc_unregister_device_change_callback | ( | void | ) |
Unregister device change callback.
Definition at line 752 of file api.cpp.
References duvc::unregister_device_change_callback().
Referenced by duvc_shutdown().
| const char * duvc_vid_prop_to_string | ( | duvc_vid_prop_t | prop | ) |
Convert video property to string.
| prop | Video property to convert |
Definition at line 377 of file api.cpp.
References duvc::to_string().