Hi,
Le dim. 1 avril 2018 à 13:39, Arkadiusz Raj <arek.raj@xxxxxxxxx> a
écrit :
I started to think that while constructing circular buffer, I can preallocate memory for OpenCV Mat objects, and pass this to Aravis using
auto payload = arv_camera_get_payload (camera);
for(auto& p : fb) {
// allocate Mat structure (without diamensions)
p.image() = Mat::zeros(Size(1,payload), CV_8UC1);
// register buffer in Aravis
arv_stream_push_buffer(stream, arv_buffer_new(payload, p.image().data));
}
Where p.image() is a Mat.
Now my question is: will this work?
I.e. how Aravis handles buffers? Can I assume they will be used in circular manner?
Those questions are about Glib async queues indeed.
When waiting for next frames, following code is executed:
for(; tries < max_tries; tries ++) {
arv_buffer = arv_stream_timeout_pop_buffer (stream, 200000);
if (arv_buffer != NULL && arv_buffer_get_status (arv_buffer) != ARV_BUFFER_STATUS_SUCCESS) {
arv_stream_push_buffer (stream, arv_buffer);
} else break;
}