Hello, there.
I am wondering what is the correct way to handle a buffer that you have returned using arv_stream_timeout_pop_buffer() or arv_stream_try_pop_buffer() but that is not of status ARV_BUFFER_STATUS_SUCCESS?
I understand that when the buffer is ARV_BUFFER_STATUS_SUCCESS you are to call arv_stream_push_buffer() to give back control of that buffer to the stream.
My question is, when the status is anything else, for example ARV_BUFFER_STATUS_TIMEOUT what is the correct way to handle that case?
Thank you.
Hi Ron,
Every buffer should be returned to aravis using arv_stream_push_buffer()
. A buffer status different from SUCCESS
indicates the images data are not valid and should not be used (for computation, or whatever you want to do with the incoming images).
Cheers,
Emmanuel.
Ah, OK, that makes sense now.
Thank you very much!
it works very good for me
thanks dear Emmanuel for his support lead me to develop this code
my genicam output is bayer and i use opencv
while(1){
ArvBuffer arv_buffer;
size_t buffer_size;
void framebuffer;
arv_buffer = arv_stream_try_pop_buffer (stream);
if (arv_buffer == NULL)
continue;
framebuffer = (void*)arv_buffer_get_data(arv_buffer, &buffer_size);
int height=arv_buffer_get_image_height(arv_buffer);
int width=arv_buffer_get_image_width(arv_buffer);
cv::Mat tempframe(height,width,CV_8UC1,framebuffer);
tempframe.copyTo(bayerFrame);
arv_stream_push_buffer (stream, arv_buffer);
cv::cvtColor(bayerFrame,rgbFrame,CV_BayerGB2RGB,0);
cv::imshow(rgbFrame);
cv::waitKey(10);
}
cv::imshow(“video”,rgbFrame);