Qt Camera example doesn't work on Android



  • I've tried compiling and running the C++-based Qt Camera example (not the declarative-camera example, just the regular camera one). It compiles fine, but when I run it the Camera view is missing:

    !https://dl.dropboxusercontent.com/u/3837092/Screenshots/Screenshot_2014-08-12-11-09-08.png(Screenshot)!

    Is this normal? Everything I've read in the forums says that Qt Widgets and Camera should be working on Android in Qt 5.3. The device I'm testing on is a Nexus 7 (first gen).

    Thanks!
    Dave


  • Lifetime Qt Champion

    Hi,

    It's not an element from QtWidgets but from QtMultimediaWidgets and IIRC camera rendering to widgets is not yet supported on Android



  • Thanks! I didn't realize that.


  • Lifetime Qt Champion

    You're welcome !

    "Here":http://qt-project.org/wiki/Qt_Multimedia_Backends is the backend grid, it hasn't been updated in a while but AFAIK it's correct



  • 5.3 worked, 5.3.1 doesnt. 5.4 should bring full support according to digia


  • Lifetime Qt Champion

    Do you mean that QCameraViewFinder worked in 5.3.0 and not in 5.3.1 ?



  • yeah
    [quote author="SGaist" date="1407915793"]Do you mean that QCameraViewFinder worked in 5.3.0 and not in 5.3.1 ?[/quote]


  • Lifetime Qt Champion

    Was there a bug report filled ?



  • no, since it was never declared to be properly working on android, yet. as said, 5.4 should officially support it, the alpha release should be tomorrow anyway.

    [quote author="SGaist" date="1407931059"]Was there a bug report filled ?[/quote]



  • I've just compiled the latest Qt 5.4 source for Android and tried out the camera example again. No dice. The camera frame shows up, but nothing appears in it. I get this in the console Application Output window:

    @D/Qt (25873): fontdatabases/basic/qbasicfontdatabase.cpp:239 (static QStringList QBasicFontDatabase::addTTFile(const QByteArray&, const QByteArray&, QSupportedWritingSystems*)): FT_New_Face failed with index 0 : 90
    W/System.err(25873): java.lang.RuntimeException: setParameters failed
    W/System.err(25873): at android.hardware.Camera.native_setParameters(Native Method)
    W/System.err(25873): at android.hardware.Camera.setParameters(Camera.java:1650)
    W/System.err(25873): at dalvik.system.NativeStart.run(Native Method)
    W/System.err(25873): java.lang.RuntimeException: setParameters failed
    W/System.err(25873): at android.hardware.Camera.native_setParameters(Native Method)
    W/System.err(25873): at android.hardware.Camera.setParameters(Camera.java:1650)
    W/System.err(25873): at dalvik.system.NativeStart.run(Native Method)
    W/InputEventReceiver(25873): Attempted to finish an input event but the input event receiver has already been disposed.
    W/Qt (25873): mediacapture/qandroidcapturesession.cpp:167 (void QAndroidCaptureSession::setState(QMediaRecorder::State)): QMediaRecorder::PausedState is not supported on Android
    W/Qt (25873): mediacapture/qandroidcapturesession.cpp:167 (void QAndroidCaptureSession::setState(QMediaRecorder::State)): QMediaRecorder::PausedState is not supported on Android@



  • -QML or C++ example?-

    Nvm, just saw first post again. Well that would be pretty disappointing...

    I'll wait for the prebuild alpha to try, seems it's delayed again tho.

    [quote author="davidh" date="1408974650"]I've just compiled the latest Qt 5.4 source for Android and tried out the camera example again. No dice. The camera frame shows up, but nothing appears in it. I get this in the console Application Output window:

    @D/Qt (25873): fontdatabases/basic/qbasicfontdatabase.cpp:239 (static QStringList QBasicFontDatabase::addTTFile(const QByteArray&, const QByteArray&, QSupportedWritingSystems*)): FT_New_Face failed with index 0 : 90
    W/System.err(25873): java.lang.RuntimeException: setParameters failed
    W/System.err(25873): at android.hardware.Camera.native_setParameters(Native Method)
    W/System.err(25873): at android.hardware.Camera.setParameters(Camera.java:1650)
    W/System.err(25873): at dalvik.system.NativeStart.run(Native Method)
    W/System.err(25873): java.lang.RuntimeException: setParameters failed
    W/System.err(25873): at android.hardware.Camera.native_setParameters(Native Method)
    W/System.err(25873): at android.hardware.Camera.setParameters(Camera.java:1650)
    W/System.err(25873): at dalvik.system.NativeStart.run(Native Method)
    W/InputEventReceiver(25873): Attempted to finish an input event but the input event receiver has already been disposed.
    W/Qt (25873): mediacapture/qandroidcapturesession.cpp:167 (void QAndroidCaptureSession::setState(QMediaRecorder::State)): QMediaRecorder::PausedState is not supported on Android
    W/Qt (25873): mediacapture/qandroidcapturesession.cpp:167 (void QAndroidCaptureSession::setState(QMediaRecorder::State)): QMediaRecorder::PausedState is not supported on Android@[/quote]



  • @davidh: just tested the camera example with the 5.4 alpha -> same result as your first post, sadly...



  • So what is the difference between the Widget camera example and the declarative-camera example?

    I've tried both v5.3 (?) and on a nexus7 the later works fine.

    Is it a widget vs qml thing? Is there a work around for using the qml code that works in conjunction with a widget based app?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.