Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Android : SupportedViewFinderResolutions is undefined / aspect ratio of VideoOutput not consistent



  • Hi, it seems that on qt 5.13.1 , android,

    viewfinder.supportedViewFinderResolutions is not usable / accessible / defined on my different android devices.
    I get

     qrc:/qml/pages/Capture.qml:251: TypeError: Property 'supportedViewfinderResolutions' of object QDeclarativeCameraViewfinder(0xc9045890) is not a function
    

    with the following code

                        console.debug(" SUPPORTED VIEWFINDER RESOLUTIONS " + camera.viewfinder.supportedViewfinderResolutions())
    

    The code is executed when the camera reaches the Camera.LoadedStatus.

    I searched through the forums and found mentions of "backend not supporting", "backend might have problems".
    Is this something that can be worked around? Also it appears the view finder has a default resolution set by the system;
    can I somehow override that? The aspect ratio is not correct (even with autorotate set).
    Can I create my own viewfinder renderer? What could be the best approach for that?

    Update:
    What am I missing?
    Digged a bit more around, found this, which seems to hint at where the onResolutionChange originates when camera becomes active:

    https://code.woboq.org/qt5/qtmultimedia/src/imports/multimedia/qdeclarativecameraviewfinder.cpp.html#115

    but there is no supportedViewfinderResolutions declared at all;
    and also :

    https://code.woboq.org/qt5/qtmultimedia/src/imports/multimedia/qdeclarativecameraviewfinder.cpp.html#3

    Mentions Jolla. Guess Ill have to take a look a their camera app to understand how they get the aspect ratio of the viewfinder to be correct (which is reported as default on 4:3 on all the android devices I have).

    Please help me understand Qt :D



  • Self response : supportedViewFinderResolutions is defined on the Camera object, not on the viewfinder.
    Documentation could perhaps be clearer on this.


Log in to reply