From 3737e0ec9723c0b13c968e613065dd8085479fb1 Mon Sep 17 00:00:00 2001 From: Luca Carlon Date: Fri, 3 Jun 2016 14:29:45 -0700 Subject: [PATCH] Added new signal to prevent mem leak when handling in QML on gstremaer plugin. --- piomxtextures_qmlutils/piomxtextures_qmlutils.pro | 2 +- piomxtextures_qmlutils/pot_videoprobe.cpp | 11 +++++++++++ piomxtextures_qmlutils/pot_videoprobe.h | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/piomxtextures_qmlutils/piomxtextures_qmlutils.pro b/piomxtextures_qmlutils/piomxtextures_qmlutils.pro index e85b683..3d85047 100644 --- a/piomxtextures_qmlutils/piomxtextures_qmlutils.pro +++ b/piomxtextures_qmlutils/piomxtextures_qmlutils.pro @@ -28,7 +28,7 @@ DEFINES += VERSION=\\\"$$VERSION\\\" QT += quick qml multimedia CONFIG += qt plugin -QMAKE_CXXFLAGS += -std=c++11 +CONFIG += -std=c++11 INCLUDEPATH += \ $$_PRO_FILE_PWD_/../3rdparty/LightLogger \ diff --git a/piomxtextures_qmlutils/pot_videoprobe.cpp b/piomxtextures_qmlutils/pot_videoprobe.cpp index 490f6cf..00bd491 100644 --- a/piomxtextures_qmlutils/pot_videoprobe.cpp +++ b/piomxtextures_qmlutils/pot_videoprobe.cpp @@ -36,6 +36,9 @@ POT_VideoProbe::POT_VideoProbe(QObject* parent) : QVideoProbe(parent) { // Do nothing. + + connect(this, SIGNAL(videoFrameProbed(QVideoFrame)), + this, SLOT(onVideoFrameProbed(QVideoFrame))); } /*------------------------------------------------------------------------------ @@ -67,3 +70,11 @@ void POT_VideoProbe::setSource(QObject* source) emit sourceChanged(); } + +/*------------------------------------------------------------------------------ +| POT_VideoProbe::onVideoFrameProbed ++-----------------------------------------------------------------------------*/ +void POT_VideoProbe::onVideoFrameProbed(const QVideoFrame &frame) +{ + emit videoFrameDecoded(); +} diff --git a/piomxtextures_qmlutils/pot_videoprobe.h b/piomxtextures_qmlutils/pot_videoprobe.h index 18aab31..df28ba2 100644 --- a/piomxtextures_qmlutils/pot_videoprobe.h +++ b/piomxtextures_qmlutils/pot_videoprobe.h @@ -47,6 +47,10 @@ class POT_VideoProbe : public QVideoProbe signals: void sourceChanged(); + void videoFrameDecoded(); + +private slots: + void onVideoFrameProbed(const QVideoFrame& frame); private: QObject* m_source;