c++multithreadingqtqmlqtmultimedia

How to send a parameter to QAbstractVideoFilter in qml?


I want to have multiple camera that processing by unique filter and all camera filter have to access to unique Array in memory(should not passing copy of Array to each filter).

Do you have any idea? my solution is to send the Array by parameter to QAbstractVideoFilter, but dont know how to do that and how it possible ?


Solution

  • You will need to reimplement QAbstractVideoFilter::createFilterRunnable, which will return your custom filter class inherited from QVideoFilterRunnable. This allows you to declare and implement any interface, parameters and communication in your class, which will affect video filtering/processing.

    So, you'll have two own classes:

    1. Inherited from QAbstractVideoFilter
    2. Inherited from QVideoFilterRunnable

    You can make changes in each one, but I recommend you to make your interface in QAbstractVideoFilter and then forward to spawned QVideoFilterRunnable.

    To make your interface work in QML, you should: