|
duvc-ctl 2.0.0
USB Video Class Camera Control Library
|
Namespaces | |
| namespace | detail |
| Internal implementation details. | |
| namespace | logitech |
Classes | |
| class | Camera |
| RAII camera handle for simplified device management. More... | |
| class | com_apartment |
| class | com_ptr |
| struct | Device |
| Represents a camera device. More... | |
| class | DeviceCapabilities |
| Complete device capability snapshot. More... | |
| class | DeviceConnection |
| RAII wrapper for DirectShow device connections. More... | |
| class | Error |
| Error information with context. More... | |
| class | IDeviceConnection |
| Abstract interface for device-specific operations. More... | |
| class | IPlatformInterface |
| Abstract interface for platform-specific camera operations. More... | |
| class | KsPropertySet |
| RAII wrapper for IKsPropertySet interface. More... | |
| struct | PropertyCapability |
| Property capability information. More... | |
| struct | PropRange |
| Property range and default information. More... | |
| struct | PropSetting |
| Property setting with value and control mode. More... | |
| class | Result |
| Result type that can contain either a value or an error. More... | |
| class | Result< void > |
| Specialization for void results (operations that don't return values) More... | |
| struct | VendorProperty |
| Vendor-specific property data container. More... | |
| class | WindowsPlatformInterface |
| Windows DirectShow platform implementation. More... | |
Typedefs | |
| using | DeviceChangeCallback = std::function<void(bool device_added, const std::wstring& device_path)> |
| Device change callback function type. | |
| using | LogCallback |
| Log message callback type. | |
Functions | |
| std::vector< Device > | list_devices () |
| Enumerate all available video input devices. | |
| bool | get_range (const Device &dev, CamProp prop, PropRange &out) |
| Get the valid range for a camera control property. | |
| bool | get (const Device &dev, CamProp prop, PropSetting &out) |
| Get a camera control property value. | |
| bool | set (const Device &dev, CamProp prop, const PropSetting &in) |
| Set a camera control property value. | |
| bool | get_range (const Device &dev, VidProp prop, PropRange &out) |
| Get the valid range for a video processing property. | |
| bool | get (const Device &dev, VidProp prop, PropSetting &out) |
| Get a video processing property value. | |
| bool | set (const Device &dev, VidProp prop, const PropSetting &in) |
| Set a video processing property value. | |
| const char * | to_string (CamProp prop) |
| Convert camera property enum to string. | |
| const char * | to_string (VidProp prop) |
| Convert video property enum to string. | |
| const char * | to_string (CamMode mode) |
| Convert camera mode enum to string. | |
| const wchar_t * | to_wstring (CamProp prop) |
| Convert camera property enum to wide string. | |
| const wchar_t * | to_wstring (VidProp prop) |
| Convert video property enum to wide string. | |
| const wchar_t * | to_wstring (CamMode mode) |
| Convert camera mode enum to wide string. | |
| void | register_device_change_callback (DeviceChangeCallback callback) |
| Register callback for device hotplug events. | |
| void | unregister_device_change_callback () |
| Unregister device change callback. | |
| bool | is_device_connected (const Device &dev) |
| Check if a device is currently connected and accessible. | |
| bool | get_vendor_property (const Device &dev, const GUID &property_set, ULONG property_id, std::vector< uint8_t > &data) |
| Get vendor-specific property data from device. | |
| bool | set_vendor_property (const Device &dev, const GUID &property_set, ULONG property_id, const std::vector< uint8_t > &data) |
| Set vendor-specific property data on device. | |
| bool | query_vendor_property_support (const Device &dev, const GUID &property_set, ULONG property_id) |
| Query whether device supports a vendor-specific property. | |
| DeviceConnection * | get_cached_connection (const Device &dev) |
| void | release_cached_connection (const Device &dev) |
| void | clear_connection_cache () |
| Result< Camera > | open_camera (int device_index) |
| Create camera from device index. | |
| Result< Camera > | open_camera (const Device &device) |
| Create camera from device. | |
| Result< Camera > | open_camera (const std::wstring &device_path) |
| Create camera from device path. | |
| Result< DeviceCapabilities > | get_device_capabilities (const Device &device) |
| Create device capability snapshot. | |
| Result< DeviceCapabilities > | get_device_capabilities (int device_index) |
| Create device capability snapshot by index. | |
| Device | find_device_by_path (const std::wstring &device_path) |
| Find device by unique Windows device path. | |
| const char * | to_string (ErrorCode code) |
| Convert error code to string. | |
| template<typename T > | |
| Result< T > | Ok (T value) |
| Helper to create successful Result. | |
| Result< void > | Ok () |
| Helper to create successful void Result. | |
| template<typename T > | |
| Result< T > | Err (Error error) |
| Helper to create error Result. | |
| template<typename T > | |
| Result< T > | Err (ErrorCode code, std::string message="") |
| Helper to create error Result from code. | |
| std::unique_ptr< IPlatformInterface > | create_platform_interface () |
| Get platform-specific interface implementation. | |
| com_ptr< ICreateDevEnum > | create_dev_enum () |
| Create DirectShow device enumerator. | |
| com_ptr< IEnumMoniker > | enum_video_devices (ICreateDevEnum *dev) |
| Enumerate video input devices. | |
| std::wstring | read_friendly_name (IMoniker *mon) |
| Read friendly name from device moniker. | |
| std::wstring | read_device_path (IMoniker *mon) |
| Read device path from moniker. | |
| bool | is_same_device (const Device &d, const std::wstring &name, const std::wstring &path) |
| Check if two device identifiers refer to same device. | |
| com_ptr< IBaseFilter > | open_device_filter (const Device &dev) |
| Create DirectShow filter from device. | |
| std::string | decode_system_error (unsigned long error_code) |
| Decode system error code to human-readable string. | |
| std::string | decode_hresult (HRESULT hr) |
| Decode HRESULT to human-readable string. | |
| std::string | get_hresult_details (HRESULT hr) |
| Get detailed HRESULT information. | |
| bool | is_device_error (HRESULT hr) |
| Check if HRESULT indicates a device-related error. | |
| bool | is_permission_error (HRESULT hr) |
| Check if HRESULT indicates permission/access error. | |
| std::string | get_diagnostic_info () |
| Get diagnostic information for troubleshooting. | |
| const char * | to_string (LogLevel level) |
| Convert log level to string. | |
| void | set_log_callback (LogCallback callback) |
| Set global log callback. | |
| void | set_log_level (LogLevel level) |
| Set minimum log level. | |
| LogLevel | get_log_level () |
| Get current minimum log level. | |
| void | log_message (LogLevel level, const std::string &message) |
| Log a message. | |
| void | log_debug (const std::string &message) |
| Log debug message. | |
| void | log_info (const std::string &message) |
| Log info message. | |
| void | log_warning (const std::string &message) |
| Log warning message. | |
| void | log_error (const std::string &message) |
| Log error message. | |
| void | log_critical (const std::string &message) |
| Log critical message. | |
| std::string | to_utf8 (const std::wstring &wstr) |
| Converts a wide string (UTF-16 on Windows) to a UTF-8 string. | |
| std::wstring | to_wstring (const std::string &str) |
| Converts a UTF-8 string to a wide string (UTF-16 on Windows) | |
| static std::string | wide_to_utf8 (const wchar_t *ws) |
| static void | throw_hr (HRESULT hr, const char *where) |
| static LRESULT CALLBACK | device_wndproc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
| static std::wstring | read_prop_bstr (IPropertyBag *bag, const wchar_t *key) |
| static com_ptr< IBaseFilter > | bind_to_filter (IMoniker *mon) |
| static com_ptr< IAMCameraControl > | get_cam_ctrl (IBaseFilter *f) |
| static com_ptr< IAMVideoProcAmp > | get_vproc (IBaseFilter *f) |
| static com_ptr< IKsPropertySet > | get_property_set (IBaseFilter *f) |
| static long | camprop_to_dshow (CamProp p) |
| static long | vidprop_to_dshow (VidProp p) |
| static long | to_flag (CamMode m, bool is_camera_control) |
| static CamMode | from_flag (long flag, bool is_camera_control) |
| static std::wstring | read_prop_bstr (IPropertyBag *bag, const wchar_t *key) |
| static com_ptr< IBaseFilter > | bind_to_filter (IMoniker *mon) |
| static com_ptr< IAMCameraControl > | get_cam_ctrl (IBaseFilter *f) |
| static com_ptr< IAMVideoProcAmp > | get_vproc (IBaseFilter *f) |
| static long | camprop_to_dshow (CamProp p) |
| static long | vidprop_to_dshow (VidProp p) |
| static long | to_flag (CamMode m, bool is_camera_control) |
| static CamMode | from_flag (long flag, bool is_camera_control) |
| static LRESULT CALLBACK | device_notification_wndproc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
| Window procedure for handling device change notifications. | |
| static bool | register_notification_window_class () |
| Register window class for device notifications. | |
| static HWND | create_notification_window () |
| Create invisible window for receiving device notifications. | |
| static HDEVNOTIFY | register_device_notifications (HWND hwnd) |
| Register for device interface notifications. | |
| static std::string | get_timestamp () |
| Get current timestamp as string. | |
| static void | default_log_callback (LogLevel level, const std::string &message) |
| Default logging callback that writes to stderr. | |
| static com_ptr< IKsPropertySet > | get_property_set (IBaseFilter *f) |
Variables | |
| static DeviceChangeCallback | g_device_callback = nullptr |
| static HWND | g_notification_window = nullptr |
| static HDEVNOTIFY | g_device_notify = nullptr |
| static std::mutex | g_cache_mutex |
| static std::unordered_map< std::wstring, std::unique_ptr< DeviceConnection > > | g_connection_cache |
| static std::mutex | g_log_mutex |
| static LogCallback | g_log_callback = nullptr |
| static LogLevel | g_min_log_level = LogLevel::Info |
| using duvc::DeviceChangeCallback = std::function<void(bool device_added, const std::wstring& device_path)> |
|
strong |
|
strong |
|
strong |
Camera control properties (IAMCameraControl interface)
These properties correspond to DirectShow's IAMCameraControl interface and control physical camera mechanisms.
| Enumerator | |
|---|---|
| Pan | Horizontal camera rotation. |
| Tilt | Vertical camera rotation. |
| Roll | Camera roll rotation. |
| Zoom | Optical zoom level. |
| Exposure | Exposure time. |
| Iris | Aperture/iris setting. |
| Focus | Focus position. |
| ScanMode | Scan mode (progressive/interlaced) |
| Privacy | Privacy mode on/off. |
| PanRelative | Relative pan movement. |
| TiltRelative | Relative tilt movement. |
| RollRelative | Relative roll movement. |
| ZoomRelative | Relative zoom movement. |
| ExposureRelative | Relative exposure adjustment. |
| IrisRelative | Relative iris adjustment. |
| FocusRelative | Relative focus adjustment. |
| PanTilt | Combined pan/tilt control. |
| PanTiltRelative | Relative pan/tilt movement. |
| FocusSimple | Simple focus control. |
| DigitalZoom | Digital zoom level. |
| DigitalZoomRelative | Relative digital zoom. |
| BacklightCompensation | Backlight compensation. |
| Lamp | Camera lamp/flash control. |
| Pan | |
| Tilt | |
| Roll | |
| Zoom | |
| Exposure | |
| Iris | |
| Focus | |
| ScanMode | |
| Privacy | |
| PanRelative | |
| TiltRelative | |
| RollRelative | |
| ZoomRelative | |
| ExposureRelative | |
| IrisRelative | |
| FocusRelative | |
| PanTilt | |
| PanTiltRelative | |
| FocusSimple | |
| DigitalZoom | |
| DigitalZoomRelative | |
| BacklightCompensation | |
| Lamp | |
|
strong |
| Enumerator | |
|---|---|
| Pan | Horizontal camera rotation. |
| Tilt | Vertical camera rotation. |
| Roll | Camera roll rotation. |
| Zoom | Optical zoom level. |
| Exposure | Exposure time. |
| Iris | Aperture/iris setting. |
| Focus | Focus position. |
| ScanMode | Scan mode (progressive/interlaced) |
| Privacy | Privacy mode on/off. |
| PanRelative | Relative pan movement. |
| TiltRelative | Relative tilt movement. |
| RollRelative | Relative roll movement. |
| ZoomRelative | Relative zoom movement. |
| ExposureRelative | Relative exposure adjustment. |
| IrisRelative | Relative iris adjustment. |
| FocusRelative | Relative focus adjustment. |
| PanTilt | Combined pan/tilt control. |
| PanTiltRelative | Relative pan/tilt movement. |
| FocusSimple | Simple focus control. |
| DigitalZoom | Digital zoom level. |
| DigitalZoomRelative | Relative digital zoom. |
| BacklightCompensation | Backlight compensation. |
| Lamp | Camera lamp/flash control. |
| Pan | |
| Tilt | |
| Roll | |
| Zoom | |
| Exposure | |
| Iris | |
| Focus | |
| ScanMode | |
| Privacy | |
| PanRelative | |
| TiltRelative | |
| RollRelative | |
| ZoomRelative | |
| ExposureRelative | |
| IrisRelative | |
| FocusRelative | |
| PanTilt | |
| PanTiltRelative | |
| FocusSimple | |
| DigitalZoom | |
| DigitalZoomRelative | |
| BacklightCompensation | |
| Lamp | |
|
strong |
Error codes for duvc operations.
| Enumerator | |
|---|---|
| Success | Operation succeeded. |
| DeviceNotFound | Device not found or disconnected. |
| DeviceBusy | Device is busy or in use. |
| PropertyNotSupported | Property not supported by device. |
| InvalidValue | Property value out of range. |
| PermissionDenied | Insufficient permissions. |
| SystemError | System/platform error. |
| InvalidArgument | Invalid function argument. |
| NotImplemented | Feature not implemented on this platform. |
|
strong |
|
strong |
Video processing properties (IAMVideoProcAmp interface)
These properties correspond to DirectShow's IAMVideoProcAmp interface and control image processing parameters.
|
strong |
|
static |
Definition at line 223 of file core.cpp.
References throw_hr().
Referenced by open_device_filter().
|
static |
Definition at line 81 of file connection_pool.cpp.
References throw_hr().
Definition at line 279 of file core.cpp.
References BacklightCompensation, CameraControl_BacklightCompensation, CameraControl_DigitalZoom, CameraControl_DigitalZoomRelative, CameraControl_Exposure, CameraControl_ExposureRelative, CameraControl_Focus, CameraControl_FocusRelative, CameraControl_FocusSimple, CameraControl_Iris, CameraControl_IrisRelative, CameraControl_Lamp, CameraControl_Pan, CameraControl_PanRelative, CameraControl_PanTilt, CameraControl_PanTiltRelative, CameraControl_Privacy, CameraControl_Roll, CameraControl_RollRelative, CameraControl_ScanMode, CameraControl_Tilt, CameraControl_TiltRelative, CameraControl_Zoom, CameraControl_ZoomRelative, DigitalZoom, DigitalZoomRelative, Exposure, ExposureRelative, Focus, FocusRelative, FocusSimple, Iris, IrisRelative, Lamp, Pan, PanRelative, PanTilt, PanTiltRelative, Privacy, Roll, RollRelative, ScanMode, Tilt, TiltRelative, Zoom, and ZoomRelative.
Referenced by duvc::DeviceConnection::get(), duvc::DeviceConnection::get_range(), and duvc::DeviceConnection::set().
Definition at line 132 of file connection_pool.cpp.
References BacklightCompensation, CameraControl_BacklightCompensation, CameraControl_DigitalZoom, CameraControl_DigitalZoomRelative, CameraControl_Exposure, CameraControl_ExposureRelative, CameraControl_Focus, CameraControl_FocusRelative, CameraControl_FocusSimple, CameraControl_Iris, CameraControl_IrisRelative, CameraControl_Lamp, CameraControl_Pan, CameraControl_PanRelative, CameraControl_PanTilt, CameraControl_PanTiltRelative, CameraControl_Privacy, CameraControl_Roll, CameraControl_RollRelative, CameraControl_ScanMode, CameraControl_Tilt, CameraControl_TiltRelative, CameraControl_Zoom, CameraControl_ZoomRelative, DigitalZoom, DigitalZoomRelative, Exposure, ExposureRelative, Focus, FocusRelative, FocusSimple, Iris, IrisRelative, Lamp, Pan, PanRelative, PanTilt, PanTiltRelative, Privacy, Roll, RollRelative, ScanMode, Tilt, TiltRelative, Zoom, and ZoomRelative.
| void duvc::clear_connection_cache | ( | ) |
Definition at line 505 of file core.cpp.
References g_cache_mutex, and g_connection_cache.
Referenced by duvc_clear_cache().
| com_ptr< ICreateDevEnum > duvc::create_dev_enum | ( | ) |
Create DirectShow device enumerator.
Definition at line 173 of file core.cpp.
References CLSID_SystemDeviceEnum, IID_ICreateDevEnum, and throw_hr().
Referenced by is_device_connected(), list_devices(), and open_device_filter().
Create invisible window for receiving device notifications.
Definition at line 95 of file device_monitor.cpp.
References DUVC_LOG_ERROR, and register_notification_window_class().
| std::unique_ptr< IPlatformInterface > duvc::create_platform_interface | ( | ) |
Get platform-specific interface implementation.
Definition at line 60 of file factory.cpp.
| std::string duvc::decode_hresult | ( | HRESULT | hr | ) |
Decode HRESULT to human-readable string.
| hr | HRESULT value |
Definition at line 70 of file error_decoder.cpp.
References decode_system_error().
Referenced by get_diagnostic_info(), get_hresult_details(), duvc::KsPropertySet::get_property(), duvc::KsPropertySet::KsPropertySet(), duvc::KsPropertySet::query_support(), and duvc::KsPropertySet::set_property().
Decode system error code to human-readable string.
| error_code | System error code |
Definition at line 26 of file error_decoder.cpp.
Referenced by decode_hresult().
Default logging callback that writes to stderr.
| level | Log level |
| message | Log message |
Definition at line 59 of file logging.cpp.
References Error, get_timestamp(), and to_string().
Referenced by log_message().
|
static |
Window procedure for handling device change notifications.
| hwnd | Window handle |
| msg | Message type |
| wParam | Message parameter |
| lParam | Message parameter |
Definition at line 32 of file device_monitor.cpp.
References DUVC_LOG_DEBUG, DUVC_LOG_ERROR, DUVC_LOG_INFO, and g_device_callback.
Referenced by register_notification_window_class().
|
static |
Definition at line 156 of file core.cpp.
References g_device_callback.
Referenced by register_device_change_callback().
| com_ptr< IEnumMoniker > duvc::enum_video_devices | ( | ICreateDevEnum * | dev | ) |
Enumerate video input devices.
| dev | Device enumerator |
Definition at line 181 of file core.cpp.
References CLSID_VideoInputDeviceCategory, and throw_hr().
Referenced by is_device_connected(), list_devices(), and open_device_filter().
Find device by unique Windows device path.
Searches the current device enumeration for a device matching the specified Windows device instance path. This provides unambiguous identification when multiple cameras have identical names due to firmware variations.
| device_path | Wide string containing the device path (case-insensitive) |
| std::runtime_error | if enumeration fails or device not found |
The device path format is: USB\VID_XXXX&PID_XXXX&MI_XX#...#{GUID}
Example:
Definition at line 211 of file device.cpp.
References CLSID_SystemDeviceEnum, CLSID_VideoInputDeviceCategory, IID_ICreateDevEnum, read_device_path(), read_friendly_name(), and throw_hr().
Referenced by duvc::Camera::Camera(), duvc_find_device_by_path(), and open_camera().
Definition at line 332 of file core.cpp.
References Auto, CameraControl_Flags_Auto, Manual, and VideoProcAmp_Flags_Auto.
Referenced by duvc::DeviceConnection::get(), duvc::DeviceConnection::get(), duvc::DeviceConnection::get_range(), and duvc::DeviceConnection::get_range().
Definition at line 222 of file connection_pool.cpp.
References Auto, CameraControl_Flags_Auto, Manual, and VideoProcAmp_Flags_Auto.
| DeviceConnection * duvc::get_cached_connection | ( | const Device & | dev | ) |
Definition at line 480 of file core.cpp.
References g_cache_mutex, and g_connection_cache.
Referenced by is_device_connected().
|
static |
Definition at line 230 of file core.cpp.
Referenced by duvc::DeviceConnection::DeviceConnection().
|
static |
Definition at line 90 of file connection_pool.cpp.
| Result< DeviceCapabilities > duvc::get_device_capabilities | ( | const Device & | device | ) |
Create device capability snapshot.
| device | Device to analyze |
Definition at line 140 of file capability.cpp.
References DeviceNotFound, InvalidArgument, duvc::DeviceCapabilities::is_device_accessible(), duvc::Device::is_valid(), duvc::Device::name, Ok(), and duvc::Device::path.
Referenced by duvc_get_device_capabilities(), duvc_get_device_capabilities_by_index(), and get_device_capabilities().
| Result< DeviceCapabilities > duvc::get_device_capabilities | ( | int | device_index | ) |
Create device capability snapshot by index.
| device_index | Device index from list_devices() |
Definition at line 188 of file capability.cpp.
References DeviceNotFound, get_device_capabilities(), and list_devices().
| std::string duvc::get_diagnostic_info | ( | ) |
Get diagnostic information for troubleshooting.
Definition at line 149 of file error_decoder.cpp.
References CLSID_SystemDeviceEnum, decode_hresult(), and IID_ICreateDevEnum.
| std::string duvc::get_hresult_details | ( | HRESULT | hr | ) |
Get detailed HRESULT information.
| hr | HRESULT value |
Definition at line 94 of file error_decoder.cpp.
References decode_hresult().
| LogLevel duvc::get_log_level | ( | ) |
Get current minimum log level.
Definition at line 83 of file logging.cpp.
References g_log_mutex, and g_min_log_level.
Referenced by duvc_get_log_level().
|
static |
Definition at line 242 of file core.cpp.
Referenced by get_vendor_property(), query_vendor_property_support(), and set_vendor_property().
|
static |
Definition at line 21 of file constants.cpp.
|
static |
Get current timestamp as string.
Definition at line 41 of file logging.cpp.
Referenced by default_log_callback().
| bool duvc::get_vendor_property | ( | const Device & | dev, |
| const GUID & | property_set, | ||
| ULONG | property_id, | ||
| std::vector< uint8_t > & | data ) |
Get vendor-specific property data from device.
| dev | Target device to query | |
| property_set | Property set GUID identifying the extension unit | |
| property_id | Property ID within the extension unit | |
| [out] | data | Output buffer to receive property data |
Definition at line 584 of file core.cpp.
References get_property_set(), and open_device_filter().
|
static |
Definition at line 236 of file core.cpp.
Referenced by duvc::DeviceConnection::DeviceConnection().
|
static |
Definition at line 99 of file connection_pool.cpp.
Check if a device is currently connected and accessible.
| dev | Device to check |
This performs a lightweight check to determine if the device still exists and can be accessed.
Definition at line 549 of file core.cpp.
References create_dev_enum(), enum_video_devices(), get_cached_connection(), is_same_device(), read_device_path(), and read_friendly_name().
Referenced by duvc::DeviceCapabilities::DeviceCapabilities(), duvc_is_device_connected(), duvc_is_device_connected(), duvc::Camera::is_valid(), open_camera(), open_camera(), and duvc::DeviceCapabilities::refresh().
Check if HRESULT indicates a device-related error.
| hr | HRESULT value |
Definition at line 121 of file error_decoder.cpp.
References VFW_E_DEVICE_IN_USE.
Check if HRESULT indicates permission/access error.
| hr | HRESULT value |
Definition at line 138 of file error_decoder.cpp.
| bool duvc::is_same_device | ( | const Device & | d, |
| const std::wstring & | name, | ||
| const std::wstring & | path ) |
Check if two device identifiers refer to same device.
| d | Device structure to compare |
| name | Device name from enumeration |
| path | Device path from enumeration |
Definition at line 250 of file core.cpp.
Referenced by is_device_connected(), and open_device_filter().
| std::vector< Device > duvc::list_devices | ( | ) |
Enumerate all available video input devices.
| std::runtime_error | if device enumeration fails |
Definition at line 626 of file core.cpp.
References create_dev_enum(), enum_video_devices(), read_device_path(), and read_friendly_name().
Referenced by duvc::Camera::Camera(), duvc_cam_get(), duvc_cam_get_range(), duvc_cam_set(), duvc_get_device_count(), duvc_get_device_name(), duvc_get_device_path(), duvc_is_device_connected(), duvc_list_devices(), duvc_refresh_devices(), duvc_vid_get(), duvc_vid_get_range(), duvc_vid_set(), get_device_capabilities(), and open_camera().
Log critical message.
| message | Critical message |
Definition at line 126 of file logging.cpp.
References Critical, and log_message().
Log debug message.
| message | Debug message |
Definition at line 110 of file logging.cpp.
References Debug, and log_message().
Log error message.
| message | Error message |
Definition at line 122 of file logging.cpp.
References Error, and log_message().
Log info message.
| message | Info message |
Definition at line 114 of file logging.cpp.
References Info, and log_message().
Referenced by duvc_initialize().
Log a message.
| level | Log level |
| message | Log message |
Definition at line 88 of file logging.cpp.
References default_log_callback(), Error, g_log_callback, g_log_mutex, and g_min_log_level.
Referenced by duvc_log_message(), log_critical(), log_debug(), log_error(), log_info(), and log_warning().
Log warning message.
| message | Warning message |
Definition at line 118 of file logging.cpp.
References log_message(), and Warning.
Helper to create successful void Result.
Definition at line 222 of file result.h.
Referenced by duvc::WindowsPlatformInterface::create_connection(), duvc::Camera::get(), duvc::Camera::get(), get_device_capabilities(), duvc::logitech::get_logitech_property_typed(), duvc::KsPropertySet::get_property(), duvc::KsPropertySet::get_property_typed(), duvc::Camera::get_range(), duvc::Camera::get_range(), duvc::WindowsPlatformInterface::is_device_connected(), duvc::WindowsPlatformInterface::list_devices(), open_camera(), open_camera(), duvc::KsPropertySet::query_support(), duvc::DeviceCapabilities::refresh(), duvc::Camera::set(), duvc::Camera::set(), duvc::KsPropertySet::set_property(), and duvc::logitech::supports_logitech_properties().
Create camera from device.
| device | Device to connect to |
Definition at line 139 of file camera.cpp.
References DeviceNotFound, InvalidArgument, is_device_connected(), duvc::Device::is_valid(), and Ok().
Create camera from device path.
| device_path | Windows device instance path |
Most precise method for opening cameras when multiple devices share the same name or VID/PID due to firmware variations.
Definition at line 151 of file camera.cpp.
References DeviceNotFound, find_device_by_path(), InvalidArgument, is_device_connected(), duvc::Device::is_valid(), and Ok().
Create camera from device index.
| device_index | Index from list_devices() |
Definition at line 130 of file camera.cpp.
References DeviceNotFound, list_devices(), and open_camera().
Referenced by duvc_open_camera(), duvc_open_camera_by_index(), duvc_quick_get_camera_property(), duvc_quick_get_camera_property_range(), duvc_quick_get_video_property(), duvc_quick_get_video_property_range(), duvc_quick_set_camera_property(), duvc_quick_set_video_property(), and open_camera().
| com_ptr< IBaseFilter > duvc::open_device_filter | ( | const Device & | dev | ) |
Create DirectShow filter from device.
| dev | Device to open |
Definition at line 260 of file core.cpp.
References bind_to_filter(), create_dev_enum(), enum_video_devices(), is_same_device(), read_device_path(), and read_friendly_name().
Referenced by duvc::DeviceConnection::DeviceConnection(), get_vendor_property(), query_vendor_property_support(), and set_vendor_property().
| bool duvc::query_vendor_property_support | ( | const Device & | dev, |
| const GUID & | property_set, | ||
| ULONG | property_id ) |
Query whether device supports a vendor-specific property.
| dev | Target device to check |
| property_set | Property set GUID to query |
| property_id | Property ID within set to query |
Definition at line 614 of file core.cpp.
References get_property_set(), KSPROPERTY_SUPPORT_GET, KSPROPERTY_SUPPORT_SET, and open_device_filter().
| std::wstring duvc::read_device_path | ( | IMoniker * | mon | ) |
Read device path from moniker.
| mon | Device moniker |
Definition at line 207 of file core.cpp.
References IID_IPropertyBag, and read_prop_bstr().
Referenced by find_device_by_path(), is_device_connected(), list_devices(), and open_device_filter().
| std::wstring duvc::read_friendly_name | ( | IMoniker * | mon | ) |
Read friendly name from device moniker.
| mon | Device moniker |
Definition at line 199 of file core.cpp.
References IID_IPropertyBag, and read_prop_bstr().
Referenced by find_device_by_path(), is_device_connected(), list_devices(), and open_device_filter().
|
static |
Definition at line 189 of file core.cpp.
Referenced by read_device_path(), and read_friendly_name().
|
static |
Definition at line 54 of file device.cpp.
| void duvc::register_device_change_callback | ( | DeviceChangeCallback | callback | ) |
Register callback for device hotplug events.
| callback | Function to call when devices are added/removed |
Only one callback can be registered at a time. Calling this multiple times will replace the previous callback.
Definition at line 511 of file core.cpp.
References CLSID_VideoInputDeviceCategory, device_wndproc(), g_device_callback, g_device_notify, and g_notification_window.
Referenced by duvc_register_device_change_callback().
|
static |
Register for device interface notifications.
| hwnd | Window to receive notifications |
Definition at line 123 of file device_monitor.cpp.
References CLSID_VideoInputDeviceCategory, DUVC_LOG_ERROR, and DUVC_LOG_INFO.
Register window class for device notifications.
Definition at line 72 of file device_monitor.cpp.
References device_notification_wndproc(), and DUVC_LOG_ERROR.
Referenced by create_notification_window().
Definition at line 499 of file core.cpp.
References g_cache_mutex, and g_connection_cache.
| void duvc::set_log_callback | ( | LogCallback | callback | ) |
Set global log callback.
| callback | Callback function (nullptr to disable logging) |
Definition at line 73 of file logging.cpp.
References g_log_callback, and g_log_mutex.
Referenced by duvc_set_log_callback().
Set minimum log level.
| level | Minimum level to log |
Definition at line 78 of file logging.cpp.
References g_log_mutex, and g_min_log_level.
Referenced by duvc_initialize(), and duvc_set_log_level().
| bool duvc::set_vendor_property | ( | const Device & | dev, |
| const GUID & | property_set, | ||
| ULONG | property_id, | ||
| const std::vector< uint8_t > & | data ) |
Set vendor-specific property data on device.
| dev | Target device to modify |
| property_set | Property set GUID identifying the extension unit |
| property_id | Property ID within the extension unit |
| data | Property data to write (vendor-specific binary format) |
Definition at line 602 of file core.cpp.
References get_property_set(), and open_device_filter().
Definition at line 115 of file core.cpp.
References wide_to_utf8().
Referenced by bind_to_filter(), duvc::com_apartment::com_apartment(), duvc::DeviceConnection::com_apartment::com_apartment(), create_dev_enum(), enum_video_devices(), and find_device_by_path().
Definition at line 324 of file core.cpp.
References Auto, CameraControl_Flags_Auto, CameraControl_Flags_Manual, VideoProcAmp_Flags_Auto, and VideoProcAmp_Flags_Manual.
Referenced by duvc::DeviceConnection::set(), and duvc::DeviceConnection::set().
Definition at line 212 of file connection_pool.cpp.
References Auto, CameraControl_Flags_Auto, CameraControl_Flags_Manual, VideoProcAmp_Flags_Auto, and VideoProcAmp_Flags_Manual.
Convert camera property enum to string.
| prop | Camera property to convert |
Definition at line 678 of file core.cpp.
References BacklightCompensation, DigitalZoom, DigitalZoomRelative, Exposure, ExposureRelative, Focus, FocusRelative, FocusSimple, Iris, IrisRelative, Lamp, Pan, PanRelative, PanTilt, PanTiltRelative, Privacy, Roll, RollRelative, ScanMode, Tilt, TiltRelative, Zoom, and ZoomRelative.
Referenced by default_log_callback(), duvc::Error::description(), duvc_cam_mode_to_string(), duvc_cam_prop_to_string(), and duvc_vid_prop_to_string().
Convert error code to string.
| code | Error code |
Definition at line 10 of file result.cpp.
References DeviceBusy, DeviceNotFound, InvalidArgument, InvalidValue, NotImplemented, PermissionDenied, PropertyNotSupported, Success, and SystemError.
Convert video property enum to string.
| prop | Video property to convert |
Definition at line 736 of file core.cpp.
References BacklightCompensation, Brightness, ColorEnable, Contrast, Gain, Gamma, Hue, Saturation, Sharpness, and WhiteBalance.
| std::string duvc::to_utf8 | ( | const std::wstring & | wstr | ) |
Converts a wide string (UTF-16 on Windows) to a UTF-8 string.
| wstr | Wide string to convert (UTF-16 encoded on Windows) |
Definition at line 181 of file string_conversion.cpp.
Referenced by duvc_register_device_change_callback().
Convert camera property enum to wide string.
| prop | Camera property to convert |
Definition at line 707 of file core.cpp.
References BacklightCompensation, DigitalZoom, DigitalZoomRelative, Exposure, ExposureRelative, Focus, FocusRelative, FocusSimple, Iris, IrisRelative, Lamp, Pan, PanRelative, PanTilt, PanTiltRelative, Privacy, Roll, RollRelative, ScanMode, Tilt, TiltRelative, Zoom, and ZoomRelative.
Referenced by duvc_find_device_by_path().
| std::wstring duvc::to_wstring | ( | const std::string & | str | ) |
Converts a UTF-8 string to a wide string (UTF-16 on Windows)
| str | UTF-8 encoded string to convert |
Definition at line 196 of file string_conversion.cpp.
Convert video property enum to wide string.
| prop | Video property to convert |
Definition at line 752 of file core.cpp.
References BacklightCompensation, Brightness, ColorEnable, Contrast, Gain, Gamma, Hue, Saturation, Sharpness, and WhiteBalance.
| void duvc::unregister_device_change_callback | ( | ) |
Unregister device change callback.
Stops monitoring device changes and cleans up resources.
Definition at line 537 of file core.cpp.
References g_device_callback, g_device_notify, and g_notification_window.
Referenced by duvc_unregister_device_change_callback().
Definition at line 308 of file core.cpp.
References BacklightCompensation, Brightness, ColorEnable, Contrast, Gain, Gamma, Hue, Saturation, Sharpness, VideoProcAmp_BacklightCompensation, VideoProcAmp_Brightness, VideoProcAmp_ColorEnable, VideoProcAmp_Contrast, VideoProcAmp_Gain, VideoProcAmp_Gamma, VideoProcAmp_Hue, VideoProcAmp_Saturation, VideoProcAmp_Sharpness, VideoProcAmp_WhiteBalance, and WhiteBalance.
Referenced by duvc::DeviceConnection::get(), duvc::DeviceConnection::get_range(), and duvc::DeviceConnection::set().
Definition at line 185 of file connection_pool.cpp.
References BacklightCompensation, Brightness, ColorEnable, Contrast, Gain, Gamma, Hue, Saturation, Sharpness, VideoProcAmp_BacklightCompensation, VideoProcAmp_Brightness, VideoProcAmp_ColorEnable, VideoProcAmp_Contrast, VideoProcAmp_Gain, VideoProcAmp_Gamma, VideoProcAmp_Hue, VideoProcAmp_Saturation, VideoProcAmp_Sharpness, VideoProcAmp_WhiteBalance, and WhiteBalance.
Definition at line 107 of file core.cpp.
Referenced by throw_hr().
|
static |
Definition at line 152 of file core.cpp.
Referenced by clear_connection_cache(), get_cached_connection(), and release_cached_connection().
|
static |
Definition at line 153 of file core.cpp.
Referenced by clear_connection_cache(), get_cached_connection(), and release_cached_connection().
|
static |
Definition at line 147 of file core.cpp.
Referenced by device_notification_wndproc(), device_wndproc(), register_device_change_callback(), and unregister_device_change_callback().
|
static |
Definition at line 149 of file core.cpp.
Referenced by register_device_change_callback(), and unregister_device_change_callback().
|
static |
Definition at line 17 of file logging.cpp.
Referenced by log_message(), and set_log_callback().
|
static |
Definition at line 16 of file logging.cpp.
Referenced by get_log_level(), log_message(), set_log_callback(), and set_log_level().
|
static |
Definition at line 18 of file logging.cpp.
Referenced by get_log_level(), log_message(), and set_log_level().
Definition at line 148 of file core.cpp.
Referenced by register_device_change_callback(), and unregister_device_change_callback().