Commit 2d5b3dd7 authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Update more information like number of overruns, lost frames, etc.

parent bb4e8550
......@@ -1318,6 +1318,17 @@ static void wait_buffer(
buf->data = NULL;
}
// Copy information that may have changed.
tao_camera_info* dst = &srv->info;
const tao_camera_info* src = &srv->device->info;
dst->frames = src->frames;
dst->droppedframes = src->droppedframes;
dst->overruns = src->overruns;
dst->lostframes = src->lostframes;
dst->overflows = src->overflows;
dst->lostsyncs = src->lostsyncs;
dst->timeouts = src->timeouts;
// Unlock the camera device.
camera_device_unlock(srv);
}
......@@ -1453,13 +1464,22 @@ static void* run_worker(
tao_shared_array* arr = srv->locked;
bool flag = process_acquisition_buffer(srv, arr, &buf);
prepare_next_output_image(srv, flag);
if (flag) {
remote_camera_lock(srv);
remote_camera_serial(srv) = srv->serial;
remote_camera_notify(srv);
remote_camera_unlock(srv);
}
}
// Update remote camera information.
remote_camera_lock(srv);
remote_camera_serial(srv) = srv->serial;
tao_camera_info* dst = &srv->remote->info;
const tao_camera_info* src = &srv->info;
dst->frames = src->frames;
dst->droppedframes = src->droppedframes;
dst->overruns = src->overruns;
dst->lostframes = src->lostframes;
dst->overflows = src->overflows;
dst->lostsyncs = src->lostsyncs;
dst->timeouts = src->timeouts;
remote_camera_notify(srv);
remote_camera_unlock(srv);
}
} // end of main loop
......@@ -1773,6 +1793,7 @@ tao_camera_server* tao_camera_server_create(
srv->cond = TAO_COND_INITIALIZER;
srv->remote = remote;
srv->device = device;
srv->info = device->info;
srv->logfile = stdout;
srv->loglevel = 0;
srv->fancy = true;
......
......@@ -90,6 +90,7 @@ struct tao_camera_server_ {
tao_cond cond;///> Condition variable to notify changes.
tao_remote_camera* remote;///> Remote camera to communicate with clients.
tao_camera* device;///> Unified camera device.
tao_camera_info info;///> Copy of camera device configuration.
FILE* logfile;///> File to print log messages.
tao_message_level loglevel;///> Level of details for log messages.
bool fancy;///> Use ANSI escape codes.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment