WPILibC++ 2023.4.3
cscore C API

Handle-based interface for C. More...

Modules

 Typedefs
 
 Property Functions
 
 Source Creation Functions
 
 Source Functions
 
 Camera Source Common Property Functions
 
 UsbCamera Source Functions
 
 HttpCamera Source Functions
 
 OpenCV Source Functions
 
 Sink Creation Functions
 
 Sink Functions
 
 MjpegServer Sink Functions
 
 OpenCV Sink Functions
 
 Listener Functions
 
 Telemetry Functions
 
 Logging Functions
 
 Library Shutdown Function
 
 Utility Functions
 

Classes

struct  CS_VideoMode
 Video mode. More...
 
struct  CS_Event
 Listener event. More...
 
struct  CS_UsbCameraInfo
 USB camera information. More...
 

Typedefs

typedef struct CS_VideoMode CS_VideoMode
 Video mode. More...
 
typedef struct CS_UsbCameraInfo CS_UsbCameraInfo
 USB camera information. More...
 

Enumerations

enum  CS_StatusValue {
  CS_PROPERTY_WRITE_FAILED = 2000 , CS_OK = 0 , CS_INVALID_HANDLE = -2000 , CS_WRONG_HANDLE_SUBTYPE = -2001 ,
  CS_INVALID_PROPERTY = -2002 , CS_WRONG_PROPERTY_TYPE = -2003 , CS_READ_FAILED = -2004 , CS_SOURCE_IS_DISCONNECTED = -2005 ,
  CS_EMPTY_VALUE = -2006 , CS_BAD_URL = -2007 , CS_TELEMETRY_NOT_ENABLED = -2008 , CS_UNSUPPORTED_MODE = -2009
}
 Status values. More...
 
enum  CS_LogLevel {
  CS_LOG_CRITICAL = 50 , CS_LOG_ERROR = 40 , CS_LOG_WARNING = 30 , CS_LOG_INFO = 20 ,
  CS_LOG_DEBUG = 10 , CS_LOG_DEBUG1 = 9 , CS_LOG_DEBUG2 = 8 , CS_LOG_DEBUG3 = 7 ,
  CS_LOG_DEBUG4 = 6
}
 Logging levels. More...
 
enum  CS_PixelFormat {
  CS_PIXFMT_UNKNOWN = 0 , CS_PIXFMT_MJPEG , CS_PIXFMT_YUYV , CS_PIXFMT_RGB565 ,
  CS_PIXFMT_BGR , CS_PIXFMT_GRAY , CS_PIXFMT_Y16 , CS_PIXFMT_UYVY
}
 Pixel formats. More...
 
enum  CS_PropertyKind {
  CS_PROP_NONE = 0 , CS_PROP_BOOLEAN = 1 , CS_PROP_INTEGER = 2 , CS_PROP_STRING = 4 ,
  CS_PROP_ENUM = 8
}
 Property kinds. More...
 
enum  CS_SourceKind {
  CS_SOURCE_UNKNOWN = 0 , CS_SOURCE_USB = 1 , CS_SOURCE_HTTP = 2 , CS_SOURCE_CV = 4 ,
  CS_SOURCE_RAW = 8
}
 Source kinds. More...
 
enum  CS_HttpCameraKind { CS_HTTP_UNKNOWN = 0 , CS_HTTP_MJPGSTREAMER = 1 , CS_HTTP_CSCORE = 2 , CS_HTTP_AXIS = 3 }
 HTTP Camera kinds. More...
 
enum  CS_SinkKind { CS_SINK_UNKNOWN = 0 , CS_SINK_MJPEG = 2 , CS_SINK_CV = 4 , CS_SINK_RAW = 8 }
 Sink kinds. More...
 
enum  CS_EventKind {
  CS_SOURCE_CREATED = 0x0001 , CS_SOURCE_DESTROYED = 0x0002 , CS_SOURCE_CONNECTED = 0x0004 , CS_SOURCE_DISCONNECTED = 0x0008 ,
  CS_SOURCE_VIDEOMODES_UPDATED = 0x0010 , CS_SOURCE_VIDEOMODE_CHANGED = 0x0020 , CS_SOURCE_PROPERTY_CREATED = 0x0040 , CS_SOURCE_PROPERTY_VALUE_UPDATED = 0x0080 ,
  CS_SOURCE_PROPERTY_CHOICES_UPDATED = 0x0100 , CS_SINK_SOURCE_CHANGED = 0x0200 , CS_SINK_CREATED = 0x0400 , CS_SINK_DESTROYED = 0x0800 ,
  CS_SINK_ENABLED = 0x1000 , CS_SINK_DISABLED = 0x2000 , CS_NETWORK_INTERFACES_CHANGED = 0x4000 , CS_TELEMETRY_UPDATED = 0x8000 ,
  CS_SINK_PROPERTY_CREATED = 0x10000 , CS_SINK_PROPERTY_VALUE_UPDATED = 0x20000 , CS_SINK_PROPERTY_CHOICES_UPDATED = 0x40000 , CS_USB_CAMERAS_CHANGED = 0x80000
}
 Listener event kinds. More...
 
enum  CS_TelemetryKind { CS_SOURCE_BYTES_RECEIVED = 1 , CS_SOURCE_FRAMES_RECEIVED = 2 }
 Telemetry kinds. More...
 
enum  CS_ConnectionStrategy { CS_CONNECTION_AUTO_MANAGE = 0 , CS_CONNECTION_KEEP_OPEN , CS_CONNECTION_FORCE_CLOSE }
 Connection strategy. More...
 

Functions

int CS_NotifierDestroyed (void)
 

Detailed Description

Handle-based interface for C.

Sources and sinks are reference counted internally to the library. Any time a source or sink handle is returned or provided to a callback, the reference count is incremented.

Calling CS_ReleaseSource() or CS_ReleaseSink() decrements the reference count, and when the reference count reaches zero, the object is destroyed.

Connecting a source to a sink increments the reference count of the source, and when the sink is destroyed (its reference count reaches zero), the source reference count is decremented.

Typedef Documentation

◆ CS_UsbCameraInfo

USB camera information.

◆ CS_VideoMode

typedef struct CS_VideoMode CS_VideoMode

Video mode.

Enumeration Type Documentation

◆ CS_ConnectionStrategy

Connection strategy.

Enumerator
CS_CONNECTION_AUTO_MANAGE 

Automatically connect or disconnect based on whether any sinks are connected to this source.

This is the default behavior.

CS_CONNECTION_KEEP_OPEN 

Try to keep the connection open regardless of whether any sinks are connected.

CS_CONNECTION_FORCE_CLOSE 

Never open the connection.

If this is set when the connection is open, close the connection.

◆ CS_EventKind

Listener event kinds.

Enumerator
CS_SOURCE_CREATED 
CS_SOURCE_DESTROYED 
CS_SOURCE_CONNECTED 
CS_SOURCE_DISCONNECTED 
CS_SOURCE_VIDEOMODES_UPDATED 
CS_SOURCE_VIDEOMODE_CHANGED 
CS_SOURCE_PROPERTY_CREATED 
CS_SOURCE_PROPERTY_VALUE_UPDATED 
CS_SOURCE_PROPERTY_CHOICES_UPDATED 
CS_SINK_SOURCE_CHANGED 
CS_SINK_CREATED 
CS_SINK_DESTROYED 
CS_SINK_ENABLED 
CS_SINK_DISABLED 
CS_NETWORK_INTERFACES_CHANGED 
CS_TELEMETRY_UPDATED 
CS_SINK_PROPERTY_CREATED 
CS_SINK_PROPERTY_VALUE_UPDATED 
CS_SINK_PROPERTY_CHOICES_UPDATED 
CS_USB_CAMERAS_CHANGED 

◆ CS_HttpCameraKind

HTTP Camera kinds.

Enumerator
CS_HTTP_UNKNOWN 
CS_HTTP_MJPGSTREAMER 
CS_HTTP_CSCORE 
CS_HTTP_AXIS 

◆ CS_LogLevel

Logging levels.

Enumerator
CS_LOG_CRITICAL 
CS_LOG_ERROR 
CS_LOG_WARNING 
CS_LOG_INFO 
CS_LOG_DEBUG 
CS_LOG_DEBUG1 
CS_LOG_DEBUG2 
CS_LOG_DEBUG3 
CS_LOG_DEBUG4 

◆ CS_PixelFormat

Pixel formats.

Enumerator
CS_PIXFMT_UNKNOWN 
CS_PIXFMT_MJPEG 
CS_PIXFMT_YUYV 
CS_PIXFMT_RGB565 
CS_PIXFMT_BGR 
CS_PIXFMT_GRAY 
CS_PIXFMT_Y16 
CS_PIXFMT_UYVY 

◆ CS_PropertyKind

Property kinds.

Enumerator
CS_PROP_NONE 
CS_PROP_BOOLEAN 
CS_PROP_INTEGER 
CS_PROP_STRING 
CS_PROP_ENUM 

◆ CS_SinkKind

Sink kinds.

Enumerator
CS_SINK_UNKNOWN 
CS_SINK_MJPEG 
CS_SINK_CV 
CS_SINK_RAW 

◆ CS_SourceKind

Source kinds.

Enumerator
CS_SOURCE_UNKNOWN 
CS_SOURCE_USB 
CS_SOURCE_HTTP 
CS_SOURCE_CV 
CS_SOURCE_RAW 

◆ CS_StatusValue

Status values.

Enumerator
CS_PROPERTY_WRITE_FAILED 
CS_OK 
CS_INVALID_HANDLE 
CS_WRONG_HANDLE_SUBTYPE 
CS_INVALID_PROPERTY 
CS_WRONG_PROPERTY_TYPE 
CS_READ_FAILED 
CS_SOURCE_IS_DISCONNECTED 
CS_EMPTY_VALUE 
CS_BAD_URL 
CS_TELEMETRY_NOT_ENABLED 
CS_UNSUPPORTED_MODE 

◆ CS_TelemetryKind

Telemetry kinds.

Enumerator
CS_SOURCE_BYTES_RECEIVED 
CS_SOURCE_FRAMES_RECEIVED 

Function Documentation

◆ CS_NotifierDestroyed()

int CS_NotifierDestroyed ( void  )