mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
fpi-image-device: Allow overriding of enroll stages
This commit is contained in:
@@ -190,9 +190,7 @@ fp_image_device_constructed (GObject *obj)
|
|||||||
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
|
||||||
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (self);
|
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (self);
|
||||||
|
|
||||||
/* Set default values. */
|
/* Set default threshold. */
|
||||||
fpi_device_set_nr_enroll_stages (FP_DEVICE (self), IMG_ENROLL_STAGES);
|
|
||||||
|
|
||||||
priv->bz3_threshold = BOZORTH3_DEFAULT_THRESHOLD;
|
priv->bz3_threshold = BOZORTH3_DEFAULT_THRESHOLD;
|
||||||
if (cls->bz3_threshold > 0)
|
if (cls->bz3_threshold > 0)
|
||||||
priv->bz3_threshold = cls->bz3_threshold;
|
priv->bz3_threshold = cls->bz3_threshold;
|
||||||
@@ -210,6 +208,9 @@ fp_image_device_class_init (FpImageDeviceClass *klass)
|
|||||||
object_class->get_property = fp_image_device_get_property;
|
object_class->get_property = fp_image_device_get_property;
|
||||||
object_class->constructed = fp_image_device_constructed;
|
object_class->constructed = fp_image_device_constructed;
|
||||||
|
|
||||||
|
/* Set default enroll stage count. */
|
||||||
|
fp_device_class->nr_enroll_stages = IMG_ENROLL_STAGES;
|
||||||
|
|
||||||
fp_device_class->open = fp_image_device_open;
|
fp_device_class->open = fp_image_device_open;
|
||||||
fp_device_class->close = fp_image_device_close;
|
fp_device_class->close = fp_image_device_close;
|
||||||
fp_device_class->enroll = fp_image_device_start_capture_action;
|
fp_device_class->enroll = fp_image_device_start_capture_action;
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ fpi_image_device_minutiae_detected (GObject *source_object, GAsyncResult *res, g
|
|||||||
g_steal_pointer (&print), error);
|
g_steal_pointer (&print), error);
|
||||||
|
|
||||||
/* Start another scan or deactivate. */
|
/* Start another scan or deactivate. */
|
||||||
if (priv->enroll_stage == IMG_ENROLL_STAGES)
|
if (priv->enroll_stage == fp_device_get_nr_enroll_stages (device))
|
||||||
{
|
{
|
||||||
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
fp_image_device_maybe_complete_action (self, g_steal_pointer (&error));
|
||||||
fpi_image_device_deactivate (self, FALSE);
|
fpi_image_device_deactivate (self, FALSE);
|
||||||
|
|||||||
Reference in New Issue
Block a user