duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
ks_properties.h
Go to the documentation of this file.
1 #pragma once
2
8 #ifdef _WIN32
9
10 #include <dshow.h>
11 #include <ks.h>
12 #include <ksproxy.h>
13 #include <duvc-ctl/core/result.h>
14 #include <duvc-ctl/core/types.h>
15 #include <duvc-ctl/detail/com_helpers.h>
16 #include <vector>
17 #include <windows.h>
18
19 struct IKsPropertySet;
20
21 namespace duvc {
22
27 public:
32 explicit KsPropertySet(const Device &device);
33
36
37 // Non-copyable but movable
38 KsPropertySet(const KsPropertySet &) = delete;
42
47 bool is_valid() const;
48
55 Result<uint32_t> query_support(const GUID &property_set,
56 uint32_t property_id);
57
64 Result<std::vector<uint8_t>> get_property(const GUID &property_set,
65 uint32_t property_id);
66
74 Result<void> set_property(const GUID &property_set, uint32_t property_id,
75 const std::vector<uint8_t> &data);
76
85 Result<T> get_property_typed(const GUID &property_set, uint32_t property_id);
86
96 Result<void> set_property_typed(const GUID &property_set,
97 uint32_t property_id, const T &value);
98
99 private:
100 Device device_;
101 detail::com_ptr<IBaseFilter> basefilter_; // keeps DLL loaded
102 // Helper to get property set interface on-demand
103 detail::com_ptr<IKsPropertySet> get_property_set() const;
104 HMODULE mfksproxy_dll_ = nullptr;
105 };
106
107 } // namespace duvc
108
109 #endif // _WIN32
RAII wrapper for IKsPropertySet interface.
Result< T > get_property_typed(const GUID &property_set, uint32_t property_id)
Get typed property value.
Result< uint32_t > query_support(const GUID &property_set, uint32_t property_id)
Query property support.
Result< void > set_property_typed(const GUID &property_set, uint32_t property_id, const T &value)
Set typed property value.
Result< void > set_property(const GUID &property_set, uint32_t property_id, const std::vector< uint8_t > &data)
Set property data.
KsPropertySet & operator=(const KsPropertySet &)=delete
bool is_valid() const
Check if property set is valid.
Result< std::vector< uint8_t > > get_property(const GUID &property_set, uint32_t property_id)
Get property data.
KsPropertySet(const Device &device)
Create KsPropertySet from device.
~KsPropertySet()
Destructor.
KsPropertySet(const KsPropertySet &)=delete
Result type that can contain either a value or an error.
Definition result.h:75
Definition core.h:13
Result/Error type system for duvc-ctl.
Represents a camera device.
Definition types.h:131
Core data types and enumerations for duvc-ctl.