mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
cscore: Documentation cleanups (#1236)
Reformat the C++ documentation to use the normal comment style and add doxygen grouping.
This commit is contained in:
@@ -22,20 +22,29 @@ extern "C" {
|
||||
|
||||
struct CvMat;
|
||||
|
||||
//
|
||||
// The C API is handle-based. 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.
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_c_api cscore C API
|
||||
*
|
||||
* Handle-based interface for C.
|
||||
*
|
||||
* <p>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.
|
||||
*
|
||||
* <p>Calling CS_ReleaseSource() or CS_ReleaseSink() decrements the reference
|
||||
* count, and when the reference count reaches zero, the object is destroyed.
|
||||
*
|
||||
* <p>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.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
//
|
||||
// Typedefs
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_typedefs Typedefs
|
||||
* @{
|
||||
*/
|
||||
typedef int CS_Bool;
|
||||
typedef int CS_Status;
|
||||
|
||||
@@ -44,10 +53,11 @@ typedef CS_Handle CS_Property;
|
||||
typedef CS_Handle CS_Listener;
|
||||
typedef CS_Handle CS_Sink;
|
||||
typedef CS_Handle CS_Source;
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Status values
|
||||
//
|
||||
/**
|
||||
* Status values
|
||||
*/
|
||||
enum CS_StatusValue {
|
||||
CS_PROPERTY_WRITE_FAILED = 2000,
|
||||
CS_OK = 0,
|
||||
@@ -62,9 +72,9 @@ enum CS_StatusValue {
|
||||
CS_TELEMETRY_NOT_ENABLED = -2008
|
||||
};
|
||||
|
||||
//
|
||||
// Logging levels
|
||||
//
|
||||
/**
|
||||
* Logging levels
|
||||
*/
|
||||
enum CS_LogLevel {
|
||||
CS_LOG_CRITICAL = 50,
|
||||
CS_LOG_ERROR = 40,
|
||||
@@ -77,9 +87,9 @@ enum CS_LogLevel {
|
||||
CS_LOG_DEBUG4 = 6
|
||||
};
|
||||
|
||||
//
|
||||
// Pixel formats
|
||||
//
|
||||
/**
|
||||
* Pixel formats
|
||||
*/
|
||||
enum CS_PixelFormat {
|
||||
CS_PIXFMT_UNKNOWN = 0,
|
||||
CS_PIXFMT_MJPEG,
|
||||
@@ -89,9 +99,9 @@ enum CS_PixelFormat {
|
||||
CS_PIXFMT_GRAY
|
||||
};
|
||||
|
||||
//
|
||||
// Frame formats
|
||||
//
|
||||
/**
|
||||
* Video mode
|
||||
*/
|
||||
typedef struct CS_VideoMode {
|
||||
int pixelFormat;
|
||||
int width;
|
||||
@@ -99,9 +109,9 @@ typedef struct CS_VideoMode {
|
||||
int fps;
|
||||
} CS_VideoMode;
|
||||
|
||||
//
|
||||
// Property kinds
|
||||
//
|
||||
/**
|
||||
* Property kinds
|
||||
*/
|
||||
enum CS_PropertyKind {
|
||||
CS_PROP_NONE = 0,
|
||||
CS_PROP_BOOLEAN = 1,
|
||||
@@ -110,9 +120,9 @@ enum CS_PropertyKind {
|
||||
CS_PROP_ENUM = 8
|
||||
};
|
||||
|
||||
//
|
||||
// Source kinds
|
||||
//
|
||||
/**
|
||||
* Source kinds
|
||||
*/
|
||||
enum CS_SourceKind {
|
||||
CS_SOURCE_UNKNOWN = 0,
|
||||
CS_SOURCE_USB = 1,
|
||||
@@ -120,9 +130,9 @@ enum CS_SourceKind {
|
||||
CS_SOURCE_CV = 4
|
||||
};
|
||||
|
||||
//
|
||||
// HTTP Camera kinds
|
||||
//
|
||||
/**
|
||||
* HTTP Camera kinds
|
||||
*/
|
||||
enum CS_HttpCameraKind {
|
||||
CS_HTTP_UNKNOWN = 0,
|
||||
CS_HTTP_MJPGSTREAMER = 1,
|
||||
@@ -130,14 +140,14 @@ enum CS_HttpCameraKind {
|
||||
CS_HTTP_AXIS = 3
|
||||
};
|
||||
|
||||
//
|
||||
// Sink kinds
|
||||
//
|
||||
/**
|
||||
* Sink kinds
|
||||
*/
|
||||
enum CS_SinkKind { CS_SINK_UNKNOWN = 0, CS_SINK_MJPEG = 2, CS_SINK_CV = 4 };
|
||||
|
||||
//
|
||||
// Listener event kinds
|
||||
//
|
||||
/**
|
||||
* Listener event kinds
|
||||
*/
|
||||
enum CS_EventKind {
|
||||
CS_SOURCE_CREATED = 0x0001,
|
||||
CS_SOURCE_DESTROYED = 0x0002,
|
||||
@@ -160,17 +170,17 @@ enum CS_EventKind {
|
||||
CS_SINK_PROPERTY_CHOICES_UPDATED = 0x40000
|
||||
};
|
||||
|
||||
//
|
||||
// Telemetry kinds
|
||||
//
|
||||
/**
|
||||
* Telemetry kinds
|
||||
*/
|
||||
enum CS_TelemetryKind {
|
||||
CS_SOURCE_BYTES_RECEIVED = 1,
|
||||
CS_SOURCE_FRAMES_RECEIVED = 2
|
||||
};
|
||||
|
||||
//
|
||||
// Listener event
|
||||
//
|
||||
/**
|
||||
* Listener event
|
||||
*/
|
||||
struct CS_Event {
|
||||
enum CS_EventKind kind;
|
||||
|
||||
@@ -191,9 +201,10 @@ struct CS_Event {
|
||||
const char* valueStr;
|
||||
};
|
||||
|
||||
//
|
||||
// Property Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_property_cfunc Property Functions
|
||||
* @{
|
||||
*/
|
||||
enum CS_PropertyKind CS_GetPropertyKind(CS_Property property,
|
||||
CS_Status* status);
|
||||
char* CS_GetPropertyName(CS_Property property, CS_Status* status);
|
||||
@@ -208,10 +219,12 @@ void CS_SetStringProperty(CS_Property property, const char* value,
|
||||
CS_Status* status);
|
||||
char** CS_GetEnumPropertyChoices(CS_Property property, int* count,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Source Creation Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_source_create_cfunc Source Creation Functions
|
||||
* @{
|
||||
*/
|
||||
CS_Source CS_CreateUsbCameraDev(const char* name, int dev, CS_Status* status);
|
||||
CS_Source CS_CreateUsbCameraPath(const char* name, const char* path,
|
||||
CS_Status* status);
|
||||
@@ -222,10 +235,12 @@ CS_Source CS_CreateHttpCameraMulti(const char* name, const char** urls,
|
||||
CS_Status* status);
|
||||
CS_Source CS_CreateCvSource(const char* name, const CS_VideoMode* mode,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_source_cfunc Source Functions
|
||||
* @{
|
||||
*/
|
||||
enum CS_SourceKind CS_GetSourceKind(CS_Source source, CS_Status* status);
|
||||
char* CS_GetSourceName(CS_Source source, CS_Status* status);
|
||||
char* CS_GetSourceDescription(CS_Source source, CS_Status* status);
|
||||
@@ -255,10 +270,12 @@ CS_Sink* CS_EnumerateSourceSinks(CS_Source source, int* count,
|
||||
CS_Status* status);
|
||||
CS_Source CS_CopySource(CS_Source source, CS_Status* status);
|
||||
void CS_ReleaseSource(CS_Source source, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Camera Source Common Property Fuctions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_source_prop_cfunc Camera Source Common Property Fuctions
|
||||
* @{
|
||||
*/
|
||||
void CS_SetCameraBrightness(CS_Source source, int brightness,
|
||||
CS_Status* status);
|
||||
int CS_GetCameraBrightness(CS_Source source, CS_Status* status);
|
||||
@@ -269,24 +286,30 @@ void CS_SetCameraWhiteBalanceManual(CS_Source source, int value,
|
||||
void CS_SetCameraExposureAuto(CS_Source source, CS_Status* status);
|
||||
void CS_SetCameraExposureHoldCurrent(CS_Source source, CS_Status* status);
|
||||
void CS_SetCameraExposureManual(CS_Source source, int value, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// UsbCamera Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_usbcamera_cfunc UsbCamera Source Functions
|
||||
* @{
|
||||
*/
|
||||
char* CS_GetUsbCameraPath(CS_Source source, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// HttpCamera Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_httpcamera_cfunc HttpCamera Source Functions
|
||||
* @{
|
||||
*/
|
||||
enum CS_HttpCameraKind CS_GetHttpCameraKind(CS_Source source,
|
||||
CS_Status* status);
|
||||
void CS_SetHttpCameraUrls(CS_Source source, const char** urls, int count,
|
||||
CS_Status* status);
|
||||
char** CS_GetHttpCameraUrls(CS_Source source, int* count, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// OpenCV Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_opencv_source_cfunc OpenCV Source Functions
|
||||
* @{
|
||||
*/
|
||||
void CS_PutSourceFrame(CS_Source source, struct CvMat* image,
|
||||
CS_Status* status);
|
||||
void CS_NotifySourceError(CS_Source source, const char* msg, CS_Status* status);
|
||||
@@ -301,20 +324,24 @@ CS_Property CS_CreateSourceProperty(CS_Source source, const char* name,
|
||||
void CS_SetSourceEnumPropertyChoices(CS_Source source, CS_Property property,
|
||||
const char** choices, int count,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Sink Creation Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_sink_create_cfunc Sink Creation Functions
|
||||
* @{
|
||||
*/
|
||||
CS_Sink CS_CreateMjpegServer(const char* name, const char* listenAddress,
|
||||
int port, CS_Status* status);
|
||||
CS_Sink CS_CreateCvSink(const char* name, CS_Status* status);
|
||||
CS_Sink CS_CreateCvSinkCallback(const char* name, void* data,
|
||||
void (*processFrame)(void* data, uint64_t time),
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Sink Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_sink_cfunc Sink Functions
|
||||
* @{
|
||||
*/
|
||||
enum CS_SinkKind CS_GetSinkKind(CS_Sink sink, CS_Status* status);
|
||||
char* CS_GetSinkName(CS_Sink sink, CS_Status* status);
|
||||
char* CS_GetSinkDescription(CS_Sink sink, CS_Status* status);
|
||||
@@ -328,16 +355,20 @@ CS_Property CS_GetSinkSourceProperty(CS_Sink sink, const char* name,
|
||||
CS_Source CS_GetSinkSource(CS_Sink sink, CS_Status* status);
|
||||
CS_Sink CS_CopySink(CS_Sink sink, CS_Status* status);
|
||||
void CS_ReleaseSink(CS_Sink sink, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// MjpegServer Sink Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_mjpegserver_cfunc MjpegServer Sink Functions
|
||||
* @{
|
||||
*/
|
||||
char* CS_GetMjpegServerListenAddress(CS_Sink sink, CS_Status* status);
|
||||
int CS_GetMjpegServerPort(CS_Sink sink, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// OpenCV Sink Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_opencv_sink_cfunc OpenCV Sink Functions
|
||||
* @{
|
||||
*/
|
||||
void CS_SetSinkDescription(CS_Sink sink, const char* description,
|
||||
CS_Status* status);
|
||||
uint64_t CS_GrabSinkFrame(CS_Sink sink, struct CvMat* image, CS_Status* status);
|
||||
@@ -345,10 +376,12 @@ uint64_t CS_GrabSinkFrameTimeout(CS_Sink sink, struct CvMat* image,
|
||||
double timeout, CS_Status* status);
|
||||
char* CS_GetSinkError(CS_Sink sink, CS_Status* status);
|
||||
void CS_SetSinkEnabled(CS_Sink sink, CS_Bool enabled, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Listener Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_listener_cfunc Listener Functions
|
||||
* @{
|
||||
*/
|
||||
void CS_SetListenerOnStart(void (*onStart)(void* data), void* data);
|
||||
void CS_SetListenerOnExit(void (*onExit)(void* data), void* data);
|
||||
CS_Listener CS_AddListener(
|
||||
@@ -356,30 +389,40 @@ CS_Listener CS_AddListener(
|
||||
int eventMask, int immediateNotify, CS_Status* status);
|
||||
|
||||
void CS_RemoveListener(CS_Listener handle, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
int CS_NotifierDestroyed(void);
|
||||
|
||||
//
|
||||
// Telemetry Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_telemetry_cfunc Telemetry Functions
|
||||
* @{
|
||||
*/
|
||||
void CS_SetTelemetryPeriod(double seconds);
|
||||
double CS_GetTelemetryElapsedTime(void);
|
||||
int64_t CS_GetTelemetryValue(CS_Handle handle, enum CS_TelemetryKind kind,
|
||||
CS_Status* status);
|
||||
double CS_GetTelemetryAverageValue(CS_Handle handle, enum CS_TelemetryKind kind,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Logging Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_logging_cfunc Logging Functions
|
||||
* @{
|
||||
*/
|
||||
typedef void (*CS_LogFunc)(unsigned int level, const char* file,
|
||||
unsigned int line, const char* msg);
|
||||
void CS_SetLogger(CS_LogFunc func, unsigned int min_level);
|
||||
void CS_SetDefaultLogger(unsigned int min_level);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Utility Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_utility_cfunc Utility Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* USB camera infomation
|
||||
*/
|
||||
typedef struct CS_UsbCameraInfo {
|
||||
int dev;
|
||||
char* path;
|
||||
@@ -406,6 +449,9 @@ char* CS_GetHostname();
|
||||
|
||||
char** CS_GetNetworkInterfaces(int* count);
|
||||
void CS_FreeNetworkInterfaces(char** interfaces, int count);
|
||||
/** @} */
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -26,23 +26,31 @@ class Mat;
|
||||
|
||||
namespace cs {
|
||||
|
||||
//
|
||||
// Handle-based interface for C++. Users are encouraged to use the
|
||||
// object oriented interface instead; this interface is intended for use
|
||||
// in applications such as JNI which require handle-based access.
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_cpp_api cscore C++ function API
|
||||
*
|
||||
* Handle-based interface for C++. Users are encouraged to use the
|
||||
* object oriented interface instead; this interface is intended for use
|
||||
* in applications such as JNI which require handle-based access.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/// USB camera information
|
||||
/**
|
||||
* USB camera information
|
||||
*/
|
||||
struct UsbCameraInfo {
|
||||
/// Device number (e.g. N in '/dev/videoN' on Linux)
|
||||
/** Device number (e.g. N in '/dev/videoN' on Linux) */
|
||||
int dev;
|
||||
/// Path to device if available (e.g. '/dev/video0' on Linux)
|
||||
/** Path to device if available (e.g. '/dev/video0' on Linux) */
|
||||
std::string path;
|
||||
/// Vendor/model name of the camera as provided by the USB driver
|
||||
/** Vendor/model name of the camera as provided by the USB driver */
|
||||
std::string name;
|
||||
};
|
||||
|
||||
/// Video mode
|
||||
/**
|
||||
* Video mode
|
||||
*/
|
||||
struct VideoMode : public CS_VideoMode {
|
||||
enum PixelFormat {
|
||||
kUnknown = CS_PIXFMT_UNKNOWN,
|
||||
@@ -67,7 +75,9 @@ struct VideoMode : public CS_VideoMode {
|
||||
explicit operator bool() const { return pixelFormat == kUnknown; }
|
||||
};
|
||||
|
||||
/// Listener event
|
||||
/**
|
||||
* Listener event
|
||||
*/
|
||||
struct RawEvent {
|
||||
enum Kind {
|
||||
kSourceCreated = CS_SOURCE_CREATED,
|
||||
@@ -136,9 +146,10 @@ struct RawEvent {
|
||||
std::string valueStr;
|
||||
};
|
||||
|
||||
//
|
||||
// Property Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_property_func Property Functions
|
||||
* @{
|
||||
*/
|
||||
CS_PropertyKind GetPropertyKind(CS_Property property, CS_Status* status);
|
||||
std::string GetPropertyName(CS_Property property, CS_Status* status);
|
||||
wpi::StringRef GetPropertyName(CS_Property property,
|
||||
@@ -158,10 +169,12 @@ void SetStringProperty(CS_Property property, wpi::StringRef value,
|
||||
CS_Status* status);
|
||||
std::vector<std::string> GetEnumPropertyChoices(CS_Property property,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Source Creation Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_source_create_func Source Creation Functions
|
||||
* @{
|
||||
*/
|
||||
CS_Source CreateUsbCameraDev(wpi::StringRef name, int dev, CS_Status* status);
|
||||
CS_Source CreateUsbCameraPath(wpi::StringRef name, wpi::StringRef path,
|
||||
CS_Status* status);
|
||||
@@ -171,10 +184,12 @@ CS_Source CreateHttpCamera(wpi::StringRef name, wpi::ArrayRef<std::string> urls,
|
||||
CS_HttpCameraKind kind, CS_Status* status);
|
||||
CS_Source CreateCvSource(wpi::StringRef name, const VideoMode& mode,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_source_func Source Functions
|
||||
* @{
|
||||
*/
|
||||
CS_SourceKind GetSourceKind(CS_Source source, CS_Status* status);
|
||||
std::string GetSourceName(CS_Source source, CS_Status* status);
|
||||
wpi::StringRef GetSourceName(CS_Source source, wpi::SmallVectorImpl<char>& buf,
|
||||
@@ -205,10 +220,12 @@ wpi::ArrayRef<CS_Sink> EnumerateSourceSinks(CS_Source source,
|
||||
CS_Status* status);
|
||||
CS_Source CopySource(CS_Source source, CS_Status* status);
|
||||
void ReleaseSource(CS_Source source, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Camera Source Common Property Fuctions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_camera_property_func Camera Source Common Property Fuctions
|
||||
* @{
|
||||
*/
|
||||
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);
|
||||
@@ -218,23 +235,29 @@ void SetCameraWhiteBalanceManual(CS_Source source, int value,
|
||||
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);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// UsbCamera Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_usbcamera_func UsbCamera Source Functions
|
||||
* @{
|
||||
*/
|
||||
std::string GetUsbCameraPath(CS_Source source, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// HttpCamera Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_httpcamera_func HttpCamera Source Functions
|
||||
* @{
|
||||
*/
|
||||
CS_HttpCameraKind GetHttpCameraKind(CS_Source source, CS_Status* status);
|
||||
void SetHttpCameraUrls(CS_Source source, wpi::ArrayRef<std::string> urls,
|
||||
CS_Status* status);
|
||||
std::vector<std::string> GetHttpCameraUrls(CS_Source source, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// OpenCV Source Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_opencv_source_func OpenCV Source Functions
|
||||
* @{
|
||||
*/
|
||||
void PutSourceFrame(CS_Source source, cv::Mat& image, CS_Status* status);
|
||||
void NotifySourceError(CS_Source source, wpi::StringRef msg, CS_Status* status);
|
||||
void SetSourceConnected(CS_Source source, bool connected, CS_Status* status);
|
||||
@@ -247,20 +270,24 @@ CS_Property CreateSourceProperty(CS_Source source, wpi::StringRef name,
|
||||
void SetSourceEnumPropertyChoices(CS_Source source, CS_Property property,
|
||||
wpi::ArrayRef<std::string> choices,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Sink Creation Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_sink_create_func Sink Creation Functions
|
||||
* @{
|
||||
*/
|
||||
CS_Sink CreateMjpegServer(wpi::StringRef name, wpi::StringRef listenAddress,
|
||||
int port, CS_Status* status);
|
||||
CS_Sink CreateCvSink(wpi::StringRef name, CS_Status* status);
|
||||
CS_Sink CreateCvSinkCallback(wpi::StringRef name,
|
||||
std::function<void(uint64_t time)> processFrame,
|
||||
CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Sink Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_sink_func Sink Functions
|
||||
* @{
|
||||
*/
|
||||
CS_SinkKind GetSinkKind(CS_Sink sink, CS_Status* status);
|
||||
std::string GetSinkName(CS_Sink sink, CS_Status* status);
|
||||
wpi::StringRef GetSinkName(CS_Sink sink, wpi::SmallVectorImpl<char>& buf,
|
||||
@@ -278,16 +305,20 @@ CS_Property GetSinkSourceProperty(CS_Sink sink, wpi::StringRef name,
|
||||
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);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// MjpegServer Sink Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_mjpegserver_func MjpegServer Sink Functions
|
||||
* @{
|
||||
*/
|
||||
std::string GetMjpegServerListenAddress(CS_Sink sink, CS_Status* status);
|
||||
int GetMjpegServerPort(CS_Sink sink, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// OpenCV Sink Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_opencv_sink_func OpenCV Sink Functions
|
||||
* @{
|
||||
*/
|
||||
void SetSinkDescription(CS_Sink sink, wpi::StringRef description,
|
||||
CS_Status* status);
|
||||
uint64_t GrabSinkFrame(CS_Sink sink, cv::Mat& image, CS_Status* status);
|
||||
@@ -297,10 +328,12 @@ std::string GetSinkError(CS_Sink sink, CS_Status* status);
|
||||
wpi::StringRef GetSinkError(CS_Sink sink, wpi::SmallVectorImpl<char>& buf,
|
||||
CS_Status* status);
|
||||
void SetSinkEnabled(CS_Sink sink, bool enabled, CS_Status* status);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Listener Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_listener_func Listener Functions
|
||||
* @{
|
||||
*/
|
||||
void SetListenerOnStart(std::function<void()> onStart);
|
||||
void SetListenerOnExit(std::function<void()> onExit);
|
||||
|
||||
@@ -308,31 +341,37 @@ 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);
|
||||
/** @} */
|
||||
|
||||
bool NotifierDestroyed();
|
||||
|
||||
//
|
||||
// Telemetry Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_telemetry_func Telemetry Functions
|
||||
* @{
|
||||
*/
|
||||
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);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Logging Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_logging_func Logging Functions
|
||||
* @{
|
||||
*/
|
||||
typedef std::function<void(unsigned int level, const char* file,
|
||||
unsigned int line, const char* msg)>
|
||||
LogFunc;
|
||||
void SetLogger(LogFunc func, unsigned int min_level);
|
||||
void SetDefaultLogger(unsigned int min_level);
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// Utility Functions
|
||||
//
|
||||
/**
|
||||
* @defgroup cscore_utility_func Utility Functions
|
||||
* @{
|
||||
*/
|
||||
std::vector<UsbCameraInfo> EnumerateUsbCameras(CS_Status* status);
|
||||
|
||||
wpi::ArrayRef<CS_Source> EnumerateSourceHandles(
|
||||
@@ -343,15 +382,24 @@ wpi::ArrayRef<CS_Sink> EnumerateSinkHandles(wpi::SmallVectorImpl<CS_Sink>& vec,
|
||||
std::string GetHostname();
|
||||
|
||||
std::vector<std::string> GetNetworkInterfaces();
|
||||
/** @} */
|
||||
|
||||
/** @} */
|
||||
|
||||
} // namespace cs
|
||||
|
||||
// C functions taking a cv::Mat* for specific interop implementations
|
||||
/**
|
||||
* @defgroup cscore_cpp_opencv_special cscore C functions taking a cv::Mat*
|
||||
*
|
||||
* These are needed for specific interop implementations.
|
||||
* @{
|
||||
*/
|
||||
extern "C" {
|
||||
uint64_t CS_GrabSinkFrameCpp(CS_Sink sink, cv::Mat* image, CS_Status* status);
|
||||
uint64_t CS_GrabSinkFrameTimeoutCpp(CS_Sink sink, cv::Mat* image,
|
||||
double timeout, CS_Status* status);
|
||||
void CS_PutSourceFrameCpp(CS_Source source, cv::Mat* image, CS_Status* status);
|
||||
} // extern "C"
|
||||
/** @} */
|
||||
|
||||
#endif // CSCORE_CSCORE_CPP_H_
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user