summaryrefslogtreecommitdiffstats
path: root/test/grab-async.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-02-03 11:09:54 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-02-03 11:09:54 +0100
commitc9c94390c520ad496082222858c0f1285f1432df (patch)
treee0cec60e2e99a7eba3dca63399054f89097f8d9a /test/grab-async.c
parent6461f2e549876cb54456925f47094bb53e2c8672 (diff)
downloaduca-c9c94390c520ad496082222858c0f1285f1432df.tar.gz
uca-c9c94390c520ad496082222858c0f1285f1432df.tar.bz2
uca-c9c94390c520ad496082222858c0f1285f1432df.tar.xz
uca-c9c94390c520ad496082222858c0f1285f1432df.zip
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.
Diffstat (limited to 'test/grab-async.c')
-rw-r--r--test/grab-async.c4
1 files changed, 3 insertions, 1 deletions
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[])