Qt Camera example doesn't work on Android
-
wrote on 12 Aug 2014, 15:15 last edited by
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:
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 -
Hi,
It's not an element from QtWidgets but from QtMultimediaWidgets and IIRC camera rendering to widgets is not yet supported on Android
-
wrote on 12 Aug 2014, 15:57 last edited by
Thanks! I didn't realize that.
-
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
-
wrote on 13 Aug 2014, 07:32 last edited by
5.3 worked, 5.3.1 doesnt. 5.4 should bring full support according to digia
-
Do you mean that QCameraViewFinder worked in 5.3.0 and not in 5.3.1 ?
-
wrote on 13 Aug 2014, 07:44 last edited by
yeah
[quote author="SGaist" date="1407915793"]Do you mean that QCameraViewFinder worked in 5.3.0 and not in 5.3.1 ?[/quote] -
Was there a bug report filled ?
-
wrote on 13 Aug 2014, 11:59 last edited by
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]
-
wrote on 25 Aug 2014, 13:50 last edited by
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@ -
wrote on 25 Aug 2014, 13:54 last edited by
-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] -
wrote on 26 Oct 2014, 06:29 last edited by
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?