summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--examples/multimedia/audiodevices/audiodevices.cpp2
-rw-r--r--examples/multimedia/audioinput/audioinput.cpp4
-rw-r--r--examples/multimedia/audiooutput/audiooutput.cpp4
-rw-r--r--src/gsttools/gsttools.pro9
-rw-r--r--src/gsttools/qgstreamermirtexturerenderer.cpp357
-rw-r--r--src/gsttools/qgstreamermirtexturerenderer_p.h119
-rw-r--r--src/multimedia/video/qvideosurfaceformat.cpp12
-rw-r--r--src/multimediawidgets/qvideowidget.cpp4
-rw-r--r--src/multimediawidgets/qvideowidget.h4
-rw-r--r--src/plugins/gstreamer/camerabin/camerabincontrol.cpp2
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp10
-rw-r--r--tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp4
-rw-r--r--tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp4
14 files changed, 25 insertions, 512 deletions
diff --git a/.qmake.conf b/.qmake.conf
index f8cda0e7d..db2e0b653 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,3 +1,3 @@
load(qt_build_config)
-MODULE_VERSION = 5.13.0
+MODULE_VERSION = 5.14.0
diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp
index 468dbc659..52ff2176a 100644
--- a/examples/multimedia/audiodevices/audiodevices.cpp
+++ b/examples/multimedia/audiodevices/audiodevices.cpp
@@ -150,7 +150,7 @@ void AudioTest::modeChanged(int idx)
deviceBox->clear();
const QAudio::Mode mode = idx == 0 ? QAudio::AudioInput : QAudio::AudioOutput;
for (auto &deviceInfo: QAudioDeviceInfo::availableDevices(mode))
- deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));
+ deviceBox->addItem(deviceInfo.deviceName(), QVariant::fromValue(deviceInfo));
deviceBox->setCurrentIndex(0);
deviceChanged(0);
diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp
index ec6088780..86da20d51 100644
--- a/examples/multimedia/audioinput/audioinput.cpp
+++ b/examples/multimedia/audioinput/audioinput.cpp
@@ -239,10 +239,10 @@ void InputTest::initializeWindow()
m_deviceBox = new QComboBox(this);
const QAudioDeviceInfo &defaultDeviceInfo = QAudioDeviceInfo::defaultInputDevice();
- m_deviceBox->addItem(defaultDeviceInfo.deviceName(), qVariantFromValue(defaultDeviceInfo));
+ m_deviceBox->addItem(defaultDeviceInfo.deviceName(), QVariant::fromValue(defaultDeviceInfo));
for (auto &deviceInfo: QAudioDeviceInfo::availableDevices(QAudio::AudioInput)) {
if (deviceInfo != defaultDeviceInfo)
- m_deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));
+ m_deviceBox->addItem(deviceInfo.deviceName(), QVariant::fromValue(deviceInfo));
}
connect(m_deviceBox, QOverload<int>::of(&QComboBox::activated), this, &InputTest::deviceChanged);
diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp
index 229727422..69b4470be 100644
--- a/examples/multimedia/audiooutput/audiooutput.cpp
+++ b/examples/multimedia/audiooutput/audiooutput.cpp
@@ -169,10 +169,10 @@ void AudioTest::initializeWindow()
m_deviceBox = new QComboBox(this);
const QAudioDeviceInfo &defaultDeviceInfo = QAudioDeviceInfo::defaultOutputDevice();
- m_deviceBox->addItem(defaultDeviceInfo.deviceName(), qVariantFromValue(defaultDeviceInfo));
+ m_deviceBox->addItem(defaultDeviceInfo.deviceName(), QVariant::fromValue(defaultDeviceInfo));
for (auto &deviceInfo: QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
if (deviceInfo != defaultDeviceInfo)
- m_deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));
+ m_deviceBox->addItem(deviceInfo.deviceName(), QVariant::fromValue(deviceInfo));
}
connect(m_deviceBox, QOverload<int>::of(&QComboBox::activated), this, &AudioTest::deviceChanged);
layout->addWidget(m_deviceBox);
diff --git a/src/gsttools/gsttools.pro b/src/gsttools/gsttools.pro
index b13479ce7..d161fff85 100644
--- a/src/gsttools/gsttools.pro
+++ b/src/gsttools/gsttools.pro
@@ -82,15 +82,6 @@ qtConfig(gstreamer_0_10) {
qgstvideorenderersink.cpp
}
-qtConfig(mirclient): {
- qtConfig(opengles2):qtHaveModule(widgets) {
- PRIVATE_HEADERS += qgstreamermirtexturerenderer_p.h
- SOURCES += qgstreamermirtexturerenderer.cpp
- QT += opengl quick
- LIBS += -lEGL
- }
-}
-
qtConfig(gstreamer_app) {
QMAKE_USE += gstreamer_app
PRIVATE_HEADERS += qgstappsrc_p.h
diff --git a/src/gsttools/qgstreamermirtexturerenderer.cpp b/src/gsttools/qgstreamermirtexturerenderer.cpp
deleted file mode 100644
index 35050db03..000000000
--- a/src/gsttools/qgstreamermirtexturerenderer.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgstreamermirtexturerenderer_p.h"
-
-#include <qgstreamerplayersession.h>
-#include <private/qvideosurfacegstsink_p.h>
-#include <private/qgstutils_p.h>
-#include <qabstractvideosurface.h>
-
-#include <QAbstractVideoBuffer>
-#include <QGuiApplication>
-#include <QDebug>
-#include <QtQuick/QQuickWindow>
-#include <QOpenGLContext>
-#include <QGLContext>
-#include <QGuiApplication>
-#include <qgl.h>
-
-#include <gst/gst.h>
-
-static QGstreamerMirTextureRenderer *rendererInstance = NULL;
-
-class QGstreamerMirTextureBuffer : public QAbstractVideoBuffer
-{
-public:
- QGstreamerMirTextureBuffer(GLuint textureId) :
- QAbstractVideoBuffer(QAbstractVideoBuffer::GLTextureHandle),
- m_textureId(textureId)
- {
- }
-
- MapMode mapMode() const { return NotMapped; }
-
- uchar *map(MapMode mode, int *numBytes, int *bytesPerLine)
- {
- qDebug() << Q_FUNC_INFO;
- Q_UNUSED(mode);
- Q_UNUSED(numBytes);
- Q_UNUSED(bytesPerLine);
-
- return NULL;
- }
-
- void unmap() { qDebug() << Q_FUNC_INFO; }
-
- QVariant handle() const { return QVariant::fromValue<unsigned int>(m_textureId); }
-
- GLuint textureId() { return m_textureId; }
-
-private:
- GLuint m_textureId;
-};
-
-QGstreamerMirTextureRenderer::QGstreamerMirTextureRenderer(QObject *parent
- , const QGstreamerPlayerSession *playerSession)
- : QVideoRendererControl(0), m_videoSink(0), m_surface(0),
- m_glSurface(0),
- m_context(0),
- m_glContext(0),
- m_textureId(0),
- m_offscreenSurface(0),
- m_textureBuffer(0)
-{
- Q_UNUSED(parent);
- setPlayerSession(playerSession);
-}
-
-QGstreamerMirTextureRenderer::~QGstreamerMirTextureRenderer()
-{
- if (m_videoSink)
- gst_object_unref(GST_OBJECT(m_videoSink));
-
- delete m_glContext;
- delete m_offscreenSurface;
-}
-
-GstElement *QGstreamerMirTextureRenderer::videoSink()
-{
- qDebug() << Q_FUNC_INFO;
-
- // FIXME: Ugly hack until I figure out why passing this segfaults in the g_signal handler
- rendererInstance = const_cast<QGstreamerMirTextureRenderer*>(this);
-
- if (!m_videoSink && m_surface) {
- qDebug() << Q_FUNC_INFO << ": using mirsink, (this: " << this << ")";
-
- m_videoSink = gst_element_factory_make("mirsink", "video-output");
-
- connect(QGuiApplication::instance(), SIGNAL(focusWindowChanged(QWindow*)),
- this, SLOT(handleFocusWindowChanged(QWindow*)), Qt::QueuedConnection);
-
- g_signal_connect(G_OBJECT(m_videoSink), "frame-ready", G_CALLBACK(handleFrameReady),
- (gpointer)this);
- }
-
- if (m_videoSink) {
- gst_object_ref_sink(GST_OBJECT(m_videoSink));
-
- GstPad *pad = gst_element_get_static_pad(m_videoSink, "sink");
- gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_BUFFER,
- padBufferProbe, this, NULL);
- }
-
- return m_videoSink;
-}
-
-QWindow *QGstreamerMirTextureRenderer::createOffscreenWindow(const QSurfaceFormat &format)
-{
- QWindow *w = new QWindow();
- w->setSurfaceType(QWindow::OpenGLSurface);
- w->setFormat(format);
- w->setGeometry(0, 0, 1, 1);
- w->setFlags(w->flags() | Qt::WindowTransparentForInput);
- w->create();
-
- return w;
-}
-
-void QGstreamerMirTextureRenderer::handleFrameReady(gpointer userData)
-{
- QGstreamerMirTextureRenderer *renderer = reinterpret_cast<QGstreamerMirTextureRenderer*>(userData);
-#if 1
- QMutexLocker locker(&rendererInstance->m_mutex);
- QMetaObject::invokeMethod(rendererInstance, "renderFrame", Qt::QueuedConnection);
-#else
- // FIXME!
- //QMutexLocker locker(&renderer->m_mutex);
- QMetaObject::invokeMethod(renderer, "renderFrame", Qt::QueuedConnection);
-#endif
-}
-
-void QGstreamerMirTextureRenderer::renderFrame()
-{
- //qDebug() << Q_FUNC_INFO;
-
- if (m_context)
- m_context->makeCurrent();
-
- GstState pendingState = GST_STATE_NULL;
- GstState newState = GST_STATE_NULL;
- // Don't block and return immediately:
- GstStateChangeReturn ret = gst_element_get_state(m_videoSink, &newState,
- &pendingState, 0);
- if (ret == GST_STATE_CHANGE_FAILURE || newState == GST_STATE_NULL||
- pendingState == GST_STATE_NULL) {
- qWarning() << "Invalid state change for renderer, aborting";
- stopRenderer();
- return;
- }
-
- if (!m_surface->isActive()) {
- qDebug() << "m_surface is not active";
- GstPad *pad = gst_element_get_static_pad(m_videoSink, "sink");
- GstCaps *caps = gst_pad_get_current_caps(pad);
-
- if (caps) {
- // Get the native video size from the video sink
- QSize newNativeSize = QGstUtils::capsCorrectedResolution(caps);
- if (m_nativeSize != newNativeSize) {
- m_nativeSize = newNativeSize;
- emit nativeSizeChanged();
- }
- gst_caps_unref(caps);
- }
-
- // Start the surface
- QVideoSurfaceFormat format(m_nativeSize, QVideoFrame::Format_RGB32, QAbstractVideoBuffer::GLTextureHandle);
- qDebug() << "m_nativeSize: " << m_nativeSize;
- qDebug() << "format: " << format;
- if (!m_surface->start(format)) {
- qWarning() << Q_FUNC_INFO << ": failed to start the video surface " << format;
- return;
- }
- }
-
- QGstreamerMirTextureBuffer *buffer = new QGstreamerMirTextureBuffer(m_textureId);
- //qDebug() << "frameSize: " << m_surface->surfaceFormat().frameSize();
- QVideoFrame frame(buffer, m_surface->surfaceFormat().frameSize(),
- m_surface->surfaceFormat().pixelFormat());
-
- frame.setMetaData("TextureId", m_textureId);
-
- // Display the video frame on the surface:
- m_surface->present(frame);
-}
-
-GstPadProbeReturn QGstreamerMirTextureRenderer::padBufferProbe(GstPad *pad, GstPadProbeInfo *info, gpointer userData)
-{
- Q_UNUSED(pad);
- Q_UNUSED(info);
-
- QGstreamerMirTextureRenderer *control = reinterpret_cast<QGstreamerMirTextureRenderer*>(userData);
- QMetaObject::invokeMethod(control, "updateNativeVideoSize", Qt::QueuedConnection);
-
- return GST_PAD_PROBE_REMOVE;
-}
-
-void QGstreamerMirTextureRenderer::stopRenderer()
-{
- if (m_surface)
- m_surface->stop();
-}
-
-QAbstractVideoSurface *QGstreamerMirTextureRenderer::surface() const
-{
- return m_surface;
-}
-
-void QGstreamerMirTextureRenderer::setSurface(QAbstractVideoSurface *surface)
-{
- qDebug() << Q_FUNC_INFO;
-
- if (m_surface != surface) {
- qDebug() << "Saving current QGLContext";
- m_context = const_cast<QGLContext*>(QGLContext::currentContext());
-
- if (m_videoSink)
- gst_object_unref(GST_OBJECT(m_videoSink));
-
- m_videoSink = 0;
-
- if (m_surface) {
- disconnect(m_surface.data(), SIGNAL(supportedFormatsChanged()),
- this, SLOT(handleFormatChange()));
- }
-
- bool wasReady = isReady();
-
- m_surface = surface;
-
- if (m_surface) {
- connect(m_surface.data(), SIGNAL(supportedFormatsChanged()),
- this, SLOT(handleFormatChange()));
- }
-
- if (wasReady != isReady())
- emit readyChanged(isReady());
-
- emit sinkChanged();
- }
-}
-
-void QGstreamerMirTextureRenderer::setPlayerSession(const QGstreamerPlayerSession *playerSession)
-{
- m_playerSession = const_cast<QGstreamerPlayerSession*>(playerSession);
-}
-
-void QGstreamerMirTextureRenderer::handleFormatChange()
-{
- qDebug() << "Supported formats list has changed, reload video output";
-
- if (m_videoSink)
- gst_object_unref(GST_OBJECT(m_videoSink));
-
- m_videoSink = 0;
- emit sinkChanged();
-}
-
-void QGstreamerMirTextureRenderer::updateNativeVideoSize()
-{
- //qDebug() << Q_FUNC_INFO;
- const QSize oldSize = m_nativeSize;
-
- if (m_videoSink) {
- // Find video native size to update video widget size hint
- GstPad *pad = gst_element_get_static_pad(m_videoSink,"sink");
- GstCaps *caps = gst_pad_get_current_caps(pad);
-
- if (caps) {
- m_nativeSize = QGstUtils::capsCorrectedResolution(caps);
- gst_caps_unref(caps);
- }
- } else {
- m_nativeSize = QSize();
- }
- qDebug() << Q_FUNC_INFO << oldSize << m_nativeSize << m_videoSink;
-
- if (m_nativeSize != oldSize)
- emit nativeSizeChanged();
-}
-
-void QGstreamerMirTextureRenderer::handleFocusWindowChanged(QWindow *window)
-{
- qDebug() << Q_FUNC_INFO;
-
- QOpenGLContext *currContext = QOpenGLContext::currentContext();
-
- QQuickWindow *w = dynamic_cast<QQuickWindow*>(window);
- // If we don't have a GL context in the current thread, create one and share it
- // with the render thread GL context
- if (!currContext && !m_glContext) {
- // This emulates the new QOffscreenWindow class with Qt5.1
- m_offscreenSurface = createOffscreenWindow(w->openglContext()->surface()->format());
- m_offscreenSurface->setParent(window);
-
- QOpenGLContext *shareContext = 0;
- if (m_surface)
- shareContext = qobject_cast<QOpenGLContext*>(m_surface->property("GLContext").value<QObject*>());
- m_glContext = new QOpenGLContext;
- m_glContext->setFormat(m_offscreenSurface->requestedFormat());
-
- if (shareContext)
- m_glContext->setShareContext(shareContext);
-
- if (!m_glContext->create())
- {
- qWarning() << "Failed to create new shared context.";
- return;
- }
- }
-
- if (m_glContext)
- m_glContext->makeCurrent(m_offscreenSurface);
-
- if (m_textureId == 0) {
- glGenTextures(1, &m_textureId);
- qDebug() << "texture_id (handleFocusWindowChanged): " << m_textureId << endl;
- g_object_set(G_OBJECT(m_videoSink), "texture-id", m_textureId, (char*)NULL);
- }
-}
diff --git a/src/gsttools/qgstreamermirtexturerenderer_p.h b/src/gsttools/qgstreamermirtexturerenderer_p.h
deleted file mode 100644
index 62150f7e1..000000000
--- a/src/gsttools/qgstreamermirtexturerenderer_p.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGSTREAMERMIRTEXTURERENDERER_H
-#define QGSTREAMERMIRTEXTURERENDERER_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <qmediaplayer.h>
-#include <qvideorenderercontrol.h>
-#include <private/qvideosurfacegstsink_p.h>
-#include <qabstractvideosurface.h>
-
-#include "qgstreamervideorendererinterface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGstreamerMirTextureBuffer;
-class QGstreamerPlayerSession;
-class QGLContext;
-class QOpenGLContext;
-class QSurfaceFormat;
-
-class QGstreamerMirTextureRenderer : public QVideoRendererControl, public QGstreamerVideoRendererInterface
-{
- Q_OBJECT
- Q_INTERFACES(QGstreamerVideoRendererInterface)
-public:
- QGstreamerMirTextureRenderer(QObject *parent = 0, const QGstreamerPlayerSession *playerSession = 0);
- virtual ~QGstreamerMirTextureRenderer();
-
- QAbstractVideoSurface *surface() const;
- void setSurface(QAbstractVideoSurface *surface);
-
- void setPlayerSession(const QGstreamerPlayerSession *playerSession);
-
- GstElement *videoSink();
-
- void stopRenderer();
- bool isReady() const { return m_surface != 0; }
-
-signals:
- void sinkChanged();
- void readyChanged(bool);
- void nativeSizeChanged();
-
-private slots:
- void handleFormatChange();
- void updateNativeVideoSize();
- void handleFocusWindowChanged(QWindow *window);
- void renderFrame();
-
-private:
- QWindow *createOffscreenWindow(const QSurfaceFormat &format);
- static void handleFrameReady(gpointer userData);
- static GstPadProbeReturn padBufferProbe(GstPad *pad, GstPadProbeInfo *info, gpointer userData);
-
- GstElement *m_videoSink;
- QPointer<QAbstractVideoSurface> m_surface;
- QPointer<QAbstractVideoSurface> m_glSurface;
- QGLContext *m_context;
- QOpenGLContext *m_glContext;
- unsigned int m_textureId;
- QWindow *m_offscreenSurface;
- QGstreamerPlayerSession *m_playerSession;
- QGstreamerMirTextureBuffer *m_textureBuffer;
- QSize m_nativeSize;
-
- QMutex m_mutex;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGSTREAMERMIRTEXTURERENDRER_H
diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp
index 7a703c260..77ea276c7 100644
--- a/src/multimedia/video/qvideosurfaceformat.cpp
+++ b/src/multimedia/video/qvideosurfaceformat.cpp
@@ -519,9 +519,9 @@ QList<QByteArray> QVideoSurfaceFormat::propertyNames() const
QVariant QVideoSurfaceFormat::property(const char *name) const
{
if (qstrcmp(name, "handleType") == 0) {
- return qVariantFromValue(d->handleType);
+ return QVariant::fromValue(d->handleType);
} else if (qstrcmp(name, "pixelFormat") == 0) {
- return qVariantFromValue(d->pixelFormat);
+ return QVariant::fromValue(d->pixelFormat);
} else if (qstrcmp(name, "frameSize") == 0) {
return d->frameSize;
} else if (qstrcmp(name, "frameWidth") == 0) {
@@ -531,15 +531,15 @@ QVariant QVideoSurfaceFormat::property(const char *name) const
} else if (qstrcmp(name, "viewport") == 0) {
return d->viewport;
} else if (qstrcmp(name, "scanLineDirection") == 0) {
- return qVariantFromValue(d->scanLineDirection);
+ return QVariant::fromValue(d->scanLineDirection);
} else if (qstrcmp(name, "frameRate") == 0) {
- return qVariantFromValue(d->frameRate);
+ return QVariant::fromValue(d->frameRate);
} else if (qstrcmp(name, "pixelAspectRatio") == 0) {
- return qVariantFromValue(d->pixelAspectRatio);
+ return QVariant::fromValue(d->pixelAspectRatio);
} else if (qstrcmp(name, "sizeHint") == 0) {
return sizeHint();
} else if (qstrcmp(name, "yCbCrColorSpace") == 0) {
- return qVariantFromValue(d->ycbcrColorSpace);
+ return QVariant::fromValue(d->ycbcrColorSpace);
} else if (qstrcmp(name, "mirrored") == 0) {
return d->mirrored;
} else {
diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp
index 7d26a8534..991901097 100644
--- a/src/multimediawidgets/qvideowidget.cpp
+++ b/src/multimediawidgets/qvideowidget.cpp
@@ -1007,7 +1007,11 @@ void QVideoWidget::paintEvent(QPaintEvent *event)
}
#if defined(Q_OS_WIN)
+# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QVideoWidget::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
+# else
bool QVideoWidget::nativeEvent(const QByteArray &eventType, void *message, long *result)
+# endif
{
Q_D(QVideoWidget);
Q_UNUSED(eventType);
diff --git a/src/multimediawidgets/qvideowidget.h b/src/multimediawidgets/qvideowidget.h
index 2a08b6fbd..fff1153ca 100644
--- a/src/multimediawidgets/qvideowidget.h
+++ b/src/multimediawidgets/qvideowidget.h
@@ -82,7 +82,11 @@ public:
QSize sizeHint() const override;
#if defined(Q_OS_WIN)
+# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
+# else
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
+# endif
#endif
public Q_SLOTS:
diff --git a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp
index a34315b8a..fdf3ff4ac 100644
--- a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp
@@ -121,7 +121,7 @@ void CameraBinControl::setState(QCamera::State state)
//special case for stopping the camera while it's busy,
//it should be delayed until the camera is idle
- if (state == QCamera::LoadedState &&
+ if ((state == QCamera::LoadedState || state == QCamera::UnloadedState) &&
m_session->status() == QCamera::ActiveStatus &&
m_session->isBusy()) {
#ifdef CAMEABIN_DEBUG
diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp
index 0712f6e6c..a28968145 100644
--- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp
+++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp
@@ -55,10 +55,6 @@
#include <private/qgstreamervideowindow_p.h>
#include <private/qgstreamervideorenderer_p.h>
-#if QT_CONFIG(mirclient) && defined (__arm__)
-#include "private/qgstreamermirtexturerenderer_p.h"
-#endif
-
#include "qgstreamerstreamscontrol.h"
#include <private/qgstreameraudioprobecontrol_p.h>
#include <private/qgstreamervideoprobecontrol_p.h>
@@ -88,13 +84,7 @@ QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent):
m_metaData = new QGstreamerMetaDataProvider(m_session, this);
m_streamsControl = new QGstreamerStreamsControl(m_session,this);
m_availabilityControl = new QGStreamerAvailabilityControl(m_control->resources(), this);
-
-#if QT_CONFIG(mirclient) && defined (__arm__)
- m_videoRenderer = new QGstreamerMirTextureRenderer(this, m_session);
-#else
m_videoRenderer = new QGstreamerVideoRenderer(this);
-#endif
-
m_videoWindow = new QGstreamerVideoWindow(this);
// If the GStreamer video sink is not available, don't provide the video window control since
// it won't work anyway.
diff --git a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp
index 94d297ad0..871ff3cc7 100644
--- a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp
+++ b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp
@@ -1329,7 +1329,7 @@ void tst_QMediaPlayer::testAudioRole()
spy.clear();
- player.setProperty("audioRole", qVariantFromValue(QAudio::AlarmRole));
+ player.setProperty("audioRole", QVariant::fromValue(QAudio::AlarmRole));
QCOMPARE(qvariant_cast<QAudio::Role>(player.property("audioRole")), QAudio::AlarmRole);
QCOMPARE(mockService->mockAudioRoleControl->audioRole(), QAudio::AlarmRole);
QCOMPARE(spy.count(), 1);
@@ -1397,7 +1397,7 @@ void tst_QMediaPlayer::testCustomAudioRole()
spyCustomRole.clear();
QString customRole2(QStringLiteral("customRole2"));
- player.setProperty("customAudioRole", qVariantFromValue(customRole2));
+ player.setProperty("customAudioRole", QVariant::fromValue(customRole2));
QCOMPARE(qvariant_cast<QString>(player.property("customAudioRole")), customRole2);
QCOMPARE(mockService->mockCustomAudioRoleControl->customAudioRole(), customRole2);
QCOMPARE(spyRole.count(), 0);
diff --git a/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp b/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
index 5412a838d..4fa754a45 100644
--- a/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
+++ b/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp
@@ -321,7 +321,7 @@ void tst_QVideoSurfaceFormat::scanLineDirection()
{
QVideoSurfaceFormat format(QSize(16, 16), QVideoFrame::Format_RGB32);
- format.setProperty("scanLineDirection", qVariantFromValue(direction));
+ format.setProperty("scanLineDirection", QVariant::fromValue(direction));
QCOMPARE(format.scanLineDirection(), direction);
QCOMPARE(
@@ -363,7 +363,7 @@ void tst_QVideoSurfaceFormat::yCbCrColorSpaceEnum()
}
{
QVideoSurfaceFormat format(QSize(64, 64), QVideoFrame::Format_RGB32);
- format.setProperty("yCbCrColorSpace", qVariantFromValue(colorspace));
+ format.setProperty("yCbCrColorSpace", QVariant::fromValue(colorspace));
QCOMPARE(format.yCbCrColorSpace(), colorspace);
QCOMPARE(qvariant_cast<QVideoSurfaceFormat::YCbCrColorSpace>(format.property("yCbCrColorSpace")),