WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
cscore C API

Handle-based interface for C. More...

Modules

 Typedefs
 
 Property Functions
 
 Source Creation Functions
 
 Source Functions
 
 Camera Source Common Property Fuctions
 
 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 infomation. More...
 

Typedefs

typedef struct CS_VideoMode CS_VideoMode
 Video mode.
 
typedef struct CS_UsbCameraInfo CS_UsbCameraInfo
 USB camera infomation.
 

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.
 
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.
 
enum  CS_PixelFormat {
  CS_PIXFMT_UNKNOWN = 0, CS_PIXFMT_MJPEG, CS_PIXFMT_YUYV, CS_PIXFMT_RGB565,
  CS_PIXFMT_BGR, CS_PIXFMT_GRAY
}
 Pixel formats.
 
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.
 
enum  CS_SourceKind { CS_SOURCE_UNKNOWN = 0, CS_SOURCE_USB = 1, CS_SOURCE_HTTP = 2, CS_SOURCE_CV = 4 }
 Source kinds.
 
enum  CS_HttpCameraKind { CS_HTTP_UNKNOWN = 0, CS_HTTP_MJPGSTREAMER = 1, CS_HTTP_CSCORE = 2, CS_HTTP_AXIS = 3 }
 HTTP Camera kinds.
 
enum  CS_SinkKind { CS_SINK_UNKNOWN = 0, CS_SINK_MJPEG = 2, CS_SINK_CV = 4 }
 Sink kinds.
 
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
}
 Listener event kinds.
 
enum  CS_TelemetryKind { CS_SOURCE_BYTES_RECEIVED = 1, CS_SOURCE_FRAMES_RECEIVED = 2 }
 Telemetry kinds.
 
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.

Enumeration Type Documentation

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.