I am developing on a desktop as a host and the target is an iMX6 board. The OS for both is Ubuntu. I have ported the qmlvideofx example provided by Qt as a base application. From here, I want to add a QAbstractVideoFilter so that I can access the frames in the QMediaPlayer. I have two kits with this project, the Desktop Qt GCC 64bit (host) and an apalis-imx6 (target).

.h

Qt Code:
  1. #ifndef VIDEOFILTERTOSATELLITE_H
  2. #define VIDEOFILTERTOSATELLITE_H
  3.  
  4. #include <QObject>
  5. #include <QAbstractVideoFilter>
  6. #include <QVideoFilterRunnable>
  7. #include <QDebug>
  8. #include <QSize>
  9.  
  10. class VideoFilterToSatellite;
  11.  
  12. class VideoFilterToSatelliteRunnable : public QVideoFilterRunnable
  13. {
  14. public:
  15. VideoFilterToSatelliteRunnable ( VideoFilterToSatellite* parent = 0 );
  16. ~VideoFilterToSatelliteRunnable ();
  17.  
  18. QVideoFrame run ( QVideoFrame *input,
  19. const QVideoSurfaceFormat &surfaceFormat,
  20. RunFlags flags ) Q_DECL_OVERRIDE;
  21. private:
  22. VideoFilterToSatellite* m_filterParent;
  23. };
  24.  
  25. class VideoFilterToSatellite : public QAbstractVideoFilter
  26. {
  27. Q_OBJECT
  28. public:
  29. explicit VideoFilterToSatellite ( QAbstractVideoFilter *parent = 0 );
  30. QVideoFilterRunnable* createFilterRunnable ();
  31. };
  32.  
  33. #endif // VIDEOFILTERTOSATELLITE_H
To copy to clipboard, switch view to plain text mode 


.cpp

Qt Code:
  1. #include "VideoFilterToSatellite.h"
  2.  
  3. VideoFilterToSatellite::VideoFilterToSatellite ( QAbstractVideoFilter *parent )
  4. : QAbstractVideoFilter ( parent ) {}
  5.  
  6. QVideoFilterRunnable* VideoFilterToSatellite::createFilterRunnable ()
  7. {
  8. return reinterpret_cast<QVideoFilterRunnable*>( new VideoFilterToSatelliteRunnable ( this ) );
  9. }
  10.  
  11. VideoFilterToSatelliteRunnable::VideoFilterToSatelliteRunnable ( VideoFilterToSatellite* parent )
  12. : m_filterParent ( parent ) {}
  13.  
  14. VideoFilterToSatelliteRunnable::~VideoFilterToSatelliteRunnable() {}
  15.  
  16. QVideoFrame VideoFilterToSatelliteRunnable::run ( QVideoFrame *input,
  17. const QVideoSurfaceFormat &surfaceFormat,
  18. RunFlags flags )
  19. {
  20. Q_UNUSED ( surfaceFormat );
  21. Q_UNUSED ( flags );
  22.  
  23. if (!input->isValid())
  24. return *input;
  25.  
  26. // future work
  27.  
  28. return *input;
  29. }
To copy to clipboard, switch view to plain text mode 

.pro
Qt Code:
  1. TEMPLATE = app
  2. TARGET = MCS_Host
  3.  
  4. QT += qml quick multimedia network
  5. CONFIG += c++11
  6. CONFIG += qml_debug
  7.  
  8. SOURCES += main.cpp \
  9. filereader.cpp \
  10. NetworkServer.cpp \
  11. NetworkThread.cpp \
  12. VideoFilterToSatellite.cpp
  13.  
  14. RESOURCES += qml.qrc
  15.  
  16. # Additional import path used to resolve QML modules in Qt Creator's code model
  17. QML_IMPORT_PATH =
  18.  
  19. # Default rules for deployment.
  20. qnx: target.path = /tmp/$${TARGET}/bin
  21. else: unix:!android: target.path = /opt/$${TARGET}/bin
  22. !isEmpty(target.path): INSTALLS += target
  23.  
  24. HEADERS += \
  25. filereader.h \
  26. NetworkServer.h \
  27. NetworkThread.h \
  28. trace.h \
  29. VideoFilterToSatellite.h
To copy to clipboard, switch view to plain text mode 

main.cpp

Qt Code:
  1. ... includes ...
  2. #include "VideoFilterToSatellite.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. qputenv ( "QT_IM_MODULE", QByteArray ( "qtvirtualkeyboard" ) );
  7.  
  8. qSetMessagePattern ( "\033[34m%{function}[%{line}]:\033[0m %{message}" );
  9.  
  10. QGuiApplication app ( argc, argv );
  11. qmlRegisterType<VideoFilterToSatellite>("VideoFilter.ToSatellite", 1, 0, "VideoFilterToSatellite" );
  12.  
  13. QQuickView viewer;
  14.  
  15. viewer.setSource ( QUrl ( QLatin1String ( "qrc:/qml/qmlvideofx/Main.qml" ) ) );
  16.  
  17. viewer.show ();
  18.  
  19. // Delay invocation of init until the event loop has started, to work around
  20. // a GL context issue on Harmattan: without this, we get the following error
  21. // when the first ShaderEffectItem is created:
  22. // "QGLShaderProgram::addShader: Program and shader are not associated with same context"
  23. QMetaObject::invokeMethod ( rootObject, "init", Qt::QueuedConnection );
  24.  
  25. return app.exec();
  26. }
To copy to clipboard, switch view to plain text mode 


If I run this code on the desktop, it all works. If I run it on the target, it immediately segfaults in dl-debug.c on line 46 dl_debug_initialize. If I take out the filter, everything works on both platforms. I am missing something and am unsure where to go from here. Thanks for any pointers.