WPILibC++ 2023.4.3
cs Namespace Reference

CameraServer (cscore) namespace. More...

Classes

class  AxisCamera
 A source that represents an Axis IP camera. More...
 
class  HttpCamera
 A source that represents a MJPEG-over-HTTP (IP) camera. More...
 
class  ImageSink
 A base class for single image reading sinks. More...
 
class  ImageSource
 A base class for single image providing sources. More...
 
class  MjpegServer
 A sink that acts as a MJPEG-over-HTTP network server. More...
 
class  RawCvSink
 A sink for user code to accept raw video frames as OpenCV images. More...
 
class  RawCvSource
 A source for using the raw frame API to provide opencv images. More...
 
struct  RawEvent
 Listener event. More...
 
class  UsbCamera
 A source that represents a USB camera. More...
 
struct  UsbCameraInfo
 USB camera information. More...
 
class  VideoCamera
 A source that represents a video camera. More...
 
class  VideoEvent
 An event generated by the library and provided to event listeners. More...
 
class  VideoListener
 An event listener. More...
 
struct  VideoMode
 Video mode. More...
 
class  VideoProperty
 A source or sink property. More...
 
class  VideoSink
 A sink for video that accepts a sequence of frames. More...
 
class  VideoSource
 A source for video that provides a sequence of frames. More...
 

Typedefs

using LogFunc = std::function< void(unsigned int level, const char *file, unsigned int line, const char *msg)>
 

Functions

CS_PropertyKind GetPropertyKind (CS_Property property, CS_Status *status)
 
std::string GetPropertyName (CS_Property property, CS_Status *status)
 
std::string_view GetPropertyName (CS_Property property, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
int GetProperty (CS_Property property, CS_Status *status)
 
void SetProperty (CS_Property property, int value, CS_Status *status)
 
int GetPropertyMin (CS_Property property, CS_Status *status)
 
int GetPropertyMax (CS_Property property, CS_Status *status)
 
int GetPropertyStep (CS_Property property, CS_Status *status)
 
int GetPropertyDefault (CS_Property property, CS_Status *status)
 
std::string GetStringProperty (CS_Property property, CS_Status *status)
 
std::string_view GetStringProperty (CS_Property property, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
void SetStringProperty (CS_Property property, std::string_view value, CS_Status *status)
 
std::vector< std::string > GetEnumPropertyChoices (CS_Property property, CS_Status *status)
 
CS_Source CreateUsbCameraDev (std::string_view name, int dev, 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 CreateHttpCamera (std::string_view name, std::span< const std::string > urls, CS_HttpCameraKind kind, CS_Status *status)
 
CS_Source CreateCvSource (std::string_view name, const VideoMode &mode, CS_Status *status)
 
CS_SourceKind GetSourceKind (CS_Source source, CS_Status *status)
 
std::string GetSourceName (CS_Source source, CS_Status *status)
 
std::string_view GetSourceName (CS_Source source, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
std::string GetSourceDescription (CS_Source source, CS_Status *status)
 
std::string_view GetSourceDescription (CS_Source source, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
uint64_t GetSourceLastFrameTime (CS_Source source, CS_Status *status)
 
void SetSourceConnectionStrategy (CS_Source source, CS_ConnectionStrategy strategy, CS_Status *status)
 
bool IsSourceConnected (CS_Source source, CS_Status *status)
 
bool IsSourceEnabled (CS_Source source, CS_Status *status)
 
CS_Property GetSourceProperty (CS_Source source, std::string_view name, CS_Status *status)
 
std::span< CS_PropertyEnumerateSourceProperties (CS_Source source, wpi::SmallVectorImpl< CS_Property > &vec, CS_Status *status)
 
VideoMode GetSourceVideoMode (CS_Source source, CS_Status *status)
 
bool SetSourceVideoMode (CS_Source source, const VideoMode &mode, CS_Status *status)
 
bool SetSourcePixelFormat (CS_Source source, VideoMode::PixelFormat pixelFormat, CS_Status *status)
 
bool SetSourceResolution (CS_Source source, int width, int height, CS_Status *status)
 
bool SetSourceFPS (CS_Source source, int fps, CS_Status *status)
 
bool SetSourceConfigJson (CS_Source source, std::string_view config, CS_Status *status)
 
bool SetSourceConfigJson (CS_Source source, const wpi::json &config, CS_Status *status)
 
std::string GetSourceConfigJson (CS_Source source, CS_Status *status)
 
wpi::json GetSourceConfigJsonObject (CS_Source source, CS_Status *status)
 
std::vector< VideoModeEnumerateSourceVideoModes (CS_Source source, CS_Status *status)
 
std::span< CS_SinkEnumerateSourceSinks (CS_Source source, wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
 
CS_Source CopySource (CS_Source source, CS_Status *status)
 
void ReleaseSource (CS_Source source, CS_Status *status)
 
void SetCameraBrightness (CS_Source source, int brightness, CS_Status *status)
 
int GetCameraBrightness (CS_Source source, CS_Status *status)
 
void SetCameraWhiteBalanceAuto (CS_Source source, CS_Status *status)
 
void SetCameraWhiteBalanceHoldCurrent (CS_Source source, CS_Status *status)
 
void SetCameraWhiteBalanceManual (CS_Source source, int value, CS_Status *status)
 
void SetCameraExposureAuto (CS_Source source, CS_Status *status)
 
void SetCameraExposureHoldCurrent (CS_Source source, CS_Status *status)
 
void SetCameraExposureManual (CS_Source source, int value, CS_Status *status)
 
void SetUsbCameraPath (CS_Source, std::string_view path, CS_Status *status)
 
std::string GetUsbCameraPath (CS_Source source, CS_Status *status)
 
UsbCameraInfo GetUsbCameraInfo (CS_Source source, CS_Status *status)
 
CS_HttpCameraKind GetHttpCameraKind (CS_Source source, CS_Status *status)
 
void SetHttpCameraUrls (CS_Source source, std::span< const std::string > urls, CS_Status *status)
 
std::vector< std::string > GetHttpCameraUrls (CS_Source source, CS_Status *status)
 
void NotifySourceError (CS_Source source, std::string_view msg, 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 SetSourceEnumPropertyChoices (CS_Source source, CS_Property property, std::span< const std::string > choices, CS_Status *status)
 
CS_Sink CreateMjpegServer (std::string_view name, std::string_view listenAddress, int port, CS_Status *status)
 
CS_Sink CreateCvSink (std::string_view name, CS_Status *status)
 
CS_Sink CreateCvSinkCallback (std::string_view name, std::function< void(uint64_t time)> processFrame, CS_Status *status)
 
CS_SinkKind GetSinkKind (CS_Sink sink, CS_Status *status)
 
std::string GetSinkName (CS_Sink sink, CS_Status *status)
 
std::string_view GetSinkName (CS_Sink sink, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
std::string GetSinkDescription (CS_Sink sink, CS_Status *status)
 
std::string_view GetSinkDescription (CS_Sink sink, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
CS_Property GetSinkProperty (CS_Sink sink, std::string_view name, CS_Status *status)
 
std::span< CS_PropertyEnumerateSinkProperties (CS_Sink sink, wpi::SmallVectorImpl< CS_Property > &vec, 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)
 
bool SetSinkConfigJson (CS_Sink sink, std::string_view config, CS_Status *status)
 
bool SetSinkConfigJson (CS_Sink sink, const wpi::json &config, CS_Status *status)
 
std::string GetSinkConfigJson (CS_Sink sink, CS_Status *status)
 
wpi::json GetSinkConfigJsonObject (CS_Sink sink, CS_Status *status)
 
CS_Source GetSinkSource (CS_Sink sink, CS_Status *status)
 
CS_Sink CopySink (CS_Sink sink, CS_Status *status)
 
void ReleaseSink (CS_Sink sink, CS_Status *status)
 
std::string GetMjpegServerListenAddress (CS_Sink sink, CS_Status *status)
 
int GetMjpegServerPort (CS_Sink sink, CS_Status *status)
 
void SetSinkDescription (CS_Sink sink, std::string_view description, CS_Status *status)
 
std::string GetSinkError (CS_Sink sink, CS_Status *status)
 
std::string_view GetSinkError (CS_Sink sink, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
void SetSinkEnabled (CS_Sink sink, bool enabled, CS_Status *status)
 
void SetListenerOnStart (std::function< void()> onStart)
 
void SetListenerOnExit (std::function< void()> onExit)
 
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)
 
CS_ListenerPoller CreateListenerPoller ()
 
void DestroyListenerPoller (CS_ListenerPoller poller)
 
CS_Listener AddPolledListener (CS_ListenerPoller poller, int eventMask, bool immediateNotify, CS_Status *status)
 
std::vector< RawEventPollListener (CS_ListenerPoller poller)
 
std::vector< RawEventPollListener (CS_ListenerPoller poller, double timeout, bool *timedOut)
 
void CancelPollListener (CS_ListenerPoller poller)
 
bool NotifierDestroyed ()
 
void SetTelemetryPeriod (double seconds)
 
double GetTelemetryElapsedTime ()
 
int64_t GetTelemetryValue (CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
 
double GetTelemetryAverageValue (CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
 
void SetLogger (LogFunc func, unsigned int min_level)
 
void SetDefaultLogger (unsigned int min_level)
 
void Shutdown ()
 
std::vector< UsbCameraInfoEnumerateUsbCameras (CS_Status *status)
 
std::span< CS_SourceEnumerateSourceHandles (wpi::SmallVectorImpl< CS_Source > &vec, CS_Status *status)
 
std::span< CS_SinkEnumerateSinkHandles (wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
 
std::string GetHostname ()
 
std::vector< std::string > GetNetworkInterfaces ()
 
void RunMainRunLoop ()
 
int RunMainRunLoopTimeout (double timeoutSeconds)
 
void StopMainRunLoop ()
 

Detailed Description

CameraServer (cscore) namespace.

Function Documentation

◆ RunMainRunLoop()

void cs::RunMainRunLoop ( )

◆ RunMainRunLoopTimeout()

int cs::RunMainRunLoopTimeout ( double  timeoutSeconds)

◆ StopMainRunLoop()

void cs::StopMainRunLoop ( )