Skip to content

Commit

Permalink
Added new signal to prevent mem leak when handling in QML on gstremae…
Browse files Browse the repository at this point in the history
…r plugin.
  • Loading branch information
carlonluca committed Jun 3, 2016
1 parent 3d58329 commit 3737e0e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion piomxtextures_qmlutils/piomxtextures_qmlutils.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
11 changes: 11 additions & 0 deletions piomxtextures_qmlutils/pot_videoprobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ POT_VideoProbe::POT_VideoProbe(QObject* parent) :
QVideoProbe(parent)
{
// Do nothing.

connect(this, SIGNAL(videoFrameProbed(QVideoFrame)),
this, SLOT(onVideoFrameProbed(QVideoFrame)));
}

/*------------------------------------------------------------------------------
Expand Down Expand Up @@ -67,3 +70,11 @@ void POT_VideoProbe::setSource(QObject* source)

emit sourceChanged();
}

/*------------------------------------------------------------------------------
| POT_VideoProbe::onVideoFrameProbed
+-----------------------------------------------------------------------------*/
void POT_VideoProbe::onVideoFrameProbed(const QVideoFrame &frame)
{
emit videoFrameDecoded();
}
4 changes: 4 additions & 0 deletions piomxtextures_qmlutils/pot_videoprobe.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3737e0e

Please sign in to comment.