QML Camera onImageCaptured
In my QR code scanner app, I use QMLs Camera element and QZXing. In my current version I use
camera.imageCapture.captureToLocation(imagePath);
with an imagePath to /{PicturesLocation}/tempqr.jpg
And then I call QZXing with that path.
This method includes a lot of I/O and it would be better to use onImageCaptured with an in-memory-Image. However, onImageCaptured is never called if I call capture(). Will future updates to Sailfish include improvements to the Camera QML item?
I've been perplexed as to why the
onImageCaptured
signal is never called. It looks like the answer is in the gstreamer camerabin plugin. Thepost-previews
property of the gstreamer object is set to TRUE in the mer project source, whereas in the Sailfish source it's set to FALSE. The equivalent line in the most recent Sailfish sources is the following:g_object_set(G_OBJECT(m_camerabin), POST_PREVIEWS_PROPERTY, FALSE, NULL);
Unfortunately I don't see any way to change this easily through the API. Technically you can access
m_camerabin
like this:QMediaControl *control = m_camera->service()->requestControl(QCameraImageCaptureControl_iid); CameraBinSession * session = qobject_cast<QCameraImageCaptureControl*>(control)->parent(); CameraBin * m_camerabin = session->cameraBin();
but none of the required header files are available.
flypig ( 2018-04-24 00:29:08 +0200 )edit