duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
duvc::KsPropertySet Class Reference

RAII wrapper for IKsPropertySet interface. More...

#include <duvc-ctl/platform/windows/ks_properties.h>

Collaboration diagram for duvc::KsPropertySet:

Public Member Functions

 KsPropertySet (const Device &device)
 Create KsPropertySet from device.
 
 ~KsPropertySet ()
 Destructor.
 
 KsPropertySet (const KsPropertySet &)=delete
 
KsPropertySetoperator= (const KsPropertySet &)=delete
 
 KsPropertySet (KsPropertySet &&) noexcept
 
KsPropertySetoperator= (KsPropertySet &&) noexcept
 
bool is_valid () const
 Check if property set is valid.
 
Result< uint32_tquery_support (const GUID &property_set, uint32_t property_id)
 Query property support.
 
Result< std::vector< uint8_t > > get_property (const GUID &property_set, uint32_t property_id)
 Get property data.
 
Result< voidset_property (const GUID &property_set, uint32_t property_id, const std::vector< uint8_t > &data)
 Set property data.
 
template<typename T >
Result< T > get_property_typed (const GUID &property_set, uint32_t property_id)
 Get typed property value.
 
template<typename T >
Result< voidset_property_typed (const GUID &property_set, uint32_t property_id, const T &value)
 Set typed property value.
 

Detailed Description

RAII wrapper for IKsPropertySet interface.

Definition at line 26 of file ks_properties.h.

Constructor & Destructor Documentation

◆ KsPropertySet() [1/3]

duvc::KsPropertySet::KsPropertySet ( const Device & device)
explicit

Create KsPropertySet from device.

Parameters
deviceDevice to get property set from

Definition at line 22 of file ks_properties.cpp.

References duvc::decode_hresult(), duvc::Device::is_valid(), and duvc::detail::open_device_filter().

Here is the call graph for this function:

◆ ~KsPropertySet()

duvc::KsPropertySet::~KsPropertySet ( )

Destructor.

Definition at line 94 of file ks_properties.cpp.

◆ KsPropertySet() [2/3]

duvc::KsPropertySet::KsPropertySet ( const KsPropertySet & )
delete

◆ KsPropertySet() [3/3]

duvc::KsPropertySet::KsPropertySet ( KsPropertySet && other)
noexcept

Definition at line 106 of file ks_properties.cpp.

Member Function Documentation

◆ get_property()

Result< std::vector< uint8_t > > duvc::KsPropertySet::get_property ( const GUID & property_set,
uint32_t property_id )

Get property data.

Parameters
property_setProperty set GUID
property_idProperty ID
Returns
Result containing property data or error

Definition at line 156 of file ks_properties.cpp.

References duvc::decode_hresult(), duvc::Ok(), duvc::PropertyNotSupported, and duvc::SystemError.

Referenced by get_property_typed().

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

◆ get_property_typed()

template<typename T >
template Result< bool > duvc::KsPropertySet::get_property_typed< bool > ( const GUID & property_set,
uint32_t property_id )

Get typed property value.

Template Parameters
TProperty value type
Parameters
property_setProperty set GUID
property_idProperty ID
Returns
Result containing typed value or error

Definition at line 213 of file ks_properties.cpp.

References duvc::Result< T >::error(), get_property(), duvc::InvalidValue, duvc::Result< T >::is_ok(), duvc::Ok(), and duvc::Result< T >::value().

Here is the call graph for this function:

◆ is_valid()

bool duvc::KsPropertySet::is_valid ( ) const

Check if property set is valid.

Returns
true if property set can be used

Definition at line 131 of file ks_properties.cpp.

◆ operator=() [1/2]

KsPropertySet & duvc::KsPropertySet::operator= ( const KsPropertySet & )
delete

◆ operator=() [2/2]

KsPropertySet & duvc::KsPropertySet::operator= ( KsPropertySet && other)
noexcept

Definition at line 113 of file ks_properties.cpp.

◆ query_support()

Result< uint32_t > duvc::KsPropertySet::query_support ( const GUID & property_set,
uint32_t property_id )

Query property support.

Parameters
property_setProperty set GUID
property_idProperty ID
Returns
Result containing support flags or error

Definition at line 135 of file ks_properties.cpp.

References duvc::decode_hresult(), duvc::Ok(), duvc::PropertyNotSupported, and duvc::SystemError.

Here is the call graph for this function:

◆ set_property()

Result< void > duvc::KsPropertySet::set_property ( const GUID & property_set,
uint32_t property_id,
const std::vector< uint8_t > & data )

Set property data.

Parameters
property_setProperty set GUID
property_idProperty ID
dataProperty data to set
Returns
Result indicating success or error

Definition at line 190 of file ks_properties.cpp.

References duvc::decode_hresult(), duvc::Ok(), and duvc::SystemError.

Referenced by set_property_typed().

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

◆ set_property_typed()

template<typename T >
template Result< void > duvc::KsPropertySet::set_property_typed< bool > ( const GUID & property_set,
uint32_t property_id,
const T & value )

Set typed property value.

Template Parameters
TProperty value type
Parameters
property_setProperty set GUID
property_idProperty ID
valueProperty value to set
Returns
Result indicating success or error

Definition at line 234 of file ks_properties.cpp.

References set_property().

Here is the call graph for this function:

The documentation for this class was generated from the following files: