Changes to media probing API.

Added flush signals.

Change-Id: I9c124317e843c9b9011e69c44649ae9a4e974161
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
This commit is contained in:
Lev Zelenskiy
2012-02-09 16:40:10 +10:00
committed by Qt by Nokia
parent 7b3d3ae453
commit 32b68f17f5
8 changed files with 56 additions and 2 deletions

View File

@@ -103,8 +103,10 @@ QVideoProbe::~QVideoProbe()
{
if (d->source) {
// Disconnect
if (d->probee)
if (d->probee) {
disconnect(d->probee.data(), SIGNAL(videoFrameProbed(QVideoFrame)), this, SIGNAL(videoFrameProbed(QVideoFrame)));
disconnect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
}
d->source.data()->service()->releaseControl(d->probee.data());
}
}
@@ -132,6 +134,7 @@ bool QVideoProbe::setSource(QMediaObject *source)
if (d->source) {
Q_ASSERT(d->probee);
disconnect(d->probee.data(), SIGNAL(videoFrameProbed(QVideoFrame)), this, SIGNAL(videoFrameProbed(QVideoFrame)));
disconnect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
d->source.data()->service()->releaseControl(d->probee.data());
d->source.clear();
d->probee.clear();
@@ -145,6 +148,7 @@ bool QVideoProbe::setSource(QMediaObject *source)
if (d->probee) {
connect(d->probee.data(), SIGNAL(videoFrameProbed(QVideoFrame)), this, SIGNAL(videoFrameProbed(QVideoFrame)));
connect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
d->source = source;
}
}
@@ -190,4 +194,18 @@ bool QVideoProbe::isActive() const
return d->probee != 0;
}
/*!
\fn QVideoProbe::videoFrameProbed(const QVideoFrame &frame)
This signal should be emitted when a video frame is processed in the
media service.
*/
/*!
\fn QVideoProbe::flush()
This signal should be emitted when it is required to release all frames.
Application must release all outstanding references to video frames.
*/
QT_END_NAMESPACE

View File

@@ -69,6 +69,7 @@ public:
Q_SIGNALS:
void videoFrameProbed(const QVideoFrame &videoFrame);
void flush();
private:
QVideoProbePrivate *d;