5#ifndef CSCORE_CSCORE_OO_H_
6#define CSCORE_CSCORE_OO_H_
9#include <initializer_list>
85 explicit operator bool()
const {
return m_kind !=
kNone; }
237 m_kind =
static_cast<Kind>(
243 : m_handle(handle), m_kind(kind) {}
318 explicit operator bool()
const {
return m_handle != 0; }
593 swap(first.m_status, second.m_status);
594 swap(first.m_handle, second.m_handle);
720 UsbCamera(std::string_view name, std::string_view path) {
731 return ::cs::EnumerateUsbCameras(&status);
835 HttpCamera(std::string_view name, std::span<const std::string> urls,
849 template <
typename T>
850 HttpCamera(std::string_view name, std::initializer_list<T> urls,
852 std::vector<std::string> vec;
853 vec.reserve(urls.size());
854 for (
const auto& url : urls) {
855 vec.emplace_back(url);
877 void SetUrls(std::span<const std::string> urls) {
885 template <
typename T>
887 std::vector<std::string> vec;
888 vec.reserve(urls.size());
889 for (
const auto& url : urls) {
890 vec.emplace_back(url);
911 static std::string HostToUrl(std::string_view host);
913 static std::vector<std::string> HostToUrl(
914 std::span<const std::string> hosts) {
915 std::vector<std::string> rv;
916 rv.reserve(hosts.size());
917 for (
const auto& host : hosts) {
918 rv.emplace_back(HostToUrl(std::string_view{host}));
923 template <
typename T>
924 static std::vector<std::string> HostToUrl(std::initializer_list<T> hosts) {
925 std::vector<std::string> rv;
926 rv.reserve(hosts.size());
927 for (
const auto& host : hosts) {
928 rv.emplace_back(HostToUrl(std::string_view{host}));
967 AxisCamera(std::string_view name, std::span<const std::string> hosts)
968 :
HttpCamera(name, HostToUrl(hosts), kAxis) {}
976 template <
typename T>
977 AxisCamera(std::string_view name, std::initializer_list<T> hosts)
978 :
HttpCamera(name, HostToUrl(hosts), kAxis) {}
1033 int minimum,
int maximum,
int step,
1034 int defaultValue,
int value) {
1038 minimum, maximum, step, defaultValue, value, &
m_status)};
1053 int maximum,
int step,
int defaultValue,
1060 minimum, maximum, step, defaultValue, value, &
m_status)};
1078 0, 1, 1, defaultValue ? 1 : 0, value ? 1 : 0, &
m_status)};
1089 std::string_view value) {
1107 std::span<const std::string> choices) {
1119 template <
typename T>
1121 std::initializer_list<T> choices) {
1122 std::vector<std::string> vec;
1123 vec.reserve(choices.size());
1124 for (
const auto& choice : choices) {
1125 vec.emplace_back(choice);
1175 explicit operator bool()
const {
return m_handle != 0; }
1332 swap(first.m_status, second.m_status);
1333 swap(first.m_handle, second.m_handle);
1357 MjpegServer(std::string_view name, std::string_view listenAddress,
int port) {
1542 int eventMask,
bool immediateNotify) {
1546 callback(
static_cast<const VideoEvent&
>(event));
1548 eventMask, immediateNotify, &status);
1565 if (m_handle != 0) {
1572 swap(first.m_handle, second.m_handle);
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 and nanopb were all modified for use in 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:124
A source that represents an Axis IP camera.
Definition cscore_oo.h:910
AxisCamera(std::string_view name, std::initializer_list< T > hosts)
Create a source for an Axis IP camera.
Definition cscore_oo.h:977
AxisCamera(std::string_view name, std::string_view host)
Create a source for an Axis IP camera.
Definition cscore_oo.h:940
AxisCamera(std::string_view name, const std::string &host)
Create a source for an Axis IP camera.
Definition cscore_oo.h:958
AxisCamera(std::string_view name, std::span< const std::string > hosts)
Create a source for an Axis IP camera.
Definition cscore_oo.h:967
AxisCamera(std::string_view name, const char *host)
Create a source for an Axis IP camera.
Definition cscore_oo.h:949
A source that represents a MJPEG-over-HTTP (IP) camera.
Definition cscore_oo.h:773
HttpCamera(std::string_view name, std::span< const std::string > urls, HttpCameraKind kind=kUnknown)
Create a source for a MJPEG-over-HTTP (IP) camera.
Definition cscore_oo.h:835
HttpCamera(std::string_view name, std::string_view url, HttpCameraKind kind=kUnknown)
Create a source for a MJPEG-over-HTTP (IP) camera.
Definition cscore_oo.h:796
HttpCamera(std::string_view name, const char *url, HttpCameraKind kind=kUnknown)
Create a source for a MJPEG-over-HTTP (IP) camera.
Definition cscore_oo.h:810
std::vector< std::string > GetUrls() const
Get the URLs used to connect to the camera.
Definition cscore_oo.h:899
HttpCameraKind GetHttpCameraKind() const
Get the kind of HTTP camera.
Definition cscore_oo.h:868
void SetUrls(std::initializer_list< T > urls)
Change the URLs used to connect to the camera.
Definition cscore_oo.h:886
void SetUrls(std::span< const std::string > urls)
Change the URLs used to connect to the camera.
Definition cscore_oo.h:877
HttpCameraKind
HTTP camera kind.
Definition cscore_oo.h:778
@ kMJPGStreamer
MJPG Streamer camera.
Definition cscore_oo.h:782
@ kCSCore
CS Core camera.
Definition cscore_oo.h:784
@ kAxis
Axis camera.
Definition cscore_oo.h:786
@ kUnknown
Unknown camera kind.
Definition cscore_oo.h:780
HttpCamera(std::string_view name, const std::string &url, HttpCameraKind kind=kUnknown)
Create a source for a MJPEG-over-HTTP (IP) camera.
Definition cscore_oo.h:824
HttpCamera(std::string_view name, std::initializer_list< T > urls, HttpCameraKind kind=kUnknown)
Create a source for a MJPEG-over-HTTP (IP) camera.
Definition cscore_oo.h:850
A base class for single image reading sinks.
Definition cscore_oo.h:1451
void SetEnabled(bool enabled)
Enable or disable getting new frames.
Definition cscore_oo.h:1482
std::string GetError() const
Get error string.
Definition cscore_oo.h:1470
void SetDescription(std::string_view description)
Set sink description.
Definition cscore_oo.h:1461
A base class for single image providing sources.
Definition cscore_oo.h:984
VideoProperty CreateBooleanProperty(std::string_view name, bool defaultValue, bool value)
Create a boolean property.
Definition cscore_oo.h:1071
void SetDescription(std::string_view description)
Set source description.
Definition cscore_oo.h:1015
void SetEnumPropertyChoices(const VideoProperty &property, std::initializer_list< T > choices)
Configure enum property choices.
Definition cscore_oo.h:1120
VideoProperty CreateIntegerProperty(std::string_view name, int minimum, int maximum, int step, int defaultValue, int value)
Create an integer property.
Definition cscore_oo.h:1052
VideoProperty CreateProperty(std::string_view name, VideoProperty::Kind kind, int minimum, int maximum, int step, int defaultValue, int value)
Create a property.
Definition cscore_oo.h:1032
void SetConnected(bool connected)
Set source connection status.
Definition cscore_oo.h:1005
VideoProperty CreateStringProperty(std::string_view name, std::string_view value)
Create a string property.
Definition cscore_oo.h:1088
void NotifyError(std::string_view msg)
Signal sinks that an error has occurred.
Definition cscore_oo.h:995
void SetEnumPropertyChoices(const VideoProperty &property, std::span< const std::string > choices)
Configure enum property choices.
Definition cscore_oo.h:1106
A sink that acts as a MJPEG-over-HTTP network server.
Definition cscore_oo.h:1346
void SetFPS(int fps)
Set the stream frames per second (FPS) for clients that don't specify it.
Definition cscore_oo.h:1414
void SetResolution(int width, int height)
Set the stream resolution for clients that don't specify it.
Definition cscore_oo.h:1399
MjpegServer(std::string_view name, std::string_view listenAddress, int port)
Create a MJPEG-over-HTTP server sink.
Definition cscore_oo.h:1357
std::string GetListenAddress() const
Get the listen address of the server.
Definition cscore_oo.h:1372
MjpegServer(std::string_view name, int port)
Create a MJPEG-over-HTTP server sink.
Definition cscore_oo.h:1367
void SetDefaultCompression(int quality)
Set the default compression used for non-MJPEG sources.
Definition cscore_oo.h:1441
void SetCompression(int quality)
Set the compression for clients that don't specify it.
Definition cscore_oo.h:1428
int GetPort() const
Get the port number of the server.
Definition cscore_oo.h:1380
A source that represents a USB camera.
Definition cscore_oo.h:700
UsbCameraInfo GetInfo() const
Get the full camera information for the device.
Definition cscore_oo.h:753
static std::vector< UsbCameraInfo > EnumerateUsbCameras()
Enumerate USB cameras on the local system.
Definition cscore_oo.h:729
std::string GetPath() const
Get the path to the device.
Definition cscore_oo.h:745
UsbCamera(std::string_view name, std::string_view path)
Create a source for a USB camera based on device path.
Definition cscore_oo.h:720
void SetConnectVerbose(int level)
Set how verbose the camera connection messages are.
Definition cscore_oo.h:763
void SetPath(std::string_view path)
Change the path to the device.
Definition cscore_oo.h:737
UsbCamera(std::string_view name, int dev)
Create a source for a USB camera based on device number.
Definition cscore_oo.h:710
A source that represents a video camera.
Definition cscore_oo.h:609
VideoCamera(CS_Source handle)
Definition cscore_oo.h:694
void SetExposureAuto()
Set the exposure to auto aperture.
Definition cscore_oo.h:672
void SetWhiteBalanceManual(int value)
Set the white balance to manual, with specified color temperature.
Definition cscore_oo.h:664
void SetWhiteBalanceAuto()
Set the white balance to auto.
Definition cscore_oo.h:648
int GetBrightness()
Get the brightness, as a percentage (0-100).
Definition cscore_oo.h:640
void SetBrightness(int brightness)
Set the brightness, as a percentage (0-100).
Definition cscore_oo.h:632
void SetWhiteBalanceHoldCurrent()
Set the white balance to hold current.
Definition cscore_oo.h:656
void SetExposureManual(int value)
Set the exposure to manual, as a percentage (0-100).
Definition cscore_oo.h:688
WhiteBalance
White balance.
Definition cscore_oo.h:614
@ kFixedOutdoor1
Fixed outdoor white balance 1.
Definition cscore_oo.h:618
@ kFixedFlourescent2
Fixed fluorescent white balance 2.
Definition cscore_oo.h:624
@ kFixedIndoor
Fixed indoor white balance.
Definition cscore_oo.h:616
@ kFixedFluorescent1
Fixed fluorescent white balance 1.
Definition cscore_oo.h:622
@ kFixedOutdoor2
Fixed outdoor white balance 2.
Definition cscore_oo.h:620
void SetExposureHoldCurrent()
Set the exposure to hold current.
Definition cscore_oo.h:680
An event generated by the library and provided to event listeners.
Definition cscore_oo.h:1491
VideoSink GetSink() const
Returns the sink associated with the event (if any).
Definition cscore_oo.h:1509
VideoProperty GetProperty() const
Returns the property associated with the event (if any).
Definition cscore_oo.h:1519
VideoSource GetSource() const
Returns the source associated with the event (if any).
Definition cscore_oo.h:1498
An event listener.
Definition cscore_oo.h:1529
friend void swap(VideoListener &first, VideoListener &second) noexcept
Definition cscore_oo.h:1570
VideoListener & operator=(VideoListener &&other) noexcept
Definition cscore_oo.h:1558
~VideoListener()
Definition cscore_oo.h:1563
VideoListener(std::function< void(const VideoEvent &event)> callback, int eventMask, bool immediateNotify)
Create an event listener.
Definition cscore_oo.h:1541
VideoListener & operator=(const VideoListener &)=delete
VideoListener(VideoListener &&other) noexcept
Definition cscore_oo.h:1554
VideoListener(const VideoListener &)=delete
A source or sink property.
Definition cscore_oo.h:41
int GetMin() const
Returns property minimum value.
Definition cscore_oo.h:140
int Get() const
Returns property value.
Definition cscore_oo.h:120
bool IsInteger() const
Returns true if property is an integer.
Definition cscore_oo.h:99
std::string_view GetString(wpi::SmallVectorImpl< char > &buf) const
Returns the string property value as a reference to the given buffer.
Definition cscore_oo.h:195
void SetString(std::string_view value)
Sets the string property value.
Definition cscore_oo.h:207
bool IsEnum() const
Returns true if property is an enum.
Definition cscore_oo.h:113
std::string GetName() const
Returns property name.
Definition cscore_oo.h:68
int GetDefault() const
Returns property default value.
Definition cscore_oo.h:170
Kind
Definition cscore_oo.h:48
@ kString
String property.
Definition cscore_oo.h:56
@ kInteger
Integer property.
Definition cscore_oo.h:54
@ kEnum
Enum property.
Definition cscore_oo.h:58
@ kBoolean
Boolean property.
Definition cscore_oo.h:52
@ kNone
No specific property.
Definition cscore_oo.h:50
CS_Status GetLastStatus() const
Returns the last status.
Definition cscore_oo.h:229
void Set(int value)
Sets property value.
Definition cscore_oo.h:130
bool IsBoolean() const
Returns true if property is a boolean.
Definition cscore_oo.h:92
std::vector< std::string > GetChoices() const
Returns the possible values for the enum property value.
Definition cscore_oo.h:219
int GetStep() const
Returns property step size.
Definition cscore_oo.h:160
Kind GetKind() const
Returns property kind.
Definition cscore_oo.h:78
bool IsString() const
Returns true if property is a string.
Definition cscore_oo.h:106
std::string GetString() const
Returns the string property value.
Definition cscore_oo.h:182
int GetMax() const
Returns property maximum value.
Definition cscore_oo.h:150
A sink for video that accepts a sequence of frames.
Definition cscore_oo.h:1135
VideoSink(VideoSink &&other) noexcept
Definition cscore_oo.h:1156
void SetSource(VideoSource source)
Configure which source should provide frames to this sink.
Definition cscore_oo.h:1289
Kind
Definition cscore_oo.h:1140
@ kCv
CV video sink.
Definition cscore_oo.h:1146
@ kUnknown
Unknown sink type.
Definition cscore_oo.h:1142
@ kRaw
Raw video sink.
Definition cscore_oo.h:1148
@ kMjpeg
MJPEG video sink.
Definition cscore_oo.h:1144
VideoProperty GetProperty(std::string_view name)
Get a property of the sink.
Definition cscore_oo.h:1220
friend void swap(VideoSink &first, VideoSink &second) noexcept
Definition cscore_oo.h:1330
std::string GetDescription() const
Get the sink description.
Definition cscore_oo.h:1208
std::vector< VideoProperty > EnumerateProperties() const
Enumerate all properties of this sink.
bool SetConfigJson(const wpi::json &config)
Set properties from a JSON configuration object.
Definition cscore_oo.h:1260
VideoProperty GetSourceProperty(std::string_view name)
Get a property of the associated source.
Definition cscore_oo.h:1316
bool SetConfigJson(std::string_view config)
Set properties from a JSON configuration string.
Definition cscore_oo.h:1249
int GetHandle() const
Returns the VideoSink handle.
Definition cscore_oo.h:1182
VideoSink & operator=(VideoSink other) noexcept
Definition cscore_oo.h:1158
VideoSource GetSource() const
Get the connected source.
Definition cscore_oo.h:1303
CS_Status m_status
Definition cscore_oo.h:1339
VideoSink() noexcept=default
std::string GetConfigJson() const
Get a JSON configuration string.
Definition cscore_oo.h:1270
bool operator==(const VideoSink &other) const
Definition cscore_oo.h:1184
CS_Sink m_handle
Definition cscore_oo.h:1340
VideoSink(CS_Sink handle)
Definition cscore_oo.h:1337
static std::vector< VideoSink > EnumerateSinks()
Enumerate all existing sinks.
std::string GetName() const
Get the name of the sink.
Definition cscore_oo.h:1200
CS_Status GetLastStatus() const
Definition cscore_oo.h:1321
wpi::json GetConfigJsonObject() const
Get a JSON configuration object.
~VideoSink()
Definition cscore_oo.h:1163
Kind GetKind() const
Get the kind of the sink.
Definition cscore_oo.h:1191
A source for video that provides a sequence of frames.
Definition cscore_oo.h:253
std::vector< VideoSink > EnumerateSinks()
Enumerate all sinks connected to this source.
bool SetPixelFormat(VideoMode::PixelFormat pixelFormat)
Set the pixel format.
Definition cscore_oo.h:454
double GetActualDataRate() const
Get the data rate (in bytes per second).
Definition cscore_oo.h:561
Kind GetKind() const
Get the kind of the source.
Definition cscore_oo.h:329
CS_Source m_handle
Video source handle.
Definition cscore_oo.h:603
VideoSource() noexcept=default
VideoProperty GetProperty(std::string_view name)
Get a property.
Definition cscore_oo.h:404
VideoMode GetVideoMode() const
Get the current video mode.
Definition cscore_oo.h:417
CS_Status m_status
Definition cscore_oo.h:600
~VideoSource()
Definition cscore_oo.h:311
int GetHandle() const
Definition cscore_oo.h:320
friend void swap(VideoSource &first, VideoSource &second) noexcept
Definition cscore_oo.h:591
VideoSource(CS_Source handle)
Definition cscore_oo.h:598
std::vector< VideoProperty > EnumerateProperties() const
Enumerate all properties of this source.
bool SetConfigJson(const wpi::json &config)
Set video mode and properties from a JSON configuration object.
Definition cscore_oo.h:519
bool IsConnected() const
Is the source currently connected to whatever is providing the images?
Definition cscore_oo.h:382
std::string GetDescription() const
Get the source description.
Definition cscore_oo.h:346
VideoSource(VideoSource &&other) noexcept
Definition cscore_oo.h:302
bool SetVideoMode(VideoMode::PixelFormat pixelFormat, int width, int height, int fps)
Set the video mode.
Definition cscore_oo.h:441
wpi::json GetConfigJsonObject() const
Get a JSON configuration object.
VideoSource & operator=(VideoSource other) noexcept
Definition cscore_oo.h:306
bool IsEnabled() const
Gets source enable status.
Definition cscore_oo.h:393
ConnectionStrategy
Connection strategy.
Definition cscore_oo.h:275
@ kConnectionKeepOpen
Try to keep the connection open regardless of whether any sinks are connected.
Definition cscore_oo.h:286
@ kConnectionAutoManage
Automatically connect or disconnect based on whether any sinks are connected to this source.
Definition cscore_oo.h:280
@ kConnectionForceClose
Never open the connection.
Definition cscore_oo.h:292
std::vector< VideoMode > EnumerateVideoModes() const
Enumerate all known video modes for this source.
Definition cscore_oo.h:570
uint64_t GetLastFrameTime() const
Get the last time a frame was captured.
Definition cscore_oo.h:357
double GetActualFPS() const
Get the actual FPS.
Definition cscore_oo.h:548
bool operator==(const VideoSource &other) const
Definition cscore_oo.h:322
Kind
Video source kind.
Definition cscore_oo.h:261
@ kCv
CV video source.
Definition cscore_oo.h:269
@ kHttp
HTTP video source.
Definition cscore_oo.h:267
@ kRaw
Raw video source.
Definition cscore_oo.h:271
@ kUnknown
Unknown video source.
Definition cscore_oo.h:263
@ kUsb
USB video source.
Definition cscore_oo.h:265
bool SetConfigJson(std::string_view config)
Set video mode and properties from a JSON configuration string.
Definition cscore_oo.h:508
bool SetFPS(int fps)
Set the frames per second (FPS).
Definition cscore_oo.h:477
static std::vector< VideoSource > EnumerateSources()
Enumerate all existing sources.
void SetConnectionStrategy(ConnectionStrategy strategy)
Sets the connection strategy.
Definition cscore_oo.h:371
CS_Status GetLastStatus() const
Definition cscore_oo.h:575
std::string GetConfigJson() const
Get a JSON configuration string.
Definition cscore_oo.h:529
bool SetResolution(int width, int height)
Set the resolution.
Definition cscore_oo.h:466
bool SetVideoMode(const VideoMode &mode)
Set the video mode.
Definition cscore_oo.h:427
std::string GetName() const
Get the name of the source.
Definition cscore_oo.h:338
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition sha1.h:30
CS_ConnectionStrategy
Connection strategy.
Definition cscore_c.h:177
CS_HttpCameraKind
HTTP Camera kinds.
Definition cscore_c.h:125
CS_PropertyKind
Property kinds.
Definition cscore_c.h:103
@ CS_CONNECTION_AUTO_MANAGE
Automatically connect or disconnect based on whether any sinks are connected to this source.
Definition cscore_c.h:182
@ CS_CONNECTION_KEEP_OPEN
Try to keep the connection open regardless of whether any sinks are connected.
Definition cscore_c.h:188
@ CS_CONNECTION_FORCE_CLOSE
Never open the connection.
Definition cscore_c.h:194
@ CS_HTTP_MJPGSTREAMER
Definition cscore_c.h:127
@ CS_HTTP_CSCORE
Definition cscore_c.h:128
@ CS_HTTP_UNKNOWN
Definition cscore_c.h:126
@ CS_HTTP_AXIS
Definition cscore_c.h:129
@ CS_PROP_ENUM
Definition cscore_c.h:108
@ CS_PROP_NONE
Definition cscore_c.h:104
@ CS_PROP_INTEGER
Definition cscore_c.h:106
@ CS_PROP_BOOLEAN
Definition cscore_c.h:105
@ CS_PROP_STRING
Definition cscore_c.h:107
@ CS_SOURCE_FRAMES_RECEIVED
Definition cscore_c.h:173
@ CS_SOURCE_BYTES_RECEIVED
Definition cscore_c.h:172
@ CS_SINK_MJPEG
Definition cscore_c.h:137
@ CS_SINK_RAW
Definition cscore_c.h:139
@ CS_SINK_CV
Definition cscore_c.h:138
@ CS_SINK_UNKNOWN
Definition cscore_c.h:136
@ CS_SOURCE_USB
Definition cscore_c.h:116
@ CS_SOURCE_HTTP
Definition cscore_c.h:117
@ CS_SOURCE_UNKNOWN
Definition cscore_c.h:115
@ CS_SOURCE_RAW
Definition cscore_c.h:119
@ CS_SOURCE_CV
Definition cscore_c.h:118
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)
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)
void SetHttpCameraUrls(CS_Source source, std::span< const std::string > urls, CS_Status *status)
CS_HttpCameraKind GetHttpCameraKind(CS_Source source, CS_Status *status)
CS_Listener AddListener(std::function< void(const RawEvent &event)> callback, int eventMask, bool immediateNotify, CS_Status *status)
void RemoveListener(CS_Listener handle, CS_Status *status)
int GetMjpegServerPort(CS_Sink sink, CS_Status *status)
std::string GetMjpegServerListenAddress(CS_Sink sink, 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)
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)
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::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)
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)
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::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)
double GetTelemetryAverageValue(CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
CS_Handle CS_Source
Definition cscore_c.h:54
int CS_Status
Definition cscore_c.h:47
CS_Handle CS_Property
Definition cscore_c.h:50
CS_Handle CS_Sink
Definition cscore_c.h:53
CS_Handle CS_Listener
Definition cscore_c.h:51
CameraServer (cscore) namespace.
Definition ShuffleboardContainer.h:25
Implement std::hash so that hash_code can be used in STL containers.
Definition PointerIntPair.h:280
WPI_BASIC_JSON_TPL_DECLARATION void swap(wpi::WPI_BASIC_JSON_TPL &j1, wpi::WPI_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< wpi::WPI_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression, cppcoreguidelines-noexcept-swap, performance-noexcept-swap) is_nothrow_move_assignable< wpi::WPI_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
Definition json.h:5258
Listener event.
Definition cscore_cpp.h:102
CS_Sink sinkHandle
Definition cscore_cpp.h:157
CS_Property propertyHandle
Definition cscore_cpp.h:166
CS_Source sourceHandle
Definition cscore_cpp.h:156
CS_PropertyKind propertyKind
Definition cscore_cpp.h:167
USB camera information.
Definition cscore_cpp.h:44
Video mode.
Definition cscore_cpp.h:62
PixelFormat
Definition cscore_cpp.h:63