16#ifndef KSPROPERTY_SUPPORT_GET
17#define KSPROPERTY_SUPPORT_GET 1
18#define KSPROPERTY_SUPPORT_SET 2
30 "Device does not support vendor properties");
36 }
catch (
const std::exception &
e) {
38 std::string(
e.what()));
44 const std::vector<uint8_t> &data) {
49 "Device does not support vendor properties");
55 }
catch (
const std::exception &
e) {
57 std::string(
e.what()));
82 }
catch (
const std::exception &
e) {
84 std::string(
e.what()));
98 if (data.size() !=
sizeof(T)) {
100 "Property data size mismatch for Logitech property");
104 std::memcpy(&value, data.data(),
sizeof(T));
112 std::vector<uint8_t> data(
sizeof(T));
113 std::memcpy(data.data(), &value,
sizeof(T));
#define DUVC_LOG_ERROR(msg)
#define DUVC_LOG_DEBUG(msg)
RAII wrapper for IKsPropertySet interface.
Result type that can contain either a value or an error.
const T & value() const &
Get the value (assumes success)
bool is_ok() const
Check if result contains a value (success)
const Error & error() const
Get the error (assumes error)
IKsPropertySet wrapper for vendor properties.
Structured logging interface for duvc-ctl.
#define KSPROPERTY_SUPPORT_SET
#define KSPROPERTY_SUPPORT_GET
Logitech-specific vendor property definitions and helpers.
template Result< void > set_logitech_property_typed< int32_t >(const Device &, LogitechProperty, const int32_t &)
Result< void > set_logitech_property_typed(const Device &device, LogitechProperty prop, const T &value)
Set typed Logitech property value.
template Result< void > set_logitech_property_typed< uint32_t >(const Device &, LogitechProperty, const uint32_t &)
Result< bool > supports_logitech_properties(const Device &device)
Check if device supports Logitech vendor properties.
Result< void > set_logitech_property(const Device &device, LogitechProperty prop, const std::vector< uint8_t > &data)
Set Logitech vendor property from raw byte vector.
Result< T > get_logitech_property_typed(const Device &device, LogitechProperty prop)
Get typed Logitech property value.
Result< std::vector< uint8_t > > get_logitech_property(const Device &device, LogitechProperty prop)
Get Logitech vendor property as raw byte vector.
LogitechProperty
Logitech vendor property IDs.
@ RightLight
RightLight auto-exposure and brightness optimization.
constexpr GUID LOGITECH_PROPERTY_SET
Logitech vendor-specific property set GUID.
template Result< bool > get_logitech_property_typed< bool >(const Device &, LogitechProperty)
template Result< void > set_logitech_property_typed< bool >(const Device &, LogitechProperty, const bool &)
template Result< int32_t > get_logitech_property_typed< int32_t >(const Device &, LogitechProperty)
template Result< uint32_t > get_logitech_property_typed< uint32_t >(const Device &, LogitechProperty)
@ InvalidValue
Property value out of range.
@ PropertyNotSupported
Property not supported by device.
@ SystemError
System/platform error.
Result< void > Ok()
Helper to create successful void Result.
Represents a camera device.