I’m trying to use ArvStream. Initially I simply looped on arv_camera_acquisition to grab images and was getting about 10 frames (2048x1536 mono) per sec. So next I’m trying to use AvrStream to supply 50 buffers. But I’m trying to avoid using signals and callbacks for now.
In my thread, I simply loop on
buffer = arv_stream_timeout_pop_buffer ( self.arvStream, 100000);
// check and grab the image
arv_stream_push_buffer ( self.arvStream, buffer);
So I set things up
self.arvStream = arv_camera_create_stream (self.arvCamera, NULL, NULL, &error);
ERROR_CHECK ("arv_camera_create_stream", error)
bufferSize = arv_camera_get_payload (self.arvCamera, &error);
ERROR_CHECK ("arv_camera_get_payload", error)
for (int i = 0; i < 50; i++) {
arv_stream_push_buffer (self.arvStream, arv_buffer_new (bufferSize, &error));
ERROR_CHECK ("arv_stream_push_buffer", error)
}
grabberThread = [[NSThread alloc] initWithTarget :self
selector :@selector(grabThreadStream)
object :nil];
grabberThread.name = @"GigE Grabber";
[grabberThread setThreadPriority:1.0];
[grabberThread start];
arv_camera_start_acquisition (self.arvCamera, &error);
ERROR_CHECK ("arv_camera_start_acquisition", error)
No Error returned but almost instantly it craches on line 328 of _process_data_block
memcpy ((( **char** *) frame->buffer->priv->data) + block_offset, arv_gvsp_packet_get_data (packet), block_size);
with the mention
arv_gv_stream (29): EXC_BAD_ACCESS
Strange thing: the first few times I tried this code, it work for about 500 to 1000 frames and then simply stopped. Restarted the camera , rebooted my MacBook… never works. I’ve got a console log with ARV_DEBUG-all:3. and my actual obj-c code at the beginning if interested…
Thanks for any clues…