summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Zelenskiy <lev.zelenskiy@nokia.com>2012-02-09 16:40:10 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-10 00:57:47 +0100
commit32b68f17f59a7736de6b4928c6c97e7584e6eb6f (patch)
tree75e3eaafbcf209b7c63ad4f97022072102b3cd06
parent7b3d3ae4539185d5fa155f13c2e6f7fc7b4be0e2 (diff)
Changes to media probing API.
Added flush signals. Change-Id: I9c124317e843c9b9011e69c44649ae9a4e974161 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
-rw-r--r--src/multimedia/audio/qaudioprobe.cpp21
-rw-r--r--src/multimedia/audio/qaudioprobe.h1
-rw-r--r--src/multimedia/controls/qmediaaudioprobecontrol.cpp7
-rw-r--r--src/multimedia/controls/qmediaaudioprobecontrol.h1
-rw-r--r--src/multimedia/controls/qmediavideoprobecontrol.cpp6
-rw-r--r--src/multimedia/controls/qmediavideoprobecontrol.h1
-rw-r--r--src/multimedia/video/qvideoprobe.cpp20
-rw-r--r--src/multimedia/video/qvideoprobe.h1
8 files changed, 56 insertions, 2 deletions
diff --git a/src/multimedia/audio/qaudioprobe.cpp b/src/multimedia/audio/qaudioprobe.cpp
index 9a71b65d..d23b0d10 100644
--- a/src/multimedia/audio/qaudioprobe.cpp
+++ b/src/multimedia/audio/qaudioprobe.cpp
@@ -98,8 +98,10 @@ QAudioProbe::~QAudioProbe()
{
if (d->source) {
// Disconnect
- if (d->probee)
+ if (d->probee) {
disconnect(d->probee.data(), SIGNAL(audioBufferProbed(QAudioBuffer)), this, SIGNAL(audioBufferProbed(QAudioBuffer)));
+ disconnect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
+ }
d->source.data()->service()->releaseControl(d->probee.data());
}
}
@@ -127,6 +129,7 @@ bool QAudioProbe::setSource(QMediaObject *source)
if (d->source) {
Q_ASSERT(d->probee);
disconnect(d->probee.data(), SIGNAL(audioBufferProbed(QAudioBuffer)), this, SIGNAL(audioBufferProbed(QAudioBuffer)));
+ disconnect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
d->source.data()->service()->releaseControl(d->probee.data());
d->source.clear();
d->probee.clear();
@@ -140,6 +143,7 @@ bool QAudioProbe::setSource(QMediaObject *source)
if (d->probee) {
connect(d->probee.data(), SIGNAL(audioBufferProbed(QAudioBuffer)), this, SIGNAL(audioBufferProbed(QAudioBuffer)));
+ connect(d->probee.data(), SIGNAL(flush()), this, SIGNAL(flush()));
d->source = source;
}
}
@@ -187,4 +191,19 @@ bool QAudioProbe::isActive() const
return d->probee != 0;
}
+/*!
+ \fn QAudioProbe::audioBufferProbed(const QAudioBuffer &buffer)
+
+ This signal should be emitted when an audio buffer is processed in the
+ media service.
+*/
+
+
+/*!
+ \fn QAudioProbe::flush()
+
+ This signal should be emitted when it is required to release all buffers.
+ Application must release all outstanding references to audio buffers.
+*/
+
QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudioprobe.h b/src/multimedia/audio/qaudioprobe.h
index 6012284e..777dd79b 100644
--- a/src/multimedia/audio/qaudioprobe.h
+++ b/src/multimedia/audio/qaudioprobe.h
@@ -69,6 +69,7 @@ public:
Q_SIGNALS:
void audioBufferProbed(const QAudioBuffer &audioBuffer);
+ void flush();
private:
QAudioProbePrivate *d;
diff --git a/src/multimedia/controls/qmediaaudioprobecontrol.cpp b/src/multimedia/controls/qmediaaudioprobecontrol.cpp
index dc32cbab..3068fd30 100644
--- a/src/multimedia/controls/qmediaaudioprobecontrol.cpp
+++ b/src/multimedia/controls/qmediaaudioprobecontrol.cpp
@@ -92,6 +92,13 @@ QMediaAudioProbeControl::~QMediaAudioProbeControl()
media service.
*/
+
+/*!
+ \fn QMediaAudioProbeControl::flush()
+
+ This signal should be emitted when it is required to release all frames.
+*/
+
#include "moc_qmediaaudioprobecontrol.cpp"
QT_END_NAMESPACE
diff --git a/src/multimedia/controls/qmediaaudioprobecontrol.h b/src/multimedia/controls/qmediaaudioprobecontrol.h
index fd78002a..f5359b9a 100644
--- a/src/multimedia/controls/qmediaaudioprobecontrol.h
+++ b/src/multimedia/controls/qmediaaudioprobecontrol.h
@@ -59,6 +59,7 @@ public:
signals:
void audioBufferProbed(const QAudioBuffer &buffer);
+ void flush();
protected:
explicit QMediaAudioProbeControl(QObject *parent = 0);
diff --git a/src/multimedia/controls/qmediavideoprobecontrol.cpp b/src/multimedia/controls/qmediavideoprobecontrol.cpp
index f42e17ab..9a723c0a 100644
--- a/src/multimedia/controls/qmediavideoprobecontrol.cpp
+++ b/src/multimedia/controls/qmediavideoprobecontrol.cpp
@@ -92,6 +92,12 @@ QMediaVideoProbeControl::~QMediaVideoProbeControl()
media service.
*/
+/*!
+ \fn QMediaVideoProbeControl::flush()
+
+ This signal should be emitted when it is required to release all frames.
+*/
+
#include "moc_qmediavideoprobecontrol.cpp"
QT_END_NAMESPACE
diff --git a/src/multimedia/controls/qmediavideoprobecontrol.h b/src/multimedia/controls/qmediavideoprobecontrol.h
index 40e64d38..d2031ca4 100644
--- a/src/multimedia/controls/qmediavideoprobecontrol.h
+++ b/src/multimedia/controls/qmediavideoprobecontrol.h
@@ -61,6 +61,7 @@ public:
signals:
void videoFrameProbed(const QVideoFrame &frame);
+ void flush();
protected:
explicit QMediaVideoProbeControl(QObject *parent = 0);
diff --git a/src/multimedia/video/qvideoprobe.cpp b/src/multimedia/video/qvideoprobe.cpp
index d9d0d658..49d78c4a 100644
--- a/src/multimedia/video/qvideoprobe.cpp
+++ b/src/multimedia/video/qvideoprobe.cpp
@@ -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
diff --git a/src/multimedia/video/qvideoprobe.h b/src/multimedia/video/qvideoprobe.h
index bfc3e051..e4ba0f8d 100644
--- a/src/multimedia/video/qvideoprobe.h
+++ b/src/multimedia/video/qvideoprobe.h
@@ -69,6 +69,7 @@ public:
Q_SIGNALS:
void videoFrameProbed(const QVideoFrame &videoFrame);
+ void flush();
private:
QVideoProbePrivate *d;