Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt Camera example doesn't work on Android
QtWS25 Last Chance

Qt Camera example doesn't work on Android

Scheduled Pinned Locked Moved Mobile and Embedded
13 Posts 4 Posters 6.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    davidh
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davidh
        wrote on last edited by
        #3

        Thanks! I didn't realize that.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • metaDomM Offline
            metaDomM Offline
            metaDom
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

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

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • metaDomM Offline
                metaDomM Offline
                metaDom
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Was there a bug report filled ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • metaDomM Offline
                    metaDomM Offline
                    metaDom
                    wrote on last edited by
                    #9

                    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]

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      davidh
                      wrote on last edited by
                      #10

                      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@

                      1 Reply Last reply
                      0
                      • metaDomM Offline
                        metaDomM Offline
                        metaDom
                        wrote on last edited by
                        #11

                        -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]

                        1 Reply Last reply
                        0
                        • metaDomM Offline
                          metaDomM Offline
                          metaDom
                          wrote on last edited by
                          #12

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

                          1 Reply Last reply
                          0
                          • P Offline
                            P Offline
                            PSI-lbc
                            wrote on last edited by
                            #13

                            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?

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved