summaryrefslogtreecommitdiffstats
path: root/src/uca-cam.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-09 11:34:30 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-09 11:34:30 +0100
commitcd7590bac56800586c4aadef077d1effe03b00c4 (patch)
tree38863a4996a42301cb68becb88f137d2c28ccac3 /src/uca-cam.c
parentcc74561cfaff3a4c8719b6972d4ec5c21be535ea (diff)
downloaduca-cd7590bac56800586c4aadef077d1effe03b00c4.tar.gz
uca-cd7590bac56800586c4aadef077d1effe03b00c4.tar.bz2
uca-cd7590bac56800586c4aadef077d1effe03b00c4.tar.xz
uca-cd7590bac56800586c4aadef077d1effe03b00c4.zip
Use correct number of bytes per pixel when allocating buffers
Diffstat (limited to 'src/uca-cam.c')
-rw-r--r--src/uca-cam.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/uca-cam.c b/src/uca-cam.c
index b77d62b..31ad416 100644
--- a/src/uca-cam.c
+++ b/src/uca-cam.c
@@ -6,7 +6,10 @@
uint32_t uca_cam_alloc(struct uca_camera_t *cam, uint32_t n_buffers)
{
- cam->grabber->alloc(cam->grabber, n_buffers);
+ uint32_t bitdepth;
+ cam->get_property(cam, UCA_PROP_BITDEPTH, &bitdepth);
+ const int pixel_size = bitdepth == 8 ? 1 : 2;
+ cam->grabber->alloc(cam->grabber, pixel_size, n_buffers);
}
enum uca_cam_state uca_cam_get_state(struct uca_camera_t *cam)