4 #ifndef WCWEBCAMCLIENT_H
5 #define WCWEBCAMCLIENT_H
7 #define COMMON_FUNC_ONLY
8 #ifdef COMMON_FUNC_ONLY
11 #include "wcCallbacks.h"
14 #if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
18 #ifdef _ANDROID_COMPILER_
24 #define DLLEXPORT __declspec(dllexport)
25 #elif defined(__GNUC__)
28 #define DLLEXPORT __attribute__ ((dllexport))
30 #define DLLEXPORT __attribute__ ((visibility ("default")))
39 #define DLLEXPORT __declspec(dllimport)
40 #elif defined(__GNUC__)
129 __pragma( pack(push, 1) )
164 __attribute__((__packed__))
199 __attribute__((__packed__))
210 __attribute__((__packed__))
267 #ifndef COMMON_FUNC_ONLY
273 typedef void (*cJSONNotifyEventLibFunc) (
wcHandle client,
wcTask tsk,
const cJSON * jsonObj);;
278 typedef void (*StringNotifyLibFunc) (
wcHandle client,
const std::string& value);
284 typedef void (*JSONNotifyEventLibFunc) (
wcHandle client,
wcTask tsk, wcJSON& jsonObj);
610 #ifndef COMMON_FUNC_ONLY
628 #ifndef COMMON_FUNC_ONLY
652 #ifndef COMMON_FUNC_ONLY
710 #ifndef COMMON_FUNC_ONLY
721 wcRCode DLLEXPORT wcSendMsg_cJson(
wcHandle client, cJSON * msg,
void * data);
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 for...
Definition: wcwebcamclient.h:265
wcRCode DLLEXPORT wcSetTaskCallback(wcHandle client, wcCallback callbackId, TaskNotifyLibFunc func)
Set specified task notify callback for client.
void(* NotifyEventLibFunc)(wcHandle client, void *data)
Notification callback with an additional data.
Definition: wcwebcamclient.h:231
wcRCode DLLEXPORT wcSetNotifyCallback(wcHandle client, wcCallback callbackId, NotifyEventLibFunc func)
Set specified notify callback for client.
void(* DataNotifyEventLibFunc)(wcHandle client, wcTask tsk, void *strm)
Notification callback that returned a wcCustomStream.
Definition: wcwebcamclient.h:252
wcRCode DLLEXPORT wcSetCStringCallback(wcHandle client, wcCallback callbackId, CStringNotifyLibFunc func)
Set specified notify callback for client to handling the C-style string values.
void(* CStringNotifyLibFunc)(wcHandle client, const char *value)
Notification callback that returned a C-style string.
Definition: wcwebcamclient.h:246
wcCallback
The list of callbacks.
Definition: wcwebcamclient.h:133
void(* TaskNotifyLibFunc)(wcHandle client, wcTask tsk)
Notification callback from the specific task.
Definition: wcwebcamclient.h:236
void(* EmptyNotifyLibFunc)(wcHandle client)
Notification callback.
Definition: wcwebcamclient.h:226
wcRCode DLLEXPORT wcSetAltDataCallback(wcHandle client, wcCallback callbackId, DataAltNotifyEventLibFunc func)
Set specified notify callback for client to handling the sized data values.
void(* DataAltNotifyEventLibFunc)(wcHandle client, wcTask tsk, void *data, size_t sz)
Notification callback that returned a sized data buffer.
Definition: wcwebcamclient.h:259
void(* ConnNotifyEventLibFunc)(wcHandle client, int state)
Notification callback that the connection status has been changed.
Definition: wcwebcamclient.h:241
wcRCode DLLEXPORT wcSetJSONStrCallback(wcHandle client, wcCallback callbackId, JSONStrNotifyEventLibFunc func)
Set specified notify callback for client to process the JSON-formatted response results represented a...
wcRCode DLLEXPORT wcSetConnCallback(wcHandle client, ConnNotifyEventLibFunc func)
Set specified connection notify callback for client.
@ wccbkAddLog
Added new log entry.
Definition: wcwebcamclient.h:140
@ wccbkSuccessDeleteRecords
The request to delete records has been completed.
Definition: wcwebcamclient.h:160
@ wccbkSuccessSendMsg
The request to send message has been completed.
Definition: wcwebcamclient.h:157
@ wccbkSynchroUpdateTask
The IO streaming task signals that a change has occurred.
Definition: wcwebcamclient.h:141
@ wccbkAfterLaunchInStream
Incoming stream started.
Definition: wcwebcamclient.h:144
@ wccbkSuccessUpdateMsgs
The request to update list of messages has been completed.
Definition: wcwebcamclient.h:156
@ wccbkSuccessRequestRecord
The request to get the media record has been completed.
Definition: wcwebcamclient.h:150
@ wccbkSuccessRequestRecordMeta
The request to get metadata for the media record has been completed.
Definition: wcwebcamclient.h:158
@ wccbkLast
Definition: wcwebcamclient.h:162
@ wccbkSuccessSaveRecord
The request to save the media record has been completed.
Definition: wcwebcamclient.h:149
@ wccbkInitCURL
Successful initialization of the multiCURL handle.
Definition: wcwebcamclient.h:135
@ wccbkConnected
The connection state has been changed.
Definition: wcwebcamclient.h:137
@ wccbkSuccessAuth
Successful authorization.
Definition: wcwebcamclient.h:136
@ wccbkAfterLaunchOutStream
Outgoing stream started.
Definition: wcwebcamclient.h:145
@ wccbkSuccessUpdateDevices
The request to update list of online devices has been completed.
Definition: wcwebcamclient.h:154
@ wccbkSuccessIOStream
IO stream terminated for some reason.
Definition: wcwebcamclient.h:146
@ wccbkSuccessUpdateRecords
The request to update list of records has been completed.
Definition: wcwebcamclient.h:153
@ wccbkDisconnect
Client has been disconnected.
Definition: wcwebcamclient.h:138
@ wccbkSuccessUpdateStreams
The request to update list of streaming devices has been completed.
Definition: wcwebcamclient.h:155
@ wccbkSIDSetted
The session id has been changed.
Definition: wcwebcamclient.h:139
@ wccbkSuccessGetConfig
The request to get actual config has been completed.
Definition: wcwebcamclient.h:159
wcRCode DLLEXPORT wcClientGetStrValue(wcHandle client, wcStateId aStateId, char **aStateVal)
Get a C-style string value for the selected client state.
wcRCode DLLEXPORT wcClientInvalidateState(wcHandle client, wcStateId aStateId)
Reset the selected client state.
wcRCode DLLEXPORT wcClientSetStrValue(wcHandle client, wcStateId aStateId, const char *aStateVal)
Set a C-style string value to the selected client state.
wcRCode DLLEXPORT wcClientGetIntState(wcHandle client, wcStateId aStateId, int *aStateVal)
Get a integer value for the selected client state.
wcRCode DLLEXPORT wcClientSetBoolState(wcHandle client, wcStateId aStateId, wcStateVal aStateVal)
Set the boolean value to the selected client state.
wcRCode DLLEXPORT wcClientGetStrNValue(wcHandle client, wcStateId aStateId, uint32_t sz, char *aStateVal)
Get a C-style string value for the selected client state.
wcRCode DLLEXPORT wcClientGetBoolState(wcHandle client, wcStateId aStateId)
Get a boolean value for the selected client state.
wcStateId
Definition: wcwebcamclient.h:173
wcTaskStateId
Definition: wcwebcamclient.h:203
@ wcstDevices
Definition: wcwebcamclient.h:180
@ wcstProxyPwrd
Definition: wcwebcamclient.h:196
@ wcstProxyHost
Definition: wcwebcamclient.h:193
@ wcstStreams
Definition: wcwebcamclient.h:179
@ wcstProxyUser
Definition: wcwebcamclient.h:195
@ wcstError
Definition: wcwebcamclient.h:176
@ wcstDeviceName
Definition: wcwebcamclient.h:187
@ wcstProxyAuth
Definition: wcwebcamclient.h:191
@ wcstMsgsStamp
Definition: wcwebcamclient.h:185
@ wcstStreaming
Definition: wcwebcamclient.h:178
@ wcstConnection
Definition: wcwebcamclient.h:174
@ wcstSID
Definition: wcwebcamclient.h:188
@ wcstProxyPort
Definition: wcwebcamclient.h:194
@ wcstProxy
Definition: wcwebcamclient.h:190
@ wcstSendWithSync
since v0.8
Definition: wcwebcamclient.h:184
@ wcstMsgs
Definition: wcwebcamclient.h:183
@ wcstMetaData
Definition: wcwebcamclient.h:186
@ wcstHostName
Definition: wcwebcamclient.h:189
@ wcstVerifyTLS
Definition: wcwebcamclient.h:175
@ wcstRecords
Definition: wcwebcamclient.h:181
@ wcstProxyProtocol
Definition: wcwebcamclient.h:192
@ wcstRecordsStamp
Definition: wcwebcamclient.h:182
@ wcstLog
Definition: wcwebcamclient.h:177
@ wctstPath
Definition: wcwebcamclient.h:205
@ wctstDeviceName
Definition: wcwebcamclient.h:207
@ wctstSubProto
Definition: wcwebcamclient.h:206
@ wctstError
Definition: wcwebcamclient.h:204
wcHandle DLLEXPORT wcClientCreate()
Create client.
wcRCode DLLEXPORT wcClientTasksProceed(wcHandle client)
Call the synchronous client update stage.
wcRCode DLLEXPORT wcClientDisconnect(wcHandle client)
Disconnect client from the server host.
wcRCode DLLEXPORT wcClientProceed(wcHandle client)
Call the asynchronous client update stage.
wcRCode DLLEXPORT wcClientAuth(wcHandle client, const char *aLogin, const char *aPwrd)
Authorize client on the server host.
wcRCode DLLEXPORT wcClientDestroy(wcHandle client)
Destroy client.
wcRCode DLLEXPORT wcClientStart(wcHandle client)
Launch client.
wcRCode DLLEXPORT wcLaunchOutStream(wcHandle client, const char *subProtocol, int delta, void *data)
Launch output stream for authorized client.
wcRCode DLLEXPORT wcRequestRecord(wcHandle client, int rid, void *data)
Request specified media record from server for authorized client.
wcRCode DLLEXPORT wcLaunchInStream(wcHandle client, const char *deviceName, void *data)
Launch task to consume incoming stream from the specified device for authorized client.
wcRCode DLLEXPORT wcSendMsg(wcHandle client, const char *msg, void *data)
Send message from authorized client.
wcRCode DLLEXPORT wcDeleteRecords(wcHandle client, const char *indices, void *data)
Delete specified media records for authorized client.
wcRCode DLLEXPORT wcRequestRecordMeta(wcHandle client, int rid, void *data)
Request metadata of specified media record from server for authorized client.
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.
wcRCode DLLEXPORT wcSetConfig(wcHandle client, const char *cfg)
Send configuration of authorized client to the server.
wcRCode DLLEXPORT wcGetConfig(wcHandle client, void *data)
Get configuration from the server for authorized client.
void DLLEXPORT wcGetLibVersion(uint8_t *vmajor, uint8_t *vminor, uint16_t *vrev)
Get the library version.
wcRCode DLLEXPORT wcClientFrameLock(wcHandle client)
Lock the frame object for threadsafe access to the output data stack.
wcRCode DLLEXPORT wcClientFrameGetData(wcHandle client, void **data, size_t *len)
Get access to the last frame in the outgoing data stack.
wcRCode DLLEXPORT wcClientFramePushData(wcHandle client, const void *data, size_t len)
Add a new frame to the outgoing data stack to send.
wcRCode DLLEXPORT wcClientFrameUnLock(wcHandle client)
Unlock the frame object.
wcRCode DLLEXPORT wcClientGetFrameID(wcHandle client, long *id)
Get the ID of the current output frame.
wcRCode DLLEXPORT wcInTaskPopFrame(wcTask task, void **data, size_t *len)
Get access to the first frame in the incoming data stack.
const wcRCode WC_NOT_A_TASK
Definition: wcwebcamclient.h:89
int wcStateVal
Boolean operation completion codes.
Definition: wcwebcamclient.h:59
const wcRCode WC_BAD_PARAM
Definition: wcwebcamclient.h:80
const wcRCode WC_BAD_VALUE
Definition: wcwebcamclient.h:83
const wcRCode WC_OK
Definition: wcwebcamclient.h:74
int wcRCode
Operation completion codes.
Definition: wcwebcamclient.h:65
const wcRCode WC_FALSE
Definition: wcwebcamclient.h:71
const wcRCode WC_NOT_ENOUGH_MEM
Definition: wcwebcamclient.h:95
const wcRCode WC_BAD_TARGET
Definition: wcwebcamclient.h:77
const wcRCode WC_TASK_MISMATCH
Definition: wcwebcamclient.h:92
const wcRCode WC_CLIENT_NOT_STREAMING
Definition: wcwebcamclient.h:86
const wcRCode WC_TRUE
Definition: wcwebcamclient.h:68
wcRCode DLLEXPORT wcTaskGetClass(wcTask task, wcTaskClass *id)
Get the class of the task.
wcRCode DLLEXPORT wcTaskLock(wcTask task)
Lock the task object for threadsafe access.
wcRCode DLLEXPORT wcTaskSetUserData(wcTask task, void *data)
Set the user data for the task.
wcRCode DLLEXPORT wcTaskGetStrValue(wcTask task, wcTaskStateId aStateId, char **aStateVal)
Get a C-style string value for the selected task state.
wcRCode DLLEXPORT wcTaskUnLock(wcTask task)
Unlock the task object.
wcRCode DLLEXPORT wcTaskGetStrNValue(wcTask task, wcTaskStateId aStateId, uint32_t sz, char *aStateVal)
Get a C-style string value for the selected task state.
wcRCode DLLEXPORT wcTaskGetUserData(wcTask task, void **data)
Get the user data for the task.
void * wcCallbackTask
Definition: wcCommonCallbacks.h:8
const wcTaskClass WC_OUT_STREAM_TASK
The Output-stream task class (for UPLOAD requests)
Definition: wcwebcamclient.h:114
const wcTaskClass WC_BASE_TASK
The Base task class.
Definition: wcwebcamclient.h:108
const wcTaskClass WC_ALL_TASKS
All tasks classes (mask)
Definition: wcwebcamclient.h:116
const wcTaskClass WC_IN_STREAM_TASK
The Input-stream task class (for GET requests)
Definition: wcwebcamclient.h:112
int wcHandle
Client handle.
Definition: wcwebcamclient.h:99
wcCallbackTask wcTask
Pointer to task.
Definition: wcwebcamclient.h:102
const uint16_t WC_STREAM_FRAME_HEADER_SIZE
The size of frame header (6 bytes)
Definition: wcwebcamclient.h:119
const uint16_t WC_FRAME_START_SEQ
The frame header sequence.
Definition: wcwebcamclient.h:121
const wcTaskClass WC_TASK
The Simple task class (for POST requests)
Definition: wcwebcamclient.h:110
uint32_t wcTaskClass
Task class.
Definition: wcwebcamclient.h:105