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

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -