From 3b480caab151573cc185ba7ad9f15b917d8d6d9e Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 5 Aug 2019 18:57:55 +0200 Subject: [PATCH] lib: Remove num_stripes from fpi_do_movement_estimation() --- libfprint/drivers/aes1610.c | 3 +-- libfprint/drivers/aes2501.c | 3 +-- libfprint/drivers/elan.c | 2 +- libfprint/fpi-assembling.c | 8 +------- libfprint/fpi-assembling.h | 3 +-- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/libfprint/drivers/aes1610.c b/libfprint/drivers/aes1610.c index 0d3ca4a..e597772 100644 --- a/libfprint/drivers/aes1610.c +++ b/libfprint/drivers/aes1610.c @@ -590,8 +590,7 @@ static void capture_read_strip_cb(FpiUsbTransfer *transfer, FpDevice *device, /* send stop capture bits */ aes_write_regv(dev, capture_stop, G_N_ELEMENTS(capture_stop), stub_capture_stop_cb, NULL); self->strips = g_slist_reverse(self->strips); - fpi_do_movement_estimation(&assembling_ctx, self->strips, - self->strips_len); + fpi_do_movement_estimation(&assembling_ctx, self->strips); img = fpi_assemble_frames(&assembling_ctx, self->strips, self->strips_len); diff --git a/libfprint/drivers/aes2501.c b/libfprint/drivers/aes2501.c index 50b3498..bb94d65 100644 --- a/libfprint/drivers/aes2501.c +++ b/libfprint/drivers/aes2501.c @@ -435,8 +435,7 @@ static void capture_read_strip_cb(FpiUsbTransfer *transfer, FpDevice *_dev, FpImage *img; self->strips = g_slist_reverse(self->strips); - fpi_do_movement_estimation(&assembling_ctx, - self->strips, self->strips_len); + fpi_do_movement_estimation(&assembling_ctx, self->strips); img = fpi_assemble_frames(&assembling_ctx, self->strips, self->strips_len); diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c index 2c4e3be..3608897 100644 --- a/libfprint/drivers/elan.c +++ b/libfprint/drivers/elan.c @@ -302,7 +302,7 @@ static void elan_submit_image(FpImageDevice *dev) assembling_ctx.frame_height = self->frame_height; assembling_ctx.image_width = self->frame_width * 3 / 2; g_slist_foreach(raw_frames, (GFunc) self->process_frame, &frames); - fpi_do_movement_estimation(&assembling_ctx, frames, num_frames); + fpi_do_movement_estimation(&assembling_ctx, frames); img = fpi_assemble_frames(&assembling_ctx, frames, num_frames); fpi_image_device_image_captured(dev, img); diff --git a/libfprint/fpi-assembling.c b/libfprint/fpi-assembling.c index ccd9643..116d01d 100644 --- a/libfprint/fpi-assembling.c +++ b/libfprint/fpi-assembling.c @@ -173,7 +173,6 @@ do_movement_estimation (struct fpi_frame_asmbl_ctx *ctx, * fpi_do_movement_estimation: * @ctx: #fpi_frame_asmbl_ctx - frame assembling context * @stripes: a singly-linked list of #fpi_frame - * @num_stripes: number of items in @stripes to process * * fpi_do_movement_estimation() estimates the movement between adjacent * frames, populating @delta_x and @delta_y values for each #fpi_frame. @@ -181,18 +180,13 @@ do_movement_estimation (struct fpi_frame_asmbl_ctx *ctx, * This function is used for devices that don't do movement estimation * in hardware. If hardware movement estimation is supported, the driver * should populate @delta_x and @delta_y instead. - * - * Note that @num_stripes might be shorter than the length of the list, - * if some stripes should be skipped. */ void fpi_do_movement_estimation (struct fpi_frame_asmbl_ctx *ctx, - GSList *stripes, size_t num_stripes) + GSList *stripes) { int err, rev_err; - g_return_if_fail (g_slist_length(stripes) != num_stripes); - err = do_movement_estimation (ctx, stripes, FALSE); rev_err = do_movement_estimation (ctx, stripes, TRUE); fp_dbg ("errors: %d rev: %d", err, rev_err); diff --git a/libfprint/fpi-assembling.h b/libfprint/fpi-assembling.h index ae9adc2..33adcfd 100644 --- a/libfprint/fpi-assembling.h +++ b/libfprint/fpi-assembling.h @@ -65,8 +65,7 @@ struct fpi_frame_asmbl_ctx }; void fpi_do_movement_estimation (struct fpi_frame_asmbl_ctx *ctx, - GSList *stripes, - size_t num_stripes); + GSList *stripes); FpImage *fpi_assemble_frames (struct fpi_frame_asmbl_ctx *ctx, GSList *stripes,