summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qtmultimedia.pro2
-rw-r--r--src/imports/multimedia/qdeclarativeplaylist.cpp3
-rw-r--r--src/multimedia/audio/qsoundeffect_pulse_p.cpp61
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp13
-rw-r--r--src/plugins/pulseaudio/qpulseaudioengine.cpp65
-rw-r--r--tests/auto/integration/qaudiooutput/BLACKLIST8
-rw-r--r--tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp7
7 files changed, 110 insertions, 49 deletions
diff --git a/qtmultimedia.pro b/qtmultimedia.pro
index 98bb3152f..a49700d16 100644
--- a/qtmultimedia.pro
+++ b/qtmultimedia.pro
@@ -33,7 +33,7 @@ win32 {
}
qtCompileTest(resourcepolicy)
- qtCompileTest(gpu_vivante)
+ contains(QT_CONFIG, opengles2):qtCompileTest(gpu_vivante)
}
load(qt_parts)
diff --git a/src/imports/multimedia/qdeclarativeplaylist.cpp b/src/imports/multimedia/qdeclarativeplaylist.cpp
index b338c33e5..e8df8c376 100644
--- a/src/imports/multimedia/qdeclarativeplaylist.cpp
+++ b/src/imports/multimedia/qdeclarativeplaylist.cpp
@@ -94,9 +94,6 @@ void QDeclarativePlaylistItem::setSource(const QUrl &source)
item's source URL can be accessed using the \c source role.
\qml
- import QtQuick 2.0
- import QtMultimedia 5.6
-
Item {
width: 400;
height: 300;
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
index 6e4aadd0b..fcf4fee35 100644
--- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
@@ -443,7 +443,11 @@ void QSoundEffectPrivate::setSource(const QUrl &url)
if (m_pulseStream && !pa_stream_is_corked(m_pulseStream)) {
pa_stream_set_write_callback(m_pulseStream, 0, 0);
pa_stream_set_underflow_callback(m_pulseStream, 0, 0);
- pa_operation_unref(pa_stream_cork(m_pulseStream, 1, 0, 0));
+ pa_operation *op = pa_stream_cork(m_pulseStream, 1, 0, 0);
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to cork stream");
}
setPlaying(false);
@@ -625,7 +629,11 @@ void QSoundEffectPrivate::emptyStream(EmptyStreamOptions options)
m_emptying = true;
pa_stream_set_write_callback(m_pulseStream, 0, 0);
pa_stream_set_underflow_callback(m_pulseStream, 0, 0);
- pa_operation_unref(pa_stream_flush(m_pulseStream, flushCompleteCb, m_ref->getRef()));
+ pa_operation *op = pa_stream_flush(m_pulseStream, flushCompleteCb, m_ref->getRef());
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to flush stream");
}
void QSoundEffectPrivate::emptyComplete(void *stream, bool reload)
@@ -637,8 +645,13 @@ void QSoundEffectPrivate::emptyComplete(void *stream, bool reload)
m_emptying = false;
- if ((pa_stream *)stream == m_pulseStream)
- pa_operation_unref(pa_stream_cork(m_pulseStream, 1, reload ? stream_cork_callback : 0, m_ref->getRef()));
+ if ((pa_stream *)stream == m_pulseStream) {
+ pa_operation *op = pa_stream_cork(m_pulseStream, 1, reload ? stream_cork_callback : 0, m_ref->getRef());
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to cork stream");
+ }
}
void QSoundEffectPrivate::sampleReady()
@@ -672,7 +685,11 @@ void QSoundEffectPrivate::sampleReady()
pa_buffer_attr newBufferAttr;
newBufferAttr = *bufferAttr;
newBufferAttr.prebuf = m_sample->data().size();
- pa_operation_unref(pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, m_ref->getRef()));
+ pa_operation *op = pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, m_ref->getRef());
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute");
} else {
streamReady();
}
@@ -685,12 +702,20 @@ void QSoundEffectPrivate::sampleReady()
newBufferAttr.minreq = bufferAttr->tlength / 2;
newBufferAttr.prebuf = -1;
newBufferAttr.fragsize = -1;
- pa_operation_unref(pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_reset_buffer_callback, m_ref->getRef()));
+ pa_operation *op = pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_reset_buffer_callback, m_ref->getRef());
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute");
} else if (bufferAttr->prebuf > uint32_t(m_sample->data().size())) {
pa_buffer_attr newBufferAttr;
newBufferAttr = *bufferAttr;
newBufferAttr.prebuf = m_sample->data().size();
- pa_operation_unref(pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, m_ref->getRef()));
+ pa_operation *op = pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, m_ref->getRef());
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute");
} else {
streamReady();
}
@@ -995,7 +1020,11 @@ void QSoundEffectPrivate::stream_state_callback(pa_stream *s, void *userdata)
pa_buffer_attr newBufferAttr;
newBufferAttr = *bufferAttr;
newBufferAttr.prebuf = self->m_sample->data().size();
- pa_stream_set_buffer_attr(self->m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, self->m_ref->getRef());
+ pa_operation *op = pa_stream_set_buffer_attr(self->m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, self->m_ref->getRef());
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute");
} else {
QMetaObject::invokeMethod(self, "streamReady", Qt::QueuedConnection);
}
@@ -1032,7 +1061,7 @@ void QSoundEffectPrivate::stream_reset_buffer_callback(pa_stream *s, int success
return;
if (!success)
- qWarning("QSoundEffect(pulseaudio): faild to reset buffer attribute");
+ qWarning("QSoundEffect(pulseaudio): failed to reset buffer attribute");
#ifdef QT_PA_DEBUG
qDebug() << self << "stream_reset_buffer_callback";
#endif
@@ -1042,7 +1071,11 @@ void QSoundEffectPrivate::stream_reset_buffer_callback(pa_stream *s, int success
pa_buffer_attr newBufferAttr;
newBufferAttr = *bufferAttr;
newBufferAttr.prebuf = self->m_sample->data().size();
- pa_stream_set_buffer_attr(self->m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, userdata);
+ pa_operation *op = pa_stream_set_buffer_attr(self->m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, userdata);
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute");
} else {
QMetaObject::invokeMethod(self, "streamReady", Qt::QueuedConnection);
}
@@ -1061,7 +1094,7 @@ void QSoundEffectPrivate::stream_adjust_prebuffer_callback(pa_stream *s, int suc
return;
if (!success)
- qWarning("QSoundEffect(pulseaudio): faild to adjust pre-buffer attribute");
+ qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute");
#ifdef QT_PA_DEBUG
qDebug() << self << "stream_adjust_prebuffer_callback";
#endif
@@ -1096,7 +1129,7 @@ void QSoundEffectPrivate::stream_cork_callback(pa_stream *s, int success, void *
return;
if (!success)
- qWarning("QSoundEffect(pulseaudio): faild to stop");
+ qWarning("QSoundEffect(pulseaudio): failed to stop");
#ifdef QT_PA_DEBUG
qDebug() << self << "stream_cork_callback";
#endif
@@ -1116,7 +1149,7 @@ void QSoundEffectPrivate::stream_flush_callback(pa_stream *s, int success, void
return;
if (!success)
- qWarning("QSoundEffect(pulseaudio): faild to drain");
+ qWarning("QSoundEffect(pulseaudio): failed to drain");
QMetaObject::invokeMethod(self, "emptyComplete", Qt::QueuedConnection, Q_ARG(void*, s), Q_ARG(bool, false));
}
@@ -1134,7 +1167,7 @@ void QSoundEffectPrivate::stream_flush_reload_callback(pa_stream *s, int success
return;
if (!success)
- qWarning("QSoundEffect(pulseaudio): faild to drain");
+ qWarning("QSoundEffect(pulseaudio): failed to drain");
QMetaObject::invokeMethod(self, "emptyComplete", Qt::QueuedConnection, Q_ARG(void*, s), Q_ARG(bool, true));
}
diff --git a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
index b810e2b02..2d3c7c2ea 100644
--- a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
@@ -66,8 +66,19 @@ QMediaService* CameraBinServicePlugin::create(const QString &key)
{
QGstUtils::initializeGst();
- if (key == QLatin1String(Q_MEDIASERVICE_CAMERA))
+ if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) {
+ if (!CameraBinService::isCameraBinAvailable()) {
+ guint major, minor, micro, nano;
+ gst_version(&major, &minor, &micro, &nano);
+ qWarning("Error: cannot create camera service, the 'camerabin' plugin is missing for "
+ "GStreamer %u.%u."
+ "\nPlease install the 'bad' GStreamer plugin package.",
+ major, minor);
+ return Q_NULLPTR;
+ }
+
return new CameraBinService(sourceFactory());
+ }
qWarning() << "Gstreamer camerabin service plugin: unsupported key:" << key;
return 0;
diff --git a/src/plugins/pulseaudio/qpulseaudioengine.cpp b/src/plugins/pulseaudio/qpulseaudioengine.cpp
index 286f310bc..41aba378a 100644
--- a/src/plugins/pulseaudio/qpulseaudioengine.cpp
+++ b/src/plugins/pulseaudio/qpulseaudioengine.cpp
@@ -176,15 +176,30 @@ static void event_cb(pa_context* context, pa_subscription_event_type_t t, uint32
case PA_SUBSCRIPTION_EVENT_NEW:
case PA_SUBSCRIPTION_EVENT_CHANGE:
switch (facility) {
- case PA_SUBSCRIPTION_EVENT_SERVER:
- pa_operation_unref(pa_context_get_server_info(context, serverInfoCallback, userdata));
+ case PA_SUBSCRIPTION_EVENT_SERVER: {
+ pa_operation *op = pa_context_get_server_info(context, serverInfoCallback, userdata);
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("PulseAudioService: failed to get server info");
break;
- case PA_SUBSCRIPTION_EVENT_SINK:
- pa_operation_unref(pa_context_get_sink_info_by_index(context, index, sinkInfoCallback, userdata));
+ }
+ case PA_SUBSCRIPTION_EVENT_SINK: {
+ pa_operation *op = pa_context_get_sink_info_by_index(context, index, sinkInfoCallback, userdata);
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("PulseAudioService: failed to get sink info");
break;
- case PA_SUBSCRIPTION_EVENT_SOURCE:
- pa_operation_unref(pa_context_get_source_info_by_index(context, index, sourceInfoCallback, userdata));
+ }
+ case PA_SUBSCRIPTION_EVENT_SOURCE: {
+ pa_operation *op = pa_context_get_source_info_by_index(context, index, sourceInfoCallback, userdata);
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("PulseAudioService: failed to get source info");
break;
+ }
default:
break;
}
@@ -334,11 +349,15 @@ void QPulseAudioEngine::prepare()
pa_context_set_state_callback(m_context, contextStateCallback, this);
pa_context_set_subscribe_callback(m_context, event_cb, this);
- pa_operation_unref(pa_context_subscribe(m_context,
+ pa_operation *op = pa_context_subscribe(m_context,
pa_subscription_mask_t(PA_SUBSCRIPTION_MASK_SINK |
PA_SUBSCRIPTION_MASK_SOURCE |
PA_SUBSCRIPTION_MASK_SERVER),
- NULL, NULL));
+ NULL, NULL);
+ if (op)
+ pa_operation_unref(op);
+ else
+ qWarning("PulseAudioService: failed to subscribe to context notifications");
} else {
pa_context_unref(m_context);
m_context = 0;
@@ -382,21 +401,33 @@ void QPulseAudioEngine::updateDevices()
// Get default input and output devices
pa_operation *operation = pa_context_get_server_info(m_context, serverInfoCallback, this);
- while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING)
- pa_threaded_mainloop_wait(m_mainLoop);
- pa_operation_unref(operation);
+ if (operation) {
+ while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING)
+ pa_threaded_mainloop_wait(m_mainLoop);
+ pa_operation_unref(operation);
+ } else {
+ qWarning("PulseAudioService: failed to get server info");
+ }
// Get output devices
operation = pa_context_get_sink_info_list(m_context, sinkInfoCallback, this);
- while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING)
- pa_threaded_mainloop_wait(m_mainLoop);
- pa_operation_unref(operation);
+ if (operation) {
+ while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING)
+ pa_threaded_mainloop_wait(m_mainLoop);
+ pa_operation_unref(operation);
+ } else {
+ qWarning("PulseAudioService: failed to get sink info");
+ }
// Get input devices
operation = pa_context_get_source_info_list(m_context, sourceInfoCallback, this);
- while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING)
- pa_threaded_mainloop_wait(m_mainLoop);
- pa_operation_unref(operation);
+ if (operation) {
+ while (pa_operation_get_state(operation) == PA_OPERATION_RUNNING)
+ pa_threaded_mainloop_wait(m_mainLoop);
+ pa_operation_unref(operation);
+ } else {
+ qWarning("PulseAudioService: failed to get source info");
+ }
unlock();
}
diff --git a/tests/auto/integration/qaudiooutput/BLACKLIST b/tests/auto/integration/qaudiooutput/BLACKLIST
deleted file mode 100644
index e6cd7c846..000000000
--- a/tests/auto/integration/qaudiooutput/BLACKLIST
+++ /dev/null
@@ -1,8 +0,0 @@
-#QTBUG-52673
-[pullSuspendResume]
-redhatenterpriselinuxworkstation-6.6
-rhel-7.1
-ubuntu-14.04
-opensuse-13.1 64bit
-opensuse-42.1
-rhel-7.2
diff --git a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp
index fbbd9c731..ca1f2b67e 100644
--- a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp
+++ b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp
@@ -605,9 +605,6 @@ void tst_QAudioOutput::pullSuspendResume()
audioOutput.resume();
- // Give backends running in separate threads a chance to suspend.
- QTest::qWait(100);
-
// Check that QAudioOutput immediately transitions to ActiveState
QVERIFY2((stateSignal.count() == 1),
QString("didn't emit signal after resume(), got %1 signals instead").arg(stateSignal.count()).toLocal8Bit().constData());
@@ -619,8 +616,8 @@ void tst_QAudioOutput::pullSuspendResume()
QTest::qWait(3000); // 3 seconds should be plenty
QVERIFY2(audioFile->atEnd(), "didn't play to EOF");
- QVERIFY2((stateSignal.count() == 1),
- QString("didn't emit IdleState signal when at EOF, got %1 signals instead").arg(stateSignal.count()).toLocal8Bit().constData());
+ QVERIFY(stateSignal.count() > 0);
+ QCOMPARE(qvariant_cast<QAudio::State>(stateSignal.last().at(0)), QAudio::IdleState);
QVERIFY2((audioOutput.state() == QAudio::IdleState), "didn't transitions to IdleState when at EOF");
stateSignal.clear();