summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/snippets/multimedia-snippets/audio.cpp28
-rw-r--r--examples/audiodevices/audiodevices.cpp2
-rw-r--r--examples/spectrum/app/waveform.cpp1
-rw-r--r--examples/spectrum/app/wavfile.h1
-rw-r--r--examples/videowidget/videowidgetsurface.cpp5
-rw-r--r--examples/videowidget/videowidgetsurface.h2
-rw-r--r--src/multimediawidgets/qpaintervideosurface.cpp17
-rw-r--r--src/multimediawidgets/qpaintervideosurface_mac.mm3
-rw-r--r--src/multimediawidgets/qpaintervideosurface_mac_p.h3
-rw-r--r--src/multimediawidgets/qpaintervideosurface_p.h6
-rw-r--r--src/plugins/pulseaudio/qaudioinput_pulse.cpp4
-rw-r--r--src/plugins/qt7/qt7movierenderer.mm2
-rw-r--r--tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp1
13 files changed, 39 insertions, 36 deletions
diff --git a/doc/src/snippets/multimedia-snippets/audio.cpp b/doc/src/snippets/multimedia-snippets/audio.cpp
index eb329a8d8..d25c05efa 100644
--- a/doc/src/snippets/multimedia-snippets/audio.cpp
+++ b/doc/src/snippets/multimedia-snippets/audio.cpp
@@ -114,15 +114,21 @@ void AudioInputExample::stopRecording()
void AudioInputExample::stateChanged(QAudio::State newState)
{
switch (newState) {
- case QAudio::StoppedState:
- if (audio->error() != QAudio::NoError) {
- // Error handling
- } else {
- // Finished recording
- }
- break;
-
- // ...
+ case QAudio::StoppedState:
+ if (audio->error() != QAudio::NoError) {
+ // Error handling
+ } else {
+ // Finished recording
+ }
+ break;
+
+ case QAudio::ActiveState:
+ // Started recording - read from IO device
+ break;
+
+ default:
+ // ... other cases as appropriate
+ break;
}
}
//! [Audio input state changed]
@@ -189,7 +195,9 @@ void AudioOutputExample::stateChanged(QAudio::State newState)
}
break;
- // ...
+ default:
+ // ... other cases as appropriate
+ break;
}
}
//! [Audio output state changed]
diff --git a/examples/audiodevices/audiodevices.cpp b/examples/audiodevices/audiodevices.cpp
index fb7677632..d8be77f2c 100644
--- a/examples/audiodevices/audiodevices.cpp
+++ b/examples/audiodevices/audiodevices.cpp
@@ -58,6 +58,8 @@ QString toString(QAudioFormat::SampleType sampleType)
case QAudioFormat::Float:
result = "Float";
break;
+ case QAudioFormat::Unknown:
+ result = "Unknown";
}
return result;
}
diff --git a/examples/spectrum/app/waveform.cpp b/examples/spectrum/app/waveform.cpp
index 420a01eb0..744c98063 100644
--- a/examples/spectrum/app/waveform.cpp
+++ b/examples/spectrum/app/waveform.cpp
@@ -393,6 +393,7 @@ void Waveform::paintTile(int index)
const int offset = reinterpret_cast<const char*>(ptr) - m_buffer.constData();
Q_ASSERT(offset >= 0);
Q_ASSERT(offset < m_bufferLength);
+ Q_UNUSED(offset);
const qint16 pcmValue = *ptr;
const qreal realValue = pcmToReal(pcmValue);
diff --git a/examples/spectrum/app/wavfile.h b/examples/spectrum/app/wavfile.h
index cd4988d23..eb867241d 100644
--- a/examples/spectrum/app/wavfile.h
+++ b/examples/spectrum/app/wavfile.h
@@ -51,6 +51,7 @@ class WavFile : public QFile
public:
WavFile(QObject *parent = 0);
+ using QFile::open;
bool open(const QString &fileName);
const QAudioFormat &fileFormat() const;
qint64 headerLength() const;
diff --git a/examples/videowidget/videowidgetsurface.cpp b/examples/videowidget/videowidgetsurface.cpp
index 0aafc1e2b..da94763f7 100644
--- a/examples/videowidget/videowidgetsurface.cpp
+++ b/examples/videowidget/videowidgetsurface.cpp
@@ -69,11 +69,8 @@ QList<QVideoFrame::PixelFormat> VideoWidgetSurface::supportedPixelFormats(
//! [0]
//! [1]
-bool VideoWidgetSurface::isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const
+bool VideoWidgetSurface::isFormatSupported(const QVideoSurfaceFormat &format) const
{
- Q_UNUSED(similar);
-
const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
const QSize size = format.frameSize();
diff --git a/examples/videowidget/videowidgetsurface.h b/examples/videowidget/videowidgetsurface.h
index d25399e07..ebd46ebf6 100644
--- a/examples/videowidget/videowidgetsurface.h
+++ b/examples/videowidget/videowidgetsurface.h
@@ -55,7 +55,7 @@ public:
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
- bool isFormatSupported(const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
+ bool isFormatSupported(const QVideoSurfaceFormat &format) const;
bool start(const QVideoSurfaceFormat &format);
void stop();
diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp
index c0e1c3925..672a103de 100644
--- a/src/multimediawidgets/qpaintervideosurface.cpp
+++ b/src/multimediawidgets/qpaintervideosurface.cpp
@@ -70,8 +70,7 @@ public:
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType) const;
- bool isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
+ bool isFormatSupported(const QVideoSurfaceFormat &format) const;
QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format);
void stop();
@@ -117,8 +116,7 @@ QList<QVideoFrame::PixelFormat> QVideoSurfaceGenericPainter::supportedPixelForma
return QList<QVideoFrame::PixelFormat>();
}
-bool QVideoSurfaceGenericPainter::isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
+bool QVideoSurfaceGenericPainter::isFormatSupported(const QVideoSurfaceFormat &format) const
{
switch (format.handleType()) {
case QAbstractVideoBuffer::QPixmapHandle:
@@ -246,8 +244,7 @@ public:
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType) const;
- bool isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
+ bool isFormatSupported(const QVideoSurfaceFormat &format) const;
QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame);
@@ -327,8 +324,7 @@ QList<QVideoFrame::PixelFormat> QVideoSurfaceGLPainter::supportedPixelFormats(
return QList<QVideoFrame::PixelFormat>();
}
-bool QVideoSurfaceGLPainter::isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
+bool QVideoSurfaceGLPainter::isFormatSupported(const QVideoSurfaceFormat &format) const
{
if (format.frameSize().isEmpty()) {
return false;
@@ -1349,13 +1345,12 @@ QList<QVideoFrame::PixelFormat> QPainterVideoSurface::supportedPixelFormats(
/*!
*/
-bool QPainterVideoSurface::isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const
+bool QPainterVideoSurface::isFormatSupported(const QVideoSurfaceFormat &format) const
{
if (!m_painter)
const_cast<QPainterVideoSurface *>(this)->createPainter();
- return m_painter->isFormatSupported(format, similar);
+ return m_painter->isFormatSupported(format);
}
/*!
diff --git a/src/multimediawidgets/qpaintervideosurface_mac.mm b/src/multimediawidgets/qpaintervideosurface_mac.mm
index a3c55ca4b..a741d9eea 100644
--- a/src/multimediawidgets/qpaintervideosurface_mac.mm
+++ b/src/multimediawidgets/qpaintervideosurface_mac.mm
@@ -97,8 +97,7 @@ QList<QVideoFrame::PixelFormat> QVideoSurfaceCoreGraphicsPainter::supportedPixel
: QList<QVideoFrame::PixelFormat>();
}
-bool QVideoSurfaceCoreGraphicsPainter::isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
+bool QVideoSurfaceCoreGraphicsPainter::isFormatSupported(const QVideoSurfaceFormat &format) const
{
return m_supportedHandles.contains(format.handleType())
&& m_imagePixelFormats.contains(format.pixelFormat())
diff --git a/src/multimediawidgets/qpaintervideosurface_mac_p.h b/src/multimediawidgets/qpaintervideosurface_mac_p.h
index 6f78c8f2a..6d93381ab 100644
--- a/src/multimediawidgets/qpaintervideosurface_mac_p.h
+++ b/src/multimediawidgets/qpaintervideosurface_mac_p.h
@@ -73,8 +73,7 @@ public:
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType) const;
- bool isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
+ bool isFormatSupported(const QVideoSurfaceFormat &format) const;
QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format);
void stop();
diff --git a/src/multimediawidgets/qpaintervideosurface_p.h b/src/multimediawidgets/qpaintervideosurface_p.h
index 57d4bb69a..341f940e3 100644
--- a/src/multimediawidgets/qpaintervideosurface_p.h
+++ b/src/multimediawidgets/qpaintervideosurface_p.h
@@ -82,8 +82,7 @@ public:
virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType) const = 0;
- virtual bool isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const = 0;
+ virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const = 0;
virtual QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format) = 0;
virtual void stop() = 0;
@@ -108,8 +107,7 @@ public:
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
- bool isFormatSupported(
- const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar = 0) const;
+ bool isFormatSupported(const QVideoSurfaceFormat &format) const;
bool start(const QVideoSurfaceFormat &format);
void stop();
diff --git a/src/plugins/pulseaudio/qaudioinput_pulse.cpp b/src/plugins/pulseaudio/qaudioinput_pulse.cpp
index 98925be1d..79d7b7e24 100644
--- a/src/plugins/pulseaudio/qaudioinput_pulse.cpp
+++ b/src/plugins/pulseaudio/qaudioinput_pulse.cpp
@@ -471,7 +471,7 @@ qint64 QPulseAudioInput::read(char *data, qint64 len)
if (m_pullMode) {
actualLength = m_audioSource->write(static_cast<const char *>(audioBuffer), readLength);
- if (actualLength < readLength) {
+ if (actualLength < qint64(readLength)) {
pa_threaded_mainloop_unlock(pulseEngine->mainloop());
m_errorState = QAudio::UnderrunError;
@@ -489,7 +489,7 @@ qint64 QPulseAudioInput::read(char *data, qint64 len)
qDebug() << "QPulseAudioInput::read -- wrote " << actualLength << " to client";
#endif
- if (actualLength < readLength) {
+ if (actualLength < qint64(readLength)) {
#ifdef DEBUG_PULSE
qDebug() << "QPulseAudioInput::read -- appending " << readLength - actualLength << " bytes of data to temp buffer";
#endif
diff --git a/src/plugins/qt7/qt7movierenderer.mm b/src/plugins/qt7/qt7movierenderer.mm
index 95f45f0f3..afddd4dd4 100644
--- a/src/plugins/qt7/qt7movierenderer.mm
+++ b/src/plugins/qt7/qt7movierenderer.mm
@@ -401,6 +401,8 @@ void QT7MovieRenderer::setMovie(void *movie)
setupVideoOutput();
}
+#else
+ Q_UNUSED(movie);
#endif
}
diff --git a/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp b/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp
index 40ec395f0..d76bd92d5 100644
--- a/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp
+++ b/tests/auto/unit/qmediaserviceprovider/tst_qmediaserviceprovider.cpp
@@ -112,6 +112,7 @@ public:
QList<QByteArray> devices(const QByteArray &service) const
{
+ Q_UNUSED(service);
QList<QByteArray> res;
return res;
}