duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
connection_pool.h
Go to the documentation of this file.
1#pragma once
2
8#ifdef _WIN32
9
10#include <duvc-ctl/core/types.h>
11#include <duvc-ctl/detail/com_helpers.h>
12#include <memory>
13
14namespace duvc {
15
23class DeviceConnection {
24public:
30 explicit DeviceConnection(const Device &dev);
31
34
35 // Non-copyable but movable
40
48
56
64
72
80
88
93 bool is_valid() const { return filter_ != nullptr; }
94
95private:
97 std::unique_ptr<duvc::detail::com_apartment> com_;
98
100 void *filter_;
101
103 void *cam_ctrl_;
104
106 void *vid_proc_;
107};
108
109} // namespace duvc
110
111#endif // _WIN32
RAII wrapper for DirectShow device connections.
Definition core.h:55
bool is_valid() const
Check if connection is valid.
DeviceConnection & operator=(const DeviceConnection &)=delete
DeviceConnection(const DeviceConnection &)=delete
bool get_range(VidProp prop, PropRange &range)
Get valid range for a video processing property.
DeviceConnection(const Device &dev)
Create connection to specified device.
DeviceConnection & operator=(DeviceConnection &&)=default
~DeviceConnection()
Destructor - releases all COM interfaces.
bool set(VidProp prop, const PropSetting &val)
Set value of a video processing property.
bool get(CamProp prop, PropSetting &val)
Get current value of a camera control property.
bool set(CamProp prop, const PropSetting &val)
Set value of a camera control property.
bool get_range(CamProp prop, PropRange &range)
Get valid range for a camera control property.
bool get(VidProp prop, PropSetting &val)
Get current value of a video processing property.
DeviceConnection(DeviceConnection &&)=default
Result type that can contain either a value or an error.
Definition result.h:75
Definition core.h:13
VidProp
Video processing properties (IAMVideoProcAmp interface)
Definition types.h:50
CamProp
Camera control properties (IAMCameraControl interface)
Definition types.h:18
Represents a camera device.
Definition types.h:131
Property range and default information.
Definition types.h:92
Property setting with value and control mode.
Definition types.h:74
Core data types and enumerations for duvc-ctl.