WPILibC++ 2023.4.3-108-ge5452e3
cscore_cpp.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#ifndef CSCORE_CSCORE_CPP_H_
6#define CSCORE_CSCORE_CPP_H_
7
8#include <stdint.h>
9
10#include <functional>
11#include <span>
12#include <string>
13#include <string_view>
14#include <vector>
15
16#include <wpi/SmallVector.h>
17
18#include "cscore_c.h"
19
20#ifdef _WIN32
21// Disable uninitialized variable warnings
22#pragma warning(push)
23#pragma warning(disable : 26495)
24#endif
25
26namespace wpi {
27class json;
28} // namespace wpi
29
30/** CameraServer (cscore) namespace */
31namespace cs {
32
33/**
34 * @defgroup cscore_cpp_api cscore C++ function API
35 *
36 * Handle-based interface for C++. Users are encouraged to use the
37 * object oriented interface instead; this interface is intended for use
38 * in applications such as JNI which require handle-based access.
39 *
40 * @{
41 */
42
43/**
44 * USB camera information
45 */
47 /** Device number (e.g. N in '/dev/videoN' on Linux) */
48 int dev = -1;
49 /** Path to device if available (e.g. '/dev/video0' on Linux) */
50 std::string path;
51 /** Vendor/model name of the camera as provided by the USB driver */
52 std::string name;
53 /** Other path aliases to device (e.g. '/dev/v4l/by-id/...' etc on Linux) */
54 std::vector<std::string> otherPaths;
55 /** USB Vendor Id */
56 int vendorId = -1;
57 /** USB Product Id */
58 int productId = -1;
59};
60
61/**
62 * Video mode
63 */
64struct VideoMode : public CS_VideoMode {
74 };
76 pixelFormat = 0;
77 width = 0;
78 height = 0;
79 fps = 0;
80 }
81 VideoMode(PixelFormat pixelFormat_, int width_, int height_, int fps_) {
82 pixelFormat = pixelFormat_;
83 width = width_;
84 height = height_;
85 fps = fps_;
86 }
87 explicit operator bool() const { return pixelFormat == kUnknown; }
88
89 bool operator==(const VideoMode& other) const {
90 return pixelFormat == other.pixelFormat && width == other.width &&
91 height == other.height && fps == other.fps;
92 }
93
94 bool CompareWithoutFps(const VideoMode& other) const {
95 return pixelFormat == other.pixelFormat && width == other.width &&
96 height == other.height;
97 }
98};
99
100/**
101 * Listener event
102 */
103struct RawEvent {
104 enum Kind {
125 };
126
127 RawEvent() = default;
128 explicit RawEvent(RawEvent::Kind kind_) : kind{kind_} {}
130 : kind{kind_}, name{name_} {
131 if (kind_ == kSinkCreated || kind_ == kSinkDestroyed ||
132 kind_ == kSinkEnabled || kind_ == kSinkDisabled) {
133 sinkHandle = handle_;
134 } else {
135 sourceHandle = handle_;
136 }
137 }
138 RawEvent(std::string_view name_, CS_Source source_, const VideoMode& mode_)
140 sourceHandle{source_},
141 name{name_},
142 mode{mode_} {}
144 CS_Property property_, CS_PropertyKind propertyKind_, int value_,
145 std::string_view valueStr_)
146 : kind{kind_},
147 sourceHandle{source_},
148 name{name_},
149 propertyHandle{property_},
150 propertyKind{propertyKind_},
151 value{value_},
152 valueStr{valueStr_} {}
153
155
156 // Valid for kSource* and kSink* respectively
159
160 // Source/sink/property name
161 std::string name;
162
163 // Fields for kSourceVideoModeChanged event
165
166 // Fields for kSourceProperty* events
169 int value;
170 std::string valueStr;
171
172 // Listener that was triggered
174};
175
176/**
177 * @defgroup cscore_property_func Property Functions
178 * @{
179 */
181std::string GetPropertyName(CS_Property property, CS_Status* status);
184 CS_Status* status);
185int GetProperty(CS_Property property, CS_Status* status);
186void SetProperty(CS_Property property, int value, CS_Status* status);
187int GetPropertyMin(CS_Property property, CS_Status* status);
188int GetPropertyMax(CS_Property property, CS_Status* status);
189int GetPropertyStep(CS_Property property, CS_Status* status);
191std::string GetStringProperty(CS_Property property, CS_Status* status);
194 CS_Status* status);
196 CS_Status* status);
197std::vector<std::string> GetEnumPropertyChoices(CS_Property property,
198 CS_Status* status);
199/** @} */
200
201/**
202 * @defgroup cscore_source_create_func Source Creation Functions
203 * @{
204 */
207 CS_Status* status);
209 CS_HttpCameraKind kind, CS_Status* status);
211 std::span<const std::string> urls,
212 CS_HttpCameraKind kind, CS_Status* status);
214 CS_Status* status);
215/** @} */
216
217/**
218 * @defgroup cscore_source_func Source Functions
219 * @{
220 */
225 CS_Status* status);
229 CS_Status* status);
232 CS_ConnectionStrategy strategy,
233 CS_Status* status);
237 CS_Status* status);
238std::span<CS_Property> EnumerateSourceProperties(
240 CS_Status* status);
243 CS_Status* status);
245 CS_Status* status);
246bool SetSourceResolution(CS_Source source, int width, int height,
247 CS_Status* status);
250 CS_Status* status);
252 CS_Status* status);
256 CS_Status* status);
259 CS_Status* status);
262/** @} */
263
264/**
265 * @defgroup cscore_camera_property_func Camera Source Common Property Functions
266 * @{
267 */
268void SetCameraBrightness(CS_Source source, int brightness, CS_Status* status);
273 CS_Status* status);
277/** @} */
278
279/**
280 * @defgroup cscore_usbcamera_func UsbCamera Source Functions
281 * @{
282 */
286/** @} */
287
288/**
289 * @defgroup cscore_httpcamera_func HttpCamera Source Functions
290 * @{
291 */
293void SetHttpCameraUrls(CS_Source source, std::span<const std::string> urls,
294 CS_Status* status);
295std::vector<std::string> GetHttpCameraUrls(CS_Source source, CS_Status* status);
296/** @} */
297
298/**
299 * @defgroup cscore_opencv_source_func OpenCV Source Functions
300 * @{
301 */
303 CS_Status* status);
304void SetSourceConnected(CS_Source source, bool connected, CS_Status* status);
306 CS_Status* status);
308 CS_PropertyKind kind, int minimum, int maximum,
309 int step, int defaultValue, int value,
310 CS_Status* status);
312 std::span<const std::string> choices,
313 CS_Status* status);
314/** @} */
315
316/**
317 * @defgroup cscore_sink_create_func Sink Creation Functions
318 * @{
319 */
321 int port, CS_Status* status);
324 std::function<void(uint64_t time)> processFrame,
325 CS_Status* status);
326
327/** @} */
328
329/**
330 * @defgroup cscore_sink_func Sink Functions
331 * @{
332 */
334std::string GetSinkName(CS_Sink sink, CS_Status* status);
336 CS_Status* status);
337std::string GetSinkDescription(CS_Sink sink, CS_Status* status);
340 CS_Status* status);
342 CS_Status* status);
343std::span<CS_Property> EnumerateSinkProperties(
347 CS_Status* status);
349 CS_Status* status);
350bool SetSinkConfigJson(CS_Sink sink, const wpi::json& config,
351 CS_Status* status);
352std::string GetSinkConfigJson(CS_Sink sink, CS_Status* status);
356void ReleaseSink(CS_Sink sink, CS_Status* status);
357/** @} */
358
359/**
360 * @defgroup cscore_mjpegserver_func MjpegServer Sink Functions
361 * @{
362 */
365/** @} */
366
367/**
368 * @defgroup cscore_opencv_sink_func OpenCV Sink Functions
369 * @{
370 */
372 CS_Status* status);
373std::string GetSinkError(CS_Sink sink, CS_Status* status);
375 CS_Status* status);
376void SetSinkEnabled(CS_Sink sink, bool enabled, CS_Status* status);
377/** @} */
378
379/**
380 * @defgroup cscore_listener_func Listener Functions
381 * @{
382 */
383void SetListenerOnStart(std::function<void()> onStart);
384void SetListenerOnExit(std::function<void()> onExit);
385
386CS_Listener AddListener(std::function<void(const RawEvent& event)> callback,
387 int eventMask, bool immediateNotify, CS_Status* status);
388
390
394 bool immediateNotify, CS_Status* status);
395std::vector<RawEvent> PollListener(CS_ListenerPoller poller);
396std::vector<RawEvent> PollListener(CS_ListenerPoller poller, double timeout,
397 bool* timedOut);
399/** @} */
400
402
403/**
404 * @defgroup cscore_telemetry_func Telemetry Functions
405 * @{
406 */
407void SetTelemetryPeriod(double seconds);
410 CS_Status* status);
412 CS_Status* status);
413/** @} */
414
415/**
416 * @defgroup cscore_logging_func Logging Functions
417 * @{
418 */
419using LogFunc = std::function<void(unsigned int level, const char* file,
420 unsigned int line, const char* msg)>;
421void SetLogger(LogFunc func, unsigned int min_level);
422void SetDefaultLogger(unsigned int min_level);
423/** @} */
424
425/**
426 * @defgroup cscore_shutdown_func Library Shutdown Function
427 * @{
428 */
429void Shutdown();
430/** @} */
431
432/**
433 * @defgroup cscore_utility_func Utility Functions
434 * @{
435 */
436std::vector<UsbCameraInfo> EnumerateUsbCameras(CS_Status* status);
437
438std::span<CS_Source> EnumerateSourceHandles(
441 CS_Status* status);
442
443std::string GetHostname();
444
445std::vector<std::string> GetNetworkInterfaces();
446/** @} */
447
448/** @} */
449
450} // namespace cs
451
452#ifdef _WIN32
453// Disable uninitialized variable warnings
454#pragma warning(pop)
455#endif
456
457#endif // CSCORE_CSCORE_CPP_H_
This file defines the SmallVector class.
then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file
Definition: ThirdPartyNotices.txt:192
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation source
Definition: ThirdPartyNotices.txt:111
Definition: core.h:1240
a class to store JSON values
Definition: json.h:2655
basic_string_view< char > string_view
Definition: core.h:520
CS_ConnectionStrategy
Connection strategy.
Definition: cscore_c.h:188
CS_HttpCameraKind
HTTP Camera kinds.
Definition: cscore_c.h:136
CS_PropertyKind
Property kinds.
Definition: cscore_c.h:114
CS_TelemetryKind
Telemetry kinds.
Definition: cscore_c.h:182
CS_SinkKind
Sink kinds.
Definition: cscore_c.h:146
CS_SourceKind
Source kinds.
Definition: cscore_c.h:125
@ CS_SOURCE_PROPERTY_CREATED
Definition: cscore_c.h:163
@ CS_SOURCE_VIDEOMODES_UPDATED
Definition: cscore_c.h:161
@ CS_SINK_PROPERTY_VALUE_UPDATED
Definition: cscore_c.h:174
@ CS_SOURCE_CONNECTED
Definition: cscore_c.h:159
@ CS_TELEMETRY_UPDATED
Definition: cscore_c.h:172
@ CS_SINK_ENABLED
Definition: cscore_c.h:169
@ CS_USB_CAMERAS_CHANGED
Definition: cscore_c.h:176
@ CS_SOURCE_CREATED
Definition: cscore_c.h:157
@ CS_SINK_DESTROYED
Definition: cscore_c.h:168
@ CS_SINK_PROPERTY_CREATED
Definition: cscore_c.h:173
@ CS_SINK_PROPERTY_CHOICES_UPDATED
Definition: cscore_c.h:175
@ CS_NETWORK_INTERFACES_CHANGED
Definition: cscore_c.h:171
@ CS_SOURCE_VIDEOMODE_CHANGED
Definition: cscore_c.h:162
@ CS_SINK_SOURCE_CHANGED
Definition: cscore_c.h:166
@ CS_SOURCE_PROPERTY_VALUE_UPDATED
Definition: cscore_c.h:164
@ CS_SOURCE_DISCONNECTED
Definition: cscore_c.h:160
@ CS_SOURCE_DESTROYED
Definition: cscore_c.h:158
@ CS_SINK_CREATED
Definition: cscore_c.h:167
@ CS_SOURCE_PROPERTY_CHOICES_UPDATED
Definition: cscore_c.h:165
@ CS_SINK_DISABLED
Definition: cscore_c.h:170
@ CS_PIXFMT_BGR
Definition: cscore_c.h:95
@ CS_PIXFMT_GRAY
Definition: cscore_c.h:96
@ CS_PIXFMT_RGB565
Definition: cscore_c.h:94
@ CS_PIXFMT_Y16
Definition: cscore_c.h:97
@ CS_PIXFMT_MJPEG
Definition: cscore_c.h:92
@ CS_PIXFMT_YUYV
Definition: cscore_c.h:93
@ CS_PIXFMT_UNKNOWN
Definition: cscore_c.h:91
@ CS_PIXFMT_UYVY
Definition: cscore_c.h:98
@ CS_INVALID_HANDLE
Definition: cscore_c.h:60
int GetCameraBrightness(CS_Source source, CS_Status *status)
void SetCameraExposureManual(CS_Source source, int value, CS_Status *status)
void SetCameraExposureAuto(CS_Source source, CS_Status *status)
void SetCameraWhiteBalanceManual(CS_Source source, int value, CS_Status *status)
void SetCameraBrightness(CS_Source source, int brightness, CS_Status *status)
void SetCameraWhiteBalanceHoldCurrent(CS_Source source, CS_Status *status)
void SetCameraWhiteBalanceAuto(CS_Source source, CS_Status *status)
void SetCameraExposureHoldCurrent(CS_Source source, CS_Status *status)
bool NotifierDestroyed()
std::vector< std::string > GetHttpCameraUrls(CS_Source source, CS_Status *status)
void SetHttpCameraUrls(CS_Source source, std::span< const std::string > urls, CS_Status *status)
CS_HttpCameraKind GetHttpCameraKind(CS_Source source, CS_Status *status)
CS_ListenerPoller CreateListenerPoller()
CS_Listener AddListener(std::function< void(const RawEvent &event)> callback, int eventMask, bool immediateNotify, CS_Status *status)
std::vector< RawEvent > PollListener(CS_ListenerPoller poller)
void CancelPollListener(CS_ListenerPoller poller)
CS_Listener AddPolledListener(CS_ListenerPoller poller, int eventMask, bool immediateNotify, CS_Status *status)
void SetListenerOnExit(std::function< void()> onExit)
void SetListenerOnStart(std::function< void()> onStart)
void RemoveListener(CS_Listener handle, CS_Status *status)
void DestroyListenerPoller(CS_ListenerPoller poller)
void SetDefaultLogger(unsigned int min_level)
std::function< void(unsigned int level, const char *file, unsigned int line, const char *msg)> LogFunc
Definition: cscore_cpp.h:420
void SetLogger(LogFunc func, unsigned int min_level)
int GetMjpegServerPort(CS_Sink sink, CS_Status *status)
std::string GetMjpegServerListenAddress(CS_Sink sink, CS_Status *status)
void SetSinkEnabled(CS_Sink sink, bool enabled, CS_Status *status)
void SetSinkDescription(CS_Sink sink, std::string_view description, CS_Status *status)
std::string GetSinkError(CS_Sink sink, CS_Status *status)
void SetSourceEnumPropertyChoices(CS_Source source, CS_Property property, std::span< const std::string > choices, CS_Status *status)
void SetSourceConnected(CS_Source source, bool connected, CS_Status *status)
void SetSourceDescription(CS_Source source, std::string_view description, CS_Status *status)
CS_Property CreateSourceProperty(CS_Source source, std::string_view name, CS_PropertyKind kind, int minimum, int maximum, int step, int defaultValue, int value, CS_Status *status)
void NotifySourceError(CS_Source source, std::string_view msg, CS_Status *status)
int GetPropertyMin(CS_Property property, CS_Status *status)
void SetProperty(CS_Property property, int value, CS_Status *status)
void SetStringProperty(CS_Property property, std::string_view value, CS_Status *status)
CS_PropertyKind GetPropertyKind(CS_Property property, CS_Status *status)
int GetPropertyDefault(CS_Property property, CS_Status *status)
int GetPropertyMax(CS_Property property, CS_Status *status)
int GetProperty(CS_Property property, CS_Status *status)
int GetPropertyStep(CS_Property property, CS_Status *status)
std::string GetStringProperty(CS_Property property, CS_Status *status)
std::vector< std::string > GetEnumPropertyChoices(CS_Property property, CS_Status *status)
std::string GetPropertyName(CS_Property property, CS_Status *status)
void Shutdown()
CS_Sink CreateCvSinkCallback(std::string_view name, std::function< void(uint64_t time)> processFrame, CS_Status *status)
CS_Sink CreateCvSink(std::string_view name, CS_Status *status)
CS_Sink CreateMjpegServer(std::string_view name, std::string_view listenAddress, int port, CS_Status *status)
bool SetSinkConfigJson(CS_Sink sink, std::string_view config, CS_Status *status)
CS_Source GetSinkSource(CS_Sink sink, CS_Status *status)
CS_Sink CopySink(CS_Sink sink, CS_Status *status)
wpi::json GetSinkConfigJsonObject(CS_Sink sink, CS_Status *status)
void SetSinkSource(CS_Sink sink, CS_Source source, CS_Status *status)
CS_Property GetSinkSourceProperty(CS_Sink sink, std::string_view name, CS_Status *status)
void ReleaseSink(CS_Sink sink, CS_Status *status)
std::span< CS_Property > EnumerateSinkProperties(CS_Sink sink, wpi::SmallVectorImpl< CS_Property > &vec, CS_Status *status)
std::string GetSinkDescription(CS_Sink sink, CS_Status *status)
std::string GetSinkName(CS_Sink sink, CS_Status *status)
std::string GetSinkConfigJson(CS_Sink sink, CS_Status *status)
CS_SinkKind GetSinkKind(CS_Sink sink, CS_Status *status)
CS_Property GetSinkProperty(CS_Sink sink, std::string_view name, CS_Status *status)
CS_Source CreateUsbCameraPath(std::string_view name, std::string_view path, CS_Status *status)
CS_Source CreateHttpCamera(std::string_view name, std::string_view url, CS_HttpCameraKind kind, CS_Status *status)
CS_Source CreateUsbCameraDev(std::string_view name, int dev, CS_Status *status)
CS_Source CreateCvSource(std::string_view name, const VideoMode &mode, CS_Status *status)
void ReleaseSource(CS_Source source, CS_Status *status)
bool IsSourceConnected(CS_Source source, CS_Status *status)
uint64_t GetSourceLastFrameTime(CS_Source source, CS_Status *status)
bool SetSourceResolution(CS_Source source, int width, int height, CS_Status *status)
CS_Property GetSourceProperty(CS_Source source, std::string_view name, CS_Status *status)
bool SetSourceConfigJson(CS_Source source, std::string_view config, CS_Status *status)
bool SetSourcePixelFormat(CS_Source source, VideoMode::PixelFormat pixelFormat, CS_Status *status)
std::string GetSourceConfigJson(CS_Source source, CS_Status *status)
wpi::json GetSourceConfigJsonObject(CS_Source source, CS_Status *status)
void SetSourceConnectionStrategy(CS_Source source, CS_ConnectionStrategy strategy, CS_Status *status)
VideoMode GetSourceVideoMode(CS_Source source, CS_Status *status)
CS_Source CopySource(CS_Source source, CS_Status *status)
bool IsSourceEnabled(CS_Source source, CS_Status *status)
std::span< CS_Property > EnumerateSourceProperties(CS_Source source, wpi::SmallVectorImpl< CS_Property > &vec, CS_Status *status)
std::vector< VideoMode > EnumerateSourceVideoModes(CS_Source source, CS_Status *status)
CS_SourceKind GetSourceKind(CS_Source source, CS_Status *status)
std::string GetSourceName(CS_Source source, CS_Status *status)
std::string GetSourceDescription(CS_Source source, CS_Status *status)
bool SetSourceVideoMode(CS_Source source, const VideoMode &mode, CS_Status *status)
bool SetSourceFPS(CS_Source source, int fps, CS_Status *status)
std::span< CS_Sink > EnumerateSourceSinks(CS_Source source, wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
int64_t GetTelemetryValue(CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
double GetTelemetryElapsedTime()
double GetTelemetryAverageValue(CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
void SetTelemetryPeriod(double seconds)
CS_Handle CS_Source
Definition: cscore_c.h:51
int CS_Status
Definition: cscore_c.h:44
CS_Handle CS_ListenerPoller
Definition: cscore_c.h:49
CS_Handle CS_Property
Definition: cscore_c.h:47
CS_Handle CS_Sink
Definition: cscore_c.h:50
int CS_Handle
Definition: cscore_c.h:46
CS_Handle CS_Listener
Definition: cscore_c.h:48
UsbCameraInfo GetUsbCameraInfo(CS_Source source, CS_Status *status)
std::string GetUsbCameraPath(CS_Source source, CS_Status *status)
void SetUsbCameraPath(CS_Source, std::string_view path, CS_Status *status)
std::string GetHostname()
std::vector< UsbCameraInfo > EnumerateUsbCameras(CS_Status *status)
std::span< CS_Sink > EnumerateSinkHandles(wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
std::span< CS_Source > EnumerateSourceHandles(wpi::SmallVectorImpl< CS_Source > &vec, CS_Status *status)
std::vector< std::string > GetNetworkInterfaces()
::uint64_t uint64_t
Definition: Meta.h:58
::int64_t int64_t
Definition: Meta.h:59
CameraServer (cscore) namespace.
Definition: cscore_oo.inc:15
fps
Definition: velocity.h:46
Definition: AprilTagFieldLayout.h:18
Video mode.
Definition: cscore_c.h:104
int width
Definition: cscore_c.h:106
int pixelFormat
Definition: cscore_c.h:105
int fps
Definition: cscore_c.h:108
int height
Definition: cscore_c.h:107
Listener event.
Definition: cscore_cpp.h:103
VideoMode mode
Definition: cscore_cpp.h:164
CS_Sink sinkHandle
Definition: cscore_cpp.h:158
int value
Definition: cscore_cpp.h:169
std::string name
Definition: cscore_cpp.h:161
Kind kind
Definition: cscore_cpp.h:154
CS_Property propertyHandle
Definition: cscore_cpp.h:167
RawEvent(std::string_view name_, CS_Source source_, RawEvent::Kind kind_, CS_Property property_, CS_PropertyKind propertyKind_, int value_, std::string_view valueStr_)
Definition: cscore_cpp.h:143
CS_Source sourceHandle
Definition: cscore_cpp.h:157
std::string valueStr
Definition: cscore_cpp.h:170
RawEvent(RawEvent::Kind kind_)
Definition: cscore_cpp.h:128
RawEvent(std::string_view name_, CS_Source source_, const VideoMode &mode_)
Definition: cscore_cpp.h:138
CS_Listener listener
Definition: cscore_cpp.h:173
RawEvent(std::string_view name_, CS_Handle handle_, RawEvent::Kind kind_)
Definition: cscore_cpp.h:129
CS_PropertyKind propertyKind
Definition: cscore_cpp.h:168
Kind
Definition: cscore_cpp.h:104
@ kTelemetryUpdated
Definition: cscore_cpp.h:120
@ kUsbCamerasChanged
Definition: cscore_cpp.h:124
@ kSinkSourceChanged
Definition: cscore_cpp.h:114
@ kSourcePropertyCreated
Definition: cscore_cpp.h:111
@ kSinkEnabled
Definition: cscore_cpp.h:117
@ kSinkPropertyCreated
Definition: cscore_cpp.h:121
@ kSourceVideoModeChanged
Definition: cscore_cpp.h:110
@ kSinkDisabled
Definition: cscore_cpp.h:118
@ kSourcePropertyValueUpdated
Definition: cscore_cpp.h:112
@ kSinkPropertyValueUpdated
Definition: cscore_cpp.h:122
@ kSinkPropertyChoicesUpdated
Definition: cscore_cpp.h:123
@ kSinkCreated
Definition: cscore_cpp.h:115
@ kSourceCreated
Definition: cscore_cpp.h:105
@ kSourceDisconnected
Definition: cscore_cpp.h:108
@ kNetworkInterfacesChanged
Definition: cscore_cpp.h:119
@ kSinkDestroyed
Definition: cscore_cpp.h:116
@ kSourcePropertyChoicesUpdated
Definition: cscore_cpp.h:113
@ kSourceDestroyed
Definition: cscore_cpp.h:106
@ kSourceVideoModesUpdated
Definition: cscore_cpp.h:109
@ kSourceConnected
Definition: cscore_cpp.h:107
RawEvent()=default
USB camera information.
Definition: cscore_cpp.h:46
int dev
Device number (e.g.
Definition: cscore_cpp.h:48
std::string name
Vendor/model name of the camera as provided by the USB driver.
Definition: cscore_cpp.h:52
int productId
USB Product Id.
Definition: cscore_cpp.h:58
int vendorId
USB Vendor Id.
Definition: cscore_cpp.h:56
std::string path
Path to device if available (e.g.
Definition: cscore_cpp.h:50
std::vector< std::string > otherPaths
Other path aliases to device (e.g.
Definition: cscore_cpp.h:54
Video mode.
Definition: cscore_cpp.h:64
VideoMode(PixelFormat pixelFormat_, int width_, int height_, int fps_)
Definition: cscore_cpp.h:81
VideoMode()
Definition: cscore_cpp.h:75
bool CompareWithoutFps(const VideoMode &other) const
Definition: cscore_cpp.h:94
bool operator==(const VideoMode &other) const
Definition: cscore_cpp.h:89
PixelFormat
Definition: cscore_cpp.h:65
@ kYUYV
Definition: cscore_cpp.h:68
@ kUnknown
Definition: cscore_cpp.h:66
@ kGray
Definition: cscore_cpp.h:71
@ kBGR
Definition: cscore_cpp.h:70
@ kMJPEG
Definition: cscore_cpp.h:67
@ kY16
Definition: cscore_cpp.h:72
@ kUYVY
Definition: cscore_cpp.h:73
@ kRGB565
Definition: cscore_cpp.h:69