qt - How to access camera in QML QVideoFilterRunnable? -
following blog @ https://blog.qt.io/blog/2015/03/20/introducing-video-filters-in-qt-multimedia, managed c++ filter work qml-defined camera. problem running image filter receives not account screen orientation. qt documentation http://doc.qt.io/qt-5/cameraoverview.html shows how rotate image based on camera , screen orientations. not clear how obtain camera instance filter. here relevant snippet qml file:
camera { id: camera capturemode: camera.capturestillimage ... } myfilter { id: filter } videooutput { id: viewfinder source: camera filters: [ filter ] ... } how can access qcamera instance qvideofilterrunnable instance? regards.
answer specific question rotation, best answer have pass orientation videooutput component custom component, i.e.
camera { id: camera capturemode: camera.capturestillimage ... } myfilter { id: filter orientation: videofinder.orientation } videooutput { id: viewfinder source: camera autoorientation: true filters: [ filter ] ... } that way, custom filter know how end user sees image. gotcha on devices image flipped well:
#ifdef q_os_android bool flip = true; #else bool flip = surfaceformat.scanlinedirection() == qvideosurfaceformat::bottomtotop; #endif
Comments
Post a Comment