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:
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
-
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
-
Do you mean that QCameraViewFinder worked in 5.3.0 and not in 5.3.1 ?
-
Was there a bug report filled ?
-
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] -
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?