49
// This loop iterates while the generation
50
while ((run_flag)&&((ctx->run_streamer)||(ctx->reported_id != ctx->event_id))) {
49
if (ctx->parse_data) {
50
// This loop iterates while the generation
51
while ((run_flag)&&((ctx->run_streamer)||(ctx->reported_id != ctx->event_id))) {
51
52
#ifdef IPECAMERA_ANNOUNCE_READY
52
while (((!ctx->preproc)&&(ctx->reported_id != ctx->event_id))||((ctx->preproc)&&(ctx->reported_id != ctx->preproc_id))) {
53
while (((!ctx->preproc)&&(ctx->reported_id != ctx->event_id))||((ctx->preproc)&&(ctx->reported_id != ctx->preproc_id))) {
53
54
#else /* IPECAMERA_ANNOUNCE_READY */
54
while (ctx->reported_id != ctx->event_id) {
55
while (ctx->reported_id != ctx->event_id) {
55
56
#endif /* IPECAMERA_ANNOUNCE_READY */
56
if ((ctx->event_id - ctx->reported_id) > (ctx->buffer_size - IPECAMERA_RESERVE_BUFFERS)) ctx->reported_id = ctx->event_id - (ctx->buffer_size - 1) - IPECAMERA_RESERVE_BUFFERS;
57
else ++ctx->reported_id;
59
memcpy(&info, ctx->frame + ((ctx->reported_id-1)%ctx->buffer_size), sizeof(ipecamera_event_info_t));
61
if ((ctx->event_id - ctx->reported_id) < ctx->buffer_size) {
62
res = callback(ctx->reported_id, (pcilib_event_info_t*)&info, user);
64
if (res < 0) err = -res;
57
if ((ctx->event_id - ctx->reported_id) > (ctx->buffer_size - IPECAMERA_RESERVE_BUFFERS)) ctx->reported_id = ctx->event_id - (ctx->buffer_size - 1) - IPECAMERA_RESERVE_BUFFERS;
58
else ++ctx->reported_id;
60
memcpy(&info, ctx->frame + ((ctx->reported_id-1)%ctx->buffer_size), sizeof(ipecamera_event_info_t));
62
if ((ctx->event_id - ctx->reported_id) < ctx->buffer_size) {
63
res = callback(ctx->reported_id, (pcilib_event_info_t*)&info, user);
65
if (res < 0) err = -res;
70
usleep(IPECAMERA_NOFRAME_SLEEP);
71
usleep(IPECAMERA_NOFRAME_SLEEP);
74
while ((run_flag)&&(ctx->run_streamer)) {
75
usleep(IPECAMERA_NOFRAME_SLEEP);
73
79
ctx->streaming = 0;
93
99
pcilib_error("IPECamera is not in grabbing mode");
94
100
return PCILIB_ERROR_INVALID_REQUEST;
103
if (!ctx->parse_data) {
104
pcilib_error("RAWData only mode is requested");
105
return PCILIB_ERROR_INVALID_REQUEST;
97
108
#ifdef IPECAMERA_ANNOUNCE_READY
98
109
if (((!ctx->preproc)&&(ctx->reported_id == ctx->event_id))||((ctx->preproc)&&(ctx->reported_id == ctx->preproc_id))) {