Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1078dbe
Configure VSCode
mpi3d Jun 24, 2022
303e4ee
Add GitHub FUNDING.yml
mpi3d Aug 24, 2022
601d880
feat: add basics of sigfm impl
0x00002a Nov 4, 2022
14b2363
chore: ready to test
0x00002a Nov 4, 2022
9a78356
feat: sigfm piped up
0x00002a Nov 4, 2022
c4341d1
fix: enroll forcing nbis
0x00002a Nov 4, 2022
5dac770
fix: new/free mismatch
0x00002a Nov 4, 2022
cdd9134
fix: free and new/free mismatch
0x00002a Nov 4, 2022
7196069
feat: identitfy using sfm
0x00002a Nov 4, 2022
c67f25a
fix: memory leak
0x00002a Nov 4, 2022
77ac929
chore: add/update license headers
0x00002a Nov 5, 2022
b869001
!fix: using filestore hack
0x00002a Nov 5, 2022
6b82f2c
fix: not reading mats correctly
0x00002a Nov 5, 2022
c44d088
feat: improve error reporting for sigfm
0x00002a Nov 5, 2022
e287472
chore: add doctest wrap file
0x00002a Nov 5, 2022
72812d6
chore: cleanup and remove warnings
0x00002a Nov 6, 2022
6153161
chore: remove debug print
0x00002a Nov 6, 2022
f7969d3
chore: improve docs on sigfm and cleanup
0x00002a Nov 6, 2022
3c87b93
chore: sfm -> sigfm
0x00002a Nov 6, 2022
d2fb2a8
fix: meson wrap for doctest unused
0x00002a Nov 7, 2022
2155108
Sfm -> Sigfm
0x00002a Nov 8, 2022
332914b
chore: remove doctest wrap
0x00002a Nov 10, 2022
7aedccb
doc: Update documentation of edited functions
mpi3d Nov 19, 2022
ba01aea
fix: Add a minimum keypoint count
mpi3d Nov 19, 2022
da72f90
chore: Add missing copyright
mpi3d Nov 20, 2022
1e23ae2
Update libfprint/fp-image.c
mpi3d Nov 20, 2022
b96af5d
Merge pull request #12 from 0x00002a/0x2a/feat/sigfm
mpi3d Nov 20, 2022
9257e61
Remove .vscode, adjust .gitignore
rootd Dec 28, 2022
bfbc051
Add nFPM config
rootd Dec 28, 2022
c7a836b
Merge pull request #6 from rootd/sigfm_clean
rootd Dec 28, 2022
d02e9a0
Merge pull request #20 from rootd/sigfm_clean
mpi3d Dec 29, 2022
677ce77
Merge pull request #18 from rootd/sigfm
mpi3d Dec 29, 2022
9a36fca
Separate nFPM generation
rootd Dec 29, 2022
aee8abb
Minor change
rootd Dec 29, 2022
ecdd3c6
Merge pull request #25 from rootd/sigfm
rootd Dec 29, 2022
53ecd14
Merge branch 'master' of https://github.com/freedesktop/libfprint int…
mpi3d Dec 29, 2022
dadba95
Merge branch 'freedesktop-master' into sigfm
mpi3d Dec 29, 2022
9662476
Attempt to extract library version from meson
rootd Dec 29, 2022
565807a
Fix workflow
rootd Dec 29, 2022
7305392
Fix OpenCV version to 4.6
rootd Jan 4, 2023
07306bb
Switch to OpenCV 4.5
rootd Jan 4, 2023
2571f64
Add ELAN7001 04F3:3212 support with SIGFM
EleazarGamezD Sep 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: mpi3d
custom: "btc.com/btc/address/1MPi3D1HxS71k83XnqK3yB8CNmyHQeerZZ"
70 changes: 70 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build Linux packages
on:
workflow_dispatch:
push:
branches:
- master
- goodixtls
- sigfm

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: nicksnell/action-reset-repo@master
with:
reset_branch: buildpackage
base_branch: master
github_token: ${{ github.token }}
- name: Merge goodixtls -> buildpackage
uses: devmasx/merge-branch@master
with:
type: now
from_branch: goodixtls
target_branch: buildpackage
github_token: ${{ github.token }}
- name: Merge sigfm -> buildpackage
uses: devmasx/merge-branch@master
with:
type: now
from_branch: sigfm
target_branch: buildpackage
github_token: ${{ github.token }}
- name: Chown user
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- uses: actions/checkout@v3
with:
ref: buildpackage
- uses: actions/setup-python@v1
- name: Install dependencies
run: sudo apt-get install -y libgusb-dev libgirepository1.0-dev libnss3-dev libgudev-1.0-dev gtk-doc-tools libopencv-dev doctest-dev
- uses: BSFishy/meson-build@v1.0.3
with:
action: build
setup-options: --prefix /usr/ --buildtype=release
options: --verbose
meson-version: 0.63.3
ninja-version: 1.10.2
- name: Install nFPM
run: echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list && sudo apt update && sudo apt install nfpm
- name: Prepare nFPM DEB config
run: cd /home/runner/work/libfprint/libfprint && cp nfpm_deb_sample.yaml nfpm_deb.yaml && sed -i "s/COMMITID/$(git rev-parse --short HEAD)/g" nfpm_deb.yaml && mkdir ./output && cd /home/runner/work/libfprint/libfprint/build && sed -i "s/LIBVERSION/$(meson introspect --projectinfo | jq -r '.version')/g" /home/runner/work/libfprint/libfprint/nfpm_deb.yaml
- name: Prepare nFPM RPM config
run: cd /home/runner/work/libfprint/libfprint && cp nfpm_rpm_sample.yaml nfpm_rpm.yaml && sed -i "s/COMMITID/$(git rev-parse --short HEAD)/g" nfpm_rpm.yaml && cd /home/runner/work/libfprint/libfprint/build && sed -i "s/LIBVERSION/$(meson introspect --projectinfo | jq -r '.version')/g" /home/runner/work/libfprint/libfprint/nfpm_rpm.yaml
- name: Prepare nFPM Arch config
run: cd /home/runner/work/libfprint/libfprint && cp nfpm_arch_sample.yaml nfpm_arch.yaml && sed -i "s/COMMITID/$(git rev-parse --short HEAD)/g" nfpm_arch.yaml && cd /home/runner/work/libfprint/libfprint/build && sed -i "s/LIBVERSION/$(meson introspect --projectinfo | jq -r '.version')/g" /home/runner/work/libfprint/libfprint/nfpm_arch.yaml
- name: Generating DEB package
run: nfpm pkg --packager deb --config ./nfpm_deb.yaml --target ./output/
- name: Generating RPM package
run: nfpm pkg --packager rpm --config ./nfpm_rpm.yaml --target ./output/
- name: Generating ArchLinux package
run: nfpm pkg --packager archlinux --config ./nfpm_arch.yaml --target ./output/
- uses: actions/upload-artifact@v3
with:
name: meson-build-artifacts
path: /home/runner/work/libfprint/libfprint/build
- uses: actions/upload-artifact@v3
with:
name: deb-rpm-arch-packages
path: /home/runner/work/libfprint/libfprint/output
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.o
*.swp
_build
.vscode/
1 change: 1 addition & 0 deletions libfprint/drivers/elanspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,7 @@ fpi_device_elanspi_class_init (FpiDeviceElanSpiClass *klass)
dev_class->nr_enroll_stages = 7; /* these sensors are very hit or miss, may as well record a few extras */

img_class->bz3_threshold = 24;
img_class->algorithm = FPI_DEVICE_ALGO_SIGFM;
img_class->img_open = elanspi_open;
img_class->activate = elanspi_activate;
img_class->deactivate = elanspi_deactivate;
Expand Down
1 change: 1 addition & 0 deletions libfprint/drivers/elanspi.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ static const struct elanspi_regtable elanspi_calibration_table_new_page1 = {

// using checkargs ACPI:HIDPID
static const FpIdEntry elanspi_id_table[] = {
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x3212}, .driver_data = ELANSPI_90LEFT_ROTATE},
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x3057}, .driver_data = ELANSPI_180_ROTATE},
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x3087}, .driver_data = ELANSPI_180_ROTATE},
{.udev_types = ELANSPI_UDEV_TYPES, .spi_acpi_id = "ELAN7001", .hid_id = {.vid = ELANSPI_TP_VID, .pid = 0x30c6}, .driver_data = ELANSPI_180_ROTATE},
Expand Down
1 change: 1 addition & 0 deletions libfprint/fp-image-device-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ typedef struct
FpImage *capture_image;

gint bz3_threshold;
FpiPrintType algorithm;
} FpImageDevicePrivate;


Expand Down
108 changes: 50 additions & 58 deletions libfprint/fp-image-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "fpi-print.h"
#define FP_COMPONENT "image_device"
#include "fpi-log.h"

Expand All @@ -32,23 +33,20 @@
* This is a helper class for the commonly found image based devices.
*/

G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (FpImageDevice, fp_image_device, FP_TYPE_DEVICE)
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (FpImageDevice, fp_image_device,
FP_TYPE_DEVICE)

enum {
PROP_0,
PROP_FPI_STATE,
N_PROPS
};
enum { PROP_0, PROP_FPI_STATE, N_PROPS };

static GParamSpec *properties[N_PROPS];
static GParamSpec * properties[N_PROPS];

enum {
FPI_STATE_CHANGED,

LAST_SIGNAL
};

static guint signals[LAST_SIGNAL] = { 0 };
static guint signals[LAST_SIGNAL] = {0};

/*******************************************************/

Expand All @@ -58,30 +56,30 @@ static guint signals[LAST_SIGNAL] = { 0 };

/* Callbacks/vfuncs */
static void
fp_image_device_open (FpDevice *device)
fp_image_device_open (FpDevice * device)
{
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (device);
FpImageDeviceClass * cls = FP_IMAGE_DEVICE_GET_CLASS (device);

/* Nothing special about opening an image device, just
* forward the request. */
cls->img_open (FP_IMAGE_DEVICE (device));
}

static void
fp_image_device_close (FpDevice *device)
fp_image_device_close (FpDevice * device)
{
FpImageDevice *self = FP_IMAGE_DEVICE (device);
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (self);
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
FpImageDevice * self = FP_IMAGE_DEVICE (device);
FpImageDeviceClass * cls = FP_IMAGE_DEVICE_GET_CLASS (self);
FpImageDevicePrivate * priv = fp_image_device_get_instance_private (self);

g_assert (priv->active == FALSE);
cls->img_close (self);
}

static void
fp_image_device_cancel_action (FpDevice *device)
fp_image_device_cancel_action (FpDevice * device)
{
FpImageDevice *self = FP_IMAGE_DEVICE (device);
FpImageDevice * self = FP_IMAGE_DEVICE (device);
FpiDeviceAction action;

action = fpi_device_get_current_action (device);
Expand All @@ -96,10 +94,10 @@ fp_image_device_cancel_action (FpDevice *device)
}

static void
fp_image_device_start_capture_action (FpDevice *device)
fp_image_device_start_capture_action (FpDevice * device)
{
FpImageDevice *self = FP_IMAGE_DEVICE (device);
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
FpImageDevice * self = FP_IMAGE_DEVICE (device);
FpImageDevicePrivate * priv = fp_image_device_get_instance_private (self);
FpiDeviceAction action;
FpiPrintType print_type;

Expand All @@ -116,18 +114,17 @@ fp_image_device_start_capture_action (FpDevice *device)

if (!wait_for_finger)
{
fpi_device_action_error (device, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
fpi_device_action_error (
device, fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED));
return;
}
}
else if (action == FPI_DEVICE_ACTION_ENROLL)
{
FpPrint *enroll_print = NULL;
FpPrint * enroll_print = NULL;

fpi_device_get_enroll_data (device, &enroll_print);
g_object_get (enroll_print, "fpi-type", &print_type, NULL);
if (print_type != FPI_PRINT_NBIS)
fpi_print_set_type (enroll_print, FPI_PRINT_NBIS);
fpi_print_set_type (enroll_print, priv->algorithm);
}

priv->enroll_stage = 0;
Expand All @@ -140,40 +137,37 @@ fp_image_device_start_capture_action (FpDevice *device)
fpi_image_device_activate (self);
}


/*********************************************************/

static void
fp_image_device_finalize (GObject *object)
fp_image_device_finalize (GObject * object)
{
FpImageDevice *self = (FpImageDevice *) object;
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
FpImageDevice * self = (FpImageDevice *) object;
FpImageDevicePrivate * priv = fp_image_device_get_instance_private (self);

g_assert (priv->active == FALSE);

G_OBJECT_CLASS (fp_image_device_parent_class)->finalize (object);
}

static void
fp_image_device_default_activate (FpImageDevice *self)
fp_image_device_default_activate (FpImageDevice * self)
{
fpi_image_device_activate_complete (self, NULL);
}

static void
fp_image_device_default_deactivate (FpImageDevice *self)
fp_image_device_default_deactivate (FpImageDevice * self)
{
fpi_image_device_deactivate_complete (self, NULL);
}

static void
fp_image_device_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
fp_image_device_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
FpImageDevice *self = FP_IMAGE_DEVICE (object);
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
FpImageDevice * self = FP_IMAGE_DEVICE (object);
FpImageDevicePrivate * priv = fp_image_device_get_instance_private (self);

switch (prop_id)
{
Expand All @@ -187,25 +181,28 @@ fp_image_device_get_property (GObject *object,
}

static void
fp_image_device_constructed (GObject *obj)
fp_image_device_constructed (GObject * obj)
{
FpImageDevice *self = FP_IMAGE_DEVICE (obj);
FpImageDevicePrivate *priv = fp_image_device_get_instance_private (self);
FpImageDeviceClass *cls = FP_IMAGE_DEVICE_GET_CLASS (self);
FpImageDevice * self = FP_IMAGE_DEVICE (obj);
FpImageDevicePrivate * priv = fp_image_device_get_instance_private (self);
FpImageDeviceClass * cls = FP_IMAGE_DEVICE_GET_CLASS (self);

/* Set default threshold. */
priv->bz3_threshold = BOZORTH3_DEFAULT_THRESHOLD;
if (cls->bz3_threshold > 0)
priv->bz3_threshold = cls->bz3_threshold;
priv->algorithm = FPI_PRINT_NBIS;
if (cls->algorithm > 0)
priv->algorithm = cls->algorithm;

G_OBJECT_CLASS (fp_image_device_parent_class)->constructed (obj);
}

static void
fp_image_device_class_init (FpImageDeviceClass *klass)
fp_image_device_class_init (FpImageDeviceClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
FpDeviceClass *fp_device_class = FP_DEVICE_CLASS (klass);
GObjectClass * object_class = G_OBJECT_CLASS (klass);
FpDeviceClass * fp_device_class = FP_DEVICE_CLASS (klass);

object_class->finalize = fp_image_device_finalize;
object_class->get_property = fp_image_device_get_property;
Expand Down Expand Up @@ -237,13 +234,11 @@ fp_image_device_class_init (FpImageDeviceClass *klass)
*
* Stability: private
*/
properties[PROP_FPI_STATE] =
g_param_spec_enum ("fpi-image-device-state",
"Image Device State",
"Private: The state of the image device",
FPI_TYPE_IMAGE_DEVICE_STATE,
FPI_IMAGE_DEVICE_STATE_INACTIVE,
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);
properties[PROP_FPI_STATE] = g_param_spec_enum (
"fpi-image-device-state", "Image Device State",
"Private: The state of the image device", FPI_TYPE_IMAGE_DEVICE_STATE,
FPI_IMAGE_DEVICE_STATE_INACTIVE,
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE);

/**
* FpImageDevice::fpi-image-device-state-changed: (skip)
Expand All @@ -254,18 +249,15 @@ fp_image_device_class_init (FpImageDeviceClass *klass)
*
* Stability: private
*/
signals[FPI_STATE_CHANGED] =
g_signal_new ("fpi-image-device-state-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (FpImageDeviceClass, change_state),
NULL, NULL, NULL,
G_TYPE_NONE, 1, FPI_TYPE_IMAGE_DEVICE_STATE);
signals[FPI_STATE_CHANGED] = g_signal_new (
"fpi-image-device-state-changed", G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (FpImageDeviceClass, change_state),
NULL, NULL, NULL, G_TYPE_NONE, 1, FPI_TYPE_IMAGE_DEVICE_STATE);

g_object_class_install_properties (object_class, N_PROPS, properties);
}

static void
fp_image_device_init (FpImageDevice *self)
fp_image_device_init (FpImageDevice * self)
{
}
Loading