wcWebCamClient lib  v0.8.2
Library functions to manage with incoming streams

Functions

wcRCode DLLEXPORT wcInTaskPopFrame (wcTask task, void **data, size_t *len)
 Get access to the first frame in the incoming data stack. More...
 

Detailed Description

Function Documentation

◆ wcInTaskPopFrame()

wcRCode DLLEXPORT wcInTaskPopFrame ( wcTask  task,
void **  data,
size_t *  len 
)

Get access to the first frame in the incoming data stack.

Related to request output.raw. A signal that a new frame has been received is triggered by a task with the wccbkSynchroUpdateTask callback.

Parameters
taskPointer to the task object of WC_IN_STREAM_TASK class.
dataThe pointer to the variable of void * type 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 1

void * data = NULL;
size_t len = 0;
aCode = wcInTaskPopFrame(client, &data, &len);
if (aCode == WC_OK) {
if (data && (len > 0)) {
// work with incoming data and len (draw, save, etc.)
free(data);
}
} else {
cout << "error occurred " << aCode << endl;
}
wcRCode DLLEXPORT wcInTaskPopFrame(wcTask task, void **data, size_t *len)
Get access to the first frame in the incoming data stack.
const wcRCode WC_OK
Definition: wcwebcamclient.h:74

Example 2

// The data can be initialized in advance.
// Then the len variable should contain the size of the
// allocated memory for the data variable.
static const size_t BUFFER_SIZE = 0xffff;
size_t len = BUFFER_SIZE;
void * data = malloc(len);
aCode = wcInTaskPopFrame(client, &data, &len);
if (aCode == WC_OK) {
// now the len variable contains the actual length of the data
if (data && (len > 0)) {
// work with incoming data and len (draw, save, etc.)
}
} else {
cout << "error occurred " << aCode << endl;
}
See also
wcRCode, wccbkSynchroUpdateTask, wcSetTaskCallback, wcClientTasksProceed
Examples
theora_test/input_strm/main.cpp.