wcWebCamClient lib  v0.8.2
Library functions to manage with output stream frames

Functions

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...
 

Detailed Description

Function Documentation

◆ wcClientGetFrameID()

wcRCode DLLEXPORT wcClientGetFrameID ( wcHandle  client,
long *  id 
)

Get the ID of the current output frame.

Related to request input.raw.

Parameters
clientThe client handle.
idPointer to the long type variable.
Returns
wcRCode WC_OK or error code.
See also
wcRCode

◆ wcClientFrameLock()

wcRCode DLLEXPORT wcClientFrameLock ( wcHandle  client)

Lock the frame object for threadsafe access to the output data stack.

Related to request input.raw.

Parameters
clientThe client handle.
Returns
wcRCode WC_OK or error code.
See also
wcRCode, wcClientFrameUnLock
Examples
theora_test/output_strm/main.cpp.

◆ wcClientFrameUnLock()

wcRCode DLLEXPORT wcClientFrameUnLock ( wcHandle  client)

Unlock the frame object.

Related to request input.raw.

Parameters
clientThe client handle.
Returns
wcRCode WC_OK or error code.
See also
wcRCode, wcClientFrameLock
Examples
theora_test/output_strm/main.cpp.

◆ wcClientFramePushData()

wcRCode DLLEXPORT wcClientFramePushData ( wcHandle  client,
const void *  data,
size_t  len 
)

Add a new frame to the outgoing data stack to send.

Related to request input.raw. The sent frames counter is automatically incremented by one. It is strongly recommended to lock the frame object using the wcClientFrameLock / wcClientFrameUnLock procedures when accessing the outgoing data stack. To add a new frame after sending the previous one, use the wccbkSynchroUpdateTask callback.

Parameters
clientThe client handle.
Returns
wcRCode WC_OK or error code.
See also
wcRCode, wccbkSynchroUpdateTask, wcSetTaskCallback, wcClientTasksProceed
Examples
theora_test/output_strm/main.cpp.

◆ wcClientFrameGetData()

wcRCode DLLEXPORT wcClientFrameGetData ( wcHandle  client,
void **  data,
size_t *  len 
)

Get access to the last frame in the outgoing data stack.

Related to request input.raw. It is strongly recommended to lock the frame object using the wcClientFrameLock / wcClientFrameUnLock procedures when accessing the outgoing data stack.

Parameters
clientThe client handle.
dataThe pointer to the variable of void * type initialized with NULL value to return frame data.
lenThe pointer to the variable of size_t type to return frame size.
Returns
wcRCode WC_OK or error code.

Example

void * data = NULL;
size_t len = 0;
wcRCode aCode = wcClientFrameLock(client);
if (aCode == WC_OK) {
aCode = wcClientFrameGetData(client, &data, &len);
if (aCode == WC_OK) {
// work with data and len
// do not free this data! it will be deleted automatically by library
} else {
cout << "error occurred " << aCode << endl;
}
aCode = wcClientFrameUnLock(client);
}
if (aCode != WC_OK)
{
cout << "error occurred " << aCode << endl;
}
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 wcClientFrameUnLock(wcHandle client)
Unlock the frame object.
const wcRCode WC_OK
Definition: wcwebcamclient.h:74
int wcRCode
Operation completion codes.
Definition: wcwebcamclient.h:65
See also
wcRCode