The code tried to only write the RGB bytes of FORMAT_RGB24, however, the
in-memory layout is different on big-endian which would result in the
wrong bytes being written.
Fix this by simply also writing the byte we do not care about.
Add a GCancellable parameter to fpi_ssm_nex_state_delayed and
fpi_ssm_jump_to_state_delayed() so that it's possible to cancel an action
from the caller and in case the driver wants to cancel a delayed operation
when a device action has been cancelled.
This allows to have an automatic cleanup of the timeout source when the
the callback is reached and to avoid to do further state changes in the
middle.
Since GSource data can be automatically cleaned up on source destruction, we
can mimic this for the devices timeout easily as well.
Add an extra parameter, and let's use this cocci file to adapt all the
drivers like magic:
@@
expression e1, e2, e3, e4;
@@
fpi_device_add_timeout (e1, e2, e3, e4
+ , NULL
)
When using fpi_usb_transfer_submit_sync we still need to unref the transfer
once done with it, so let's use an auto pointer so we free it also on
errors and early returns without having to handle this manually.
In rare occasions it could happen that the driver was reading
insufficient data. Fix this by using g_input_stream_read_all_async
which will ensure that incomplete data will not be misinterpreted.
This fixes rare test failures seen in fprintd.
Seems like the older uncrustify versions did not find these indentation
issues. Fix them.
Old versions of uncrustify will leave things as is, so this is not a
problem if developers are using an old version of uncrustify.
Using floating point causes architecture dependent results due to
accuracy/rounding differences. It is not hard to switch to fixed point,
and while this does cause quite different rounding errors, the
difference is small.
Fixes: #200
The test suite needs to compare greyscale images and was picking an
undefined byte in the pixel data on big-endian. Select a byte that works
on any endian instead.
See: #200
g_variant_new_from_data() allows to destroy some other user_data passed as
parameter that might be different from the aligned_data itself.
But since in this case they match, pass it to be set as g_free parameter
or it won't be free'd.
When we notify the enroll progress with a print, this needs to be unreffed
once we're done, but this only was happening in case of error.
Since it's not up to the callback function to free it, let's do it at the
end of the function.
As per this, clarify the docs for FpEnrollProgress marking it as transfer
none.
Allow to pass a double-pointer to be nullified as the transfer data in order
to mark it as NULL when the transfer is done.
This is useful if we're keeping the transfer around in order to check that
no one is currently running.
When a transfer is completed, we automatically unref it since we can't
consider it valid anymore since this point.
Update the drivers not to free the transfer after submitting anymore.
When a machine is completed, we automatically free it since we can't
consider it valid anymore since this point.
Update the drivers not to free the SSM on completion callback anymore.
As per commit 201b5a961 we use g_date_copy() to copy the date, however the
GLib implementation is done assuming that the GDate getters are always used
as the copy function doesn't preserve the original format of the date
(whether is using julian days or dmy), and the synaptics driver access to
the dmy values directly, without using the getter that would recompute the
proper values.
Causing a read error of unset values.
So, to avoid this, just use the g_date_get_* getters to retrieve the day
month and year for for defining the print enroll id.