Fix some compiler warnings.
As it turns out, we had an overloaded virtual from an earlier era, with the extra parameter never used. So cleaning that up was a bonus to remove the compiler warning. Change-Id: I780287f8a5d2b0a1ec84ec62c88ba50e051f372b Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
bd9484ddca
commit
4f38f950b0
@@ -114,15 +114,21 @@ void AudioInputExample::stopRecording()
|
|||||||
void AudioInputExample::stateChanged(QAudio::State newState)
|
void AudioInputExample::stateChanged(QAudio::State newState)
|
||||||
{
|
{
|
||||||
switch (newState) {
|
switch (newState) {
|
||||||
case QAudio::StoppedState:
|
case QAudio::StoppedState:
|
||||||
if (audio->error() != QAudio::NoError) {
|
if (audio->error() != QAudio::NoError) {
|
||||||
// Error handling
|
// Error handling
|
||||||
} else {
|
} else {
|
||||||
// Finished recording
|
// Finished recording
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// ...
|
case QAudio::ActiveState:
|
||||||
|
// Started recording - read from IO device
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// ... other cases as appropriate
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//! [Audio input state changed]
|
//! [Audio input state changed]
|
||||||
@@ -189,7 +195,9 @@ void AudioOutputExample::stateChanged(QAudio::State newState)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// ...
|
default:
|
||||||
|
// ... other cases as appropriate
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//! [Audio output state changed]
|
//! [Audio output state changed]
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ QString toString(QAudioFormat::SampleType sampleType)
|
|||||||
case QAudioFormat::Float:
|
case QAudioFormat::Float:
|
||||||
result = "Float";
|
result = "Float";
|
||||||
break;
|
break;
|
||||||
|
case QAudioFormat::Unknown:
|
||||||
|
result = "Unknown";
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,6 +393,7 @@ void Waveform::paintTile(int index)
|
|||||||
const int offset = reinterpret_cast<const char*>(ptr) - m_buffer.constData();
|
const int offset = reinterpret_cast<const char*>(ptr) - m_buffer.constData();
|
||||||
Q_ASSERT(offset >= 0);
|
Q_ASSERT(offset >= 0);
|
||||||
Q_ASSERT(offset < m_bufferLength);
|
Q_ASSERT(offset < m_bufferLength);
|
||||||
|
Q_UNUSED(offset);
|
||||||
|
|
||||||
const qint16 pcmValue = *ptr;
|
const qint16 pcmValue = *ptr;
|
||||||
const qreal realValue = pcmToReal(pcmValue);
|
const qreal realValue = pcmToReal(pcmValue);
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class WavFile : public QFile
|
|||||||
public:
|
public:
|
||||||
WavFile(QObject *parent = 0);
|
WavFile(QObject *parent = 0);
|
||||||
|
|
||||||
|
using QFile::open;
|
||||||
bool open(const QString &fileName);
|
bool open(const QString &fileName);
|
||||||
const QAudioFormat &fileFormat() const;
|
const QAudioFormat &fileFormat() const;
|
||||||
qint64 headerLength() const;
|
qint64 headerLength() const;
|
||||||
|
|||||||
@@ -69,11 +69,8 @@ QList<QVideoFrame::PixelFormat> VideoWidgetSurface::supportedPixelFormats(
|
|||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
//! [1]
|
//! [1]
|
||||||
bool VideoWidgetSurface::isFormatSupported(
|
bool VideoWidgetSurface::isFormatSupported(const QVideoSurfaceFormat &format) const
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const
|
|
||||||
{
|
{
|
||||||
Q_UNUSED(similar);
|
|
||||||
|
|
||||||
const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
|
const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
|
||||||
const QSize size = format.frameSize();
|
const QSize size = format.frameSize();
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
|
|
||||||
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||||
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
|
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);
|
bool start(const QVideoSurfaceFormat &format);
|
||||||
void stop();
|
void stop();
|
||||||
|
|||||||
@@ -70,8 +70,7 @@ public:
|
|||||||
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||||
QAbstractVideoBuffer::HandleType handleType) const;
|
QAbstractVideoBuffer::HandleType handleType) const;
|
||||||
|
|
||||||
bool isFormatSupported(
|
bool isFormatSupported(const QVideoSurfaceFormat &format) const;
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
|
|
||||||
|
|
||||||
QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format);
|
QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format);
|
||||||
void stop();
|
void stop();
|
||||||
@@ -117,8 +116,7 @@ QList<QVideoFrame::PixelFormat> QVideoSurfaceGenericPainter::supportedPixelForma
|
|||||||
return QList<QVideoFrame::PixelFormat>();
|
return QList<QVideoFrame::PixelFormat>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QVideoSurfaceGenericPainter::isFormatSupported(
|
bool QVideoSurfaceGenericPainter::isFormatSupported(const QVideoSurfaceFormat &format) const
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
|
|
||||||
{
|
{
|
||||||
switch (format.handleType()) {
|
switch (format.handleType()) {
|
||||||
case QAbstractVideoBuffer::QPixmapHandle:
|
case QAbstractVideoBuffer::QPixmapHandle:
|
||||||
@@ -246,8 +244,7 @@ public:
|
|||||||
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||||
QAbstractVideoBuffer::HandleType handleType) const;
|
QAbstractVideoBuffer::HandleType handleType) const;
|
||||||
|
|
||||||
bool isFormatSupported(
|
bool isFormatSupported(const QVideoSurfaceFormat &format) const;
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
|
|
||||||
|
|
||||||
QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame);
|
QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame);
|
||||||
|
|
||||||
@@ -327,8 +324,7 @@ QList<QVideoFrame::PixelFormat> QVideoSurfaceGLPainter::supportedPixelFormats(
|
|||||||
return QList<QVideoFrame::PixelFormat>();
|
return QList<QVideoFrame::PixelFormat>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QVideoSurfaceGLPainter::isFormatSupported(
|
bool QVideoSurfaceGLPainter::isFormatSupported(const QVideoSurfaceFormat &format) const
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
|
|
||||||
{
|
{
|
||||||
if (format.frameSize().isEmpty()) {
|
if (format.frameSize().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1349,13 +1345,12 @@ QList<QVideoFrame::PixelFormat> QPainterVideoSurface::supportedPixelFormats(
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
*/
|
*/
|
||||||
bool QPainterVideoSurface::isFormatSupported(
|
bool QPainterVideoSurface::isFormatSupported(const QVideoSurfaceFormat &format) const
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const
|
|
||||||
{
|
{
|
||||||
if (!m_painter)
|
if (!m_painter)
|
||||||
const_cast<QPainterVideoSurface *>(this)->createPainter();
|
const_cast<QPainterVideoSurface *>(this)->createPainter();
|
||||||
|
|
||||||
return m_painter->isFormatSupported(format, similar);
|
return m_painter->isFormatSupported(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -97,8 +97,7 @@ QList<QVideoFrame::PixelFormat> QVideoSurfaceCoreGraphicsPainter::supportedPixel
|
|||||||
: QList<QVideoFrame::PixelFormat>();
|
: QList<QVideoFrame::PixelFormat>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QVideoSurfaceCoreGraphicsPainter::isFormatSupported(
|
bool QVideoSurfaceCoreGraphicsPainter::isFormatSupported(const QVideoSurfaceFormat &format) const
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
|
|
||||||
{
|
{
|
||||||
return m_supportedHandles.contains(format.handleType())
|
return m_supportedHandles.contains(format.handleType())
|
||||||
&& m_imagePixelFormats.contains(format.pixelFormat())
|
&& m_imagePixelFormats.contains(format.pixelFormat())
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ public:
|
|||||||
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||||
QAbstractVideoBuffer::HandleType handleType) const;
|
QAbstractVideoBuffer::HandleType handleType) const;
|
||||||
|
|
||||||
bool isFormatSupported(
|
bool isFormatSupported(const QVideoSurfaceFormat &format) const;
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
|
|
||||||
|
|
||||||
QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format);
|
QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format);
|
||||||
void stop();
|
void stop();
|
||||||
|
|||||||
@@ -82,8 +82,7 @@ public:
|
|||||||
virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||||
QAbstractVideoBuffer::HandleType handleType) const = 0;
|
QAbstractVideoBuffer::HandleType handleType) const = 0;
|
||||||
|
|
||||||
virtual bool isFormatSupported(
|
virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const = 0;
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const = 0;
|
|
||||||
|
|
||||||
virtual QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format) = 0;
|
virtual QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format) = 0;
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
@@ -108,8 +107,7 @@ public:
|
|||||||
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||||
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
|
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
|
||||||
|
|
||||||
bool isFormatSupported(
|
bool isFormatSupported(const QVideoSurfaceFormat &format) const;
|
||||||
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar = 0) const;
|
|
||||||
|
|
||||||
bool start(const QVideoSurfaceFormat &format);
|
bool start(const QVideoSurfaceFormat &format);
|
||||||
void stop();
|
void stop();
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ qint64 QPulseAudioInput::read(char *data, qint64 len)
|
|||||||
if (m_pullMode) {
|
if (m_pullMode) {
|
||||||
actualLength = m_audioSource->write(static_cast<const char *>(audioBuffer), readLength);
|
actualLength = m_audioSource->write(static_cast<const char *>(audioBuffer), readLength);
|
||||||
|
|
||||||
if (actualLength < readLength) {
|
if (actualLength < qint64(readLength)) {
|
||||||
pa_threaded_mainloop_unlock(pulseEngine->mainloop());
|
pa_threaded_mainloop_unlock(pulseEngine->mainloop());
|
||||||
|
|
||||||
m_errorState = QAudio::UnderrunError;
|
m_errorState = QAudio::UnderrunError;
|
||||||
@@ -489,7 +489,7 @@ qint64 QPulseAudioInput::read(char *data, qint64 len)
|
|||||||
qDebug() << "QPulseAudioInput::read -- wrote " << actualLength << " to client";
|
qDebug() << "QPulseAudioInput::read -- wrote " << actualLength << " to client";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (actualLength < readLength) {
|
if (actualLength < qint64(readLength)) {
|
||||||
#ifdef DEBUG_PULSE
|
#ifdef DEBUG_PULSE
|
||||||
qDebug() << "QPulseAudioInput::read -- appending " << readLength - actualLength << " bytes of data to temp buffer";
|
qDebug() << "QPulseAudioInput::read -- appending " << readLength - actualLength << " bytes of data to temp buffer";
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -401,6 +401,8 @@ void QT7MovieRenderer::setMovie(void *movie)
|
|||||||
|
|
||||||
setupVideoOutput();
|
setupVideoOutput();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
Q_UNUSED(movie);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ public:
|
|||||||
|
|
||||||
QList<QByteArray> devices(const QByteArray &service) const
|
QList<QByteArray> devices(const QByteArray &service) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(service);
|
||||||
QList<QByteArray> res;
|
QList<QByteArray> res;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user