9#include <duvc-ctl/detail/com_helpers.h>
16using namespace detail;
24 reinterpret_cast<void **
>(
props.put())))) {
31 ULONG property_id, std::vector<uint8_t> &data) {
39 ULONG bytes_returned = 0;
40 HRESULT hr = props->Get(property_set, property_id,
nullptr, 0,
nullptr, 0,
42 if (FAILED(hr) || bytes_returned == 0)
45 data.resize(bytes_returned);
46 hr = props->Get(property_set, property_id,
nullptr, 0, data.data(),
47 bytes_returned, &bytes_returned);
55 ULONG property_id,
const std::vector<uint8_t> &data) {
63 HRESULT hr = props->Set(property_set, property_id,
nullptr, 0,
64 const_cast<uint8_t *
>(data.data()), data.size());
80 ULONG type_support = 0;
82 props->QuerySupported(property_set, property_id, &type_support);
83 return SUCCEEDED(hr) &&
Result type that can contain either a value or an error.
Vendor-specific property constants and definitions.
#define KSPROPERTY_SUPPORT_SET
#define KSPROPERTY_SUPPORT_GET
com_ptr< IBaseFilter > open_device_filter(const Device &dev)
Create DirectShow filter from device.
bool query_vendor_property_support(const Device &dev, const GUID &property_set, ULONG property_id)
Query whether device supports a vendor-specific property.
static com_ptr< IKsPropertySet > get_property_set(IBaseFilter *f)
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.