After applying patch from
QTBUG-43752 it becames possible to use Qt Quick Camera and show preview.
However camera initialization may fail randomly when FrontFace camera is used by default (available since Qt 5.4):
It seems that QCamera uses back camera as default device and when front camera is specified as default device we will get the following behaviour:
- QCamera::start is called for back camera
- QCamera::unload is called for back camera
- QCamera::start is called for front camera
The latest call fails randomly in BbCameraSession::startViewFinder on this check:
My workaround is to call applyConfiguration directly in BbCameraSession::setState instead of queueing it with invokeMethod.
I have not found any regression after this change and I see no reason why we must use invokeMethod