Hi All
As many will know from previous threads, I am well on the way to
porting an app for paraglider pilots.
A subsidiary yet still important feature {1} that I added to the
Harmattan version is an emergency flash, using the phone's LED.
Now that I have got the app's main functionality ported and up and
running on a real Jolla device, I am now trying to get this feature
working too.
Unfortunately everything I try fails. But as there is a working
flashlight app in the Harbour, it must be possible by hook or crock.
So far i have tried 3 solutions:
Solution 1) A C++ plugin exposing QtMultimedia QCamera to QML
This is the solution that works in the Harmattan version of the app,
and was therefore the first solution I tried to port to the Sailfish
version.
When I start the flash I get the following error:
QCameraPrivate::_q_error:171 - Camera error: "The camera service is missing"
Solution 2) QtMultimedia 5.0 Torch QML element
As QtMultimedia offers a Torch Element this seemed an easier and
cleaner approach.
import QtMultimedia 5.0
Page {
id: page
Torch {
id: torch
power: 75 // 75% of full power
enabled: false // off
onEnabledChanged: console.log("onEnabledChanged: " + enabled)
}
However this gives the following errors on app start up.
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'scene-mode' from interface 'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'noise-reduction' from interface
'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'image-preview-supported-caps' from
interface 'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'image-capture-supported-caps' from
interface 'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'flicker-mode' from interface
'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'exposure' from interface 'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'ev-compensation' from interface
'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'colour-tone-mode' from interface
'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'capabilities' from interface
'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'autofocus' from interface 'GstPhotography'
(QMLTorch:2300): GLib-GObject-CRITICAL **: Object class GstDroidCamSrc
doesn't implement property 'aperture' from interface 'GstPhotography'
QObject::connect: No such signal CameraBinExposure::valueChanged(int)
Solution 3)
Via a Gstreamer QML Plugin.
I dug out some old code that worked on Harmattan, basically the code
from this link to create a qml plugin
http://developer.nokia.com/Community/Wiki/How_to_turn_your_camera_flash_into_a_torch_on_Harmattan_using_GStreamer
On Sailfish this compiles, but gives the following error when I start
the torch.
(GSTTorch:708): GStreamer-CRITICAL **: gst_element_set_state:
assertion `GST_IS_ELEMENT (element)' failed
Thanks
Chris
{1} at about this time last year I discovered that a GPS position is
enough to get a helicopter close to you, but on a dark and snowy night
you need a bright light to get it exactly over you.
_______________________________________________
SailfishOS.org Devel mailing list