summaryrefslogtreecommitdiffstats
path: root/plugins/mock/uca-mock-camera.c
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 /plugins/mock/uca-mock-camera.c
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 'plugins/mock/uca-mock-camera.c')
-rw-r--r--plugins/mock/uca-mock-camera.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/mock/uca-mock-camera.c b/plugins/mock/uca-mock-camera.c
index c7561ab..675d5ec 100644
--- a/plugins/mock/uca-mock-camera.c
+++ b/plugins/mock/uca-mock-camera.c
@@ -242,20 +242,18 @@ uca_mock_camera_trigger (UcaCamera *camera, GError **error)
{
}
-static void
-uca_mock_camera_grab (UcaCamera *camera, gpointer *data, GError **error)
+static gboolean
+uca_mock_camera_grab (UcaCamera *camera, gpointer data, GError **error)
{
- g_return_if_fail(UCA_IS_MOCK_CAMERA(camera));
- g_return_if_fail(data != NULL);
+ g_return_val_if_fail (UCA_IS_MOCK_CAMERA(camera), FALSE);
- UcaMockCameraPrivate *priv = UCA_MOCK_CAMERA_GET_PRIVATE(camera);
+ UcaMockCameraPrivate *priv = UCA_MOCK_CAMERA_GET_PRIVATE (camera);
- if (*data == NULL)
- *data = g_malloc0(priv->roi_width * priv->roi_height);
-
- g_memmove(*data, priv->dummy_data, priv->roi_width * priv->roi_height);
- print_current_frame(priv, *data);
+ g_memmove (data, priv->dummy_data, priv->roi_width * priv->roi_height);
+ print_current_frame (priv, data);
priv->current_frame++;
+
+ return TRUE;
}
static void