From ff7f3216fe76e0a4598bdf737671a5e25a780ded Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 20 Mar 2013 10:03:52 +0100 Subject: uca_camera_grab takes a gpointer and returns bool --- plugins/mock/uca-mock-camera.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'plugins/mock') 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 -- cgit v1.2.3