[SailfishDevel] LED Flash functionality on a real Jolla

Mohammed Hassan mohammed.hassan at jolla.com
Fri Jan 24 17:25:25 UTC 2014


On Thu, 23 Jan 2014 22:10:19 +0100
<christopher.lamb at thurweb.ch> wrote:

> Hi Mohammed
> 
> I have been trying to implement your suggestion, but am still having  
> problems ...
> 
> The Nokia code quoted in my original post did not have an explicit  
> sink (and on the N9 worked without one). But following the tutorial
> in the link below I have added one to the my code.

I tried to use fakesink instead of droideglsink and it worked so you
can use that too.

> http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+2%3A+GStreamer+concepts
> 
> The code compiles and runs, but the LED does not respond. On startup
> I get errors like:
> 
> "
> (GSTTorch:14916): GLib-GObject-CRITICAL **: Object class  
> GstDroidCamSrc doesn't implement property 'scene-mode' from
> interface 'GstPhotography'
> 
> (GSTTorch:14916): GLib-GObject-CRITICAL **: Object class  
> GstDroidCamSrc doesn't implement property 'noise-reduction' from  
> interface 'GstPhotography'
> ...more of the same ...

Those errors are harmless. Just ignore them. They decrease with each
update as we implement more camera features ;)

[...]
> GstTorch::GstTorch(QObject *parent) :
>      QObject(parent), pipeline(0), src(0), sink(0), mStatus(false)
> {
>      //gst-launch-0.10 droidcamsrc video-torch=1 viewfinder-mode=1 !
> fakesink gst_init(NULL, NULL);
>      src = gst_element_factory_make("droidcamsrc", "src");
>      sink = gst_element_factory_make("droideglsink", "sink");
>      pipeline = gst_pipeline_new ("test-pipeline");
>      if (!src || !sink || !pipeline) {
>          return;
>      }
>      /* Build the pipeline */
>      gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
>      if (gst_element_link (src, sink) != TRUE) {
>          qDebug() << "Elements could not be linked!";
>          gst_object_unref (pipeline);
>          return;
>      }
>      g_object_set(G_OBJECT(src), "video-torch", 1, NULL);
>      g_object_set(G_OBJECT(src), "mode", 1, NULL);
                                          ^^^
g_object_set (G_OBJECT(src), "mode", 2, NULL);

That should do it for you. Works fine here after changing mode to 2
instead of 1

1 is image mode and you can't have the torch on with that
2 is for videos and thus torch will light happily.

Cheers,


More information about the Devel mailing list