27 throw std::runtime_error(
28 "Device found by path but failed validation");
43 connection_ = std::make_unique<DeviceConnection>(device_);
45 return connection_.get();
49 auto *
conn = get_connection();
59 "Failed to get camera property");
63 auto *
conn = get_connection();
72 "Failed to set camera property");
76 auto *
conn = get_connection();
86 "Failed to get camera property range");
90 auto *
conn = get_connection();
100 "Failed to get video property");
104 auto *
conn = get_connection();
113 "Failed to set video property");
117 auto *
conn = get_connection();
127 "Failed to get video property range");
157 "Found device has invalid identifiers");
162 "Device not connected");
167 }
catch (
const std::exception &
e) {
169 std::string(
"Failed to open camera by path: ") +
e.what());
RAII camera handle for simplified device management.
RAII camera handle for simplified device management.
~Camera()
Destructor - automatically releases device connection.
Camera(const Device &device)
Create camera handle for device.
Result< PropRange > get_range(CamProp prop)
Get camera property range.
bool is_valid() const
Check if camera is valid and connected.
Result< void > set(CamProp prop, const PropSetting &setting)
Set camera property value.
Result< PropSetting > get(CamProp prop)
Get camera property value.
RAII wrapper for DirectShow device connections.
Result type that can contain either a value or an error.
Windows-specific device connection pooling.
Device enumeration and management functions.
VidProp
Video processing properties (IAMVideoProcAmp interface)
@ InvalidArgument
Invalid function argument.
@ PropertyNotSupported
Property not supported by device.
@ DeviceNotFound
Device not found or disconnected.
std::vector< Device > list_devices()
Enumerate all available video input devices.
CamProp
Camera control properties (IAMCameraControl interface)
bool is_device_connected(const Device &dev)
Check if a device is currently connected and accessible.
Result< Camera > open_camera(int device_index)
Create camera from device index.
Device find_device_by_path(const std::wstring &device_path)
Find device by unique Windows device path.
Result< void > Ok()
Helper to create successful void Result.
Represents a camera device.
bool is_valid() const
Check if device has valid identifying information.
Property range and default information.
Property setting with value and control mode.