We have moved to a new Sailfish OS Forum. Please start new discussions there.
4

[Bug] sailfish-qml Camera

asked 2015-03-29 06:10:51 +0300

backpackjoe gravatar image

updated 2015-03-29 06:36:02 +0300

I am trying to integrate a Camera/Viewfinder in my all qml/pyOtherSide App, and was using the example provided by the harbour-advcompogallery harbour-advcompogallery App.

Apperently, the Camera seems to not work with the sailfish-qml launcher, since it throws an error upon activating:

[W] QCameraPrivate::_q_error:171 - Camera error: "Failed to link 'viewfinder bin queue' to 'viewfinder bin capsfilter'."

is there a way around this other than using a compiled launcher binary? In the compiled advcompogallery app it seems to work, but not in the sailfish-qml launcher.

Thanks

edit retag flag offensive close delete

Comments

Rather a question for the sailfish devel mailing list?

MikErk ( 2015-03-29 15:55:48 +0300 )edit

i've sent it to the mailing list, too. Hopefully it will be adressed. Also, I have tried using qmlscene, it throws the same error, and on my linux Laptop it displays the Webcam totally fine. I guess its an issue with the port of the qmlscene runtime of SailfishOS.

backpackjoe ( 2015-03-30 19:15:34 +0300 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2015-03-31 05:33:33 +0300

backpackjoe gravatar image

updated 2015-03-31 05:34:17 +0300

I got a response on the maling List: https://lists.sailfishos.org/pipermail/devel/2015-March/005902.html

Its true, using only Sailfish.Media and QtMultimedia 5.0 worked perfectly fine:

import QtQuick 2.0
import Sailfish.Silica 1.0
import QtMultimedia 5.0
import Sailfish.Media 1.0

Page {
    id: page

    Camera {
        id: camera
        flash.mode: Camera.FlashOff
        captureMode: Camera.CaptureStillImage
        focus.focusMode: Camera.FocusContinuous
        imageCapture {
            resolution: "800x600"
            onImageSaved: {
                console.warn("image saved");
            }
            onCaptureFailed: {
                console.error("error: " + camera.imageCapture.errorString);
            }
            onImageCaptured: { // does not work: missing SailfishOS feature
                console.log("Image captured");
            }
        }
        onError: {
            console.error("error: " + camera.errorString);
        }
    }
    Component.onCompleted: {
        console.log(camera.cameraState == Camera.ActiveState)
        console.log("done")
    }
    Component.onDestruction: {
        if (camera.cameraState != Camera.UnloadedState) {
            camera.cameraState = Camera.UnloadedState
        }
    }
    TextSwitch {
        id: activationSwitch
        text: qsTr("Camera active")
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.bottom: parent.bottom
        checked: true
        onCheckedChanged: {
            if(camera.cameraState == Camera.ActiveState){
                camera.cameraState = Camera.UnloadedState;
            }
            else if(camera.cameraState == Camera.UnloadedState){
                camera.cameraState = Camera.ActiveState;
            }
        }
    }
    GStreamerVideoOutput {
        id: videoPreview
        anchors.centerIn: parent
        source: camera
        MouseArea {
            anchors.fill: parent
            onClicked: {
                console.log("capturing");
                camera.imageCapture.captureToLocation("/tmp/test.jpg");
            }
        }
    }
}
edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2015-03-29 06:10:51 +0300

Seen: 727 times

Last updated: Mar 31 '15