Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.7.0
-
Android 11
-
-
1f568e593 (dev), 703331817 (6.7), 2e6fd4010 (tqtc/lts-6.5)
-
2024wk14FOQtforAndroid
Description
I have a QML Module that decodes QR codes. I am using QtMultimedia for desktop and Android.
I am using a video sink for inspecting every frame from the camera like
QObject::connect(videoSink,&QVideoSink::videoFrameChanged,this,[=](const QVideoFrame & Vframe) { if(m_camera&&m_camera->isActive()&&Vframe.isValid()){ auto picture=Vframe.toImage(); WasmImageProvider::img=picture; setid(); if(m_state) { auto var = std::thread(&QRImageDecoder::decodePicture, this,picture); var.detach(); } } });
In Android, the camera preview is not shown, shows a black screen, and the qr can not be decoded.
It seems that `auto picture=Vframe.toImage();` return a black QImage. I have tried mapping the frame, setting RHS of the videosink to nullptr. However, I am not able to see the image from the camera on android.
The videosink and the `videoFrameChanged` signal work well on Linux.
The repo contains an example using the camera inside QtQrDec folder.
To build the example just set the CMake option BUILD_EXAMPLES=ON.
Then one can deploy the `qrcam` target to the Android device.