summaryrefslogtreecommitdiffstats
path: root/docs/manual.md
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-03-20 10:03:52 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-03-20 10:03:52 +0100
commitff7f3216fe76e0a4598bdf737671a5e25a780ded (patch)
tree611970247e33c4af6b1a2a6345bb39b3cb05295e /docs/manual.md
parent71acacfd31e36fcb314d0d75306d26f9518e1d6a (diff)
downloaduca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.tar.gz
uca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.tar.bz2
uca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.tar.xz
uca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.zip
uca_camera_grab takes a gpointer and returns bool
Diffstat (limited to 'docs/manual.md')
-rw-r--r--docs/manual.md18
1 files changed, 7 insertions, 11 deletions
diff --git a/docs/manual.md b/docs/manual.md
index 0dd9c66..0b81bdb 100644
--- a/docs/manual.md
+++ b/docs/manual.md
@@ -185,22 +185,18 @@ To synchronously grab frames, first start the camera:
g_assert_no_error (error);
~~~
-Now you have two options with regard to memory buffers. If you already have a
-suitable sized buffer, just pass it to `uca_camera_grab`. Otherwise pass a
-pointer pointing to `NULL` (this is different from a `NULL` pointer!). In this
-case memory will be allocated for you:
+Now, you have to allocate a suitably sized buffer and pass it to
+`uca_camera_grab`.
~~~ {.c}
- gpointer buffer_1 = NULL; /* A pointer pointing to NULL */
- gpointer buffer_2 = g_malloc0 (640 * 480 * 2);
+ gpointer buffer = g_malloc0 (640 * 480 * 2);
- /* Memory will be allocated. Remember to free it! */
- uca_camera_grab (camera, &buffer_1, &error);
-
- /* Memory buffer will be used */
- uca_camera_grab (camera, &buffer_2, &error);
+ uca_camera_grab (camera, buffer, &error);
~~~
+You have to make sure that the buffer is large enough by querying the size of
+the region of interest and the number of bits that are transferred.
+
### Getting and setting camera parameters