wcWebCamClient lib  v0.8.2
wcwebcamclient.h File Reference

Go to the source code of this file.

Macros

#define COMMON_FUNC_ONLY
 

Typedefs

typedef int wcStateVal
 Boolean operation completion codes. More...
 
typedef int wcRCode
 Operation completion codes. More...
 
typedef int wcHandle
 Client handle. More...
 
typedef wcCallbackTask wcTask
 Pointer to task. More...
 
typedef uint32_t wcTaskClass
 Task class. More...
 
typedef enum wcCallback wcCallback
 The list of callbacks. More...
 
typedef enum wcStateId wcStateId
 
typedef enum wcTaskStateId wcTaskStateId
 
typedef void(* EmptyNotifyLibFunc) (wcHandle client)
 Notification callback. More...
 
typedef void(* NotifyEventLibFunc) (wcHandle client, void *data)
 Notification callback with an additional data. More...
 
typedef void(* TaskNotifyLibFunc) (wcHandle client, wcTask tsk)
 Notification callback from the specific task. More...
 
typedef void(* ConnNotifyEventLibFunc) (wcHandle client, int state)
 Notification callback that the connection status has been changed. More...
 
typedef void(* CStringNotifyLibFunc) (wcHandle client, const char *value)
 Notification callback that returned a C-style string. More...
 
typedef void(* DataNotifyEventLibFunc) (wcHandle client, wcTask tsk, void *strm)
 Notification callback that returned a wcCustomStream. More...
 
typedef void(* DataAltNotifyEventLibFunc) (wcHandle client, wcTask tsk, void *data, size_t sz)
 Notification callback that returned a sized data buffer. More...
 
typedef void(* JSONStrNotifyEventLibFunc) (wcHandle client, wcTask tsk, const char *jsonStr)
 Notification callback that task is completed and returns a C-style string with a response in JSON format. More...
 

Enumerations

enum  wcCallback {
  wccbkInitCURL =0 , wccbkSuccessAuth , wccbkConnected , wccbkDisconnect ,
  wccbkSIDSetted , wccbkAddLog , wccbkSynchroUpdateTask , wccbkAfterLaunchInStream ,
  wccbkAfterLaunchOutStream , wccbkSuccessIOStream , wccbkSuccessSaveRecord , wccbkSuccessRequestRecord ,
  wccbkSuccessUpdateRecords , wccbkSuccessUpdateDevices , wccbkSuccessUpdateStreams , wccbkSuccessUpdateMsgs ,
  wccbkSuccessSendMsg , wccbkSuccessRequestRecordMeta , wccbkSuccessGetConfig , wccbkSuccessDeleteRecords ,
  wccbkLast
}
 The list of callbacks. More...
 
enum  wcStateId {
  wcstConnection = 0 , wcstVerifyTLS = 1 , wcstError = 2 , wcstLog = 3 ,
  wcstStreaming = 4 , wcstStreams = 5 , wcstDevices = 6 , wcstRecords = 7 ,
  wcstRecordsStamp = 8 , wcstMsgs = 9 , wcstSendWithSync = 22 , wcstMsgsStamp = 10 ,
  wcstMetaData = 11 , wcstDeviceName = 12 , wcstSID = 13 , wcstHostName = 14 ,
  wcstProxy = 15 , wcstProxyAuth = 16 , wcstProxyProtocol = 17 , wcstProxyHost = 18 ,
  wcstProxyPort = 19 , wcstProxyUser = 20 , wcstProxyPwrd = 21
}
 
enum  wcTaskStateId { wctstError = 0 , wctstPath , wctstSubProto , wctstDeviceName }
 

Functions

void DLLEXPORT wcGetLibVersion (uint8_t *vmajor, uint8_t *vminor, uint16_t *vrev)
 Get the library version. More...
 
wcHandle DLLEXPORT wcClientCreate ()
 Create client. More...
 
wcRCode DLLEXPORT wcClientStart (wcHandle client)
 Launch client. More...
 
wcRCode DLLEXPORT wcClientAuth (wcHandle client, const char *aLogin, const char *aPwrd)
 Authorize client on the server host. More...
 
wcRCode DLLEXPORT wcClientProceed (wcHandle client)
 Call the asynchronous client update stage. More...
 
wcRCode DLLEXPORT wcClientTasksProceed (wcHandle client)
 Call the synchronous client update stage. More...
 
wcRCode DLLEXPORT wcClientDisconnect (wcHandle client)
 Disconnect client from the server host. More...
 
wcRCode DLLEXPORT wcClientDestroy (wcHandle client)
 Destroy client. More...
 
wcRCode DLLEXPORT wcClientInvalidateState (wcHandle client, wcStateId aStateId)
 Reset the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetIntState (wcHandle client, wcStateId aStateId, int *aStateVal)
 Get a integer value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetBoolState (wcHandle client, wcStateId aStateId)
 Get a boolean value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientSetBoolState (wcHandle client, wcStateId aStateId, wcStateVal aStateVal)
 Set the boolean value to the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetStrValue (wcHandle client, wcStateId aStateId, char **aStateVal)
 Get a C-style string value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientGetStrNValue (wcHandle client, wcStateId aStateId, uint32_t sz, char *aStateVal)
 Get a C-style string value for the selected client state. More...
 
wcRCode DLLEXPORT wcClientSetStrValue (wcHandle client, wcStateId aStateId, const char *aStateVal)
 Set a C-style string value to the selected client state. More...
 
wcRCode DLLEXPORT wcSetNotifyCallback (wcHandle client, wcCallback callbackId, NotifyEventLibFunc func)
 Set specified notify callback for client. More...
 
wcRCode DLLEXPORT wcSetTaskCallback (wcHandle client, wcCallback callbackId, TaskNotifyLibFunc func)
 Set specified task notify callback for client. More...
 
wcRCode DLLEXPORT wcSetConnCallback (wcHandle client, ConnNotifyEventLibFunc func)
 Set specified connection notify callback for client. More...
 
wcRCode DLLEXPORT wcSetCStringCallback (wcHandle client, wcCallback callbackId, CStringNotifyLibFunc func)
 Set specified notify callback for client to handling the C-style string values. More...
 
wcRCode DLLEXPORT wcSetAltDataCallback (wcHandle client, wcCallback callbackId, DataAltNotifyEventLibFunc func)
 Set specified notify callback for client to handling the sized data values. More...
 
wcRCode DLLEXPORT wcSetJSONStrCallback (wcHandle client, wcCallback callbackId, JSONStrNotifyEventLibFunc func)
 Set specified notify callback for client to process the JSON-formatted response results represented as a C-style string. More...
 
wcRCode DLLEXPORT wcGetConfig (wcHandle client, void *data)
 Get configuration from the server for authorized client. More...
 
wcRCode DLLEXPORT wcSetConfig (wcHandle client, const char *cfg)
 Send configuration of authorized client to the server. More...
 
wcRCode DLLEXPORT wcDeleteRecords (wcHandle client, const char *indices, void *data)
 Delete specified media records for authorized client. More...
 
wcRCode DLLEXPORT wcSendMsg (wcHandle client, const char *msg, void *data)
 Send message from authorized client. More...
 
wcRCode DLLEXPORT wcRequestRecord (wcHandle client, int rid, void *data)
 Request specified media record from server for authorized client. More...
 
wcRCode DLLEXPORT wcRequestRecordMeta (wcHandle client, int rid, void *data)
 Request metadata of specified media record from server for authorized client. More...
 
wcRCode DLLEXPORT wcSaveRecord (wcHandle client, const void *aBuf, size_t sz, const char *meta, void *data)
 Send a media record to server from authorized client. More...
 
wcRCode DLLEXPORT wcLaunchOutStream (wcHandle client, const char *subProtocol, int delta, void *data)
 Launch output stream for authorized client. More...
 
wcRCode DLLEXPORT wcLaunchInStream (wcHandle client, const char *deviceName, void *data)
 Launch task to consume incoming stream from the specified device for authorized client. More...
 
wcRCode DLLEXPORT wcClientGetFrameID (wcHandle client, long *id)
 Get the ID of the current output frame. More...
 
wcRCode DLLEXPORT wcClientFrameLock (wcHandle client)
 Lock the frame object for threadsafe access to the output data stack. More...
 
wcRCode DLLEXPORT wcClientFrameUnLock (wcHandle client)
 Unlock the frame object. More...
 
wcRCode DLLEXPORT wcClientFramePushData (wcHandle client, const void *data, size_t len)
 Add a new frame to the outgoing data stack to send. More...
 
wcRCode DLLEXPORT wcClientFrameGetData (wcHandle client, void **data, size_t *len)
 Get access to the last frame in the outgoing data stack. More...
 
wcRCode DLLEXPORT wcTaskGetClass (wcTask task, wcTaskClass *id)
 Get the class of the task. More...
 
wcRCode DLLEXPORT wcTaskGetUserData (wcTask task, void **data)
 Get the user data for the task. More...
 
wcRCode DLLEXPORT wcTaskSetUserData (wcTask task, void *data)
 Set the user data for the task. More...
 
wcRCode DLLEXPORT wcTaskLock (wcTask task)
 Lock the task object for threadsafe access. More...
 
wcRCode DLLEXPORT wcTaskUnLock (wcTask task)
 Unlock the task object. More...
 
wcRCode DLLEXPORT wcTaskGetStrValue (wcTask task, wcTaskStateId aStateId, char **aStateVal)
 Get a C-style string value for the selected task state. More...
 
wcRCode DLLEXPORT wcTaskGetStrNValue (wcTask task, wcTaskStateId aStateId, uint32_t sz, char *aStateVal)
 Get a C-style string value for the selected task state. More...
 
wcRCode DLLEXPORT wcInTaskPopFrame (wcTask task, void **data, size_t *len)
 Get access to the first frame in the incoming data stack. More...
 

Variables

const wcRCode WC_TRUE = 1
 
const wcRCode WC_FALSE = 0
 
const wcRCode WC_OK = 0
 
const wcRCode WC_BAD_TARGET = -1
 
const wcRCode WC_BAD_PARAM = -2
 
const wcRCode WC_BAD_VALUE = -3
 
const wcRCode WC_CLIENT_NOT_STREAMING = -4
 
const wcRCode WC_NOT_A_TASK = -5
 
const wcRCode WC_TASK_MISMATCH = -6
 
const wcRCode WC_NOT_ENOUGH_MEM = -7
 
const wcTaskClass WC_BASE_TASK = 0
 The Base task class. More...
 
const wcTaskClass WC_TASK = 1
 The Simple task class (for POST requests) More...
 
const wcTaskClass WC_IN_STREAM_TASK = 2
 The Input-stream task class (for GET requests) More...
 
const wcTaskClass WC_OUT_STREAM_TASK = 4
 The Output-stream task class (for UPLOAD requests) More...
 
const wcTaskClass WC_ALL_TASKS = 0xffffffff
 All tasks classes (mask) More...
 
const uint16_t WC_STREAM_FRAME_HEADER_SIZE = sizeof(uint16_t) + sizeof(uint32_t)
 The size of frame header (6 bytes) More...
 
const uint16_t WC_FRAME_START_SEQ = 0xaaaa
 The frame header sequence. More...
 

Macro Definition Documentation

◆ COMMON_FUNC_ONLY

#define COMMON_FUNC_ONLY

Typedef Documentation

◆ wcHandle

typedef int wcHandle

Client handle.

◆ wcTask

Pointer to task.

◆ wcTaskClass

typedef uint32_t wcTaskClass

Task class.

Variable Documentation

◆ WC_BASE_TASK

const wcTaskClass WC_BASE_TASK = 0

◆ WC_TASK

const wcTaskClass WC_TASK = 1

The Simple task class (for POST requests)

◆ WC_IN_STREAM_TASK

const wcTaskClass WC_IN_STREAM_TASK = 2

The Input-stream task class (for GET requests)

Examples
theora_test/input_strm/main.cpp.

◆ WC_OUT_STREAM_TASK

const wcTaskClass WC_OUT_STREAM_TASK = 4

The Output-stream task class (for UPLOAD requests)

Examples
theora_test/output_strm/main.cpp.

◆ WC_ALL_TASKS

const wcTaskClass WC_ALL_TASKS = 0xffffffff

All tasks classes (mask)

◆ WC_STREAM_FRAME_HEADER_SIZE

const uint16_t WC_STREAM_FRAME_HEADER_SIZE = sizeof(uint16_t) + sizeof(uint32_t)

The size of frame header (6 bytes)

Examples
theora_test/input_strm/main.cpp, and theora_test/output_strm/main.cpp.

◆ WC_FRAME_START_SEQ

const uint16_t WC_FRAME_START_SEQ = 0xaaaa

The frame header sequence.

Examples
theora_test/output_strm/main.cpp.