diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-02-03 11:09:54 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-02-03 11:09:54 +0100 |
commit | c9c94390c520ad496082222858c0f1285f1432df (patch) | |
tree | e0cec60e2e99a7eba3dca63399054f89097f8d9a /test | |
parent | 6461f2e549876cb54456925f47094bb53e2c8672 (diff) | |
download | uca-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')
-rw-r--r-- | test/grab-async.c | 4 |
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[]) |