diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 14:25:10 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 14:25:10 +0100 |
commit | 7610f6e9ba8b92df6d18b94fcec982064dffacbd (patch) | |
tree | 65653559c62cc451258543b87ff971371e8d8e05 | |
parent | ac6f9d27b1610356303714c3f8d2f2ab2ca5883a (diff) | |
parent | 365e05bad8c4a42a449eeef257a16c6f8faca318 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I2e4e9cca01d63ed0d1e7f71c7a58322390696036
19 files changed, 120 insertions, 112 deletions
diff --git a/src/gsttools/qgstappsrc.cpp b/src/gsttools/qgstappsrc.cpp index 90e37569b..823f95655 100644 --- a/src/gsttools/qgstappsrc.cpp +++ b/src/gsttools/qgstappsrc.cpp @@ -47,7 +47,6 @@ QGstAppSrc::QGstAppSrc(QObject *parent) ,m_appSrc(0) ,m_sequential(false) ,m_maxBytes(0) - ,m_setup(false) ,m_dataRequestSize(~0) ,m_dataRequested(false) ,m_enoughData(false) @@ -66,11 +65,13 @@ QGstAppSrc::~QGstAppSrc() bool QGstAppSrc::setup(GstElement* appsrc) { - if (m_setup || m_stream == 0 || appsrc == 0) - return false; - - if (m_appSrc) + if (m_appSrc) { gst_object_unref(G_OBJECT(m_appSrc)); + m_appSrc = 0; + } + + if (!appsrc || !m_stream) + return false; m_appSrc = GST_APP_SRC(appsrc); gst_object_ref(G_OBJECT(m_appSrc)); @@ -85,32 +86,35 @@ bool QGstAppSrc::setup(GstElement* appsrc) gst_app_src_set_stream_type(m_appSrc, m_streamType); gst_app_src_set_size(m_appSrc, (m_sequential) ? -1 : m_stream->size()); - return m_setup = true; + return true; } void QGstAppSrc::setStream(QIODevice *stream) { - if (stream == 0) - return; if (m_stream) { disconnect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); disconnect(m_stream, SIGNAL(destroyed()), this, SLOT(streamDestroyed())); + m_stream = 0; } - if (m_appSrc) + + if (m_appSrc) { gst_object_unref(G_OBJECT(m_appSrc)); + m_appSrc = 0; + } m_dataRequestSize = ~0; m_dataRequested = false; m_enoughData = false; m_forceData = false; + m_sequential = false; m_maxBytes = 0; - m_appSrc = 0; - m_stream = stream; - connect(m_stream, SIGNAL(destroyed()), SLOT(streamDestroyed())); - connect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); - m_sequential = m_stream->isSequential(); - m_setup = false; + if (stream) { + m_stream = stream; + connect(m_stream, SIGNAL(destroyed()), SLOT(streamDestroyed())); + connect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); + m_sequential = m_stream->isSequential(); + } } QIODevice *QGstAppSrc::stream() const @@ -141,7 +145,7 @@ void QGstAppSrc::streamDestroyed() void QGstAppSrc::pushDataToAppSrc() { - if (!isStreamValid() || !m_setup) + if (!isStreamValid() || !m_appSrc) return; if (m_dataRequested && !m_enoughData) { @@ -248,6 +252,9 @@ void QGstAppSrc::destroy_notify(gpointer data) void QGstAppSrc::sendEOS() { + if (!m_appSrc) + return; + gst_app_src_end_of_stream(GST_APP_SRC(m_appSrc)); if (isStreamValid() && !stream()->isSequential()) stream()->reset(); diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index 978cfd2dd..7dcbf934a 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -359,7 +359,8 @@ void PrivateSoundSource::stateChanged(QAudio::State state) #ifdef QT_QAUDIO_DEBUG qDebug() << this << "stateChanged " << state; #endif - if (state == QAudio::IdleState && m_runningCount == 0) + if ((state == QAudio::IdleState && m_runningCount == 0) + || (state == QAudio::StoppedState && m_audioOutput->error() != QAudio::NoError)) emit soundeffect->stop(); } diff --git a/src/multimedia/gsttools_headers/qgstappsrc_p.h b/src/multimedia/gsttools_headers/qgstappsrc_p.h index ec7f63e61..e50915231 100644 --- a/src/multimedia/gsttools_headers/qgstappsrc_p.h +++ b/src/multimedia/gsttools_headers/qgstappsrc_p.h @@ -71,7 +71,6 @@ public: ~QGstAppSrc(); bool setup(GstElement *); - bool isReady() const { return m_setup; } void setStream(QIODevice *); QIODevice *stream() const; @@ -110,7 +109,6 @@ private: GstAppStreamType m_streamType; GstAppSrcCallbacks m_callbacks; qint64 m_maxBytes; - bool m_setup; unsigned int m_dataRequestSize; bool m_dataRequested; bool m_enoughData; diff --git a/src/plugins/alsa/qalsaaudiooutput.cpp b/src/plugins/alsa/qalsaaudiooutput.cpp index ae4761e24..9fee690b5 100644 --- a/src/plugins/alsa/qalsaaudiooutput.cpp +++ b/src/plugins/alsa/qalsaaudiooutput.cpp @@ -657,7 +657,7 @@ void QAlsaAudioOutput::resume() } resuming = true; - deviceState = QAudio::ActiveState; + deviceState = pullMode ? QAudio::ActiveState : QAudio::IdleState; errorState = QAudio::NoError; timer->start(period_time/1000); diff --git a/src/plugins/common/evr/evrd3dpresentengine.h b/src/plugins/common/evr/evrd3dpresentengine.h index e05cf0d21..d181689ec 100644 --- a/src/plugins/common/evr/evrd3dpresentengine.h +++ b/src/plugins/common/evr/evrd3dpresentengine.h @@ -40,13 +40,14 @@ #ifndef EVRD3DPRESENTENGINE_H #define EVRD3DPRESENTENGINE_H -#include <EGL/egl.h> #include <QMutex> -#include <d3d9types.h> #include <QVideoSurfaceFormat> +#include <d3d9.h> + #if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC) -#define MAYBE_ANGLE +# include <EGL/egl.h> +# define MAYBE_ANGLE #endif QT_BEGIN_NAMESPACE diff --git a/src/plugins/coreaudio/coreaudiooutput.h b/src/plugins/coreaudio/coreaudiooutput.h index 5db102ad2..9f62cd77d 100644 --- a/src/plugins/coreaudio/coreaudiooutput.h +++ b/src/plugins/coreaudio/coreaudiooutput.h @@ -193,6 +193,7 @@ private: QTimer *m_intervalTimer; CoreAudioDeviceInfo *m_audioDeviceInfo; qreal m_cachedVolume; + bool m_pullMode; QAudio::Error m_errorCode; QAudio::State m_stateCode; diff --git a/src/plugins/coreaudio/coreaudiooutput.mm b/src/plugins/coreaudio/coreaudiooutput.mm index 80e006433..dfac44c2d 100644 --- a/src/plugins/coreaudio/coreaudiooutput.mm +++ b/src/plugins/coreaudio/coreaudiooutput.mm @@ -228,6 +228,7 @@ CoreAudioOutput::CoreAudioOutput(const QByteArray &device) , m_startTime(0) , m_audioBuffer(0) , m_cachedVolume(1.0) + , m_pullMode(false) , m_errorCode(QAudio::NoError) , m_stateCode(QAudio::StoppedState) { @@ -277,6 +278,7 @@ void CoreAudioOutput::start(QIODevice *device) m_stateCode = QAudio::ActiveState; // Start + m_pullMode = true; m_errorCode = QAudio::NoError; m_totalFrames = 0; m_startTime = CoreAudioUtils::currentTime(); @@ -302,6 +304,7 @@ QIODevice *CoreAudioOutput::start() m_stateCode = QAudio::IdleState; // Start + m_pullMode = false; m_errorCode = QAudio::NoError; m_totalFrames = 0; m_startTime = CoreAudioUtils::currentTime(); @@ -353,7 +356,7 @@ void CoreAudioOutput::resume() if (m_stateCode == QAudio::SuspendedState) { audioThreadStart(); - m_stateCode = QAudio::ActiveState; + m_stateCode = m_pullMode ? QAudio::ActiveState : QAudio::IdleState; m_errorCode = QAudio::NoError; emit stateChanged(m_stateCode); } diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp index 9784ac13a..5e00dab6f 100644 --- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp +++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp @@ -148,9 +148,6 @@ void QGstreamerAudioDecoderSession::configureAppSrcElement(GObject* object, GObj if (!self->appsrc()) return; - if (self->appsrc()->isReady()) - return; - GstElement *appsrc; g_object_get(orig, "source", &appsrc, NULL); @@ -356,9 +353,8 @@ void QGstreamerAudioDecoderSession::start() return; } - if (m_appSrc) - m_appSrc->deleteLater(); - m_appSrc = new QGstAppSrc(this); + if (!m_appSrc) + m_appSrc = new QGstAppSrc(this); m_appSrc->setStream(mDevice); g_object_set(G_OBJECT(m_playbin), "uri", "appsrc://", NULL); diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp index c11de8d07..ed07e4054 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -247,6 +247,10 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) g_signal_connect(G_OBJECT(m_playbin), "video-changed", G_CALLBACK(handleStreamsChange), this); g_signal_connect(G_OBJECT(m_playbin), "audio-changed", G_CALLBACK(handleStreamsChange), this); g_signal_connect(G_OBJECT(m_playbin), "text-changed", G_CALLBACK(handleStreamsChange), this); + +#if defined(HAVE_GST_APPSRC) + g_signal_connect(G_OBJECT(m_playbin), "deep-notify::source", G_CALLBACK(configureAppSrcElement), this); +#endif } } @@ -280,7 +284,7 @@ void QGstreamerPlayerSession::configureAppSrcElement(GObject* object, GObject *o Q_UNUSED(object); Q_UNUSED(pspec); - if (self->appsrc()->isReady()) + if (!self->appsrc()) return; GstElement *appsrc; @@ -304,16 +308,14 @@ void QGstreamerPlayerSession::loadFromStream(const QNetworkRequest &request, QIO m_lastPosition = 0; m_isPlaylist = false; - if (m_appSrc) - m_appSrc->deleteLater(); - m_appSrc = new QGstAppSrc(this); + if (!m_appSrc) + m_appSrc = new QGstAppSrc(this); m_appSrc->setStream(appSrcStream); if (m_playbin) { m_tags.clear(); emit tagsChanged(); - g_signal_connect(G_OBJECT(m_playbin), "deep-notify::source", (GCallback) &QGstreamerPlayerSession::configureAppSrcElement, (gpointer)this); g_object_set(G_OBJECT(m_playbin), "uri", "appsrc://", NULL); if (!m_streamTypes.isEmpty()) { @@ -336,6 +338,13 @@ void QGstreamerPlayerSession::loadFromUri(const QNetworkRequest &request) m_lastPosition = 0; m_isPlaylist = false; +#if defined(HAVE_GST_APPSRC) + if (m_appSrc) { + m_appSrc->deleteLater(); + m_appSrc = 0; + } +#endif + if (m_playbin) { m_tags.clear(); emit tagsChanged(); diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp index 361ed6fc7..8bf0b5602 100644 --- a/src/plugins/opensles/qopenslesaudiooutput.cpp +++ b/src/plugins/opensles/qopenslesaudiooutput.cpp @@ -254,7 +254,7 @@ void QOpenSLESAudioOutput::resume() return; } - setState(QAudio::ActiveState); + setState(m_pullMode ? QAudio::ActiveState : QAudio::IdleState); setError(QAudio::NoError); } diff --git a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp index d0e8969ae..6cc9329dd 100644 --- a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp +++ b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp @@ -561,7 +561,7 @@ void QPulseAudioOutput::resume() m_tickTimer->start(m_periodTime); - setState(QAudio::ActiveState); + setState(m_pullMode ? QAudio::ActiveState : QAudio::IdleState); setError(QAudio::NoError); } } diff --git a/src/plugins/windowsaudio/qwindowsaudioinput.cpp b/src/plugins/windowsaudio/qwindowsaudioinput.cpp index a447e6416..8d0fc8c24 100644 --- a/src/plugins/windowsaudio/qwindowsaudioinput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudioinput.cpp @@ -96,7 +96,7 @@ void QT_WIN_CALLBACK QWindowsAudioInput::waveInProc( HWAVEIN hWaveIn, UINT uMsg, if(!qAudio) return; - QMutexLocker(&qAudio->mutex); + QMutexLocker locker(&qAudio->mutex); switch(uMsg) { case WIM_OPEN: diff --git a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp index 7bbccccb3..c4bbbe85d 100644 --- a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp @@ -96,7 +96,7 @@ void CALLBACK QWindowsAudioOutput::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg, if(!qAudio) return; - QMutexLocker(&qAudio->mutex); + QMutexLocker locker(&qAudio->mutex); switch(uMsg) { case WOM_OPEN: @@ -440,7 +440,7 @@ qint64 QWindowsAudioOutput::write( const char *data, qint64 len ) void QWindowsAudioOutput::resume() { if(deviceState == QAudio::SuspendedState) { - deviceState = QAudio::ActiveState; + deviceState = pullMode ? QAudio::ActiveState : QAudio::IdleState; errorState = QAudio::NoError; waveOutRestart(hWaveOut); QTimer::singleShot(10, this, SLOT(feedback())); diff --git a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp index cf62843f7..7dd2e6557 100644 --- a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp +++ b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp @@ -86,6 +86,14 @@ struct QWinRTVideoRendererControlGlobal hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, &device, &featureLevel, &context); +#ifdef _DEBUG + if (FAILED(hr)) { + qErrnoWarning(hr, "Failed to create D3D device with device debug flag"); + hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, + featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, + &device, &featureLevel, &context); + } +#endif if (FAILED(hr)) qErrnoWarning(hr, "Failed to create D3D device"); diff --git a/src/plugins/winrt/qwinrtmediaplayercontrol.cpp b/src/plugins/winrt/qwinrtmediaplayercontrol.cpp index 7bdb586c3..a07a6b622 100644 --- a/src/plugins/winrt/qwinrtmediaplayercontrol.cpp +++ b/src/plugins/winrt/qwinrtmediaplayercontrol.cpp @@ -388,8 +388,13 @@ public: HRESULT __stdcall SetCurrentPosition(QWORD position) { qint64 pos(position); - if (pos >= d->stream->size()) - return E_INVALIDARG; + if (pos >= d->stream->size()) { + // MSDN states we should return E_INVALIDARG, but that immediately + // stops playback and does not play remaining buffers in the queue. + // For some formats this can cause losing up to 5 seconds of the + // end of the stream. + return S_FALSE; + } const bool ok = d->stream->seek(pos); return ok ? S_OK : S_FALSE; diff --git a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp index 4df73a184..5274499a5 100644 --- a/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp @@ -697,11 +697,11 @@ void tst_QAudioOutput::push() QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after receiving data"); QVERIFY2((audioOutput.error() == QAudio::NoError), "error state is not equal to QAudio::NoError after receiving data"); firstBuffer = false; + stateSignal.clear(); } } else QTest::qWait(20); } - stateSignal.clear(); // Wait until playback finishes QTest::qWait(3000); // 3 seconds should be plenty @@ -820,10 +820,10 @@ void tst_QAudioOutput::pushSuspendResume() // but not too much or the rest of the file may be processed QTest::qWait(20); - // Check that QAudioOutput immediately transitions to ActiveState + // Check that QAudioOutput immediately transitions to IdleState QVERIFY2((stateSignal.count() == 1), QString("didn't emit signal after resume(), got %1 signals instead").arg(stateSignal.count()).toLocal8Bit().constData()); - QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after resume()"); + QVERIFY2((audioOutput.state() == QAudio::IdleState), "didn't transition to IdleState after resume()"); QVERIFY2((audioOutput.error() == QAudio::NoError), "error state is not equal to QAudio::NoError after resume()"); stateSignal.clear(); @@ -832,6 +832,7 @@ void tst_QAudioOutput::pushSuspendResume() if (audioOutput.bytesFree() >= audioOutput.periodSize()) { qint64 len = audioFile->read(buffer.data(),audioOutput.periodSize()); written += feed->write(buffer.constData(), len); + QVERIFY2((audioOutput.state() == QAudio::ActiveState), "didn't transition to ActiveState after writing audio data"); } else QTest::qWait(20); } diff --git a/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml b/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml index 998a41ff2..9100cd806 100644 --- a/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml +++ b/tests/auto/integration/qml/soundeffect/tst_soundeffect.qml @@ -129,7 +129,6 @@ Item { verify(sound1.muted == false) verify(sound1.playing == false) verify(sound1.status == 1) // Status.Loading - verify(sound1.category == "") } function test_muting() { diff --git a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp index 4775a78d4..dd486a1a3 100644 --- a/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp +++ b/tests/auto/integration/qsoundeffect/tst_qsoundeffect.cpp @@ -145,8 +145,7 @@ void tst_QSoundEffect::testLooping() QCOMPARE(readSignal_Remaining.count(), 0); sound->play(); - QCOMPARE(sound->loopsRemaining(), 5); - QCOMPARE(readSignal_Remaining.count(), 1); + QVERIFY(readSignal_Remaining.count() > 0); // test.wav is about 200ms, wait until it has finished playing 5 times QTestEventLoop::instance().enterLoop(3); @@ -167,11 +166,10 @@ void tst_QSoundEffect::testLooping() QCOMPARE(readSignal_Remaining.count(), 0); sound->play(); - QCOMPARE(sound->loopsRemaining(), 30); - QCOMPARE(readSignal_Remaining.count(), 1); + QVERIFY(readSignal_Remaining.count() > 0); // wait for the sound to be played several times - QTRY_COMPARE(sound->loopsRemaining(), 20); + QTRY_VERIFY(sound->loopsRemaining() <= 20); QVERIFY(readSignal_Remaining.count() >= 10); readSignal_Count.clear(); readSignal_Remaining.clear(); diff --git a/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp b/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp index b0a7c2f73..a1d16e60b 100644 --- a/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp +++ b/tests/auto/unit/qvideowidget/tst_qvideowidget.cpp @@ -109,6 +109,17 @@ private: Q_DECLARE_METATYPE(Qt::AspectRatioMode) Q_DECLARE_METATYPE(const uchar *) +class QtTestVideoWidget : public QVideoWidget +{ +public: + QtTestVideoWidget(QWidget *parent = 0) + : QVideoWidget(parent) + { + setWindowFlags(Qt::X11BypassWindowManagerHint); + resize(320, 240); + } +}; + class QtTestWindowControl : public QVideoWindowControl { public: @@ -334,8 +345,7 @@ public: void tst_QVideoWidget::nullObject() { - QVideoWidget widget; - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); + QtTestVideoWidget widget; QVERIFY(widget.sizeHint().isEmpty()); @@ -420,11 +430,9 @@ void tst_QVideoWidget::nullService() { QtTestVideoObject object(0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); - QVERIFY(widget.sizeHint().isEmpty()); widget.show(); @@ -454,9 +462,8 @@ void tst_QVideoWidget::noOutputs() { QtTestVideoObject object(0, 0, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QVERIFY(widget.sizeHint().isEmpty()); @@ -484,9 +491,8 @@ void tst_QVideoWidget::serviceDestroyed() QtTestVideoObject object(new QtTestWindowControl, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -521,16 +527,14 @@ void tst_QVideoWidget::objectDestroyed() new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object->bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(object->testService->windowRef, 0); QCOMPARE(object->testService->widgetRef, 1); QCOMPARE(object->testService->rendererRef, 0); widget.show(); - QVERIFY(QTest::qWaitForWindowExposed(&widget)); widget.setBrightness(100); widget.setContrast(100); @@ -564,8 +568,7 @@ void tst_QVideoWidget::setMediaObject() QtTestVideoObject widgetObject(0, new QtTestWidgetControl, 0); QtTestVideoObject rendererObject(0, 0, new QtTestRendererControl); - QVideoWidget widget; - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); + QtTestVideoWidget widget; widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -617,9 +620,8 @@ void tst_QVideoWidget::showWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setNativeSize(QSize(240, 180)); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -643,9 +645,8 @@ void tst_QVideoWidget::showWidgetControl() #endif QtTestVideoObject object(0, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -667,9 +668,8 @@ void tst_QVideoWidget::showRendererControl() #endif QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -688,9 +688,8 @@ void tst_QVideoWidget::aspectRatioWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setAspectRatioMode(Qt::IgnoreAspectRatio); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); // Test the aspect ratio defaults to keeping the aspect ratio. QCOMPARE(widget.aspectRatioMode(), Qt::KeepAspectRatio); @@ -724,9 +723,8 @@ void tst_QVideoWidget::aspectRatioWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setAspectRatioMode(Qt::IgnoreAspectRatio); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); // Test the aspect ratio defaults to keeping the aspect ratio. QCOMPARE(widget.aspectRatioMode(), Qt::KeepAspectRatio); @@ -759,9 +757,8 @@ void tst_QVideoWidget::aspectRatioRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); // Test the aspect ratio defaults to keeping the aspect ratio. QCOMPARE(widget.aspectRatioMode(), Qt::KeepAspectRatio); @@ -796,9 +793,8 @@ void tst_QVideoWidget::sizeHintWindowControl() QFETCH(QSize, size); QtTestVideoObject object(new QtTestWindowControl, 0, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -817,9 +813,8 @@ void tst_QVideoWidget::sizeHintWidgetControl() QFETCH(QSize, size); QtTestVideoObject object(0, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -872,9 +867,8 @@ void tst_QVideoWidget::sizeHintRendererControl() QFETCH(QSize, expectedSize); QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -892,7 +886,7 @@ void tst_QVideoWidget::sizeHintRendererControl() void tst_QVideoWidget::fullScreenWindowControl() { QtTestVideoObject object(new QtTestWindowControl, 0, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); widget.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -977,7 +971,7 @@ void tst_QVideoWidget::fullScreenWidgetControl() #endif QtTestVideoObject object(0, new QtTestWidgetControl, 0); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); widget.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1063,7 +1057,7 @@ void tst_QVideoWidget::fullScreenRendererControl() #endif QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); widget.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1159,9 +1153,8 @@ void tst_QVideoWidget::brightnessWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setBrightness(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1204,9 +1197,8 @@ void tst_QVideoWidget::brightnessWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setBrightness(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.brightness(), 0); @@ -1243,9 +1235,8 @@ void tst_QVideoWidget::brightnessRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1270,9 +1261,8 @@ void tst_QVideoWidget::contrastWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setContrast(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.contrast(), 0); @@ -1312,9 +1302,8 @@ void tst_QVideoWidget::contrastWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setContrast(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.contrast(), 0); widget.show(); @@ -1351,9 +1340,8 @@ void tst_QVideoWidget::contrastRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1378,9 +1366,8 @@ void tst_QVideoWidget::hueWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setHue(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.hue(), 0); widget.show(); @@ -1419,9 +1406,8 @@ void tst_QVideoWidget::hueWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setHue(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.hue(), 0); widget.show(); @@ -1458,9 +1444,8 @@ void tst_QVideoWidget::hueRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1485,9 +1470,8 @@ void tst_QVideoWidget::saturationWindowControl() QtTestVideoObject object(new QtTestWindowControl, 0, 0); object.testService->windowControl->setSaturation(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.saturation(), 0); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); @@ -1525,9 +1509,8 @@ void tst_QVideoWidget::saturationWidgetControl() QtTestVideoObject object(0, new QtTestWidgetControl, 0); object.testService->widgetControl->setSaturation(controlValue); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); QCOMPARE(widget.saturation(), 0); widget.show(); @@ -1565,9 +1548,8 @@ void tst_QVideoWidget::saturationRendererControl() QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); QSignalSpy spy(&widget, SIGNAL(saturationChanged(int))); @@ -1592,9 +1574,8 @@ void tst_QVideoWidget::paintRendererControl() { QtTestVideoObject object(0, 0, new QtTestRendererControl); - QVideoWidget widget; + QtTestVideoWidget widget; object.bind(&widget); - widget.setWindowFlags(Qt::X11BypassWindowManagerHint); widget.resize(640,480); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); |