From c9c94390c520ad496082222858c0f1285f1432df Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 3 Feb 2012 11:09:54 +0100 Subject: Callback function have to notify caller about buffer If they return a UCA_BUFFER_KEEP they have to call uca_cam_release_buffer() in the future. If returning UCA_BUFFER_RELEASE, this is done by the caller. --- test/grab-async.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/grab-async.c') diff --git a/test/grab-async.c b/test/grab-async.c index 43f9e1d..35ae5a4 100644 --- a/test/grab-async.c +++ b/test/grab-async.c @@ -26,7 +26,7 @@ struct image_props { uint32_t bits; }; -void grab_callback(uint64_t image_number, void *buffer, void *meta_data, void *user) +enum uca_buffer_status grab_callback(uint64_t image_number, void *buffer, void *meta_data, void *user) { struct image_props *props = (struct image_props *) user; const int pixel_size = props->bits == 8 ? 1 : 2; @@ -40,6 +40,8 @@ void grab_callback(uint64_t image_number, void *buffer, void *meta_data, void *u printf("grabbed picture %i at %p (%ix%i @ %i bits)\n", (int) image_number, buffer, props->width, props->height, props->bits); + + return UCA_BUFFER_RELEASE; } int main(int argc, char *argv[]) -- cgit v1.2.3