diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2013-03-20 10:03:52 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2013-03-20 10:03:52 +0100 |
commit | ff7f3216fe76e0a4598bdf737671a5e25a780ded (patch) | |
tree | 611970247e33c4af6b1a2a6345bb39b3cb05295e /plugins/pf/uca-pf-camera.c | |
parent | 71acacfd31e36fcb314d0d75306d26f9518e1d6a (diff) | |
download | libuca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.tar.gz libuca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.tar.bz2 libuca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.tar.xz libuca-ff7f3216fe76e0a4598bdf737671a5e25a780ded.zip |
uca_camera_grab takes a gpointer and returns bool
Diffstat (limited to 'plugins/pf/uca-pf-camera.c')
-rw-r--r-- | plugins/pf/uca-pf-camera.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/pf/uca-pf-camera.c b/plugins/pf/uca-pf-camera.c index 085fde5..b7967be 100644 --- a/plugins/pf/uca-pf-camera.c +++ b/plugins/pf/uca-pf-camera.c @@ -184,25 +184,27 @@ uca_pf_camera_start_readout(UcaCamera *camera, GError **error) "This photon focus camera does not support recording to internal memory"); } -static void -uca_pf_camera_grab(UcaCamera *camera, gpointer *data, GError **error) +static gboolean +uca_pf_camera_grab(UcaCamera *camera, gpointer data, GError **error) { - g_return_if_fail(UCA_IS_PF_CAMERA(camera)); + g_return_val_if_fail (UCA_IS_PF_CAMERA (camera), FALSE); UcaPfCameraPrivate *priv = UCA_PF_CAMERA_GET_PRIVATE(camera); - priv->last_frame = Fg_getLastPicNumberBlockingEx(priv->fg, priv->last_frame+1, priv->fg_port, 5, priv->fg_mem); + priv->last_frame = Fg_getLastPicNumberBlockingEx (priv->fg, priv->last_frame+1, + priv->fg_port, 5, priv->fg_mem); if (priv->last_frame <= 0) { - guint err = FG_OK + 1; - FG_SET_ERROR(err, priv->fg, UCA_PF_CAMERA_ERROR_FG_GENERAL); + g_set_error (error, UCA_PF_CAMERA_ERROR, + UCA_PF_CAMERA_ERROR_FG_ACQUISITION, + "%s", Fg_getLastErrorDescription(priv->fg)); + return FALSE; } - guint16 *frame = Fg_getImagePtrEx(priv->fg, priv->last_frame, priv->fg_port, priv->fg_mem); - - if (*data == NULL) - *data = g_malloc0(priv->roi_width * priv->roi_height); + guint16 *frame = Fg_getImagePtrEx (priv->fg, priv->last_frame, + priv->fg_port, priv->fg_mem); - memcpy((gchar *) *data, (gchar *) frame, priv->roi_width * priv->roi_height); + memcpy((gchar *) data, (gchar *) frame, priv->roi_width * priv->roi_height); + return TRUE; } static void |