summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcamerasession.cpp2
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcapturesession.cpp79
-rw-r--r--src/plugins/android/src/mediacapture/qandroidcapturesession.h1
-rw-r--r--src/plugins/common/evr/evrcustompresenter.cpp2
-rw-r--r--src/plugins/directshow/camera/directshowcamerazoomcontrol.cpp2
-rw-r--r--src/plugins/directshow/player/directshowplayerservice.cpp5
-rw-r--r--src/plugins/opensles/qopenslesaudiooutput.cpp6
-rw-r--r--src/plugins/opensles/qopenslesengine.cpp13
-rw-r--r--src/plugins/windowsaudio/qwindowsaudioinput.cpp6
-rw-r--r--src/plugins/winrt/qwinrtcameracontrol.cpp16
-rw-r--r--src/plugins/winrt/qwinrtimageencodercontrol.cpp9
-rw-r--r--tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp15
-rw-r--r--tests/auto/integration/qdeclarativevideooutput/main.qml7
-rw-r--r--tests/auto/integration/qdeclarativevideooutput/qdeclarativevideooutput.pro2
-rw-r--r--tests/auto/integration/qdeclarativevideooutput/qml.qrc5
-rw-r--r--tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp21
-rw-r--r--tests/auto/integration/qdeclarativevideooutput_window/main.qml13
-rw-r--r--tests/auto/integration/qdeclarativevideooutput_window/qdeclarativevideooutput_window.pro2
-rw-r--r--tests/auto/integration/qdeclarativevideooutput_window/qml.qrc5
-rw-r--r--tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp16
-rw-r--r--tests/auto/integration/qsoundeffect/qsoundeffect.pro3
-rw-r--r--tests/auto/integration/qsoundeffect/resources.qrc8
22 files changed, 138 insertions, 100 deletions
diff --git a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp
index 15aa027e4..8ba3ed12c 100644
--- a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp
+++ b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp
@@ -64,7 +64,7 @@ QAndroidCameraSession::QAndroidCameraSession(QObject *parent)
, m_camera(0)
, m_nativeOrientation(0)
, m_videoOutput(0)
- , m_captureMode(QCamera::CaptureViewfinder)
+ , m_captureMode(QCamera::CaptureStillImage)
, m_state(QCamera::UnloadedState)
, m_savedState(-1)
, m_status(QCamera::UnloadedStatus)
diff --git a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp
index bdc7ed403..bc9bc983e 100644
--- a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp
+++ b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp
@@ -73,16 +73,41 @@ QAndroidCaptureSession::QAndroidCaptureSession(QAndroidCameraSession *cameraSess
QMediaStorageLocation::Sounds,
AndroidMultimediaUtils::getDefaultMediaDirectory(AndroidMultimediaUtils::Sounds));
- connect(this, SIGNAL(stateChanged(QMediaRecorder::State)), this, SLOT(updateStatus()));
-
if (cameraSession) {
connect(cameraSession, SIGNAL(opened()), this, SLOT(onCameraOpened()));
- connect(cameraSession, SIGNAL(statusChanged(QCamera::Status)), this, SLOT(updateStatus()));
- connect(cameraSession, SIGNAL(captureModeChanged(QCamera::CaptureModes)),
- this, SLOT(updateStatus()));
- connect(cameraSession, SIGNAL(readyForCaptureChanged(bool)), this, SLOT(updateStatus()));
+ connect(cameraSession, &QAndroidCameraSession::statusChanged, this,
+ [this](QCamera::Status status) {
+ if (status == QCamera::UnavailableStatus) {
+ setState(QMediaRecorder::StoppedState);
+ setStatus(QMediaRecorder::UnavailableStatus);
+ return;
+ }
+
+ // Stop recording when stopping the camera.
+ if (status == QCamera::StoppingStatus) {
+ setState(QMediaRecorder::StoppedState);
+ setStatus(QMediaRecorder::UnloadedStatus);
+ return;
+ }
+
+ if (status == QCamera::LoadingStatus)
+ setStatus(QMediaRecorder::LoadingStatus);
+ });
+ connect(cameraSession, &QAndroidCameraSession::captureModeChanged, this,
+ [this](QCamera::CaptureModes mode) {
+ if (!mode.testFlag(QCamera::CaptureVideo)) {
+ setState(QMediaRecorder::StoppedState);
+ setStatus(QMediaRecorder::UnloadedStatus);
+ }
+ });
+ connect(cameraSession, &QAndroidCameraSession::readyForCaptureChanged, this,
+ [this](bool ready) {
+ if (ready)
+ setStatus(QMediaRecorder::LoadedStatus);
+ });
} else {
- updateStatus();
+ // Audio-only recording.
+ setStatus(QMediaRecorder::LoadedStatus);
}
m_notifyTimer.setInterval(1000);
@@ -277,6 +302,7 @@ void QAndroidCaptureSession::start()
m_state = QMediaRecorder::RecordingState;
emit stateChanged(m_state);
+ setStatus(QMediaRecorder::RecordingStatus);
}
void QAndroidCaptureSession::stop(bool error)
@@ -315,6 +341,8 @@ void QAndroidCaptureSession::stop(bool error)
m_state = QMediaRecorder::StoppedState;
emit stateChanged(m_state);
+ if (!m_cameraSession)
+ setStatus(QMediaRecorder::LoadedStatus);
}
void QAndroidCaptureSession::setStatus(QMediaRecorder::Status status)
@@ -539,43 +567,6 @@ QAndroidCaptureSession::CaptureProfile QAndroidCaptureSession::getProfile(int id
return profile;
}
-void QAndroidCaptureSession::updateStatus()
-{
- if (m_cameraSession) {
- // Video recording
-
- // stop recording when stopping the camera
- if (m_cameraSession->status() == QCamera::StoppingStatus
- || !m_cameraSession->captureMode().testFlag(QCamera::CaptureVideo)) {
- setState(QMediaRecorder::StoppedState);
- return;
- }
-
- if (m_state == QMediaRecorder::RecordingState) {
- setStatus(QMediaRecorder::RecordingStatus);
- } else if (m_cameraSession->status() == QCamera::UnavailableStatus) {
- setStatus(QMediaRecorder::UnavailableStatus);
- } else if (m_cameraSession->captureMode().testFlag(QCamera::CaptureVideo)
- && m_cameraSession->isReadyForCapture()) {
- if (m_cameraSession->status() == QCamera::StartingStatus)
- setStatus(QMediaRecorder::LoadingStatus);
- else if (m_cameraSession->status() == QCamera::ActiveStatus)
- setStatus(QMediaRecorder::LoadedStatus);
- else
- setStatus(QMediaRecorder::UnloadedStatus);
- } else {
- setStatus(QMediaRecorder::UnloadedStatus);
- }
-
- } else {
- // Audio-only recording
- if (m_state == QMediaRecorder::RecordingState)
- setStatus(QMediaRecorder::RecordingStatus);
- else
- setStatus(QMediaRecorder::LoadedStatus);
- }
-}
-
void QAndroidCaptureSession::onError(int what, int extra)
{
Q_UNUSED(what)
diff --git a/src/plugins/android/src/mediacapture/qandroidcapturesession.h b/src/plugins/android/src/mediacapture/qandroidcapturesession.h
index 286fd1aa2..8cfb9ad2a 100644
--- a/src/plugins/android/src/mediacapture/qandroidcapturesession.h
+++ b/src/plugins/android/src/mediacapture/qandroidcapturesession.h
@@ -97,7 +97,6 @@ Q_SIGNALS:
private Q_SLOTS:
void updateDuration();
void onCameraOpened();
- void updateStatus();
void onError(int what, int extra);
void onInfo(int what, int extra);
diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp
index fdaedea7a..84786e9a9 100644
--- a/src/plugins/common/evr/evrcustompresenter.cpp
+++ b/src/plugins/common/evr/evrcustompresenter.cpp
@@ -1143,7 +1143,7 @@ HRESULT EVRCustomPresenter::flush()
sample->Release();
m_frameStep.samples.clear();
- if (m_renderState == RenderStopped) {
+ if (m_renderState == RenderStopped && m_surface->isActive()) {
// Repaint with black.
presentSample(NULL);
}
diff --git a/src/plugins/directshow/camera/directshowcamerazoomcontrol.cpp b/src/plugins/directshow/camera/directshowcamerazoomcontrol.cpp
index 209cb5d96..079976e15 100644
--- a/src/plugins/directshow/camera/directshowcamerazoomcontrol.cpp
+++ b/src/plugins/directshow/camera/directshowcamerazoomcontrol.cpp
@@ -176,7 +176,7 @@ void DirectShowCameraZoomControl::updateZoomValues()
}
// Check if there is a pending zoom value.
- if (!qFuzzyCompare(m_currentOpticalZoom, m_requestedOpticalZoom))
+ if (!qFuzzyCompare(m_currentOpticalZoom, m_requestedOpticalZoom) && !qFuzzyIsNull(m_requestedOpticalZoom))
opticalZoomToPrivate(m_requestedOpticalZoom);
}
diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp
index d48350fa2..3f7346227 100644
--- a/src/plugins/directshow/player/directshowplayerservice.cpp
+++ b/src/plugins/directshow/player/directshowplayerservice.cpp
@@ -945,7 +945,6 @@ void DirectShowPlayerService::pause()
if (m_executedTasks & Render) {
if (m_executedTasks & Stop) {
- m_atEnd = false;
if (m_seekPosition == -1) {
m_dontCacheNextSeekResult = true;
m_seekPosition = 0;
@@ -971,7 +970,8 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker)
control->Release();
if (SUCCEEDED(hr)) {
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
+ IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking);
+ if (!m_atEnd && seeking) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -980,6 +980,7 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker)
m_position = position / qt_directShowTimeScale;
} else {
m_position = 0;
+ m_atEnd = false;
}
m_executedTasks |= Pause;
diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp
index 0b1f444bd..381ce0ec2 100644
--- a/src/plugins/opensles/qopenslesaudiooutput.cpp
+++ b/src/plugins/opensles/qopenslesaudiooutput.cpp
@@ -569,6 +569,12 @@ bool QOpenSLESAudioOutput::preparePlayer()
const int lowLatencyBufferSize = QOpenSLESEngine::getLowLatencyBufferSize(m_format);
const int defaultBufferSize = QOpenSLESEngine::getDefaultBufferSize(m_format);
+ if (defaultBufferSize <= 0) {
+ qWarning() << "Unable to get minimum buffer size, returned" << defaultBufferSize;
+ setError(QAudio::FatalError);
+ return false;
+ }
+
// Buffer size
if (m_bufferSize <= 0) {
m_bufferSize = defaultBufferSize;
diff --git a/src/plugins/opensles/qopenslesengine.cpp b/src/plugins/opensles/qopenslesengine.cpp
index 1a16cc2a3..43cdcb276 100644
--- a/src/plugins/opensles/qopenslesengine.cpp
+++ b/src/plugins/opensles/qopenslesengine.cpp
@@ -239,12 +239,13 @@ int QOpenSLESEngine::getDefaultBufferSize(const QAudioFormat &format)
}();
const int sampleRate = format.sampleRate();
- return QJNIObjectPrivate::callStaticMethod<jint>("android/media/AudioTrack",
- "getMinBufferSize",
- "(III)I",
- sampleRate,
- channelConfig,
- audioFormat);
+ const int minBufferSize = QJNIObjectPrivate::callStaticMethod<jint>("android/media/AudioTrack",
+ "getMinBufferSize",
+ "(III)I",
+ sampleRate,
+ channelConfig,
+ audioFormat);
+ return minBufferSize > 0 ? minBufferSize : format.bytesForDuration(DEFAULT_PERIOD_TIME_MS);
#else
return format.bytesForDuration(DEFAULT_PERIOD_TIME_MS);
#endif // Q_OS_ANDROID
diff --git a/src/plugins/windowsaudio/qwindowsaudioinput.cpp b/src/plugins/windowsaudio/qwindowsaudioinput.cpp
index 00b36cfe4..717baaff0 100644
--- a/src/plugins/windowsaudio/qwindowsaudioinput.cpp
+++ b/src/plugins/windowsaudio/qwindowsaudioinput.cpp
@@ -74,7 +74,7 @@ QWindowsAudioInput::QWindowsAudioInput(const QByteArray &device)
waveBlockOffset = 0;
mixerID = 0;
- cachedVolume = 1.0f;
+ cachedVolume = -1.0f;
memset(&mixerLineControls, 0, sizeof(mixerLineControls));
}
@@ -228,7 +228,7 @@ qreal QWindowsAudioInput::volume() const
return detailsUnsigned.dwValue / 65535.0;
}
- return cachedVolume;
+ return qFuzzyCompare(cachedVolume, qreal(-1.0f)) ? 1.0f : cachedVolume;
}
void QWindowsAudioInput::setFormat(const QAudioFormat& fmt)
@@ -429,7 +429,7 @@ void QWindowsAudioInput::initMixer()
mixerLineControls.pamxctrl = new MIXERCONTROL[mixerLineControls.cControls];
if (mixerGetLineControls(mixerID, &mixerLineControls, MIXER_GETLINECONTROLSF_ALL) != MMSYSERR_NOERROR)
closeMixer();
- else
+ else if (!qFuzzyCompare(cachedVolume, qreal(-1.0f)))
setVolume(cachedVolume);
}
}
diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp
index c00f65624..ede3f6b04 100644
--- a/src/plugins/winrt/qwinrtcameracontrol.cpp
+++ b/src/plugins/winrt/qwinrtcameracontrol.cpp
@@ -1398,6 +1398,10 @@ HRESULT QWinRTCameraControl::onInitializationCompleted(IAsyncAction *, AsyncStat
&captureResolutions);
RETURN_HR_IF_FAILED("Failed to find a suitable video format");
+ std::sort(captureResolutions.begin(), captureResolutions.end(), [](QSize size1, QSize size2) {
+ return size1.width() * size1.height() < size2.width() * size2.height();
+ });
+
// Set capture resolutions.
d->imageEncoderControl->setSupportedResolutionsList(captureResolutions.toList());
const QSize captureResolution = d->imageEncoderControl->imageSettings().resolution();
@@ -1412,17 +1416,17 @@ HRESULT QWinRTCameraControl::onInitializationCompleted(IAsyncAction *, AsyncStat
Q_ASSERT_SUCCEEDED(hr);
// Set preview resolution.
- QVector<QSize> filtered;
+ QSize maxSize;
const float captureAspectRatio = float(captureResolution.width()) / captureResolution.height();
for (const QSize &resolution : qAsConst(previewResolutions)) {
const float aspectRatio = float(resolution.width()) / resolution.height();
- if (qAbs(aspectRatio - captureAspectRatio) <= ASPECTRATIO_EPSILON)
- filtered.append(resolution);
+ if ((qAbs(aspectRatio - captureAspectRatio) <= ASPECTRATIO_EPSILON)
+ && (maxSize.width() * maxSize.height() < resolution.width() * resolution.height())) {
+ maxSize = resolution;
+ }
}
- std::sort(filtered.begin(), filtered.end(),
- [](QSize size1, QSize size2) { return size1.width() * size1.height() < size2.width() * size2.height(); });
- const QSize &viewfinderResolution = filtered.first();
+ const QSize &viewfinderResolution = maxSize;
const quint32 viewfinderResolutionIndex = quint32(previewResolutions.indexOf(viewfinderResolution));
hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Media_MediaProperties_MediaEncodingProfile).Get(),
&d->encodingProfile);
diff --git a/src/plugins/winrt/qwinrtimageencodercontrol.cpp b/src/plugins/winrt/qwinrtimageencodercontrol.cpp
index 7ea851b77..2aed5f8a6 100644
--- a/src/plugins/winrt/qwinrtimageencodercontrol.cpp
+++ b/src/plugins/winrt/qwinrtimageencodercontrol.cpp
@@ -105,8 +105,15 @@ void QWinRTImageEncoderControl::applySettings()
if (d->imageEncoderSetting.codec().isEmpty())
d->imageEncoderSetting.setCodec(QStringLiteral("jpeg"));
+ if (d->supportedResolutions.isEmpty())
+ return;
+
QSize requestResolution = d->imageEncoderSetting.resolution();
- if (d->supportedResolutions.isEmpty() || d->supportedResolutions.contains(requestResolution))
+ if (!requestResolution.isValid()) {
+ d->imageEncoderSetting.setResolution(d->supportedResolutions.last());
+ return;
+ }
+ if (d->supportedResolutions.contains(requestResolution))
return;
// Find closest resolution from the list
diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
index b568f38fc..b8d501c12 100644
--- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
+++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp
@@ -378,7 +378,7 @@ void tst_QCameraBackend::testCameraCapture()
QTRY_VERIFY(!savedSignal.isEmpty());
- QCOMPARE(capturedSignal.size(), 1);
+ QTRY_COMPARE(capturedSignal.size(), 1);
QCOMPARE(capturedSignal.last().first().toInt(), id);
QCOMPARE(errorSignal.size(), 0);
QCOMPARE(imageCapture.error(), QCameraImageCapture::NoError);
@@ -436,7 +436,7 @@ void tst_QCameraBackend::testCaptureToBuffer()
QTRY_VERIFY(!imageAvailableSignal.isEmpty());
QVERIFY(errorSignal.isEmpty());
- QVERIFY(!capturedSignal.isEmpty());
+ QTRY_VERIFY(!capturedSignal.isEmpty());
QVERIFY(!imageAvailableSignal.isEmpty());
QTest::qWait(2000);
@@ -672,9 +672,16 @@ void tst_QCameraBackend::testVideoRecording()
QTRY_COMPARE(recorder.status(), QMediaRecorder::RecordingStatus);
QCOMPARE(recorderStatusSignal.last().first().value<QMediaRecorder::Status>(), recorder.status());
QTest::qWait(5000);
+ recorderStatusSignal.clear();
recorder.stop();
- QCOMPARE(recorder.status(), QMediaRecorder::FinalizingStatus);
- QCOMPARE(recorderStatusSignal.last().first().value<QMediaRecorder::Status>(), recorder.status());
+ bool foundFinalizingStatus = false;
+ for (auto &list : recorderStatusSignal) {
+ if (list.contains(QVariant(QMediaRecorder::FinalizingStatus))) {
+ foundFinalizingStatus = true;
+ break;
+ }
+ }
+ QVERIFY(foundFinalizingStatus);
QTRY_COMPARE(recorder.status(), QMediaRecorder::LoadedStatus);
QCOMPARE(recorderStatusSignal.last().first().value<QMediaRecorder::Status>(), recorder.status());
diff --git a/tests/auto/integration/qdeclarativevideooutput/main.qml b/tests/auto/integration/qdeclarativevideooutput/main.qml
new file mode 100644
index 000000000..e456adf6c
--- /dev/null
+++ b/tests/auto/integration/qdeclarativevideooutput/main.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+import QtMultimedia 5.0
+
+VideoOutput {
+ width: 150
+ height: 100
+}
diff --git a/tests/auto/integration/qdeclarativevideooutput/qdeclarativevideooutput.pro b/tests/auto/integration/qdeclarativevideooutput/qdeclarativevideooutput.pro
index e68e87f79..1f3a00b42 100644
--- a/tests/auto/integration/qdeclarativevideooutput/qdeclarativevideooutput.pro
+++ b/tests/auto/integration/qdeclarativevideooutput/qdeclarativevideooutput.pro
@@ -3,6 +3,8 @@ TARGET = tst_qdeclarativevideooutput
QT += multimedia-private qml testlib quick
CONFIG += testcase
+RESOURCES += qml.qrc
+
SOURCES += \
tst_qdeclarativevideooutput.cpp
diff --git a/tests/auto/integration/qdeclarativevideooutput/qml.qrc b/tests/auto/integration/qdeclarativevideooutput/qml.qrc
new file mode 100644
index 000000000..5f6483ac3
--- /dev/null
+++ b/tests/auto/integration/qdeclarativevideooutput/qml.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
index 3059a4641..5b9fdd03c 100644
--- a/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
+++ b/tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
@@ -124,7 +124,6 @@ private slots:
private:
QQmlEngine m_engine;
- QByteArray m_plainQML;
// Variables used for the mapping test
QQmlComponent *m_mappingComponent;
@@ -139,17 +138,9 @@ private:
void tst_QDeclarativeVideoOutput::initTestCase()
{
- m_plainQML = \
- "import QtQuick 2.0\n" \
- "import QtMultimedia 5.0\n" \
- "VideoOutput {" \
- " width: 150;" \
- " height: 100;" \
- "}";
-
// We initialize the mapping vars here
m_mappingComponent = new QQmlComponent(&m_engine);
- m_mappingComponent->setData(m_plainQML, QUrl());
+ m_mappingComponent->loadUrl(QUrl("qrc:/main.qml"));
m_mappingSurface = new SurfaceHolder(this);
m_mappingOutput = m_mappingComponent->create();
@@ -175,7 +166,7 @@ tst_QDeclarativeVideoOutput::tst_QDeclarativeVideoOutput()
void tst_QDeclarativeVideoOutput::fillMode()
{
QQmlComponent component(&m_engine);
- component.setData(m_plainQML, QUrl());
+ component.loadUrl(QUrl("qrc:/main.qml"));
QObject *videoOutput = component.create();
QVERIFY(videoOutput != 0);
@@ -204,7 +195,7 @@ void tst_QDeclarativeVideoOutput::fillMode()
void tst_QDeclarativeVideoOutput::flushMode()
{
QQmlComponent component(&m_engine);
- component.setData(m_plainQML, QUrl());
+ component.loadUrl(QUrl("qrc:/main.qml"));
QObject *videoOutput = component.create();
QVERIFY(videoOutput != 0);
@@ -222,7 +213,7 @@ void tst_QDeclarativeVideoOutput::flushMode()
void tst_QDeclarativeVideoOutput::orientation()
{
QQmlComponent component(&m_engine);
- component.setData(m_plainQML, QUrl());
+ component.loadUrl(QUrl("qrc:/main.qml"));
QObject *videoOutput = component.create();
QVERIFY(videoOutput != 0);
@@ -275,7 +266,7 @@ void tst_QDeclarativeVideoOutput::orientation()
void tst_QDeclarativeVideoOutput::surfaceSource()
{
QQmlComponent component(&m_engine);
- component.setData(m_plainQML, QUrl());
+ component.loadUrl(QUrl("qrc:/main.qml"));
QObject *videoOutput = component.create();
QVERIFY(videoOutput != 0);
@@ -361,7 +352,7 @@ void tst_QDeclarativeVideoOutput::surfaceSource()
void tst_QDeclarativeVideoOutput::sourceRect()
{
QQmlComponent component(&m_engine);
- component.setData(m_plainQML, QUrl());
+ component.loadUrl(QUrl("qrc:/main.qml"));
QObject *videoOutput = component.create();
QVERIFY(videoOutput != 0);
diff --git a/tests/auto/integration/qdeclarativevideooutput_window/main.qml b/tests/auto/integration/qdeclarativevideooutput_window/main.qml
new file mode 100644
index 000000000..8866be147
--- /dev/null
+++ b/tests/auto/integration/qdeclarativevideooutput_window/main.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QtMultimedia 5.0
+
+Item {
+ width: 200
+ height: 200
+ VideoOutput {
+ objectName: "videoOutput"
+ x: 25; y: 50
+ width: 150
+ height: 100
+ }
+}
diff --git a/tests/auto/integration/qdeclarativevideooutput_window/qdeclarativevideooutput_window.pro b/tests/auto/integration/qdeclarativevideooutput_window/qdeclarativevideooutput_window.pro
index 975c1d6d0..82108d220 100644
--- a/tests/auto/integration/qdeclarativevideooutput_window/qdeclarativevideooutput_window.pro
+++ b/tests/auto/integration/qdeclarativevideooutput_window/qdeclarativevideooutput_window.pro
@@ -3,6 +3,8 @@ TARGET = tst_qdeclarativevideooutput_window
QT += multimedia-private qml testlib quick
CONFIG += testcase
+RESOURCES += qml.qrc
+
SOURCES += \
tst_qdeclarativevideooutput_window.cpp
diff --git a/tests/auto/integration/qdeclarativevideooutput_window/qml.qrc b/tests/auto/integration/qdeclarativevideooutput_window/qml.qrc
new file mode 100644
index 000000000..5f6483ac3
--- /dev/null
+++ b/tests/auto/integration/qdeclarativevideooutput_window/qml.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp b/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
index dd739d0e3..645b5d3c6 100644
--- a/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
+++ b/tests/auto/integration/qdeclarativevideooutput_window/tst_qdeclarativevideooutput_window.cpp
@@ -193,22 +193,8 @@ void tst_QDeclarativeVideoOutputWindow::initTestCase()
{
qRegisterMetaType<QDeclarativeVideoOutput::FillMode>();
- const QByteArray qmlSource =
- "import QtQuick 2.0\n"
- "import QtMultimedia 5.0\n\n"
- "Item {"
- " width: 200;"
- " height: 200;"
- " VideoOutput {"
- " objectName: \"videoOutput\";"
- " x: 25; y: 50;"
- " width: 150;"
- " height: 100;"
- " }"
- "}";
-
QQmlComponent component(&m_engine);
- component.setData(qmlSource, QUrl());
+ component.loadUrl(QUrl("qrc:/main.qml"));
m_rootItem.reset(qobject_cast<QQuickItem *>(component.create()));
m_videoItem = m_rootItem->findChild<QQuickItem *>("videoOutput");
diff --git a/tests/auto/integration/qsoundeffect/qsoundeffect.pro b/tests/auto/integration/qsoundeffect/qsoundeffect.pro
index 8ec2e458a..868346a2e 100644
--- a/tests/auto/integration/qsoundeffect/qsoundeffect.pro
+++ b/tests/auto/integration/qsoundeffect/qsoundeffect.pro
@@ -14,3 +14,6 @@ unix:!mac {
}
TESTDATA += test.wav
+
+RESOURCES += \
+ resources.qrc
diff --git a/tests/auto/integration/qsoundeffect/resources.qrc b/tests/auto/integration/qsoundeffect/resources.qrc
new file mode 100644
index 000000000..24700560d
--- /dev/null
+++ b/tests/auto/integration/qsoundeffect/resources.qrc
@@ -0,0 +1,8 @@
+<RCC>
+ <qresource prefix="/">
+ <file>test.wav</file>
+ <file>test_corrupted.wav</file>
+ <file>test_tone.wav</file>
+ <file>test24.wav</file>
+ </qresource>
+</RCC>