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]
}
break;
- // ...
+ default:
+ // ... other cases as appropriate
+ break;
}
}
//! [Audio output state changed]
case QAudioFormat::Float:
result = "Float";
break;
+ case QAudioFormat::Unknown:
+ result = "Unknown";
}
return result;
}
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);
public:
WavFile(QObject *parent = 0);
+ using QFile::open;
bool open(const QString &fileName);
const QAudioFormat &fileFormat() const;
qint64 headerLength() const;
//! [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();
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();
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();
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:
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);
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;
/*!
*/
-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);
}
/*!
: 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())
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();
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;
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();
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;
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
setupVideoOutput();
}
+#else
+ Q_UNUSED(movie);
#endif
}
QList<QByteArray> devices(const QByteArray &service) const
{
+ Q_UNUSED(service);
QList<QByteArray> res;
return res;
}