diff options
Diffstat (limited to 'src')
124 files changed, 589 insertions, 2928 deletions
diff --git a/src/gsttools/gsttools.pro b/src/gsttools/gsttools.pro index 216189d9a..e84454980 100644 --- a/src/gsttools/gsttools.pro +++ b/src/gsttools/gsttools.pro @@ -8,29 +8,16 @@ QT = core-private multimedia-private gui-private !static:DEFINES += QT_MAKEDLL DEFINES += GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -unix:!maemo*:contains(QT_CONFIG, alsa) { -DEFINES += HAVE_ALSA -LIBS_PRIVATE += \ - -lasound +qtConfig(alsa) { + DEFINES += HAVE_ALSA + QMAKE_USE += alsa } -CONFIG += link_pkgconfig +QMAKE_USE += gstreamer -PKGCONFIG += \ - gstreamer-$$GST_VERSION \ - gstreamer-base-$$GST_VERSION \ - gstreamer-audio-$$GST_VERSION \ - gstreamer-video-$$GST_VERSION \ - gstreamer-pbutils-$$GST_VERSION - -equals(GST_VERSION,"0.10") { - PKGCONFIG_PRIVATE += gstreamer-interfaces-0.10 - maemo*: PKGCONFIG_PRIVATE +=gstreamer-plugins-bad-0.10 -} - -config_resourcepolicy { +qtConfig(resourcepolicy) { DEFINES += HAVE_RESOURCE_POLICY - PKGCONFIG_PRIVATE += libresourceqt5 + QMAKE_USE += libresourceqt5 } # Header files must go inside source directory of a module @@ -44,7 +31,6 @@ PRIVATE_HEADERS += \ qgstreamermessage_p.h \ qgstutils_p.h \ qgstvideobuffer_p.h \ - qvideosurfacegstsink_p.h \ qgstreamerbufferprobe_p.h \ qgstreamervideorendererinterface_p.h \ qgstreameraudioinputselector_p.h \ @@ -82,26 +68,16 @@ qtHaveModule(widgets) { qgstreamervideowidget.cpp } -equals(GST_VERSION,"0.10") { +qtConfig(gstreamer_0_10) { PRIVATE_HEADERS += \ qgstbufferpoolinterface_p.h \ - gstvideoconnector_p.h \ + qvideosurfacegstsink_p.h \ + gstvideoconnector_p.h SOURCES += \ qgstbufferpoolinterface.cpp \ qvideosurfacegstsink.cpp \ gstvideoconnector.c - - maemo6 { - PKGCONFIG_PRIVATE += qmsystem2 - - qtConfig(opengles2):qtHaveModule(widgets) { - PRIVATE_HEADERS += qgstreamergltexturerenderer_p.h - SOURCES += qgstreamergltexturerenderer.cpp - QT += opengl - LIBS_PRIVATE += -lEGL -lgstmeegointerfaces-0.10 - } - } } else { PRIVATE_HEADERS += \ qgstvideorendererplugin_p.h \ @@ -112,27 +88,23 @@ equals(GST_VERSION,"0.10") { qgstvideorenderersink.cpp } -mir: { +qtConfig(mirclient): { qtConfig(opengles2):qtHaveModule(widgets) { PRIVATE_HEADERS += qgstreamermirtexturerenderer_p.h SOURCES += qgstreamermirtexturerenderer.cpp QT += opengl quick LIBS += -lEGL } - DEFINES += HAVE_MIR } -config_gstreamer_appsrc { - PKGCONFIG_PRIVATE += gstreamer-app-$$GST_VERSION +qtConfig(gstreamer_app) { + QMAKE_USE += gstreamer_app PRIVATE_HEADERS += qgstappsrc_p.h SOURCES += qgstappsrc.cpp - DEFINES += HAVE_GST_APPSRC - - LIBS_PRIVATE += -lgstapp-$$GST_VERSION } -config_linux_v4l: DEFINES += USE_V4L +qtConfig(linux_v4l): DEFINES += USE_V4L HEADERS += $$PRIVATE_HEADERS diff --git a/src/gsttools/gstvideoconnector.c b/src/gsttools/gstvideoconnector.c index d79df2091..b85f5bdbe 100644 --- a/src/gsttools/gstvideoconnector.c +++ b/src/gsttools/gstvideoconnector.c @@ -410,11 +410,7 @@ gst_video_connector_chain (GstPad * pad, GstBuffer * buf) element->latest_buffer = NULL; } - //don't save the last video buffer on maemo6 because of buffers shortage - //with omapxvsink -#ifndef Q_WS_MAEMO_6 element->latest_buffer = gst_buffer_ref(buf); -#endif gst_buffer_unref(buf); gst_object_unref (element); diff --git a/src/gsttools/qgstreamergltexturerenderer.cpp b/src/gsttools/qgstreamergltexturerenderer.cpp deleted file mode 100644 index 3cd7eddf7..000000000 --- a/src/gsttools/qgstreamergltexturerenderer.cpp +++ /dev/null @@ -1,582 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company 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 <private/qvideosurfacegstsink_p.h> -#include <qabstractvideosurface.h> -#include <private/qgstutils_p.h> - -#include <QtGui/qevent.h> -#include <QtWidgets/qapplication.h> -#include <QtWidgets/qx11info_x11.h> -#include <QtCore/qdebug.h> -#include <QtCore/qthread.h> - -#include <QtOpenGL/qgl.h> - -#include <gst/gst.h> -#include <gst/interfaces/xoverlay.h> -#include <gst/interfaces/propertyprobe.h> -#include <gst/interfaces/meegovideotexture.h> -#include <gst/interfaces/meegovideorenderswitch.h> - - -#include <EGL/egl.h> -#include <EGL/eglext.h> - -#include "qgstreamergltexturerenderer_p.h" - -//#define GL_TEXTURE_SINK_DEBUG 1 - -//from extdefs.h -typedef void *EGLSyncKHR; -typedef khronos_utime_nanoseconds_t EGLTimeKHR; - -#define GL_TEXTURE_EXTERNAL_OES 0x8D65 -#define EGL_SYNC_FENCE_KHR 0x30F9 - -typedef EGLSyncKHR (EGLAPIENTRYP _PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, - EGLenum type, const EGLint * attrib_list); -typedef EGLBoolean (EGLAPIENTRYP _PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, - EGLSyncKHR sync); - - -const QAbstractVideoBuffer::HandleType EGLImageTextureHandle = - QAbstractVideoBuffer::HandleType(QAbstractVideoBuffer::UserHandle+3434); - -// EGLSync functions -_PFNEGLCREATESYNCKHRPROC eglCreateSyncKHR; -_PFNEGLDESTROYSYNCKHRPROC eglDestroySyncKHR; - -class QGStreamerGLTextureBuffer : public QAbstractVideoBuffer -{ -public: - QGStreamerGLTextureBuffer(MeegoGstVideoTexture *textureSink, int frameNumber) : - QAbstractVideoBuffer(EGLImageTextureHandle), - m_textureSink(MEEGO_GST_VIDEO_TEXTURE(textureSink)), - m_frameNumber(frameNumber) - { - } - - ~QGStreamerGLTextureBuffer() - { - } - - - MapMode mapMode() const { return NotMapped; } - uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) - { - Q_UNUSED(mode); - Q_UNUSED(numBytes); - Q_UNUSED(bytesPerLine); - - //acquire_frame should really be called at buffer construction time - //but it conflicts with id-less implementation of gst texture sink. -#if defined(GL_TEXTURE_SINK_DEBUG) && GL_TEXTURE_SINK_DEBUG > 1 - qDebug() << "acquire frame" << m_frameNumber; -#endif - if (!meego_gst_video_texture_acquire_frame(m_textureSink,m_frameNumber)) - qWarning() << Q_FUNC_INFO << "acquire-frame failed" << m_frameNumber; - - -#if defined(GL_TEXTURE_SINK_DEBUG) && GL_TEXTURE_SINK_DEBUG > 1 - qDebug() << "map frame" << m_frameNumber; -#endif - - gboolean bind_status = meego_gst_video_texture_bind_frame(m_textureSink, GL_TEXTURE_EXTERNAL_OES, m_frameNumber); - if (!bind_status) - qWarning() << Q_FUNC_INFO << "bind-frame failed"; - - return (uchar*)1; - } - - void unmap() - { - gboolean bind_status = meego_gst_video_texture_bind_frame(m_textureSink, GL_TEXTURE_EXTERNAL_OES, -1); - -#if defined(GL_TEXTURE_SINK_DEBUG) && GL_TEXTURE_SINK_DEBUG > 1 - qDebug() << "unmap frame" << m_frameNumber; -#endif - - if (!bind_status) - qWarning() << Q_FUNC_INFO << "unbind-frame failed"; - - //release_frame should really be called in destructor - //but this conflicts with id-less implementation of gst texture sink. -#if defined(GL_TEXTURE_SINK_DEBUG) && GL_TEXTURE_SINK_DEBUG > 1 - qDebug() << "release frame" << m_frameNumber; -#endif - EGLSyncKHR sync = eglCreateSyncKHR(eglGetDisplay((EGLNativeDisplayType)QX11Info::display()), EGL_SYNC_FENCE_KHR, NULL); - meego_gst_video_texture_release_frame(m_textureSink, m_frameNumber, sync); - } - - QVariant handle() const - { - return m_frameNumber; - } - -private: - MeegoGstVideoTexture *m_textureSink; - int m_frameNumber; -}; - - -QGstreamerGLTextureRenderer::QGstreamerGLTextureRenderer(QObject *parent) : - QVideoRendererControl(parent), - m_videoSink(0), - m_surface(0), - m_context(0), - m_winId(0), - m_colorKey(49,0,49), - m_overlayEnabled(false), - m_bufferProbeId(-1) -{ - eglCreateSyncKHR = - (_PFNEGLCREATESYNCKHRPROC)eglGetProcAddress("eglCreateSyncKHR"); - eglDestroySyncKHR = - (_PFNEGLDESTROYSYNCKHRPROC)eglGetProcAddress("eglDestroySyncKHR"); -} - -QGstreamerGLTextureRenderer::~QGstreamerGLTextureRenderer() -{ - if (m_surface && m_surface->isActive()) - m_surface->stop(); - - if (m_videoSink) - gst_object_unref(GST_OBJECT(m_videoSink)); -} - -GstElement *QGstreamerGLTextureRenderer::videoSink() -{ - if (!m_videoSink && isReady()) { - if (m_context && !m_surface->supportedPixelFormats(EGLImageTextureHandle).isEmpty()) { -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO << ": using gltexture sink"; -#endif - if (m_context) - m_context->makeCurrent(); - m_videoSink = gst_element_factory_make("gltexturesink", "egl-texture-sink"); - g_object_set(G_OBJECT(m_videoSink), - "x-display", QX11Info::display(), - "egl-display", eglGetDisplay((EGLNativeDisplayType)QX11Info::display()), - "egl-context", eglGetCurrentContext(), - "colorkey", m_colorKey.rgb(), - "autopaint-colorkey", false, - "use-framebuffer-memory", true, - "render-mode", m_overlayEnabled ? VIDEO_RENDERSWITCH_XOVERLAY_MODE - : VIDEO_RENDERSWITCH_TEXTURE_STREAMING_MODE, - (char*)NULL); - - g_signal_connect(G_OBJECT(m_videoSink), "frame-ready", G_CALLBACK(handleFrameReady), (gpointer)this); - } else { - qWarning() << Q_FUNC_INFO << ": Fallback to QVideoSurfaceGstSink since EGLImageTextureHandle is not supported"; - m_videoSink = reinterpret_cast<GstElement*>(QVideoSurfaceGstSink::createSink(m_surface)); - } - - if (m_videoSink) { - gst_object_ref(GST_OBJECT(m_videoSink)); //Take ownership - gst_object_sink(GST_OBJECT(m_videoSink)); - - GstPad *pad = gst_element_get_static_pad(m_videoSink,"sink"); - m_bufferProbeId = gst_pad_add_buffer_probe(pad, G_CALLBACK(padBufferProbe), this); - gst_object_unref(GST_OBJECT(pad)); - } - } - - return m_videoSink; -} - -QAbstractVideoSurface *QGstreamerGLTextureRenderer::surface() const -{ - return m_surface; -} - -void QGstreamerGLTextureRenderer::setSurface(QAbstractVideoSurface *surface) -{ - if (m_surface != surface) { -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO << surface; -#endif - - bool oldReady = isReady(); - - 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, SIGNAL(supportedFormatsChanged()), - this, SLOT(handleFormatChange())); - } - - m_surface = surface; - - if (oldReady != isReady()) - emit readyChanged(!oldReady); - - if (m_surface) { - connect(m_surface, SIGNAL(supportedFormatsChanged()), - this, SLOT(handleFormatChange())); - } - - emit sinkChanged(); - } -} - -void QGstreamerGLTextureRenderer::handleFormatChange() -{ - if (m_videoSink) - gst_object_unref(GST_OBJECT(m_videoSink)); - - m_videoSink = 0; - emit sinkChanged(); -} - -void QGstreamerGLTextureRenderer::handleFrameReady(GstElement *sink, gint frame, gpointer data) -{ - Q_UNUSED(sink); - QGstreamerGLTextureRenderer* renderer = reinterpret_cast<QGstreamerGLTextureRenderer*>(data); - - QMutexLocker locker(&renderer->m_mutex); - QMetaObject::invokeMethod(renderer, "renderGLFrame", - Qt::QueuedConnection, - Q_ARG(int, frame)); - - //we have to wait to ensure the frame is not reused, - //timeout is added to avoid deadlocks when the main thread is - //waiting for rendering to complete, this is possible for example during state chages. - //If frame is not rendered during 60ms (~1-2 frames interval) it's better to unblock and drop it if necessary - renderer->m_renderCondition.wait(&renderer->m_mutex, 60); -} - -void QGstreamerGLTextureRenderer::renderGLFrame(int frame) -{ -#if defined(GL_TEXTURE_SINK_DEBUG) && GL_TEXTURE_SINK_DEBUG > 1 - qDebug() << Q_FUNC_INFO << "frame:" << frame << "surface active:" << m_surface->isActive(); -#endif - QMutexLocker locker(&m_mutex); - - if (!m_surface) { - m_renderCondition.wakeAll(); - return; - } - - MeegoGstVideoTexture *textureSink = MEEGO_GST_VIDEO_TEXTURE(m_videoSink); - - if (m_context) - m_context->makeCurrent(); - - //don't try to render the frame if state is changed to NULL or READY - GstState pendingState = GST_STATE_NULL; - GstState newState = GST_STATE_NULL; - GstStateChangeReturn res = gst_element_get_state(m_videoSink, - &newState, - &pendingState, - 0);//don't block and return immediately - - if (res == GST_STATE_CHANGE_FAILURE || - newState == GST_STATE_NULL || - pendingState == GST_STATE_NULL) { - stopRenderer(); - m_renderCondition.wakeAll(); - return; - } - - if (!m_surface->isActive()) { - //find the native video size - GstPad *pad = gst_element_get_static_pad(m_videoSink,"sink"); - GstCaps *caps = gst_pad_get_negotiated_caps(pad); - - if (caps) { - 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, EGLImageTextureHandle); - if (!m_surface->start(format)) { - qWarning() << Q_FUNC_INFO << "failed to start video surface" << format; - m_renderCondition.wakeAll(); - return; - } - } - - QGStreamerGLTextureBuffer *buffer = new QGStreamerGLTextureBuffer(textureSink, frame); - QVideoFrame videoFrame(buffer, - m_surface->surfaceFormat().frameSize(), - m_surface->surfaceFormat().pixelFormat()); - m_surface->present(videoFrame); - m_renderCondition.wakeAll(); -} - -bool QGstreamerGLTextureRenderer::isReady() const -{ - if (!m_surface) - return false; - - if (m_winId > 0) - return true; - - //winId is required only for EGLImageTextureHandle compatible surfaces - return m_surface->supportedPixelFormats(EGLImageTextureHandle).isEmpty(); -} - -bool QGstreamerGLTextureRenderer::processBusMessage(const QGstreamerMessage &message) -{ - GstMessage* gm = message.rawMessage(); - -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO << GST_MESSAGE_TYPE_NAME(gm); -#endif - - if (GST_MESSAGE_TYPE(gm) == GST_MESSAGE_STATE_CHANGED && - GST_MESSAGE_SRC(gm) == GST_OBJECT_CAST(m_videoSink)) { - GstState oldState; - GstState newState; - gst_message_parse_state_changed(gm, &oldState, &newState, 0); - -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO << "State changed:" << oldState << newState; -#endif - - if (newState == GST_STATE_READY || newState == GST_STATE_NULL) { - stopRenderer(); - } - - if (oldState == GST_STATE_READY && newState == GST_STATE_PAUSED) { - updateNativeVideoSize(); - } - } - - return false; -} - -bool QGstreamerGLTextureRenderer::processSyncMessage(const QGstreamerMessage &message) -{ - GstMessage* gm = message.rawMessage(); - - if ((GST_MESSAGE_TYPE(gm) == GST_MESSAGE_ELEMENT) && - gst_structure_has_name(gm->structure, "prepare-xwindow-id") && - m_videoSink && GST_IS_X_OVERLAY(m_videoSink)) { -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO; -#endif - GstXOverlay *overlay = GST_X_OVERLAY(m_videoSink); - - gst_x_overlay_set_xwindow_id(overlay, m_winId); - - if (!m_displayRect.isEmpty()) { - gst_x_overlay_set_render_rectangle(overlay, - m_displayRect.x(), - m_displayRect.y(), - m_displayRect.width(), - m_displayRect.height()); - } - - GstPad *pad = gst_element_get_static_pad(m_videoSink,"sink"); - m_bufferProbeId = gst_pad_add_buffer_probe(pad, G_CALLBACK(padBufferProbe), this); - - return true; - } - - return false; -} - -void QGstreamerGLTextureRenderer::stopRenderer() -{ -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO; -#endif - - if (m_surface && m_surface->isActive()) - m_surface->stop(); - - if (!m_nativeSize.isEmpty()) { - m_nativeSize = QSize(); - emit nativeSizeChanged(); - } -} - -bool QGstreamerGLTextureRenderer::overlayEnabled() const -{ - return m_overlayEnabled; -} - -void QGstreamerGLTextureRenderer::setOverlayEnabled(bool enabled) -{ - - if (m_videoSink && (m_overlayEnabled != enabled)) { - qDebug() << Q_FUNC_INFO << enabled; - g_object_set(G_OBJECT(m_videoSink), - "render-mode", - enabled ? VIDEO_RENDERSWITCH_XOVERLAY_MODE : VIDEO_RENDERSWITCH_TEXTURE_STREAMING_MODE, - (char *)NULL); - } - - m_overlayEnabled = enabled; -} - - -WId QGstreamerGLTextureRenderer::winId() const -{ - return m_winId; -} - -void QGstreamerGLTextureRenderer::setWinId(WId id) -{ -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO << id; -#endif - - if (m_winId == id) - return; - - bool oldReady = isReady(); - - m_winId = id; - - if (m_videoSink && GST_IS_X_OVERLAY(m_videoSink)) { - //don't set winId in NULL state, - //texture sink opens xvideo port on set_xwindow_id, - //this fails if video resource is not granted by resource policy yet. - //state is changed to READY/PAUSED/PLAYING only after resource is granted. - GstState pendingState = GST_STATE_NULL; - GstState newState = GST_STATE_NULL; - GstStateChangeReturn res = gst_element_get_state(m_videoSink, - &newState, - &pendingState, - 0);//don't block and return immediately - - if (res != GST_STATE_CHANGE_FAILURE && - newState != GST_STATE_NULL && - pendingState != GST_STATE_NULL) - gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(m_videoSink), m_winId); - } - - if (oldReady != isReady()) - emit readyChanged(!oldReady); -} - -QRect QGstreamerGLTextureRenderer::overlayGeometry() const -{ - return m_displayRect; -} - -void QGstreamerGLTextureRenderer::setOverlayGeometry(const QRect &geometry) -{ - if (m_displayRect != geometry) { -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO << geometry; -#endif - m_displayRect = geometry; - - if (m_videoSink && GST_IS_X_OVERLAY(m_videoSink)) { - if (m_displayRect.isEmpty()) - gst_x_overlay_set_render_rectangle(GST_X_OVERLAY(m_videoSink), -1, -1, -1, -1); - else - gst_x_overlay_set_render_rectangle(GST_X_OVERLAY(m_videoSink), - m_displayRect.x(), - m_displayRect.y(), - m_displayRect.width(), - m_displayRect.height()); - repaintOverlay(); - } - } -} - -QColor QGstreamerGLTextureRenderer::colorKey() const -{ - return m_colorKey; -} - -void QGstreamerGLTextureRenderer::repaintOverlay() -{ - if (m_videoSink && GST_IS_X_OVERLAY(m_videoSink)) { - //don't call gst_x_overlay_expose if the sink is in null state - GstState state = GST_STATE_NULL; - GstStateChangeReturn res = gst_element_get_state(m_videoSink, &state, NULL, 1000000); - if (res != GST_STATE_CHANGE_FAILURE && state != GST_STATE_NULL) { - gst_x_overlay_expose(GST_X_OVERLAY(m_videoSink)); - } - } -} - -QSize QGstreamerGLTextureRenderer::nativeSize() const -{ - return m_nativeSize; -} - -gboolean QGstreamerGLTextureRenderer::padBufferProbe(GstPad *pad, GstBuffer *buffer, gpointer user_data) -{ - QGstreamerGLTextureRenderer *control = reinterpret_cast<QGstreamerGLTextureRenderer*>(user_data); - QMetaObject::invokeMethod(control, "updateNativeVideoSize", Qt::QueuedConnection); - gst_pad_remove_buffer_probe(pad, control->m_bufferProbeId); - - return TRUE; -} - -void QGstreamerGLTextureRenderer::updateNativeVideoSize() -{ - 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_negotiated_caps(pad); - - if (caps) { - m_nativeSize = QGstUtils::capsCorrectedResolution(caps); - gst_caps_unref(caps); - } - } else { - m_nativeSize = QSize(); - } -#ifdef GL_TEXTURE_SINK_DEBUG - qDebug() << Q_FUNC_INFO << oldSize << m_nativeSize << m_videoSink; -#endif - - if (m_nativeSize != oldSize) - emit nativeSizeChanged(); -} diff --git a/src/imports/audioengine/audioengine.pro b/src/imports/audioengine/audioengine.pro index c00a6ec6b..1d46dfa33 100644 --- a/src/imports/audioengine/audioengine.pro +++ b/src/imports/audioengine/audioengine.pro @@ -5,10 +5,7 @@ IMPORT_VERSION = 1.1 QT += quick qml multimedia-private -win32: LIBS += -lOpenAL32 -unix:!mac:!blackberry: LIBS += -lopenal -blackberry: LIBS += -lOpenAL -mac: LIBS += -framework OpenAL +QMAKE_USE += openal mac: DEFINES += HEADER_OPENAL_PREFIX INCLUDEPATH += ../../multimedia/audio diff --git a/src/imports/imports.pro b/src/imports/imports.pro index d24bba59f..fcd9e3466 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += multimedia-private SUBDIRS += multimedia -config_openal: SUBDIRS += audioengine +qtConfig(openal): SUBDIRS += audioengine diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri index 4706fd23e..d6d74a316 100644 --- a/src/multimedia/audio/audio.pri +++ b/src/multimedia/audio/audio.pri @@ -40,20 +40,12 @@ SOURCES += \ audio/qaudiodecoder.cpp \ audio/qaudiohelpers.cpp -unix:!mac { - config_pulseaudio { - CONFIG += link_pkgconfig - PKGCONFIG_PRIVATE += libpulse +qtConfig(pulseaudio) { + QMAKE_USE += pulseaudio - DEFINES += QT_MULTIMEDIA_PULSEAUDIO - PRIVATE_HEADERS += audio/qsoundeffect_pulse_p.h - SOURCES += audio/qsoundeffect_pulse_p.cpp - !maemo*:DEFINES += QTM_PULSEAUDIO_DEFAULTBUFFER - } else { - DEFINES += QT_MULTIMEDIA_QAUDIO - PRIVATE_HEADERS += audio/qsoundeffect_qaudio_p.h - SOURCES += audio/qsoundeffect_qaudio_p.cpp - } + DEFINES += QT_MULTIMEDIA_PULSEAUDIO + PRIVATE_HEADERS += audio/qsoundeffect_pulse_p.h + SOURCES += audio/qsoundeffect_pulse_p.cpp } else { DEFINES += QT_MULTIMEDIA_QAUDIO PRIVATE_HEADERS += audio/qsoundeffect_qaudio_p.h diff --git a/src/multimedia/audio/qaudio.h b/src/multimedia/audio/qaudio.h index 457a3b621..1c38e9f35 100644 --- a/src/multimedia/audio/qaudio.h +++ b/src/multimedia/audio/qaudio.h @@ -41,7 +41,7 @@ #ifndef QAUDIO_H #define QAUDIO_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtCore/qmetatype.h> diff --git a/src/multimedia/audio/qaudiobuffer.h b/src/multimedia/audio/qaudiobuffer.h index c45b56ed3..bed387462 100644 --- a/src/multimedia/audio/qaudiobuffer.h +++ b/src/multimedia/audio/qaudiobuffer.h @@ -42,7 +42,7 @@ #include <QtCore/qshareddata.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtMultimedia/qaudio.h> diff --git a/src/multimedia/audio/qaudiobuffer_p.h b/src/multimedia/audio/qaudiobuffer_p.h index 06233ca7c..e770989f2 100644 --- a/src/multimedia/audio/qaudiobuffer_p.h +++ b/src/multimedia/audio/qaudiobuffer_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include <qmultimedia.h> #include "qaudioformat.h" diff --git a/src/multimedia/audio/qaudiodevicefactory_p.h b/src/multimedia/audio/qaudiodevicefactory_p.h index 7ad5e4e78..238be46a7 100644 --- a/src/multimedia/audio/qaudiodevicefactory_p.h +++ b/src/multimedia/audio/qaudiodevicefactory_p.h @@ -54,7 +54,7 @@ #include <QtCore/qbytearray.h> #include <QtCore/qlist.h> -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include <qmultimedia.h> #include "qaudiodeviceinfo.h" diff --git a/src/multimedia/audio/qaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo.h index 709e6830a..390458b39 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.h +++ b/src/multimedia/audio/qaudiodeviceinfo.h @@ -47,7 +47,7 @@ #include <QtCore/qstringlist.h> #include <QtCore/qlist.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtMultimedia/qaudio.h> diff --git a/src/multimedia/audio/qaudioformat.h b/src/multimedia/audio/qaudioformat.h index 2ae6d6aef..97779ea2c 100644 --- a/src/multimedia/audio/qaudioformat.h +++ b/src/multimedia/audio/qaudioformat.h @@ -44,7 +44,7 @@ #include <QtCore/qobject.h> #include <QtCore/qshareddata.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/audio/qaudioinput.h b/src/multimedia/audio/qaudioinput.h index d1a58424e..5794276d2 100644 --- a/src/multimedia/audio/qaudioinput.h +++ b/src/multimedia/audio/qaudioinput.h @@ -43,7 +43,7 @@ #include <QtCore/qiodevice.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtMultimedia/qaudio.h> diff --git a/src/multimedia/audio/qaudiooutput.h b/src/multimedia/audio/qaudiooutput.h index fab562ae1..9f817271d 100644 --- a/src/multimedia/audio/qaudiooutput.h +++ b/src/multimedia/audio/qaudiooutput.h @@ -43,7 +43,7 @@ #include <QtCore/qiodevice.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtMultimedia/qaudio.h> diff --git a/src/multimedia/audio/qaudiosystem.h b/src/multimedia/audio/qaudiosystem.h index 1a927589d..dabf8df0b 100644 --- a/src/multimedia/audio/qaudiosystem.h +++ b/src/multimedia/audio/qaudiosystem.h @@ -40,7 +40,7 @@ #ifndef QAUDIOSYSTEM_H #define QAUDIOSYSTEM_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtMultimedia/qaudio.h> diff --git a/src/multimedia/audio/qaudiosystemplugin.h b/src/multimedia/audio/qaudiosystemplugin.h index b26b2a3b9..3368c9b98 100644 --- a/src/multimedia/audio/qaudiosystemplugin.h +++ b/src/multimedia/audio/qaudiosystemplugin.h @@ -44,7 +44,7 @@ #include <QtCore/qstring.h> #include <QtCore/qplugin.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtMultimedia/qaudioformat.h> diff --git a/src/multimedia/audio/qaudiosystempluginext_p.h b/src/multimedia/audio/qaudiosystempluginext_p.h index 380bc5afa..6493b7f77 100644 --- a/src/multimedia/audio/qaudiosystempluginext_p.h +++ b/src/multimedia/audio/qaudiosystempluginext_p.h @@ -40,7 +40,7 @@ #ifndef QAUDIOSYSTEMPLUGINEXT_P_H #define QAUDIOSYSTEMPLUGINEXT_P_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qaudio.h> #include <QtCore/qplugin.h> diff --git a/src/multimedia/audio/qsound.h b/src/multimedia/audio/qsound.h index f8d47676f..304019ced 100644 --- a/src/multimedia/audio/qsound.h +++ b/src/multimedia/audio/qsound.h @@ -40,7 +40,7 @@ #ifndef QSOUND_H #define QSOUND_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtCore/qobject.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/audio/qsoundeffect.h b/src/multimedia/audio/qsoundeffect.h index f59c4d91d..7420d7b81 100644 --- a/src/multimedia/audio/qsoundeffect.h +++ b/src/multimedia/audio/qsoundeffect.h @@ -40,7 +40,7 @@ #ifndef QSOUNDEFFECT_H #define QSOUNDEFFECT_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtCore/qobject.h> #include <QtCore/qurl.h> #include <QtCore/qstringlist.h> diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index fcf4fee35..2e2dfc2db 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -62,9 +62,6 @@ #include <unistd.h> //#define QT_PA_DEBUG -#ifndef QTM_PULSEAUDIO_DEFAULTBUFFER -#define QT_PA_STREAM_BUFFER_SIZE_MAX (1024 * 64) //64KB is a trade-off for balancing control latency and uploading overhead -#endif QT_BEGIN_NAMESPACE @@ -679,7 +676,6 @@ void QSoundEffectPrivate::sampleReady() #ifdef QT_PA_DEBUG qDebug() << this << "reuse existing pulsestream"; #endif -#ifdef QTM_PULSEAUDIO_DEFAULTBUFFER const pa_buffer_attr *bufferAttr = pa_stream_get_buffer_attr(m_pulseStream); if (bufferAttr->prebuf > uint32_t(m_sample->data().size())) { pa_buffer_attr newBufferAttr; @@ -693,33 +689,6 @@ void QSoundEffectPrivate::sampleReady() } else { streamReady(); } -#else - const pa_buffer_attr *bufferAttr = pa_stream_get_buffer_attr(m_pulseStream); - if (bufferAttr->tlength < m_sample->data().size() && bufferAttr->tlength < QT_PA_STREAM_BUFFER_SIZE_MAX) { - pa_buffer_attr newBufferAttr; - newBufferAttr.maxlength = -1; - newBufferAttr.tlength = qMin(m_sample->data().size(), QT_PA_STREAM_BUFFER_SIZE_MAX); - newBufferAttr.minreq = bufferAttr->tlength / 2; - newBufferAttr.prebuf = -1; - newBufferAttr.fragsize = -1; - 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 *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(); - } -#endif } else { if (!pulseDaemon()->context() || pa_context_get_state(pulseDaemon()->context()) != PA_CONTEXT_READY) { connect(pulseDaemon(), SIGNAL(contextReady()), SLOT(contextReady())); @@ -963,17 +932,7 @@ void QSoundEffectPrivate::createPulseStream() } m_pulseStream = stream; -#ifndef QTM_PULSEAUDIO_DEFAULTBUFFER - pa_buffer_attr bufferAttr; - bufferAttr.tlength = qMin(m_sample->data().size(), QT_PA_STREAM_BUFFER_SIZE_MAX); - bufferAttr.maxlength = -1; - bufferAttr.minreq = bufferAttr.tlength / 2; - bufferAttr.prebuf = -1; - bufferAttr.fragsize = -1; - if (pa_stream_connect_playback(m_pulseStream, 0, &bufferAttr, -#else if (pa_stream_connect_playback(m_pulseStream, 0, 0, -#endif PA_STREAM_START_CORKED, 0, 0) < 0) { qWarning("QSoundEffect(pulseaudio): Failed to connect stream, error = %s", pa_strerror(pa_context_errno(pulseDaemon()->context()))); @@ -1048,39 +1007,6 @@ void QSoundEffectPrivate::stream_state_callback(pa_stream *s, void *userdata) } } -void QSoundEffectPrivate::stream_reset_buffer_callback(pa_stream *s, int success, void *userdata) -{ -#ifdef QT_PA_DEBUG - qDebug() << "stream_reset_buffer_callback"; -#endif - Q_UNUSED(s); - QSoundEffectRef *ref = reinterpret_cast<QSoundEffectRef*>(userdata); - QSoundEffectPrivate *self = ref->soundEffect(); - ref->release(); - if (!self) - return; - - if (!success) - qWarning("QSoundEffect(pulseaudio): failed to reset buffer attribute"); -#ifdef QT_PA_DEBUG - qDebug() << self << "stream_reset_buffer_callback"; -#endif - const pa_buffer_attr *bufferAttr = pa_stream_get_buffer_attr(self->m_pulseStream); - self->m_pulseBufferSize = bufferAttr->tlength; - if (bufferAttr->prebuf > uint32_t(self->m_sample->data().size())) { - pa_buffer_attr newBufferAttr; - newBufferAttr = *bufferAttr; - newBufferAttr.prebuf = self->m_sample->data().size(); - 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); - } -} - void QSoundEffectPrivate::stream_adjust_prebuffer_callback(pa_stream *s, int success, void *userdata) { #ifdef QT_PA_DEBUG diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.h b/src/multimedia/audio/qsoundeffect_pulse_p.h index 020aa031a..7be88c55a 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.h +++ b/src/multimedia/audio/qsoundeffect_pulse_p.h @@ -148,7 +148,6 @@ private: static void stream_flush_reload_callback(pa_stream *s, int success, void *userdata); static void stream_write_done_callback(void *p); static void stream_adjust_prebuffer_callback(pa_stream *s, int success, void *userdata); - static void stream_reset_buffer_callback(pa_stream *s, int success, void *userdata); pa_stream *m_pulseStream; int m_sinkInputId; diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index 4c1c0a924..fd804316c 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -71,17 +71,15 @@ static void qRegisterCameraMetaTypes() Q_CONSTRUCTOR_FUNCTION(qRegisterCameraMetaTypes) -static bool qt_sizeLessThan(const QSize &s1, const QSize &s2) +Q_DECL_CONSTEXPR static bool qt_sizeLessThan(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW { return (s1.width() * s1.height()) < (s2.width() * s2.height()); } -static bool qt_frameRateRangeLessThan(const QCamera::FrameRateRange &s1, const QCamera::FrameRateRange &s2) +Q_DECL_CONSTEXPR static bool qt_frameRateRangeLessThan(const QCamera::FrameRateRange &s1, const QCamera::FrameRateRange &s2) Q_DECL_NOTHROW { - if (s1.maximumFrameRate == s2.maximumFrameRate) - return s1.minimumFrameRate < s2.minimumFrameRate; - - return s1.maximumFrameRate < s2.maximumFrameRate; + return qFuzzyCompare(s1.maximumFrameRate, s2.maximumFrameRate) ? (s1.minimumFrameRate < s2.minimumFrameRate) + : (s1.maximumFrameRate < s2.maximumFrameRate); } /*! diff --git a/src/multimedia/camera/qcameraviewfindersettings.h b/src/multimedia/camera/qcameraviewfindersettings.h index df544dd8f..432bdcf1f 100644 --- a/src/multimedia/camera/qcameraviewfindersettings.h +++ b/src/multimedia/camera/qcameraviewfindersettings.h @@ -40,7 +40,7 @@ #ifndef QCAMERAVIEWFINDERSETTINGS_H #define QCAMERAVIEWFINDERSETTINGS_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qvideoframe.h> #include <QtCore/qshareddata.h> diff --git a/src/multimedia/configure.json b/src/multimedia/configure.json new file mode 100644 index 000000000..8fb2eb868 --- /dev/null +++ b/src/multimedia/configure.json @@ -0,0 +1,314 @@ +{ + "module": "multimedia", + "depends": [ + "gui" + ], + "testDir": "../../config.tests", + + "commandline": { + "options": { + "alsa": "boolean", + "gstreamer": { "type": "optionalString", "values": [ "no", "yes", "0.10", "1.0" ] }, + "pulseaudio": "boolean", + "wmf-backend": "boolean" + } + }, + + "libraries": { + "alsa": { + "label": "ALSA", + "test": "alsa", + "sources": [ + "-lasound" + ] + }, + "avfoundation": { + "label": "AVFoundation", + "test": "avfoundation", + "sources": [ + { "libs": "-framework AVFoundation -framework Foundation" } + ] + }, + "directshow": { + "label": "DirectShow", + "test": "directshow", + "sources": [ + { "libs": "-lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32" } + ] + }, + "gstreamer_0_10": { + "label": "GStreamer 0.10", + "export": "gstreamer", + "test": "gstreamer", + "sources": [ + { "type": "pkgConfig", + "args": "gstreamer-0.10 gstreamer-base-0.10 gstreamer-audio-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10" } + ] + }, + "gstreamer_1_0": { + "label": "GStreamer 1.0", + "export": "gstreamer", + "test": "gstreamer", + "sources": [ + { "type": "pkgConfig", + "args": "gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0" } + ] + }, + "gstreamer_app_0_10": { + "label": "GStreamer App 0.10", + "export": "gstreamer_app", + "test": "gstreamer_appsrc", + "use": "gstreamer_0_10", + "sources": [ + { "type": "pkgConfig", "args": "gstreamer-app-0.10" } + ] + }, + "gstreamer_app_1_0": { + "label": "GStreamer App 1.0", + "export": "gstreamer_app", + "test": "gstreamer_appsrc", + "use": "gstreamer_1_0", + "sources": [ + { "type": "pkgConfig", "args": "gstreamer-app-1.0" } + ] + }, + "gstreamer_photography_0_10": { + "label": "GStreamer Photography 0.10", + "export": "gstreamer_photography", + "test": "gstreamer_photography", + "use": "gstreamer_0_10", + "sources": [ + { "libs": "-lgstphotography-0.10" } + ] + }, + "gstreamer_photography_1_0": { + "label": "GStreamer Photography 1.0", + "export": "gstreamer_photography", + "test": "gstreamer_photography", + "use": "gstreamer_1_0", + "sources": [ + { "libs": "-lgstphotography-1.0" } + ] + }, + "libresourceqt5": { + "label": "libresourceqt5", + "test": "resourcepolicy", + "sources": [ + { "type": "pkgConfig", "args": "libresourceqt5" } + ] + }, + "mmrenderer": { + "label": "MMRenderer", + "test": "mmrenderer", + "sources": [ + { "libs": "-lmmrndclient -lstrm" } + ] + }, + "openal": { + "label": "OpenAL", + "test": "openal", + "sources": [ + { "type": "pkgConfig", "args": "openal" }, + { "libs": "-lOpenAL32", "condition": "config.win32" }, + { "libs": "-framework OpenAL", "condition": "config.darwin" }, + { "libs": "-lopenal", "condition": "config.unix && !config.darwin" } + ] + }, + "pulseaudio": { + "label": "PulseAudio >= 0.9.10", + "test": "pulseaudio", + "sources": [ + { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" } + ] + }, + "wmf": { + "label": "WMF", + "test": "wmf", + "sources": [ + { "libs": "-lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 -lMf -lMfuuid -lMfplat -lPropsys" } + ] + } + }, + + "tests": { + "evr": { + "label": "evr.h", + "type": "compile", + "test": "evr" + }, + "gstreamer_encodingprofiles_1_0": { + "label": "GStreamer encoding-profile.h", + "type": "compile", + "use": "gstreamer_1_0", + "test": "gstreamer_encodingprofiles" + }, + "gstreamer_encodingprofiles_0_10": { + "label": "GStreamer encoding-profile.h", + "type": "compile", + "use": "gstreamer_0_10", + "test": "gstreamer_encodingprofiles" + }, + "gpu_vivante": { + "label": "Vivante GPU", + "type": "compile", + "test": "gpu_vivante" + }, + "linux_v4l": { + "label": "Video for Linux", + "type": "compile", + "test": "linux_v4l" + }, + "wasapi": { + "label": "Windows Audio Services", + "type": "compile", + "test": "wasapi" + }, + "wmsdk": { + "label": "wmsdk.h", + "type": "compile", + "test": "wmsdk" + }, + "wshellitem": { + "label": "WShellItem", + "type": "compile", + "test": "wshellitem" + } + }, + + "features": { + "alsa": { + "label": "ALSA", + "condition": "config.unix && libs.alsa", + "output": [ "feature", "privateFeature" ] + }, + "avfoundation": { + "label": "AVFoundation", + "emitIf": "config.darwin", + "condition": "libs.avfoundation", + "output": [ "feature", "privateFeature" ] + }, + "directshow": { + "label": "DirectShow", + "condition": "config.win32 && libs.directshow", + "output": [ "feature", "privateFeature" ] + }, + "evr": { + "label": "evr.h", + "condition": "config.win32 && tests.evr", + "output": [ "feature", "privateFeature" ] + }, + "gstreamer_0_10": { + "label": "GStreamer 0.10", + "disable": "input.gstreamer == '1.0' || input.gstreamer == 'no'", + "enable": "input.gstreamer == '0.10'", + "condition": "!features.gstreamer_1_0 && libs.gstreamer_0_10", + "output": [ "privateFeature" ] + }, + "gstreamer_1_0": { + "label": "GStreamer 1.0", + "disable": "input.gstreamer == '0.10' || input.gstreamer == 'no'", + "enable": "input.gstreamer == '1.0'", + "condition": "libs.gstreamer_1_0", + "output": [ "privateFeature" ] + }, + "gstreamer": { + "condition": "features.gstreamer_1_0 || features.gstreamer_0_10", + "output": [ "privateFeature" ] + }, + "gstreamer_app": { + "label": "GStreamer App", + "condition": "(features.gstreamer_1_0 && libs.gstreamer_app_1_0) + || (features.gstreamer_0_10 && libs.gstreamer_app_0_10)", + "output": [ "privateFeature" ] + }, + "gstreamer_encodingprofiles": { + "label": "GStreamer encoding-profile.h", + "condition": "(features.gstreamer_1_0 && tests.gstreamer_encodingprofiles_1_0) + || (features.gstreamer_0_10 && tests.gstreamer_encodingprofiles_0_10)", + "output": [ "privateFeature" ] + }, + "gstreamer_photography": { + "label": "GStreamer Photography", + "condition": "(features.gstreamer_1_0 && libs.gstreamer_photography_1_0) + || (features.gstreamer_0_10 && libs.gstreamer_photography_0_10)", + "output": [ "privateFeature" ] + }, + "gpu_vivante": { + "label": "Vivante GPU", + "condition": "features.opengles2 && tests.gpu_vivante", + "output": [ "privateFeature" ] + }, + "resourcepolicy": { + "label": "Resource Policy (libresourceqt5)", + "condition": "libs.libresourceqt5", + "output": [ "privateFeature" ] + }, + "linux_v4l": { + "label": "Video for Linux", + "condition": "config.unix && tests.linux_v4l", + "output": [ "privateFeature" ] + }, + "mmrenderer": { + "label": "MMRenderer", + "emitIf": "config.qnx", + "condition": "libs.mmrenderer", + "output": [ "feature", "privateFeature" ] + }, + "openal": { + "label": "OpenAL", + "condition": "libs.openal", + "output": [ "feature", "privateFeature" ] + }, + "pulseaudio": { + "label": "PulseAudio", + "autoDetect": "config.unix", + "condition": "libs.pulseaudio", + "output": [ "feature", "privateFeature" ] + }, + "wasapi": { + "label": "Windows Audio Services", + "autoDetect": "false", + "condition": "config.win32 && tests.wasapi", + "output": [ "privateFeature" ] + }, + "wmsdk": { + "label": "wmsdk.h", + "condition": "config.win32 && tests.wmsdk", + "output": [ "feature", "privateFeature" ] + }, + "wshellitem": { + "label": "WShellItem", + "condition": "config.win32 && features.directshow && tests.wshellitem", + "output": [ "feature", "privateFeature" ] + }, + "wmf-backend": { + "label": "Windows Media Foundation", + "emitIf": "config.win32", + "autoDetect": false, + "condition": "libraries.wmf", + "output": [ "privateFeature" ] + } + }, + + "report": [ + ], + + "summary": [ + { + "section": "Qt Multimedia", + "entries": [ + "alsa", + "gstreamer_1_0", + "gstreamer_0_10", + "linux_v4l", + "openal", + "pulseaudio", + "resourcepolicy", + "mmrenderer", + "avfoundation", + "directshow", + "wmf-backend" + ] + } + ] +} diff --git a/src/multimedia/controls/qmediastreamscontrol.h b/src/multimedia/controls/qmediastreamscontrol.h index ea12dd188..3c36e96cb 100644 --- a/src/multimedia/controls/qmediastreamscontrol.h +++ b/src/multimedia/controls/qmediastreamscontrol.h @@ -43,7 +43,7 @@ #include <QtMultimedia/qmediacontrol.h> #include <QtMultimedia/qmultimedia.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmediaenumdebug.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/controls/qmetadatareadercontrol.h b/src/multimedia/controls/qmetadatareadercontrol.h index 9162d6454..455ce814e 100644 --- a/src/multimedia/controls/qmetadatareadercontrol.h +++ b/src/multimedia/controls/qmetadatareadercontrol.h @@ -45,7 +45,7 @@ #include <QtMultimedia/qmediaresource.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/controls/qmetadatawritercontrol.h b/src/multimedia/controls/qmetadatawritercontrol.h index 1c2f4cf69..da3413f77 100644 --- a/src/multimedia/controls/qmetadatawritercontrol.h +++ b/src/multimedia/controls/qmetadatawritercontrol.h @@ -45,7 +45,7 @@ #include <QtMultimedia/qmediaresource.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/controls/qradiodatacontrol.cpp b/src/multimedia/controls/qradiodatacontrol.cpp index 59c7c8cb1..eaa9aaed6 100644 --- a/src/multimedia/controls/qradiodatacontrol.cpp +++ b/src/multimedia/controls/qradiodatacontrol.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include "qradiodatacontrol.h" #include "qmediacontrol_p.h" diff --git a/src/multimedia/controls/qradiotunercontrol.cpp b/src/multimedia/controls/qradiotunercontrol.cpp index 5e5c1d5a7..8b9e865e1 100644 --- a/src/multimedia/controls/qradiotunercontrol.cpp +++ b/src/multimedia/controls/qradiotunercontrol.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include "qradiotunercontrol.h" #include "qmediacontrol_p.h" diff --git a/src/multimedia/doc/src/blackberry.qdoc b/src/multimedia/doc/src/blackberry.qdoc deleted file mode 100644 index 28c176deb..000000000 --- a/src/multimedia/doc/src/blackberry.qdoc +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! -\page blackberry.html -\title Qt Multimedia on BlackBerry -\brief Platform notes for the BlackBerry Platform - -Qt Multimedia supports BlackBerry devices that run the BB10 operating system. -This page covers the availability of different features on BB10. - -\section1 Implementation - -BB10 ships with a few different multimedia libraries. The main library for audio -and video playback is \e mmrenderer. For low-latency output of raw audio samples, -\e libasound, a variant of the Linux ALSA library, is available. Finally, for -three-dimensional positional audio playback, \e OpenAL is supported and present -on BB10. - -The Qt Multimedia BlackBerry backend uses mmrenderer for media playback. - -For the positional audio classes in the \l{Qt Audio Engine QML Types}{Qt Audio Engine} -QML module, OpenAL is used as on all other platforms. - -For recording videos and taking photos, the camapi library is used. - -\section1 Supported Features - -Playback of audio and video with QMediaPlayer and related classes is supported. -This includes the corresponding QML elements like MediaPlayer and VideoOutput. -Since the playback is delegated to mmrenderer, the supported formats are the same as in -mmrenderer. As mmrenderer supports streaming from HTTP and other URLs, this is -supported in QMediaPlayer as well. Playlists as sources are also supported. - -mmrenderer does not allow access to the pixel data of video frames, hence Qt Multimedia -classes like QVideoFrame and QAbstractVideoSurface will not work since they require access -to the image data. QVideoWidget and the VideoOutput QML element are implemented with an overlay window; -mmrenderer creates a separate window displaying a video and puts that on top of the Qt application. -As a consequence, no other widget or QML element can be put on top of the video, and QML shaders have -no effect. - -The \l{Qt Audio Engine QML Types}{Qt Audio Engine} QML module is fully supported, as it is based on OpenAL which is available -in BB10. - -The \l {camera} {QCamera} support includes recording of videos and taking photos. The viewfinder -is available through QCameraViewfinder and the VideoOutput QML element. - -Note: To use the camera on BB10, your application needs the 'access_shared', 'use_camera' and 'record_audio' -permissions set in the bar-descriptor.xml file. - -\section1 Unsupported Features - -Low-latency output and input of raw audio samples with QAudioOutput, QAudioInput and related classes is -not yet supported. The SoundEffect QML element and QSoundEffect are based on these classes. In your -QML file, use the MediaPlayer element instead of the SoundEffect element, as the APIs are nearly identical. - -QMediaPlayer does not support QIODevice-based streaming sources. However, streaming by specifying, for example, -an HTTP URL as the source does work. In addition, QMediaPlayer does not yet provide metadata like -the artist and album of the current track. - -Radio and audio recording are not yet supported. -*/ diff --git a/src/multimedia/doc/src/qtmultimedia-index.qdoc b/src/multimedia/doc/src/qtmultimedia-index.qdoc index 484338dc8..553732fd1 100644 --- a/src/multimedia/doc/src/qtmultimedia-index.qdoc +++ b/src/multimedia/doc/src/qtmultimedia-index.qdoc @@ -157,7 +157,6 @@ following topics provide more platform-specific information. \list - \li \l{Qt Multimedia on BlackBerry}{BlackBerry} \li \l{Qt Multimedia on Windows}{Windows} \endlist diff --git a/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h b/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h deleted file mode 100644 index 8abdd1e02..000000000 --- a/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company 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 QGSTREAMERGLTEXTURERENDERER_H -#define QGSTREAMERGLTEXTURERENDERER_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 <qvideorenderercontrol.h> -#include <private/qvideosurfacegstsink_p.h> -#include <private/qgstreamerbushelper_p.h> - -#include "qgstreamervideorendererinterface_p.h" -#include <QtGui/qcolor.h> - -#include <X11/extensions/Xv.h> - -QT_BEGIN_NAMESPACE - -class QGLContext; - -class QGstreamerGLTextureRenderer : public QVideoRendererControl, - public QGstreamerVideoRendererInterface, - public QGstreamerSyncMessageFilter, - public QGstreamerBusMessageFilter -{ - Q_OBJECT - Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter) - - Q_PROPERTY(bool overlayEnabled READ overlayEnabled WRITE setOverlayEnabled) - Q_PROPERTY(qulonglong winId READ winId WRITE setWinId) - Q_PROPERTY(QRect overlayGeometry READ overlayGeometry WRITE setOverlayGeometry) - Q_PROPERTY(QColor colorKey READ colorKey) - Q_PROPERTY(QSize nativeSize READ nativeSize NOTIFY nativeSizeChanged) - -public: - QGstreamerGLTextureRenderer(QObject *parent = 0); - virtual ~QGstreamerGLTextureRenderer(); - - QAbstractVideoSurface *surface() const; - void setSurface(QAbstractVideoSurface *surface); - - GstElement *videoSink(); - - bool isReady() const; - bool processBusMessage(const QGstreamerMessage &message); - bool processSyncMessage(const QGstreamerMessage &message); - void stopRenderer(); - - int framebufferNumber() const; - - bool overlayEnabled() const; - WId winId() const; - QRect overlayGeometry() const; - QColor colorKey() const; - QSize nativeSize() const; - -public slots: - void renderGLFrame(int); - - void setOverlayEnabled(bool); - void setWinId(WId id); - void setOverlayGeometry(const QRect &geometry); - void repaintOverlay(); - -signals: - void sinkChanged(); - void readyChanged(bool); - void nativeSizeChanged(); - -private slots: - void handleFormatChange(); - void updateNativeVideoSize(); - -private: - static void handleFrameReady(GstElement *sink, gint frame, gpointer data); - static gboolean padBufferProbe(GstPad *pad, GstBuffer *buffer, gpointer user_data); - - GstElement *m_videoSink; - QAbstractVideoSurface *m_surface; - QGLContext *m_context; - QSize m_nativeSize; - - WId m_winId; - QColor m_colorKey; - QRect m_displayRect; - bool m_overlayEnabled; - int m_bufferProbeId; - - QMutex m_mutex; - QWaitCondition m_renderCondition; -}; - -QT_END_NAMESPACE - -#endif // QGSTREAMERVIDEORENDRER_H diff --git a/src/multimedia/multimedia.pro b/src/multimedia/multimedia.pro index 761e488ba..0f3f3ff6b 100644 --- a/src/multimedia/multimedia.pro +++ b/src/multimedia/multimedia.pro @@ -15,6 +15,7 @@ QMAKE_DOCS = $$PWD/doc/qtmultimedia.qdocconf INCLUDEPATH *= . PRIVATE_HEADERS += \ + qtmultimediaglobal_p.h \ qmediacontrol_p.h \ qmediaobject_p.h \ qmediapluginloader_p.h \ @@ -28,6 +29,7 @@ PRIVATE_HEADERS += \ qmultimediautils_p.h PUBLIC_HEADERS += \ + qtmultimediaglobal.h \ qmediabindableinterface.h \ qmediacontrol.h \ qmediaenumdebug.h \ @@ -36,8 +38,7 @@ PUBLIC_HEADERS += \ qmediaservice.h \ qmediaserviceproviderplugin.h \ qmediatimerange.h \ - qmultimedia.h \ - qtmultimediadefs.h \ + qmultimedia.h SOURCES += \ qmediabindableinterface.cpp \ diff --git a/src/multimedia/playback/playlistfileparser_p.h b/src/multimedia/playback/playlistfileparser_p.h index 353da3eca..bdf95fe7a 100644 --- a/src/multimedia/playback/playlistfileparser_p.h +++ b/src/multimedia/playback/playlistfileparser_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include "qtmultimediadefs.h" +#include "qtmultimediaglobal.h" #include <QtNetwork/QNetworkRequest> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/playback/qmediacontent.h b/src/multimedia/playback/qmediacontent.h index 25db6ecf5..f7c086752 100644 --- a/src/multimedia/playback/qmediacontent.h +++ b/src/multimedia/playback/qmediacontent.h @@ -45,7 +45,7 @@ #include <QtMultimedia/qmediaresource.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index 191095e82..c9b9b4fc1 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -100,7 +100,6 @@ static void qRegisterMediaPlayerMetaTypes() Q_CONSTRUCTOR_FUNCTION(qRegisterMediaPlayerMetaTypes) - #define MAX_NESTED_PLAYLISTS 16 class QMediaPlayerPrivate : public QMediaObjectPrivate @@ -112,38 +111,39 @@ public: : provider(0) , control(0) , audioRoleControl(0) + , playlist(0) + , networkAccessControl(0) , state(QMediaPlayer::StoppedState) , status(QMediaPlayer::UnknownMediaStatus) , error(QMediaPlayer::NoError) , ignoreNextStatusChange(-1) - , playlist(0) - , networkAccessControl(0) - , hasStreamPlaybackFeature(false) , nestedPlaylists(0) + , hasStreamPlaybackFeature(false) {} QMediaServiceProvider *provider; QMediaPlayerControl* control; QAudioRoleControl *audioRoleControl; - QMediaPlayer::State state; - QMediaPlayer::MediaStatus status; - QMediaPlayer::Error error; QString errorString; - int ignoreNextStatusChange; QPointer<QObject> videoOutput; QMediaPlaylist *playlist; QMediaNetworkAccessControl *networkAccessControl; QVideoSurfaceOutput surfaceOutput; - bool hasStreamPlaybackFeature; QMediaContent qrcMedia; QScopedPointer<QFile> qrcFile; QMediaContent rootMedia; QMediaContent pendingPlaylist; + QMediaPlayer::State state; + QMediaPlayer::MediaStatus status; + QMediaPlayer::Error error; + int ignoreNextStatusChange; + int nestedPlaylists; + bool hasStreamPlaybackFeature; + QMediaPlaylist *parentPlaylist(QMediaPlaylist *pls); bool isInChain(const QUrl &url); - int nestedPlaylists; void setMedia(const QMediaContent &media, QIODevice *stream = 0); diff --git a/src/multimedia/playback/qmediaplaylistioplugin_p.h b/src/multimedia/playback/qmediaplaylistioplugin_p.h index 62bb6757a..73281b2bf 100644 --- a/src/multimedia/playback/qmediaplaylistioplugin_p.h +++ b/src/multimedia/playback/qmediaplaylistioplugin_p.h @@ -54,7 +54,7 @@ #include <QtCore/qobject.h> #include <QtCore/qplugin.h> -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include "qmediacontent.h" diff --git a/src/multimedia/playback/qmediaresource.h b/src/multimedia/playback/qmediaresource.h index 83f998eb9..9740166c6 100644 --- a/src/multimedia/playback/qmediaresource.h +++ b/src/multimedia/playback/qmediaresource.h @@ -44,7 +44,7 @@ #include <QtCore/qmetatype.h> #include <QtNetwork/qnetworkrequest.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/qmediacontrol.h b/src/multimedia/qmediacontrol.h index 3c95444d0..680b18e7f 100644 --- a/src/multimedia/qmediacontrol.h +++ b/src/multimedia/qmediacontrol.h @@ -40,7 +40,7 @@ #ifndef QABSTRACTMEDIACONTROL_H #define QABSTRACTMEDIACONTROL_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtCore/qobject.h> #include <QtCore/qstring.h> diff --git a/src/multimedia/qmediacontrol_p.h b/src/multimedia/qmediacontrol_p.h index 948f9fdd5..e9827fd1e 100644 --- a/src/multimedia/qmediacontrol_p.h +++ b/src/multimedia/qmediacontrol_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/qmediametadata.cpp b/src/multimedia/qmediametadata.cpp index 9ffd2a727..42fabbe7e 100644 --- a/src/multimedia/qmediametadata.cpp +++ b/src/multimedia/qmediametadata.cpp @@ -164,7 +164,7 @@ Q_DEFINE_METADATA(ThumbnailImage); \ingroup multimedia \inmodule QtMultimedia - This namespace provides identifiers for meta-data attributes. + \brief Provides identifiers for meta-data attributes. \note Not all identifiers are supported on all platforms. Please consult vendor documentation for specific support on different platforms. diff --git a/src/multimedia/qmediametadata.h b/src/multimedia/qmediametadata.h index 2fb49c88e..8d8744490 100644 --- a/src/multimedia/qmediametadata.h +++ b/src/multimedia/qmediametadata.h @@ -44,7 +44,7 @@ #include <QtCore/qmetatype.h> #include <QtCore/qstring.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/qmediaobject.h b/src/multimedia/qmediaobject.h index efd89f840..5788254b8 100644 --- a/src/multimedia/qmediaobject.h +++ b/src/multimedia/qmediaobject.h @@ -43,7 +43,7 @@ #include <QtCore/qobject.h> #include <QtCore/qstringlist.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/qmediapluginloader_p.h b/src/multimedia/qmediapluginloader_p.h index 9798f2ae8..a4e726544 100644 --- a/src/multimedia/qmediapluginloader_p.h +++ b/src/multimedia/qmediapluginloader_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include <QtCore/qobject.h> #include <QtCore/qstring.h> #include <QtCore/qstringlist.h> diff --git a/src/multimedia/qmediaresourcepolicy_p.h b/src/multimedia/qmediaresourcepolicy_p.h index bfc89df84..13e3f4913 100644 --- a/src/multimedia/qmediaresourcepolicy_p.h +++ b/src/multimedia/qmediaresourcepolicy_p.h @@ -52,7 +52,7 @@ // #include <QObject> -#include "qtmultimediadefs.h" +#include "qtmultimediaglobal.h" QT_BEGIN_NAMESPACE diff --git a/src/multimedia/qmediaresourcepolicyplugin_p.h b/src/multimedia/qmediaresourcepolicyplugin_p.h index 66cef02d6..7b53c3b3a 100644 --- a/src/multimedia/qmediaresourcepolicyplugin_p.h +++ b/src/multimedia/qmediaresourcepolicyplugin_p.h @@ -52,7 +52,7 @@ // #include <QObject> -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/qmediaresourceset_p.h b/src/multimedia/qmediaresourceset_p.h index 1df6e19e5..a0158877f 100644 --- a/src/multimedia/qmediaresourceset_p.h +++ b/src/multimedia/qmediaresourceset_p.h @@ -51,7 +51,7 @@ // We mean it. // #include <QObject> -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/qmediaservice.h b/src/multimedia/qmediaservice.h index 64fe63b84..9e653b2d8 100644 --- a/src/multimedia/qmediaservice.h +++ b/src/multimedia/qmediaservice.h @@ -40,7 +40,7 @@ #ifndef QABSTRACTMEDIASERVICE_H #define QABSTRACTMEDIASERVICE_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtCore/qobject.h> #include <QtCore/qstringlist.h> diff --git a/src/multimedia/qmediaserviceprovider_p.h b/src/multimedia/qmediaserviceprovider_p.h index 63e1bdd18..4ca9c9e8f 100644 --- a/src/multimedia/qmediaserviceprovider_p.h +++ b/src/multimedia/qmediaserviceprovider_p.h @@ -53,7 +53,7 @@ #include <QtCore/qobject.h> #include <QtCore/qshareddata.h> -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include "qmultimedia.h" #include "qmediaserviceproviderplugin.h" diff --git a/src/multimedia/qmediaserviceproviderplugin.h b/src/multimedia/qmediaserviceproviderplugin.h index 6cdc18d61..43fe55d43 100644 --- a/src/multimedia/qmediaserviceproviderplugin.h +++ b/src/multimedia/qmediaserviceproviderplugin.h @@ -43,7 +43,7 @@ #include <QtCore/qstringlist.h> #include <QtCore/qplugin.h> #include <QtMultimedia/qmultimedia.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qcamera.h> #ifdef Q_MOC_RUN diff --git a/src/multimedia/qmediastoragelocation_p.h b/src/multimedia/qmediastoragelocation_p.h index 29e6a5775..13399b54d 100644 --- a/src/multimedia/qmediastoragelocation_p.h +++ b/src/multimedia/qmediastoragelocation_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include <QDir> #include <QMap> #include <QHash> diff --git a/src/multimedia/qmediatimerange.h b/src/multimedia/qmediatimerange.h index a9eab2498..0b4fe8e67 100644 --- a/src/multimedia/qmediatimerange.h +++ b/src/multimedia/qmediatimerange.h @@ -40,7 +40,7 @@ #ifndef QMEDIATIMERANGE_H #define QMEDIATIMERANGE_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> #include <QtCore/qshareddata.h> diff --git a/src/multimedia/qmultimedia.h b/src/multimedia/qmultimedia.h index b517b5a32..a3dbc5e3e 100644 --- a/src/multimedia/qmultimedia.h +++ b/src/multimedia/qmultimedia.h @@ -44,7 +44,7 @@ #include <QtCore/qmetatype.h> #include <QtCore/qstring.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/gstreamer/camerabin/camerabuttonlistener_meego.h b/src/multimedia/qtmultimediaglobal.h index 776640ed4..ae11ed271 100644 --- a/src/plugins/gstreamer/camerabin/camerabuttonlistener_meego.h +++ b/src/multimedia/qtmultimediaglobal.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -37,31 +37,23 @@ ** ****************************************************************************/ +#ifndef QTMULTIMEDIAGLOBAL_H +#define QTMULTIMEDIAGLOBAL_H -#ifndef CAMERABUTTONLISTENER_MEEGO_H -#define CAMERABUTTONLISTENER_MEEGO_H - -#include <QtCore/qobject.h> -#include <qmsystem2/qmkeys.h> +#include <QtGui/qtguiglobal.h> +#include <QtMultimedia/qtmultimedia-config.h> QT_BEGIN_NAMESPACE -class CameraButtonListener : public QObject -{ - Q_OBJECT -public: - CameraButtonListener(QObject *parent = 0); - ~CameraButtonListener(); - -private slots: - void handleQmKeyEvent(MeeGo::QmKeys::Key key, MeeGo::QmKeys::State state); - -private: - MeeGo::QmKeys *m_keys; - bool m_focusPressed; - bool m_shutterPressed; -}; +#ifndef QT_STATIC +# if defined(QT_BUILD_MULTIMEDIA_LIB) +# define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT +# else +# define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_MULTIMEDIA_EXPORT +#endif QT_END_NAMESPACE - -#endif // CAMERABUTTONLISTENER_MEEGO_H +#endif // QTQMLGLOBAL_H diff --git a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.h b/src/multimedia/qtmultimediaglobal_p.h index d9789d689..797142029 100644 --- a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.h +++ b/src/multimedia/qtmultimediaglobal_p.h @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 Research In Motion +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage @@ -36,29 +36,23 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef BPSMEDIAPLAYERCONTROL_H -#define BPSMEDIAPLAYERCONTROL_H -#include "mmrenderermediaplayercontrol.h" - -QT_BEGIN_NAMESPACE - -class BpsMediaPlayerControl Q_DECL_FINAL : public MmRendererMediaPlayerControl -{ - Q_OBJECT -public: - explicit BpsMediaPlayerControl(QObject *parent = 0); - ~BpsMediaPlayerControl(); - - void startMonitoring(int contextId, const QString &contextName) Q_DECL_OVERRIDE; - void stopMonitoring() Q_DECL_OVERRIDE; - - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; - -private: - mmrenderer_monitor_t *m_eventMonitor; -}; - -QT_END_NAMESPACE - -#endif +#ifndef QTMULTIMEDIAGLOBAL_P_H +#define QTMULTIMEDIAGLOBAL_P_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 <QtGui/private/qtguiglobal_p.h> +#include <QtMultimedia/private/qtmultimedia-config_p.h> +#include <QtMultimedia/qtmultimediaglobal.h> + +#endif // QTQMLGLOBAL_P_H diff --git a/src/multimedia/recording/qmediaencodersettings.h b/src/multimedia/recording/qmediaencodersettings.h index d6f92ca5c..0d6a9eddf 100644 --- a/src/multimedia/recording/qmediaencodersettings.h +++ b/src/multimedia/recording/qmediaencodersettings.h @@ -44,7 +44,7 @@ #include <QtCore/qstring.h> #include <QtCore/qsize.h> #include <QtCore/qvariant.h> -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> QT_BEGIN_NAMESPACE diff --git a/src/multimedia/video/qabstractvideobuffer.h b/src/multimedia/video/qabstractvideobuffer.h index 7b246a712..dcefdf7bc 100644 --- a/src/multimedia/video/qabstractvideobuffer.h +++ b/src/multimedia/video/qabstractvideobuffer.h @@ -40,7 +40,7 @@ #ifndef QABSTRACTVIDEOBUFFER_H #define QABSTRACTVIDEOBUFFER_H -#include <QtMultimedia/qtmultimediadefs.h> +#include <QtMultimedia/qtmultimediaglobal.h> #include <QtMultimedia/qmultimedia.h> diff --git a/src/multimedia/video/qabstractvideobuffer_p.h b/src/multimedia/video/qabstractvideobuffer_p.h index cae018d3c..6fbd75a30 100644 --- a/src/multimedia/video/qabstractvideobuffer_p.h +++ b/src/multimedia/video/qabstractvideobuffer_p.h @@ -54,7 +54,7 @@ #include <QtCore/qshareddata.h> #include "qabstractvideobuffer.h" -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include <qmultimedia.h> diff --git a/src/multimedia/video/qvideooutputorientationhandler_p.h b/src/multimedia/video/qvideooutputorientationhandler_p.h index cf3ddbdb2..b5cfc089b 100644 --- a/src/multimedia/video/qvideooutputorientationhandler_p.h +++ b/src/multimedia/video/qvideooutputorientationhandler_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include <qtmultimediadefs.h> +#include <qtmultimediaglobal.h> #include <QObject> diff --git a/src/multimediawidgets/multimediawidgets.pro b/src/multimediawidgets/multimediawidgets.pro index 29ec710f5..c37868933 100644 --- a/src/multimediawidgets/multimediawidgets.pro +++ b/src/multimediawidgets/multimediawidgets.pro @@ -17,27 +17,11 @@ PUBLIC_HEADERS += \ SOURCES += \ qcameraviewfinder.cpp \ + qgraphicsvideoitem.cpp \ qpaintervideosurface.cpp \ qvideowidgetcontrol.cpp \ qvideowidget.cpp -maemo6 { - qtConfig(opengles2) { - PRIVATE_HEADERS += qeglimagetexturesurface_p.h - SOURCES += qeglimagetexturesurface.cpp - - SOURCES += qgraphicsvideoitem_maemo6.cpp - - LIBS_PRIVATE += -lX11 - } else { - SOURCES += qgraphicsvideoitem.cpp - } -} - -!maemo* { - SOURCES += qgraphicsvideoitem.cpp -} - HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS load(qt_module) diff --git a/src/multimediawidgets/qeglimagetexturesurface.cpp b/src/multimediawidgets/qeglimagetexturesurface.cpp deleted file mode 100644 index 5e2073a48..000000000 --- a/src/multimediawidgets/qeglimagetexturesurface.cpp +++ /dev/null @@ -1,533 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company 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 <qeglimagetexturesurface_p.h> -#include <qpaintervideosurface_p.h> - -#include <QtCore/qmath.h> -#include <QtCore/qvariant.h> -#include <QtCore/qdebug.h> -#include <QtGui/qpainter.h> -#include <QtWidgets/qx11info_x11.h> -#include <qvideosurfaceformat.h> - - -QT_BEGIN_NAMESPACE - -//#define DEBUG_OMAPFB_SURFACE - -const QAbstractVideoBuffer::HandleType EGLImageTextureHandle = -QAbstractVideoBuffer::HandleType(QAbstractVideoBuffer::UserHandle+3434); - -/*! - \class QEglImageTextureSurface - \internal -*/ - -/*! -*/ -QEglImageTextureSurface::QEglImageTextureSurface(QObject *parent) - : QAbstractVideoSurface(parent) - , m_context(0) - , m_program(0) - , m_pixelFormat(QVideoFrame::Format_Invalid) - , m_ready(false) - , m_colorKey(49,0,49) - , m_fallbackSurface(0) - , m_fallbackSurfaceActive(false) -{ - m_fallbackSurface = new QPainterVideoSurface(this); -} - -/*! -*/ -QEglImageTextureSurface::~QEglImageTextureSurface() -{ - if (isActive()) - stop(); -} - -/*! -*/ -QList<QVideoFrame::PixelFormat> QEglImageTextureSurface::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const -{ -#ifdef DEBUG_OMAPFB_SURFACE - qDebug() << Q_FUNC_INFO << handleType; -#endif - - if (handleType == EGLImageTextureHandle) { - return QList<QVideoFrame::PixelFormat>() - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_ARGB32; - } - - return m_fallbackSurface->supportedPixelFormats(handleType); -} - -const char *qt_glsl_eglTextureVertexShaderProgram = - "attribute highp vec4 vertexCoordArray;\n" - "attribute mediump vec2 textureCoordArray;\n" - "uniform highp mat4 positionMatrix;\n" - "varying mediump vec2 textureCoord;\n" - "void main (void)\n" - "{\n" - " gl_Position = positionMatrix * vertexCoordArray;\n" - " textureCoord = textureCoordArray;\n" - "}"; - -static const char* qt_glsl_eglTextureShaderProgram = - "#extension GL_OES_EGL_image_external: enable\n" - "\n" - "uniform samplerExternalOES texRgb;\n" - "varying mediump vec2 textureCoord;\n" - "\n" - "void main (void)\n" - "{\n" - " gl_FragColor = texture2D(texRgb, textureCoord);\n" - "}"; - - -/*! -*/ -bool QEglImageTextureSurface::start(const QVideoSurfaceFormat &format) -{ -#ifdef DEBUG_OMAPFB_SURFACE - qDebug() << Q_FUNC_INFO << format; -#endif - - m_fallbackSurfaceActive = false; - if (format.handleType() != EGLImageTextureHandle) { - qWarning() << Q_FUNC_INFO << "Non EGLImageTextureHandle based format requested, fallback to QPainterVideoSurface"; - connect(m_fallbackSurface, SIGNAL(activeChanged(bool)), - this, SIGNAL(activeChanged(bool))); - connect(m_fallbackSurface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), - this, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat))); - connect(m_fallbackSurface, SIGNAL(supportedFormatsChanged()), - this, SIGNAL(supportedFormatsChanged())); - connect(m_fallbackSurface, SIGNAL(nativeResolutionChanged(QSize)), - this, SIGNAL(nativeResolutionChanged(QSize))); - connect(m_fallbackSurface, SIGNAL(frameChanged()), - this, SIGNAL(frameChanged())); - - if (m_fallbackSurface->start(format)) { - m_fallbackSurfaceActive = true; - QAbstractVideoSurface::start(format); - } else { - qWarning() << Q_FUNC_INFO << "failed to start video surface:" << m_fallbackSurface->error(); - setError(m_fallbackSurface->error()); - - disconnect(m_fallbackSurface, SIGNAL(activeChanged(bool)), - this, SIGNAL(activeChanged(bool))); - disconnect(m_fallbackSurface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), - this, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat))); - disconnect(m_fallbackSurface, SIGNAL(supportedFormatsChanged()), - this, SIGNAL(supportedFormatsChanged())); - disconnect(m_fallbackSurface, SIGNAL(nativeResolutionChanged(QSize)), - this, SIGNAL(nativeResolutionChanged(QSize))); - disconnect(m_fallbackSurface, SIGNAL(frameChanged()), - this, SIGNAL(frameChanged())); - } - - return m_fallbackSurfaceActive; - } - - QAbstractVideoSurface::Error error = NoError; - - if (isActive()) - stop(); - - if (format.frameSize().isEmpty()) { - setError(UnsupportedFormatError); - } else if (m_context) { - m_context->makeCurrent(); - m_program = new QGLShaderProgram(m_context, this); - - if (!m_program->addShaderFromSourceCode(QGLShader::Vertex, qt_glsl_eglTextureVertexShaderProgram)) { - qWarning("QOmapFbVideoSurface: Vertex shader compile error %s", - qPrintable(m_program->log())); - error = ResourceError; - } - - if (error == NoError - && !m_program->addShaderFromSourceCode(QGLShader::Fragment, qt_glsl_eglTextureShaderProgram)) { - qWarning("QOmapFbVideoSurface: Vertex shader compile error %s", - qPrintable(m_program->log())); - error = QAbstractVideoSurface::ResourceError; - } - - if (error == NoError) { - m_program->bindAttributeLocation("textureCoordArray", 1); - if(!m_program->link()) { - qWarning("QOmapFbVideoSurface: Shader link error %s", qPrintable(m_program->log())); - m_program->removeAllShaders(); - error = QAbstractVideoSurface::ResourceError; - } - } - - if (error != QAbstractVideoSurface::NoError) { - delete m_program; - m_program = 0; - } - } - - if (error == QAbstractVideoSurface::NoError) { - m_scanLineDirection = format.scanLineDirection(); - m_frameSize = format.frameSize(); - m_pixelFormat = format.pixelFormat(); - m_frameSize = format.frameSize(); - m_sourceRect = format.viewport(); - m_ready = true; - - return QAbstractVideoSurface::start(format); - } - - QAbstractVideoSurface::stop(); - return false; -} - -/*! -*/ -void QEglImageTextureSurface::stop() -{ -#ifdef DEBUG_OMAPFB_SURFACE - qDebug() << Q_FUNC_INFO; -#endif - - if (m_fallbackSurfaceActive) { - m_fallbackSurface->stop(); - m_fallbackSurfaceActive = false; - - disconnect(m_fallbackSurface, SIGNAL(activeChanged(bool)), - this, SIGNAL(activeChanged(bool))); - disconnect(m_fallbackSurface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), - this, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat))); - disconnect(m_fallbackSurface, SIGNAL(supportedFormatsChanged()), - this, SIGNAL(supportedFormatsChanged())); - disconnect(m_fallbackSurface, SIGNAL(nativeResolutionChanged(QSize)), - this, SIGNAL(nativeResolutionChanged(QSize))); - disconnect(m_fallbackSurface, SIGNAL(frameChanged()), - this, SIGNAL(frameChanged())); - - m_ready = false; - QAbstractVideoSurface::stop(); - } - - if (isActive()) { - if (m_context) - m_context->makeCurrent(); - m_frame = QVideoFrame(); - - m_program->removeAllShaders(); - delete m_program; - m_program = 0; - m_ready = false; - - QAbstractVideoSurface::stop(); - } -} - -/*! -*/ -bool QEglImageTextureSurface::present(const QVideoFrame &frame) -{ - if (m_fallbackSurfaceActive) { - if (m_fallbackSurface->present(frame)) { - return true; - } else { - setError(m_fallbackSurface->error()); - stop(); - return false; - } - } - - if (!m_ready) { - if (!isActive()) - setError(StoppedError); - else - m_frame = frame; - } else if (frame.isValid() - && (frame.pixelFormat() != m_pixelFormat || frame.size() != m_frameSize)) { - setError(IncorrectFormatError); - qWarning() << "Received frame of incorrect format, stopping the surface"; - - stop(); - } else { - if (m_context) - m_context->makeCurrent(); - m_frame = frame; - m_ready = false; - emit frameChanged(); - return true; - } - return false; -} - -/*! -*/ -int QEglImageTextureSurface::brightness() const -{ - return m_fallbackSurface->brightness(); -} - -/*! -*/ -void QEglImageTextureSurface::setBrightness(int brightness) -{ - m_fallbackSurface->setBrightness(brightness); -} - -/*! -*/ -int QEglImageTextureSurface::contrast() const -{ - return m_fallbackSurface->contrast(); -} - -/*! -*/ -void QEglImageTextureSurface::setContrast(int contrast) -{ - m_fallbackSurface->setContrast(contrast); -} - -/*! -*/ -int QEglImageTextureSurface::hue() const -{ - return m_fallbackSurface->hue(); -} - -/*! -*/ -void QEglImageTextureSurface::setHue(int hue) -{ - m_fallbackSurface->setHue(hue); -} - -/*! -*/ -int QEglImageTextureSurface::saturation() const -{ - return m_fallbackSurface->saturation(); -} - -/*! -*/ -void QEglImageTextureSurface::setSaturation(int saturation) -{ - m_fallbackSurface->setSaturation(saturation); -} - -/*! -*/ -bool QEglImageTextureSurface::isReady() const -{ - return m_fallbackSurfaceActive ? m_fallbackSurface->isReady() : m_ready; -} - -/*! -*/ -void QEglImageTextureSurface::setReady(bool ready) -{ - m_ready = ready; - if (m_fallbackSurfaceActive) - m_fallbackSurface->setReady(ready); -} - -/*! -*/ -void QEglImageTextureSurface::paint(QPainter *painter, const QRectF &target, const QRectF &sourceRect) -{ - if (m_fallbackSurfaceActive) { - m_fallbackSurface->paint(painter, target, sourceRect); - return; - } - - if (!isActive() || !m_frame.isValid()) { - painter->fillRect(target, QBrush(Qt::black)); - } else { - const QRectF source( - m_sourceRect.x() + m_sourceRect.width() * sourceRect.x(), - m_sourceRect.y() + m_sourceRect.height() * sourceRect.y(), - m_sourceRect.width() * sourceRect.width(), - m_sourceRect.height() * sourceRect.height()); - - bool stencilTestEnabled = glIsEnabled(GL_STENCIL_TEST); - bool scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); - - painter->beginNativePainting(); - - if (stencilTestEnabled) - glEnable(GL_STENCIL_TEST); - if (scissorTestEnabled) - glEnable(GL_SCISSOR_TEST); - - const int width = QGLContext::currentContext()->device()->width(); - const int height = QGLContext::currentContext()->device()->height(); - - const QTransform transform = painter->deviceTransform(); - - const GLfloat wfactor = 2.0 / width; - const GLfloat hfactor = -2.0 / height; - - const GLfloat positionMatrix[4][4] = - { - { - /*(0,0)*/ GLfloat(wfactor * transform.m11() - transform.m13()), - /*(0,1)*/ GLfloat(hfactor * transform.m12() + transform.m13()), - /*(0,2)*/ 0.0, - /*(0,3)*/ GLfloat(transform.m13()) - }, { - /*(1,0)*/ GLfloat(wfactor * transform.m21() - transform.m23()), - /*(1,1)*/ GLfloat(hfactor * transform.m22() + transform.m23()), - /*(1,2)*/ 0.0, - /*(1,3)*/ GLfloat(transform.m23()) - }, { - /*(2,0)*/ 0.0, - /*(2,1)*/ 0.0, - /*(2,2)*/ -1.0, - /*(2,3)*/ 0.0 - }, { - /*(3,0)*/ GLfloat(wfactor * transform.dx() - transform.m33()), - /*(3,1)*/ GLfloat(hfactor * transform.dy() + transform.m33()), - /*(3,2)*/ 0.0, - /*(3,3)*/ GLfloat(transform.m33()) - } - }; - - const GLfloat vTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? target.top() - : target.bottom() + 1; - const GLfloat vBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? target.bottom() + 1 - : target.top(); - - - const GLfloat vertexCoordArray[] = - { - GLfloat(target.left()) , GLfloat(vBottom), - GLfloat(target.right() + 1), GLfloat(vBottom), - GLfloat(target.left()) , GLfloat(vTop), - GLfloat(target.right() + 1), GLfloat(vTop) - }; - - const GLfloat txLeft = source.left() / m_frameSize.width(); - const GLfloat txRight = source.right() / m_frameSize.width(); - const GLfloat txTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.top() / m_frameSize.height() - : source.bottom() / m_frameSize.height(); - const GLfloat txBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.bottom() / m_frameSize.height() - : source.top() / m_frameSize.height(); - - const GLfloat textureCoordArray[] = - { - txLeft , txBottom, - txRight, txBottom, - txLeft , txTop, - txRight, txTop - }; - - m_program->bind(); - - m_program->enableAttributeArray("vertexCoordArray"); - m_program->enableAttributeArray("textureCoordArray"); - m_program->setAttributeArray("vertexCoordArray", vertexCoordArray, 2); - m_program->setAttributeArray("textureCoordArray", textureCoordArray, 2); - m_program->setUniformValue("positionMatrix", positionMatrix); - m_program->setUniformValue("texRgb", 0); - - //map() binds the external texture - m_frame.map(QAbstractVideoBuffer::ReadOnly); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - - //it's necessary to unbind the external texture - m_frame.unmap(); - - m_program->release(); - - painter->endNativePainting(); - } -} - -/*! - \fn QEglImageTextureSurface::frameChanged() -*/ - -/*! -*/ -const QGLContext *QEglImageTextureSurface::glContext() const -{ - return m_context; -} - -/*! -*/ -void QEglImageTextureSurface::setGLContext(QGLContext *context) -{ - if (m_context == context) - return; - - stop(); - - m_context = context; - - m_fallbackSurface->setGLContext(context); - if (m_fallbackSurface->supportedShaderTypes() & QPainterVideoSurface::GlslShader) { - m_fallbackSurface->setShaderType(QPainterVideoSurface::GlslShader); - } else { - m_fallbackSurface->setShaderType(QPainterVideoSurface::FragmentProgramShader); - } - - emit supportedFormatsChanged(); -} - -void QEglImageTextureSurface::viewportDestroyed() -{ - m_context = 0; - m_fallbackSurface->viewportDestroyed(); - - setError(ResourceError); - stop(); -} - -#include "moc_qeglimagetexturesurface_p.cpp" -QT_END_NAMESPACE diff --git a/src/multimediawidgets/qeglimagetexturesurface_p.h b/src/multimediawidgets/qeglimagetexturesurface_p.h deleted file mode 100644 index 8affe4dc3..000000000 --- a/src/multimediawidgets/qeglimagetexturesurface_p.h +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company 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 QEGLIMAGETEXTURESURFACE_P_H -#define QEGLIMAGETEXTURESURFACE_P_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 <qtmultimediawidgetdefs.h> -#include <QtCore/qsize.h> -#include <QtGui/qimage.h> -#include <QtGui/qmatrix4x4.h> -#include <QtGui/qpaintengine.h> - -#include <QtOpenGL/qglshaderprogram.h> - -#include <qabstractvideosurface.h> -#include <qvideosurfaceformat.h> -#include <qvideoframe.h> - -QT_BEGIN_NAMESPACE - -class QGLContext; -class QGLShaderProgram; -class QPainterVideoSurface; - -class QEglImageTextureSurface : public QAbstractVideoSurface -{ - Q_OBJECT -public: - explicit QEglImageTextureSurface(QObject *parent = 0); - ~QEglImageTextureSurface(); - - QList<QVideoFrame::PixelFormat> supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; - - bool start(const QVideoSurfaceFormat &format); - void stop(); - - bool present(const QVideoFrame &frame); - - int brightness() const; - void setBrightness(int brightness); - - int contrast() const; - void setContrast(int contrast); - - int hue() const; - void setHue(int hue); - - int saturation() const; - void setSaturation(int saturation); - - bool isReady() const; - void setReady(bool ready); - - void paint(QPainter *painter, const QRectF &target, const QRectF &source = QRectF(0, 0, 1, 1)); - - const QGLContext *glContext() const; - void setGLContext(QGLContext *context); - - bool isOverlayEnabled() const; - void setOverlayEnabled(bool enabled); - - QRect displayRect() const; - void setDisplayRect(const QRect &rect); - -public Q_SLOTS: - void viewportDestroyed(); - -Q_SIGNALS: - void frameChanged(); - -private: - QGLContext *m_context; - QGLShaderProgram *m_program; - - QVideoFrame m_frame; - - QVideoFrame::PixelFormat m_pixelFormat; - QVideoSurfaceFormat::Direction m_scanLineDirection; - QSize m_frameSize; - QRect m_sourceRect; - bool m_ready; - - QRect m_viewport; - QRect m_displayRect; - QColor m_colorKey; - - QPainterVideoSurface *m_fallbackSurface; - bool m_fallbackSurfaceActive; -}; - -QT_END_NAMESPACE - - -#endif diff --git a/src/multimediawidgets/qgraphicsvideoitem.cpp b/src/multimediawidgets/qgraphicsvideoitem.cpp index 1259f1583..584cb429a 100644 --- a/src/multimediawidgets/qgraphicsvideoitem.cpp +++ b/src/multimediawidgets/qgraphicsvideoitem.cpp @@ -48,7 +48,7 @@ #include <QtCore/qcoreevent.h> #include <QtCore/qpointer.h> -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) #include <QtOpenGL/qgl.h> #endif @@ -372,7 +372,7 @@ void QGraphicsVideoItem::paint( if (d->surface && d->updatePaintDevice) { d->updatePaintDevice = false; -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) if (widget) connect(widget, SIGNAL(destroyed()), d->surface, SLOT(viewportDestroyed())); diff --git a/src/multimediawidgets/qgraphicsvideoitem_maemo6.cpp b/src/multimediawidgets/qgraphicsvideoitem_maemo6.cpp deleted file mode 100644 index caedaeee1..000000000 --- a/src/multimediawidgets/qgraphicsvideoitem_maemo6.cpp +++ /dev/null @@ -1,497 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company 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 "qgraphicsvideoitem.h" - -#include <QtCore/qcoreevent.h> -#include <QtCore/qpointer.h> -#include <QtCore/qbasictimer.h> - -#include <QtWidgets/qgraphicsscene.h> - -#include <qmediaobject.h> -#include <qmediaservice.h> -#include <qpaintervideosurface_p.h> -#include <qeglimagetexturesurface_p.h> -#include <qvideorenderercontrol.h> - -#include <qvideosurfaceformat.h> - -#include <X11/Xlib.h> - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) -#include <QtOpenGL/qgl.h> -#endif - -//#define ENABLE_OVERLAY - -namespace -{ -//XInitThreads is necessary for gltexturesink element. -//To ensure it's called before main() it's better to link to -//libQtMultimedia.so directly, not when QML multimedia plugin is loaded. -class InitThreads -{ -public: - InitThreads() - { - XInitThreads(); - } -} _initThreads; -} - -Q_DECLARE_METATYPE(QVideoSurfaceFormat) - -QT_BEGIN_NAMESPACE - -class QGraphicsVideoItemPrivate -{ -public: - QGraphicsVideoItemPrivate() - : q_ptr(0) - , surface(0) - , mediaObject(0) - , service(0) - , rendererControl(0) - , aspectRatioMode(Qt::KeepAspectRatio) - , updatePaintDevice(true) - , rect(0.0, 0.0, 320, 240) - { - } - - QGraphicsVideoItem *q_ptr; - - QEglImageTextureSurface *surface; - QPointer<QMediaObject> mediaObject; - QMediaService *service; - QVideoRendererControl *rendererControl; - Qt::AspectRatioMode aspectRatioMode; - bool updatePaintDevice; - QRectF rect; - QRectF boundingRect; - QRectF sourceRect; - QSizeF nativeSize; - - void clearService(); - void updateRects(); - - void _q_present(); - void _q_formatChanged(const QVideoSurfaceFormat &format); - void _q_updateNativeSize(); - void _q_serviceDestroyed(); -}; - -void QGraphicsVideoItemPrivate::clearService() -{ - if (rendererControl) { - surface->stop(); - rendererControl->setSurface(0); - service->releaseControl(rendererControl); - rendererControl = 0; - } - if (service) { - QObject::disconnect(service, SIGNAL(destroyed()), q_ptr, SLOT(_q_serviceDestroyed())); - service = 0; - } -} - -void QGraphicsVideoItemPrivate::updateRects() -{ - q_ptr->prepareGeometryChange(); - - if (nativeSize.isEmpty()) { - //this is necessary for item to receive the - //first paint event and configure video surface. - boundingRect = rect; - } else if (aspectRatioMode == Qt::IgnoreAspectRatio) { - boundingRect = rect; - sourceRect = QRectF(0, 0, 1, 1); - } else if (aspectRatioMode == Qt::KeepAspectRatio) { - QSizeF size = nativeSize; - size.scale(rect.size(), Qt::KeepAspectRatio); - - boundingRect = QRectF(0, 0, size.width(), size.height()); - boundingRect.moveCenter(rect.center()); - - sourceRect = QRectF(0, 0, 1, 1); - } else if (aspectRatioMode == Qt::KeepAspectRatioByExpanding) { - boundingRect = rect; - - QSizeF size = rect.size(); - size.scale(nativeSize, Qt::KeepAspectRatio); - - sourceRect = QRectF( - 0, 0, size.width() / nativeSize.width(), size.height() / nativeSize.height()); - sourceRect.moveCenter(QPointF(0.5, 0.5)); - } -} - -void QGraphicsVideoItemPrivate::_q_present() -{ - if (q_ptr->isObscured()) { - q_ptr->update(boundingRect); - surface->setReady(true); - } else { - q_ptr->update(boundingRect); - } -} - -void QGraphicsVideoItemPrivate::_q_updateNativeSize() -{ - QSize size = surface->surfaceFormat().sizeHint(); - if (size.isEmpty()) - size = rendererControl->property("nativeSize").toSize(); - - if (nativeSize != size) { - nativeSize = size; - - updateRects(); - emit q_ptr->nativeSizeChanged(nativeSize); - } -} - -void QGraphicsVideoItemPrivate::_q_serviceDestroyed() -{ - rendererControl = 0; - service = 0; - - surface->stop(); -} - - -/* - \class QGraphicsVideoItem - - - \brief The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject. - - \inmodule QtMultimediaWidgets - \ingroup multimedia - - Attaching a QGraphicsVideoItem to a QMediaObject allows it to display - the video or image output of that media object. A QGraphicsVideoItem - is attached to a media object by passing a pointer to the QMediaObject - to the setMediaObject() function. - - \code - player = new QMediaPlayer(this); - - QGraphicsVideoItem *item = new QGraphicsVideoItem; - player->setVideoOutput(item); - graphicsView->scene()->addItem(item); - graphicsView->show(); - - player->setMedia(video); - player->play(); - \endcode - - \b {Note}: Only a single display output can be attached to a media - object at one time. - - \sa QMediaObject, QMediaPlayer, QVideoWidget -*/ - -/* - Constructs a graphics item that displays video. - - The \a parent is passed to QGraphicsItem. -*/ -QGraphicsVideoItem::QGraphicsVideoItem(QGraphicsItem *parent) - : QGraphicsObject(parent) - , d_ptr(new QGraphicsVideoItemPrivate) -{ - d_ptr->q_ptr = this; - d_ptr->surface = new QEglImageTextureSurface(this); - - qRegisterMetaType<QVideoSurfaceFormat>(); - - connect(d_ptr->surface, SIGNAL(frameChanged()), this, SLOT(_q_present())); - connect(d_ptr->surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), - this, SLOT(_q_updateNativeSize()), Qt::QueuedConnection); -} - -/* - Destroys a video graphics item. -*/ -QGraphicsVideoItem::~QGraphicsVideoItem() -{ - if (d_ptr->rendererControl) { - d_ptr->rendererControl->setSurface(0); - d_ptr->service->releaseControl(d_ptr->rendererControl); - } - - delete d_ptr->surface; - delete d_ptr; -} - -/* - \property QGraphicsVideoItem::mediaObject - \brief the media object which provides the video displayed by a graphics - item. -*/ - -QMediaObject *QGraphicsVideoItem::mediaObject() const -{ - return d_func()->mediaObject; -} - -/* - \internal -*/ -bool QGraphicsVideoItem::setMediaObject(QMediaObject *object) -{ - Q_D(QGraphicsVideoItem); - - if (object == d->mediaObject) - return true; - - d->clearService(); - - d->mediaObject = object; - - if (d->mediaObject) { - d->service = d->mediaObject->service(); - - if (d->service) { - QMediaControl *control = d->service->requestControl(QVideoRendererControl_iid); - if (control) { - d->rendererControl = qobject_cast<QVideoRendererControl *>(control); - - if (d->rendererControl) { - connect(d->rendererControl, SIGNAL(nativeSizeChanged()), - this, SLOT(_q_updateNativeSize()), Qt::QueuedConnection); - d->_q_updateNativeSize(); - //don't set the surface untill the item is painted - //at least once and the surface is configured - if (!d->updatePaintDevice) - d->rendererControl->setSurface(d->surface); - else - update(boundingRect()); - - connect(d->service, SIGNAL(destroyed()), this, SLOT(_q_serviceDestroyed())); - - return true; - } - if (control) - d->service->releaseControl(control); - } - } - } - - d->mediaObject = 0; - return false; -} - -/* - \property QGraphicsVideoItem::aspectRatioMode - \brief how a video is scaled to fit the graphics item's size. -*/ - -Qt::AspectRatioMode QGraphicsVideoItem::aspectRatioMode() const -{ - return d_func()->aspectRatioMode; -} - -void QGraphicsVideoItem::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - Q_D(QGraphicsVideoItem); - - d->aspectRatioMode = mode; - d->updateRects(); -} - -/* - \property QGraphicsVideoItem::offset - \brief the video item's offset. - - QGraphicsVideoItem will draw video using the offset for its top left - corner. -*/ - -QPointF QGraphicsVideoItem::offset() const -{ - return d_func()->rect.topLeft(); -} - -void QGraphicsVideoItem::setOffset(const QPointF &offset) -{ - Q_D(QGraphicsVideoItem); - - d->rect.moveTo(offset); - d->updateRects(); -} - -/* - \property QGraphicsVideoItem::size - \brief the video item's size. - - QGraphicsVideoItem will draw video scaled to fit size according to its - fillMode. -*/ - -QSizeF QGraphicsVideoItem::size() const -{ - return d_func()->rect.size(); -} - -void QGraphicsVideoItem::setSize(const QSizeF &size) -{ - Q_D(QGraphicsVideoItem); - - d->rect.setSize(size.isValid() ? size : QSizeF(0, 0)); - d->updateRects(); -} - -/* - \property QGraphicsVideoItem::nativeSize - \brief the native size of the video. -*/ - -QSizeF QGraphicsVideoItem::nativeSize() const -{ - return d_func()->nativeSize; -} - -/* - \fn QGraphicsVideoItem::nativeSizeChanged(const QSizeF &size) - - Signals that the native \a size of the video has changed. -*/ - -/* - \reimp -*/ -QRectF QGraphicsVideoItem::boundingRect() const -{ - return d_func()->boundingRect; -} - -/* - \reimp -*/ -void QGraphicsVideoItem::paint( - QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - Q_D(QGraphicsVideoItem); - - Q_UNUSED(option); - Q_UNUSED(widget); - - if (d->surface && d->rendererControl && d->updatePaintDevice) { - d->updatePaintDevice = false; - - if (widget) - d->rendererControl->setProperty("winId", qulonglong(widget->winId())); - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - if (widget) - connect(widget, SIGNAL(destroyed()), d->surface, SLOT(viewportDestroyed())); - - d->surface->setGLContext(const_cast<QGLContext *>(QGLContext::currentContext())); -#endif - if (d->rendererControl->surface() != d->surface) - d->rendererControl->setSurface(d->surface); - } - - - //overlay doesn't work reliably - - //check if the item is obscured: -#ifdef ENABLE_OVERLAY - if (!isObscured()) { - bool obscured = false; - - if (scene()) { - const auto items = scene()->items(mapToScene(boundingRect()), Qt::IntersectsItemBoundingRect); - for (QGraphicsItem *item : items) { - if (item->flags() & QGraphicsItem::ItemHasNoContents) - continue; - - if (item == this) - break; - - if (collidesWithItem(item)) { - obscured = true; - break; - } - } - } - - d->rendererControl->setProperty("overlayEnabled", !obscured); - } - - if (d->rendererControl->property("overlayEnabled").toBool()) { - QTransform transform = painter->combinedTransform(); - QRect overlayRect = transform.mapRect(d->boundingRect).toRect(); - - d->rendererControl->setProperty("overlayGeometry", overlayRect); - QMetaObject::invokeMethod(d->rendererControl, "repaintOverlay"); - - painter->fillRect(d->boundingRect, - d->rendererControl->property("colorKey").value<QColor>()); - } else -#endif //ENABLE_OVERLAY - { - if (d->surface && d->surface->isActive()) { - d->surface->paint(painter, d->boundingRect, d->sourceRect); - d->surface->setReady(true); - } - } -} - -/* - \reimp - - \internal -*/ -QVariant QGraphicsVideoItem::itemChange(GraphicsItemChange change, const QVariant &value) -{ - return QGraphicsItem::itemChange(change, value); -} - -/* - \internal -*/ -void QGraphicsVideoItem::timerEvent(QTimerEvent *event) -{ - QGraphicsObject::timerEvent(event); -} - -#include "moc_qgraphicsvideoitem.cpp" -QT_END_NAMESPACE diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp index 0d060dbce..9a6ad11ed 100644 --- a/src/multimediawidgets/qpaintervideosurface.cpp +++ b/src/multimediawidgets/qpaintervideosurface.cpp @@ -46,7 +46,7 @@ #include <qvideosurfaceformat.h> #include <private/qmediaopenglhelper_p.h> -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) #include <qglshaderprogram.h> #include <QtGui/QOpenGLContext> #include <QtGui/QOpenGLFunctions> @@ -222,7 +222,7 @@ void QVideoSurfaceGenericPainter::updateColors(int, int, int, int) { } -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) #ifndef APIENTRYP # ifdef APIENTRY @@ -1362,7 +1362,7 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint( QPainterVideoSurface::QPainterVideoSurface(QObject *parent) : QAbstractVideoSurface(parent) , m_painter(0) -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) , m_glContext(0) , m_shaderTypes(NoShaders) , m_shaderType(NoShaders) @@ -1593,7 +1593,7 @@ void QPainterVideoSurface::paint(QPainter *painter, const QRectF &target, const \fn QPainterVideoSurface::frameChanged() */ -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) /*! */ @@ -1723,7 +1723,7 @@ void QPainterVideoSurface::createPainter() { Q_ASSERT(!m_painter); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) switch (m_shaderType) { #if !defined(QT_OPENGL_ES) && !defined(QT_OPENGL_DYNAMIC) case FragmentProgramShader: diff --git a/src/multimediawidgets/qpaintervideosurface_p.h b/src/multimediawidgets/qpaintervideosurface_p.h index a254947d2..2e89393e9 100644 --- a/src/multimediawidgets/qpaintervideosurface_p.h +++ b/src/multimediawidgets/qpaintervideosurface_p.h @@ -125,7 +125,7 @@ public: void paint(QPainter *painter, const QRectF &target, const QRectF &source = QRectF(0, 0, 1, 1)); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) const QGLContext *glContext() const; void setGLContext(QGLContext *context); @@ -154,7 +154,7 @@ private: void createPainter(); QVideoSurfacePainter *m_painter; -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) QGLContext *m_glContext; ShaderTypes m_shaderTypes; ShaderType m_shaderType; @@ -171,7 +171,7 @@ private: bool m_ready; }; -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) Q_DECLARE_OPERATORS_FOR_FLAGS(QPainterVideoSurface::ShaderTypes) #endif diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp index 828ec2e22..3d5e5c830 100644 --- a/src/multimediawidgets/qvideowidget.cpp +++ b/src/multimediawidgets/qvideowidget.cpp @@ -210,7 +210,7 @@ void QRendererVideoWidgetBackend::showEvent() void QRendererVideoWidgetBackend::hideEvent(QHideEvent *) { -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) m_updatePaintDevice = true; m_surface->setGLContext(0); #endif @@ -246,7 +246,7 @@ void QRendererVideoWidgetBackend::paintEvent(QPaintEvent *event) m_surface->setReady(true); } else { - #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if QT_CONFIG(opengl) if (m_updatePaintDevice && (painter.paintEngine()->type() == QPaintEngine::OpenGL || painter.paintEngine()->type() == QPaintEngine::OpenGL2)) { m_updatePaintDevice = false; diff --git a/src/plugins/alsa/qalsaaudioinput.cpp b/src/plugins/alsa/qalsaaudioinput.cpp index 8109e6932..5a4111a90 100644 --- a/src/plugins/alsa/qalsaaudioinput.cpp +++ b/src/plugins/alsa/qalsaaudioinput.cpp @@ -49,6 +49,7 @@ // #include <QtCore/qcoreapplication.h> +#include <QtCore/qvarlengtharray.h> #include <QtMultimedia/private/qaudiohelpers_p.h> #include "qalsaaudioinput.h" #include "qalsaaudiodeviceinfo.h" @@ -526,20 +527,22 @@ qint64 QAlsaAudioInput::read(char* data, qint64 len) int count=0; int err = 0; + QVarLengthArray<char, 4096> buffer(bytesToRead); while(count < 5 && bytesToRead > 0) { - char buffer[bytesToRead]; int chunks = bytesToRead / period_size; int frames = chunks * period_frames; if (frames > (int)buffer_frames) frames = buffer_frames; - int readFrames = snd_pcm_readi(handle, buffer, frames); + int readFrames = snd_pcm_readi(handle, buffer.data(), frames); bytesRead = snd_pcm_frames_to_bytes(handle, readFrames); if (m_volume < 1.0f) - QAudioHelperInternal::qMultiplySamples(m_volume, settings, buffer, buffer, bytesRead); + QAudioHelperInternal::qMultiplySamples(m_volume, settings, + buffer.constData(), + buffer.data(), bytesRead); if (readFrames >= 0) { - ringBuffer.write(buffer, bytesRead); + ringBuffer.write(buffer.data(), bytesRead); #ifdef DEBUG_AUDIO qDebug() << QString::fromLatin1("read in bytes = %1 (frames=%2)").arg(bytesRead).arg(readFrames).toLatin1().constData(); #endif diff --git a/src/plugins/alsa/qalsaaudiooutput.cpp b/src/plugins/alsa/qalsaaudiooutput.cpp index 5e444a0a9..cd97ae85b 100644 --- a/src/plugins/alsa/qalsaaudiooutput.cpp +++ b/src/plugins/alsa/qalsaaudiooutput.cpp @@ -49,6 +49,7 @@ // #include <QtCore/qcoreapplication.h> +#include <QtCore/qvarlengtharray.h> #include <QtMultimedia/private/qaudiohelpers_p.h> #include "qalsaaudiooutput.h" #include "qalsaaudiodeviceinfo.h" @@ -567,9 +568,9 @@ qint64 QAlsaAudioOutput::write( const char *data, qint64 len ) frames = snd_pcm_bytes_to_frames(handle, space); if (m_volume < 1.0f) { - char out[space]; - QAudioHelperInternal::qMultiplySamples(m_volume, settings, data, out, space); - err = snd_pcm_writei(handle, out, frames); + QVarLengthArray<char, 4096> out(space); + QAudioHelperInternal::qMultiplySamples(m_volume, settings, data, out.data(), space); + err = snd_pcm_writei(handle, out.constData(), frames); } else { err = snd_pcm_writei(handle, data, frames); } diff --git a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java index 6818b2909..7fb4a8690 100644 --- a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java +++ b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java @@ -44,7 +44,6 @@ import java.lang.String; import java.io.FileInputStream; // API is level is < 9 unless marked otherwise. -import android.app.Activity; import android.content.Context; import android.media.MediaPlayer; import android.net.Uri; @@ -68,7 +67,7 @@ public class QtAndroidMediaPlayer private MediaPlayer mMediaPlayer = null; private Uri mUri = null; private final long mID; - private final Activity mActivity; + private final Context mContext; private boolean mMuted = false; private int mVolume = 100; private static final String TAG = "Qt MediaPlayer"; @@ -207,10 +206,10 @@ public class QtAndroidMediaPlayer } - public QtAndroidMediaPlayer(final Activity activity, final long id) + public QtAndroidMediaPlayer(final Context context, final long id) { mID = id; - mActivity = activity; + mContext = context; } private void setState(int state) @@ -363,7 +362,7 @@ public class QtAndroidMediaPlayer final boolean inAssets = (mUri.getScheme().compareTo("assets") == 0); if (inAssets) { final String asset = mUri.getPath().substring(1 /* Remove first '/' */); - final AssetManager am = mActivity.getAssets(); + final AssetManager am = mContext.getAssets(); afd = am.openFd(asset); final long offset = afd.getStartOffset(); final long length = afd.getLength(); @@ -374,7 +373,7 @@ public class QtAndroidMediaPlayer FileDescriptor fd = fis.getFD(); mMediaPlayer.setDataSource(fd); } else { - mMediaPlayer.setDataSource(mActivity, mUri); + mMediaPlayer.setDataSource(mContext, mUri); } setState(State.Initialized); } catch (final IOException e) { diff --git a/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp b/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp index 68d2fc66b..1c6497eb0 100644 --- a/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp +++ b/src/plugins/android/src/mediaplayer/qandroidmediaplayercontrol.cpp @@ -59,11 +59,11 @@ public: if (--mControl->mActiveStateChangeNotifiers) return; - if (mPreviousState != mControl->state()) - Q_EMIT mControl->stateChanged(mControl->state()); - if (mPreviousMediaStatus != mControl->mediaStatus()) Q_EMIT mControl->mediaStatusChanged(mControl->mediaStatus()); + + if (mPreviousState != mControl->state()) + Q_EMIT mControl->stateChanged(mControl->state()); } private: diff --git a/src/plugins/android/src/wrappers/jni/androidcamera.h b/src/plugins/android/src/wrappers/jni/androidcamera.h index f4694d7dc..1a59ff3c7 100644 --- a/src/plugins/android/src/wrappers/jni/androidcamera.h +++ b/src/plugins/android/src/wrappers/jni/androidcamera.h @@ -62,6 +62,7 @@ struct AndroidCameraInfo QCamera::Position position; int orientation; }; +Q_DECLARE_TYPEINFO(AndroidCameraInfo, Q_MOVABLE_TYPE); class AndroidCamera : public QObject { diff --git a/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp b/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp index f65d6aade..582d8aa9d 100644 --- a/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp +++ b/src/plugins/android/src/wrappers/jni/androidmediaplayer.cpp @@ -57,10 +57,11 @@ AndroidMediaPlayer::AndroidMediaPlayer() : QObject() { QWriteLocker locker(rwLock); + auto context = QtAndroidPrivate::activity() ? QtAndroidPrivate::activity() : QtAndroidPrivate::service(); const jlong id = reinterpret_cast<jlong>(this); mMediaPlayer = QJNIObjectPrivate(QtAndroidMediaPlayerClassName, - "(Landroid/app/Activity;J)V", - QtAndroidPrivate::activity(), + "(Landroid/content/Context;J)V", + context, id); mediaPlayers->append(this); } diff --git a/src/plugins/audiocapture/audiocapturesession.cpp b/src/plugins/audiocapture/audiocapturesession.cpp index e4a9688e8..7ed3313d8 100644 --- a/src/plugins/audiocapture/audiocapturesession.cpp +++ b/src/plugins/audiocapture/audiocapturesession.cpp @@ -206,10 +206,6 @@ QDir AudioCaptureSession::defaultDir() const { QStringList dirCandidates; -#if defined(Q_WS_MAEMO_6) - dirCandidates << QLatin1String("/home/user/MyDocs"); -#endif - dirCandidates << QDir::home().filePath("Documents"); dirCandidates << QDir::home().filePath("My Documents"); dirCandidates << QDir::homePath(); diff --git a/src/plugins/avfoundation/camera/avfcameradebug.h b/src/plugins/avfoundation/camera/avfcameradebug.h index 79bf8eb0e..8838122e0 100644 --- a/src/plugins/avfoundation/camera/avfcameradebug.h +++ b/src/plugins/avfoundation/camera/avfcameradebug.h @@ -40,7 +40,7 @@ #ifndef AVFDEBUG_H #define AVFDEBUG_H -#include "qtmultimediadefs.h" +#include "qtmultimediaglobal.h" #include <QtCore/qdebug.h> diff --git a/src/plugins/avfoundation/camera/avfstoragelocation.h b/src/plugins/avfoundation/camera/avfstoragelocation.h index e3267c1e7..76621983d 100644 --- a/src/plugins/avfoundation/camera/avfstoragelocation.h +++ b/src/plugins/avfoundation/camera/avfstoragelocation.h @@ -40,7 +40,7 @@ #ifndef AVFSTORAGE_H #define AVFSTORAGE_H -#include "qtmultimediadefs.h" +#include "qtmultimediaglobal.h" #include <QtCore/qdir.h> #include <QtMultimedia/qcamera.h> diff --git a/src/plugins/avfoundation/camera/camera.pro b/src/plugins/avfoundation/camera/camera.pro index 4c6376735..bd7b1fc97 100644 --- a/src/plugins/avfoundation/camera/camera.pro +++ b/src/plugins/avfoundation/camera/camera.pro @@ -10,13 +10,14 @@ LIBS += -framework CoreFoundation \ -framework AudioToolbox \ -framework CoreAudio \ -framework QuartzCore \ - -framework AVFoundation \ -framework CoreMedia osx:LIBS += -framework AppKit \ -framework AudioUnit ios:LIBS += -framework CoreGraphics \ -framework CoreVideo +QMAKE_USE += avfoundation + OTHER_FILES += avfcamera.json DEFINES += QMEDIA_AVF_CAMERA diff --git a/src/plugins/avfoundation/mediaplayer/mediaplayer.pro b/src/plugins/avfoundation/mediaplayer/mediaplayer.pro index 29e231066..f9a086b33 100644 --- a/src/plugins/avfoundation/mediaplayer/mediaplayer.pro +++ b/src/plugins/avfoundation/mediaplayer/mediaplayer.pro @@ -6,7 +6,9 @@ CONFIG += no_keywords QT += multimedia-private network -LIBS += -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework QuartzCore +LIBS += -framework CoreMedia -framework CoreVideo -framework QuartzCore + +QMAKE_USE += avfoundation DEFINES += QMEDIA_AVF_MEDIAPLAYER diff --git a/src/plugins/directshow/camera/camera.pri b/src/plugins/directshow/camera/camera.pri index 6c67a8fe2..fb7fbd3f5 100644 --- a/src/plugins/directshow/camera/camera.pri +++ b/src/plugins/directshow/camera/camera.pri @@ -28,4 +28,4 @@ SOURCES += \ $$PWD/dscameraimageprocessingcontrol.cpp *-msvc*:INCLUDEPATH += $$(DXSDK_DIR)/include -LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 +QMAKE_USE += directshow diff --git a/src/plugins/directshow/camera/dscameraservice.h b/src/plugins/directshow/camera/dscameraservice.h index dd5a7b9e3..8976e41cf 100644 --- a/src/plugins/directshow/camera/dscameraservice.h +++ b/src/plugins/directshow/camera/dscameraservice.h @@ -48,7 +48,6 @@ QT_BEGIN_NAMESPACE class DSCameraControl; class DSCameraSession; -class DSVideoOutputControl; class DSVideoDeviceControl; class DSImageCaptureControl; class DSCameraViewfinderSettingsControl; @@ -68,7 +67,6 @@ public: private: DSCameraControl *m_control; DSCameraSession *m_session; - DSVideoOutputControl *m_videoOutput; DSVideoDeviceControl *m_videoDevice; QMediaControl *m_videoRenderer; DSImageCaptureControl *m_imageCapture; diff --git a/src/plugins/directshow/directshow.pro b/src/plugins/directshow/directshow.pro index 10c6fe2b6..5eb4fbc96 100644 --- a/src/plugins/directshow/directshow.pro +++ b/src/plugins/directshow/directshow.pro @@ -1,19 +1,19 @@ TARGET = dsengine +QT += multimedia-private + win32:!qtHaveModule(opengl)|qtConfig(dynamicgl) { LIBS_PRIVATE += -lgdi32 -luser32 } -QT += multimedia-private - HEADERS += dsserviceplugin.h SOURCES += dsserviceplugin.cpp -!config_wmsdk: DEFINES += QT_NO_WMSDK +!qtConfig(wmsdk): DEFINES += QT_NO_WMSDK mingw: DEFINES += NO_DSHOW_STRSAFE include(helpers/helpers.pri) -!config_wmf: include(player/player.pri) +!qtConfig(wmf-backend): include(player/player.pri) include(camera/camera.pri) OTHER_FILES += \ diff --git a/src/plugins/directshow/player/player.pri b/src/plugins/directshow/player/player.pri index 8b4bb70b7..7391ec7f0 100644 --- a/src/plugins/directshow/player/player.pri +++ b/src/plugins/directshow/player/player.pri @@ -1,7 +1,7 @@ INCLUDEPATH += $$PWD -LIBS += -lstrmiids -ldmoguids -luuid -lole32 -loleaut32 -lmsdmo -lgdi32 - +QMAKE_USE += directshow +LIBS += -lgdi32 qtHaveModule(widgets): QT += widgets @@ -29,7 +29,7 @@ SOURCES += \ $$PWD/directshowmetadatacontrol.cpp \ $$PWD/vmr9videowindowcontrol.cpp -config_evr { +qtConfig(evr) { DEFINES += HAVE_EVR include($$PWD/../../common/evr.pri) @@ -41,7 +41,7 @@ config_evr { $$PWD/directshowevrvideowindowcontrol.cpp } -config_wshellitem { +qtConfig(wshellitem) { QT += core-private } else { DEFINES += QT_NO_SHELLITEM diff --git a/src/plugins/gstreamer/camerabin/camerabin.pro b/src/plugins/gstreamer/camerabin/camerabin.pro index 214489f3e..d214d61c6 100644 --- a/src/plugins/gstreamer/camerabin/camerabin.pro +++ b/src/plugins/gstreamer/camerabin/camerabin.pro @@ -52,17 +52,7 @@ SOURCES += \ $$PWD/camerabincapturebufferformat.cpp \ $$PWD/camerabininfocontrol.cpp -maemo6 { - HEADERS += \ - $$PWD/camerabuttonlistener_meego.h - - SOURCES += \ - $$PWD/camerabuttonlistener_meego.cpp - - CONFIG += have_gst_photography -} - -config_gstreamer_photography { +qtConfig(gstreamer_photography) { DEFINES += HAVE_GST_PHOTOGRAPHY HEADERS += \ @@ -77,15 +67,15 @@ config_gstreamer_photography { $$PWD/camerabinfocus.cpp \ $$PWD/camerabinlocks.cpp - LIBS += -lgstphotography-$$GST_VERSION + QMAKE_USE += gstreamer_photography DEFINES += GST_USE_UNSTABLE_API #prevents warnings because of unstable photography API } -config_gstreamer_encodingprofiles { +qtConfig(gstreamer_encodingprofiles) { DEFINES += HAVE_GST_ENCODING_PROFILES } -config_linux_v4l: { +qtConfig(linux_v4l) { DEFINES += USE_V4L HEADERS += \ diff --git a/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.cpp b/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.cpp index d4570b8b1..8b3e10546 100644 --- a/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.cpp +++ b/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.cpp @@ -57,11 +57,7 @@ QList<QVideoFrame::PixelFormat> CameraBinCaptureBufferFormat::supportedBufferFor { //the exact YUV format is unknown with camerabin until the first capture is requested return QList<QVideoFrame::PixelFormat>() - << QVideoFrame::Format_Jpeg -#ifdef Q_WS_MAEMO_6 - << QVideoFrame::Format_UYVY -#endif - ; + << QVideoFrame::Format_Jpeg; } QVideoFrame::PixelFormat CameraBinCaptureBufferFormat::bufferFormat() const diff --git a/src/plugins/gstreamer/camerabin/camerabinexposure.h b/src/plugins/gstreamer/camerabin/camerabinexposure.h index a7de86627..0435569d4 100644 --- a/src/plugins/gstreamer/camerabin/camerabinexposure.h +++ b/src/plugins/gstreamer/camerabin/camerabinexposure.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef CAMERABINEXPOSURECONTROL_MAEMO_H -#define CAMERABINEXPOSURECONTROL_MAEMO_H +#ifndef CAMERABINEXPOSURECONTROL_H +#define CAMERABINEXPOSURECONTROL_H #include <qcamera.h> #include <qcameraexposurecontrol.h> @@ -72,4 +72,4 @@ private: QT_END_NAMESPACE -#endif // CAMERABINEXPOSURECONTROL_MAEMO_H +#endif // CAMERABINEXPOSURECONTROL_H diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp index 2be4e345a..3fbd1a60e 100644 --- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp @@ -73,20 +73,11 @@ #endif #include <private/qgstreamervideowindow_p.h> #include <private/qgstreamervideorenderer_p.h> - -#if defined(Q_WS_MAEMO_6) && defined(__arm__) -#include "qgstreamergltexturerenderer.h" -#endif - #include <private/qmediaserviceprovider_p.h> #include <QtCore/qdebug.h> #include <QtCore/qprocess.h> -#if defined(Q_WS_MAEMO_6) -#include "camerabuttonlistener_meego.h" -#endif - QT_BEGIN_NAMESPACE CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *parent): @@ -119,17 +110,9 @@ CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *pa if (m_videoInputDevice->deviceCount()) m_captureSession->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice())); -#if defined(Q_WS_MAEMO_6) && defined(__arm__) && defined(HAVE_WIDGETS) - m_videoRenderer = new QGstreamerGLTextureRenderer(this); -#else m_videoRenderer = new QGstreamerVideoRenderer(this); -#endif -#ifdef Q_WS_MAEMO_6 - m_videoWindow = new QGstreamerVideoWindow(this, "omapxvsink"); -#else m_videoWindow = new QGstreamerVideoWindow(this); -#endif // If the GStreamer video sink is not available, don't provide the video window control since // it won't work anyway. if (!m_videoWindow->videoSink()) { @@ -156,10 +139,6 @@ CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *pa m_metaDataControl = new CameraBinMetaData(this); connect(m_metaDataControl, SIGNAL(metaDataChanged(QMap<QByteArray,QVariant>)), m_captureSession, SLOT(setMetaData(QMap<QByteArray,QVariant>))); - -#if defined(Q_WS_MAEMO_6) - new CameraButtonListener(this); -#endif } CameraBinService::~CameraBinService() diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.h b/src/plugins/gstreamer/camerabin/camerabinsession.h index 41398087d..ca0b22761 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.h +++ b/src/plugins/gstreamer/camerabin/camerabinsession.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef CAMERABINCAPTURESESSION_MAEMO_H -#define CAMERABINCAPTURESESSION_MAEMO_H +#ifndef CAMERABINCAPTURESESSION_H +#define CAMERABINCAPTURESESSION_H #include <qmediarecordercontrol.h> @@ -288,4 +288,4 @@ public: QT_END_NAMESPACE -#endif // CAMERABINCAPTURESESSION_MAEMO_H +#endif // CAMERABINCAPTURESESSION_H diff --git a/src/plugins/gstreamer/camerabin/camerabuttonlistener_meego.cpp b/src/plugins/gstreamer/camerabin/camerabuttonlistener_meego.cpp deleted file mode 100644 index 0516f338b..000000000 --- a/src/plugins/gstreamer/camerabin/camerabuttonlistener_meego.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company 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 "camerabuttonlistener_meego.h" - -#include <QtWidgets/qapplication.h> -#include <QtGui/qevent.h> -#include <QtWidgets/qwidget.h> -#include <QtCore/qdebug.h> - -QT_BEGIN_NAMESPACE - -CameraButtonListener::CameraButtonListener(QObject *parent) : - QObject(parent), - m_focusPressed(false), - m_shutterPressed(false) -{ - m_keys = new MeeGo::QmKeys(this); - connect(m_keys, SIGNAL(keyEvent(MeeGo::QmKeys::Key,MeeGo::QmKeys::State)), - this, SLOT(handleQmKeyEvent(MeeGo::QmKeys::Key,MeeGo::QmKeys::State))); -} - -CameraButtonListener::~CameraButtonListener() -{ -} - -void CameraButtonListener::handleQmKeyEvent(MeeGo::QmKeys::Key key, MeeGo::QmKeys::State state) -{ - if (key == MeeGo::QmKeys::Camera) { - QWidget *window = QApplication::focusWidget(); - - bool focusPressed = (state == MeeGo::QmKeys::KeyHalfDown) || - (state == MeeGo::QmKeys::KeyDown); - - if (m_focusPressed != focusPressed) { - m_focusPressed = focusPressed; - if (window) { - QApplication::postEvent(window, - new QKeyEvent(focusPressed ? QEvent::KeyPress : QEvent::KeyRelease, - Qt::Key_CameraFocus, - Qt::NoModifier)); - } - } - - bool shutterPressed = (state == MeeGo::QmKeys::KeyDown); - if (m_shutterPressed != shutterPressed) { - m_shutterPressed = shutterPressed; - if (window) { - QApplication::postEvent(window, - new QKeyEvent(shutterPressed ? QEvent::KeyPress : QEvent::KeyRelease, - Qt::Key_Camera, - Qt::NoModifier)); - } - } - } -} - -QT_END_NAMESPACE diff --git a/src/plugins/gstreamer/common.pri b/src/plugins/gstreamer/common.pri index babdb7cfb..110bc8549 100644 --- a/src/plugins/gstreamer/common.pri +++ b/src/plugins/gstreamer/common.pri @@ -1,4 +1,3 @@ - QT += core-private multimedia-private network qtHaveModule(widgets) { @@ -8,30 +7,15 @@ qtHaveModule(widgets) { LIBS += -lqgsttools_p -CONFIG += link_pkgconfig - -PKGCONFIG += \ - gstreamer-$$GST_VERSION \ - gstreamer-base-$$GST_VERSION \ - gstreamer-audio-$$GST_VERSION \ - gstreamer-video-$$GST_VERSION \ - gstreamer-pbutils-$$GST_VERSION - -maemo*:PKGCONFIG +=gstreamer-plugins-bad-$$GST_VERSION - -mir: { - DEFINES += HAVE_MIR -} - +QMAKE_USE += gstreamer -config_resourcepolicy { +qtConfig(resourcepolicy) { + QMAKE_USE += libresourceqt5 DEFINES += HAVE_RESOURCE_POLICY - PKGCONFIG += libresourceqt5 } -config_gstreamer_appsrc { - PKGCONFIG += gstreamer-app-$$GST_VERSION +qtConfig(gstreamer_app) { + QMAKE_USE += gstreamer_app DEFINES += HAVE_GST_APPSRC - LIBS += -lgstapp-$$GST_VERSION } diff --git a/src/plugins/gstreamer/mediacapture/mediacapture.pro b/src/plugins/gstreamer/mediacapture/mediacapture.pro index db5210d4d..17248a495 100644 --- a/src/plugins/gstreamer/mediacapture/mediacapture.pro +++ b/src/plugins/gstreamer/mediacapture/mediacapture.pro @@ -31,7 +31,7 @@ SOURCES += $$PWD/qgstreamercaptureservice.cpp \ # Camera usage with gstreamer needs to have #CONFIG += use_gstreamer_camera -use_gstreamer_camera:config_linux_v4l { +use_gstreamer_camera:qtConfig(linux_v4l) { DEFINES += USE_GSTREAMER_CAMERA OTHER_FILES += \ diff --git a/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp b/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp index 17bddbf9b..40294214a 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp @@ -50,7 +50,6 @@ QGstreamerAudioEncode::QGstreamerAudioEncode(QObject *parent) :QAudioEncoderSettingsControl(parent) , m_codecs(QGstCodecsInfo::AudioEncoder) { - for (const QString& codecName : m_codecs.supportedCodecs()) { GstElementFactory *factory = gst_element_factory_find(m_codecs.codecElement(codecName).constData()); diff --git a/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp b/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp index 7b216b63b..958204803 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreamerrecordercontrol.cpp @@ -330,10 +330,6 @@ QDir QGstreamerRecorderControl::defaultDir() const { QStringList dirCandidates; -#if defined(Q_WS_MAEMO_6) - dirCandidates << QLatin1String("/home/user/MyDocs"); -#endif - if (m_session->captureMode() & QGstreamerCaptureSession::Video) dirCandidates << QStandardPaths::writableLocation(QStandardPaths::MoviesLocation); else diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp index 2919648a7..3e7286e51 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp @@ -239,14 +239,6 @@ void QGstreamerPlayerControl::playOrPause(QMediaPlayer::State newState) setMedia(m_currentResource, m_stream); } -#ifdef Q_WS_MAEMO_6 - //this is a work around for the gstreamer bug, - //should be remove once it get fixed - if (newState == QMediaPlayer::PlayingState && m_mediaStatus == QMediaPlayer::InvalidMedia) { - setMedia(m_currentResource, m_stream); - } -#endif - if (m_mediaStatus == QMediaPlayer::EndOfMedia && m_pendingSeekPosition == -1) { m_pendingSeekPosition = 0; } @@ -612,18 +604,18 @@ void QGstreamerPlayerControl::popAndNotifyState() QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatusStack.pop(); if (m_stateStack.isEmpty()) { - if (m_currentState != oldState) { + if (m_mediaStatus != oldMediaStatus) { #ifdef DEBUG_PLAYBIN - qDebug() << "State changed:" << m_currentState; + qDebug() << "Media status changed:" << m_mediaStatus; #endif - emit stateChanged(m_currentState); + emit mediaStatusChanged(m_mediaStatus); } - if (m_mediaStatus != oldMediaStatus) { + if (m_currentState != oldState) { #ifdef DEBUG_PLAYBIN - qDebug() << "Media status changed:" << m_mediaStatus; + qDebug() << "State changed:" << m_currentState; #endif - emit mediaStatusChanged(m_mediaStatus); + emit stateChanged(m_currentState); } } } diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp index f233a487f..2c2de1bbc 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp @@ -37,6 +37,7 @@ ** ****************************************************************************/ +#include <QtMultimedia/private/qtmultimediaglobal_p.h> #include <QtCore/qvariant.h> #include <QtCore/qdebug.h> @@ -56,11 +57,7 @@ #include <private/qgstreamervideowindow_p.h> #include <private/qgstreamervideorenderer_p.h> -#if defined(Q_WS_MAEMO_6) && defined(__arm__) -#include "private/qgstreamergltexturerenderer.h" -#endif - -#if defined(HAVE_MIR) && defined (__arm__) +#if QT_CONFIG(mirclient) && defined (__arm__) #include "private/qgstreamermirtexturerenderer_p.h" #endif @@ -92,20 +89,14 @@ QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent): m_streamsControl = new QGstreamerStreamsControl(m_session,this); m_availabilityControl = new QGStreamerAvailabilityControl(m_control->resources(), this); -#if defined(Q_WS_MAEMO_6) && defined(__arm__) - m_videoRenderer = new QGstreamerGLTextureRenderer(this); -#elif defined(HAVE_MIR) && defined (__arm__) +#if QT_CONFIG(mirclient) && defined (__arm__) m_videoRenderer = new QGstreamerMirTextureRenderer(this, m_session); #else m_videoRenderer = new QGstreamerVideoRenderer(this); #endif -#ifdef Q_WS_MAEMO_6 - m_videoWindow = new QGstreamerVideoWindow(this, "omapxvsink"); -#else m_videoWindow = new QGstreamerVideoWindow(this); -#endif - // If the GStreamer video sink is not available, don't provide the video window control since + // If the GStreamer video sink is not available, don't provide the video window control since // it won't work anyway. if (!m_videoWindow->videoSink()) { delete m_videoWindow; diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp index ed07e4054..09b74148e 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -155,10 +155,6 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) if (m_playbin) { //GST_PLAY_FLAG_NATIVE_VIDEO omits configuration of ffmpegcolorspace and videoscale, //since those elements are included in the video output bin when necessary. -#ifdef Q_WS_MAEMO_6 - int flags = GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO | - GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_NATIVE_AUDIO; -#else int flags = GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO; QByteArray envFlags = qgetenv("QT_GSTREAMER_PLAYBIN_FLAGS"); if (!envFlags.isEmpty()) { @@ -168,7 +164,6 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) flags |= GST_PLAY_FLAG_NATIVE_VIDEO; #endif } -#endif g_object_set(G_OBJECT(m_playbin), "flags", flags, NULL); GstElement *audioSink = gst_element_factory_make("autoaudiosink", "audiosink"); diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index f113f68b3..099e472da 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -5,6 +5,7 @@ ###################################################################### TEMPLATE = subdirs +QT_FOR_CONFIG += multimedia-private SUBDIRS += m3u @@ -17,53 +18,53 @@ android { } qnx { - config_mmrenderer: SUBDIRS += qnx + qtConfig(mmrenderer): SUBDIRS += qnx SUBDIRS += audiocapture } -qnx:!blackberry { +qnx { SUBDIRS += qnx-audio } win32 { - config_wasapi: SUBDIRS += wasapi + qtConfig(wasapi): SUBDIRS += wasapi } win32:!winrt { SUBDIRS += audiocapture \ windowsaudio - config_directshow: SUBDIRS += directshow - config_wmf: SUBDIRS += wmf + qtConfig(directshow): SUBDIRS += directshow + qtConfig(wmf-backend): SUBDIRS += wmf } + winrt { SUBDIRS += winrt } unix:!mac:!android { - config_gstreamer { + qtConfig(gstreamer) { SUBDIRS += gstreamer } else { SUBDIRS += audiocapture } - config_pulseaudio: SUBDIRS += pulseaudio - config_alsa: SUBDIRS += alsa + qtConfig(pulseaudio): SUBDIRS += pulseaudio + qtConfig(alsa): SUBDIRS += alsa # v4l is turned off because it is not supported in Qt 5 - # config_linux_v4l { - # !maemo*:SUBDIRS += v4l + # qtConfig(linux_v4l) { + # SUBDIRS += v4l # } } darwin:!watchos { SUBDIRS += audiocapture coreaudio - - config_avfoundation: SUBDIRS += avfoundation + qtConfig(avfoundation): SUBDIRS += avfoundation } -config_resourcepolicy { +qtConfig(resourcepolicy) { SUBDIRS += resourcepolicy } diff --git a/src/plugins/pulseaudio/pulseaudio.pro b/src/plugins/pulseaudio/pulseaudio.pro index 7f4d3de22..c6339e9e8 100644 --- a/src/plugins/pulseaudio/pulseaudio.pro +++ b/src/plugins/pulseaudio/pulseaudio.pro @@ -1,8 +1,7 @@ TARGET = qtmedia_pulse QT += multimedia-private -CONFIG += link_pkgconfig -PKGCONFIG += libpulse +QMAKE_USE += pulseaudio HEADERS += qpulseaudioplugin.h \ qaudiodeviceinfo_pulse.h \ diff --git a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp index fc67f4211..35d11597c 100644 --- a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp +++ b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp @@ -282,7 +282,7 @@ bool QnxAudioInput::open() } // Necessary so that bytesFree() which uses the "free" member of the status struct works - snd_pcm_plugin_set_disable(m_pcmHandle, PLUGIN_DISABLE_MMAP); + snd_pcm_plugin_set_disable(m_pcmHandle, PLUGIN_MMAP); snd_pcm_channel_info_t info; memset(&info, 0, sizeof(info)); diff --git a/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp b/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp index 2c196624b..d5805c2bd 100644 --- a/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp +++ b/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp @@ -286,7 +286,7 @@ bool QnxAudioOutput::open() } // Necessary so that bytesFree() which uses the "free" member of the status struct works - snd_pcm_plugin_set_disable(m_pcmHandle, PLUGIN_DISABLE_MMAP); + snd_pcm_plugin_set_disable(m_pcmHandle, PLUGIN_MMAP); snd_pcm_channel_info_t info; memset(&info, 0, sizeof(info)); diff --git a/src/plugins/qnx/bbserviceplugin.cpp b/src/plugins/qnx/bbserviceplugin.cpp deleted file mode 100644 index e83d1caa3..000000000 --- a/src/plugins/qnx/bbserviceplugin.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 "bbserviceplugin.h" - -#include "bbcamerainfocontrol.h" -#include "bbcameraservice.h" -#include "bbcamerasession.h" -#include "bbvideodeviceselectorcontrol.h" -#include "mmrenderermediaplayerservice.h" - -#include <QDebug> - -QT_BEGIN_NAMESPACE - -BbServicePlugin::BbServicePlugin() -{ -} - -QMediaService *BbServicePlugin::create(const QString &key) -{ - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) - return new BbCameraService(); - - if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) - return new MmRendererMediaPlayerService(); - - return 0; -} - -void BbServicePlugin::release(QMediaService *service) -{ - delete service; -} - -QMediaServiceProviderHint::Features BbServicePlugin::supportedFeatures(const QByteArray &service) const -{ - Q_UNUSED(service) - return QMediaServiceProviderHint::Features(); -} - -QByteArray BbServicePlugin::defaultDevice(const QByteArray &service) const -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - return m_defaultCameraDevice; - } - - return QByteArray(); -} - -QList<QByteArray> BbServicePlugin::devices(const QByteArray &service) const -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - return m_cameraDevices; - } - - return QList<QByteArray>(); -} - -QString BbServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) -{ - if (service == Q_MEDIASERVICE_CAMERA) { - if (m_cameraDevices.isEmpty()) - updateDevices(); - - for (int i = 0; i < m_cameraDevices.count(); i++) - if (m_cameraDevices[i] == device) - return m_cameraDescriptions[i]; - } - - return QString(); -} - -void BbServicePlugin::updateDevices() const -{ - m_defaultCameraDevice.clear(); - BbVideoDeviceSelectorControl::enumerateDevices(&m_cameraDevices, &m_cameraDescriptions); - - if (m_cameraDevices.isEmpty()) { - qWarning() << "No camera devices found"; - } else { - m_defaultCameraDevice = m_cameraDevices.contains(BbCameraSession::cameraIdentifierRear()) - ? BbCameraSession::cameraIdentifierRear() - : m_cameraDevices.first(); - } -} - -QCamera::Position BbServicePlugin::cameraPosition(const QByteArray &device) const -{ - return BbCameraInfoControl::position(device); -} - -int BbServicePlugin::cameraOrientation(const QByteArray &device) const -{ - return BbCameraInfoControl::orientation(device); -} - -QT_END_NAMESPACE diff --git a/src/plugins/qnx/bbserviceplugin.h b/src/plugins/qnx/bbserviceplugin.h deleted file mode 100644 index e2e77c233..000000000 --- a/src/plugins/qnx/bbserviceplugin.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 BBRSERVICEPLUGIN_H -#define BBRSERVICEPLUGIN_H - -#include <qmediaserviceproviderplugin.h> - -QT_BEGIN_NAMESPACE - -class BbServicePlugin - : public QMediaServiceProviderPlugin, - public QMediaServiceSupportedDevicesInterface, - public QMediaServiceDefaultDeviceInterface, - public QMediaServiceCameraInfoInterface, - public QMediaServiceFeaturesInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceSupportedDevicesInterface) - Q_INTERFACES(QMediaServiceDefaultDeviceInterface) - Q_INTERFACES(QMediaServiceCameraInfoInterface) - Q_INTERFACES(QMediaServiceFeaturesInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "blackberry_mediaservice.json") -public: - BbServicePlugin(); - - QMediaService *create(const QString &key) Q_DECL_OVERRIDE; - void release(QMediaService *service) Q_DECL_OVERRIDE; - QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const Q_DECL_OVERRIDE; - - QByteArray defaultDevice(const QByteArray &service) const Q_DECL_OVERRIDE; - QList<QByteArray> devices(const QByteArray &service) const Q_DECL_OVERRIDE; - QString deviceDescription(const QByteArray &service, const QByteArray &device) Q_DECL_OVERRIDE; - QVariant deviceProperty(const QByteArray &service, const QByteArray &device, const QByteArray &property) Q_DECL_OVERRIDE; - - QCamera::Position cameraPosition(const QByteArray &device) const Q_DECL_OVERRIDE; - int cameraOrientation(const QByteArray &device) const Q_DECL_OVERRIDE; - -private: - void updateDevices() const; - - mutable QByteArray m_defaultCameraDevice; - mutable QList<QByteArray> m_cameraDevices; - mutable QStringList m_cameraDescriptions; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/qnx/blackberry_mediaservice.json b/src/plugins/qnx/blackberry_mediaservice.json deleted file mode 100644 index 2a59cc770..000000000 --- a/src/plugins/qnx/blackberry_mediaservice.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Keys": ["blackberrymultimedia"], - "Services": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"] -} diff --git a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp b/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp deleted file mode 100644 index 35bdb8360..000000000 --- a/src/plugins/qnx/mediaplayer/bpsmediaplayercontrol.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Research In Motion -** 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 "bpsmediaplayercontrol.h" -#include "mmrenderervideowindowcontrol.h" - -#include <bps/mmrenderer.h> -#include <bps/screen.h> - -QT_BEGIN_NAMESPACE - -BpsMediaPlayerControl::BpsMediaPlayerControl(QObject *parent) - : MmRendererMediaPlayerControl(parent), - m_eventMonitor(0) -{ - openConnection(); -} - -BpsMediaPlayerControl::~BpsMediaPlayerControl() -{ - destroy(); -} - -void BpsMediaPlayerControl::startMonitoring(int contextId, const QString &contextName) -{ - m_eventMonitor = mmrenderer_request_events(contextName.toLatin1().constData(), 0, contextId); - if (!m_eventMonitor) { - qDebug() << "Unable to request multimedia events"; - emit error(0, "Unable to request multimedia events"); - } -} - -void BpsMediaPlayerControl::stopMonitoring() -{ - if (m_eventMonitor) { - mmrenderer_stop_events(m_eventMonitor); - m_eventMonitor = 0; - } -} - -bool BpsMediaPlayerControl::nativeEventFilter(const QByteArray &eventType, void *message, long *result) -{ - Q_UNUSED(result) - Q_UNUSED(eventType) - - bps_event_t * const event = static_cast<bps_event_t *>(message); - if (!event || - (bps_event_get_domain(event) != mmrenderer_get_domain() && - bps_event_get_domain(event) != screen_get_domain())) - return false; - - if (event && bps_event_get_domain(event) == screen_get_domain()) { - const screen_event_t screen_event = screen_event_get_event(event); - if (MmRendererVideoWindowControl *control = videoWindowControl()) - control->screenEventHandler(screen_event); - } - - if (bps_event_get_domain(event) == mmrenderer_get_domain()) { - if (bps_event_get_code(event) == MMRENDERER_STATE_CHANGE) { - const mmrenderer_state_t newState = mmrenderer_event_get_state(event); - if (newState == MMR_STOPPED) { - handleMmStopped(); - return false; - } - } - - if (bps_event_get_code(event) == MMRENDERER_STATUS_UPDATE) { - const qint64 newPosition = QString::fromLatin1(mmrenderer_event_get_position(event)). - toLongLong(); - handleMmStatusUpdate(newPosition); - - const QString status = QString::fromLatin1(mmrenderer_event_get_bufferstatus(event)); - setMmBufferStatus(status); - - const QString level = QString::fromLatin1(mmrenderer_event_get_bufferlevel(event)); - setMmBufferLevel(level); - } - } - - return false; -} - -QT_END_NAMESPACE diff --git a/src/plugins/qnx/mediaplayer/mediaplayer.pri b/src/plugins/qnx/mediaplayer/mediaplayer.pri index 9dedab0fd..756857cce 100644 --- a/src/plugins/qnx/mediaplayer/mediaplayer.pri +++ b/src/plugins/qnx/mediaplayer/mediaplayer.pri @@ -7,8 +7,8 @@ HEADERS += \ $$PWD/mmrenderermetadatareadercontrol.h \ $$PWD/mmrendererplayervideorenderercontrol.h \ $$PWD/mmrendererutil.h \ - $$PWD/mmrenderervideowindowcontrol.h - + $$PWD/mmrenderervideowindowcontrol.h \ + $$PWD/ppsmediaplayercontrol.h SOURCES += \ $$PWD/mmrenderermediaplayercontrol.cpp \ $$PWD/mmrenderermediaplayerservice.cpp \ @@ -16,16 +16,7 @@ SOURCES += \ $$PWD/mmrenderermetadatareadercontrol.cpp \ $$PWD/mmrendererplayervideorenderercontrol.cpp \ $$PWD/mmrendererutil.cpp \ - $$PWD/mmrenderervideowindowcontrol.cpp - -LIBS += -lmmrndclient -lstrm + $$PWD/mmrenderervideowindowcontrol.cpp \ + $$PWD/ppsmediaplayercontrol.cpp -blackberry { - HEADERS += $$PWD/bpsmediaplayercontrol.h - SOURCES += $$PWD/bpsmediaplayercontrol.cpp -} else { - HEADERS += $$PWD/ppsmediaplayercontrol.h - SOURCES += $$PWD/ppsmediaplayercontrol.cpp - QT += core-private - LIBS += -lpps -} +QMAKE_USE += mmrenderer pps diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp index 2709a99dd..e253c68d8 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayerservice.cpp @@ -44,13 +44,7 @@ #include "mmrendererutil.h" #include "mmrenderervideowindowcontrol.h" -#ifdef Q_OS_BLACKBERRY -#include "bpsmediaplayercontrol.h" -typedef BpsMediaPlayerControl PlatformSpecificMediaPlayerControl; -#else #include "ppsmediaplayercontrol.h" -typedef PpsMediaPlayerControl PlatformSpecificMediaPlayerControl; -#endif QT_BEGIN_NAMESPACE @@ -78,7 +72,7 @@ QMediaControl *MmRendererMediaPlayerService::requestControl(const char *name) { if (qstrcmp(name, QMediaPlayerControl_iid) == 0) { if (!m_mediaPlayerControl) { - m_mediaPlayerControl = new PlatformSpecificMediaPlayerControl; + m_mediaPlayerControl = new PpsMediaPlayerControl; updateControls(); } return m_mediaPlayerControl; diff --git a/src/plugins/qnx/qnx.pro b/src/plugins/qnx/qnx.pro index 4d76fa5f7..960c614e0 100644 --- a/src/plugins/qnx/qnx.pro +++ b/src/plugins/qnx/qnx.pro @@ -1,22 +1,15 @@ TARGET = qtmedia_qnx -QT += multimedia-private gui-private +QT += multimedia-private gui-private core-private LIBS += -lscreen include(common/common.pri) include(mediaplayer/mediaplayer.pri) -blackberry { - include(camera/camera.pri) - HEADERS += bbserviceplugin.h - SOURCES += bbserviceplugin.cpp - OTHER_FILES += blackberry_mediaservice.json -} else { - HEADERS += neutrinoserviceplugin.h - SOURCES += neutrinoserviceplugin.cpp - OTHER_FILES += neutrino_mediaservice.json -} +HEADERS += neutrinoserviceplugin.h +SOURCES += neutrinoserviceplugin.cpp +OTHER_FILES += neutrino_mediaservice.json +PLUGIN_CLASS_NAME = NeutrinoServicePlugin PLUGIN_TYPE = mediaservice -PLUGIN_CLASS_NAME = BbServicePlugin load(qt_plugin) diff --git a/src/plugins/resourcepolicy/resourcepolicy.pro b/src/plugins/resourcepolicy/resourcepolicy.pro index 91a946665..89e75be1b 100644 --- a/src/plugins/resourcepolicy/resourcepolicy.pro +++ b/src/plugins/resourcepolicy/resourcepolicy.pro @@ -1,8 +1,8 @@ TARGET = resourceqt QT += multimedia-private -CONFIG += link_pkgconfig -PKGCONFIG += libresourceqt5 + +QMAKE_USE += libresourceqt5 INCLUDEPATH += $$PWD \ $${SOURCE_DIR}/src/multimedia diff --git a/src/plugins/videonode/videonode.pro b/src/plugins/videonode/videonode.pro index 5fbcaecd4..ab7295406 100644 --- a/src/plugins/videonode/videonode.pro +++ b/src/plugins/videonode/videonode.pro @@ -1,7 +1,7 @@ TEMPLATE = subdirs -QT_FOR_CONFIG += gui-private +QT_FOR_CONFIG += gui-private multimedia-private -config_gpu_vivante { +qtConfig(gpu_vivante) { SUBDIRS += imx6 } diff --git a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp index c4bbbe85d..815b78979 100644 --- a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp @@ -53,6 +53,7 @@ #include "qwindowsaudioutils.h" #include <QtEndian> #include <QtCore/QDataStream> +#include <private/qaudiohelpers_p.h> //#define DEBUG_AUDIO 1 @@ -72,7 +73,7 @@ QWindowsAudioOutput::QWindowsAudioOutput(const QByteArray &device) audioSource = 0; pullMode = true; finished = false; - volumeCache = (qreal)1.; + volumeCache = qreal(1.0); } QWindowsAudioOutput::~QWindowsAudioOutput() @@ -280,8 +281,6 @@ bool QWindowsAudioOutput::open() timeStampOpened.restart(); elapsedTimeOffset = 0; - setVolume(volumeCache); - errorState = QAudio::NoError; if(pullMode) { deviceState = QAudio::ActiveState; @@ -407,7 +406,11 @@ qint64 QWindowsAudioOutput::write( const char *data, qint64 len ) remain = l; else remain = period_size; - memcpy(current->lpData, p, remain); + + if (volumeCache < qreal(1.0)) + QAudioHelperInternal::qMultiplySamples(volumeCache, settings, p, current->lpData, remain); + else + memcpy(current->lpData, p, remain); l -= remain; p += remain; @@ -595,16 +598,10 @@ QAudio::State QWindowsAudioOutput::state() const void QWindowsAudioOutput::setVolume(qreal v) { - const qreal normalizedVolume = qBound(qreal(0.0), v, qreal(1.0)); - if (deviceState != QAudio::ActiveState) { - volumeCache = normalizedVolume; + if (qFuzzyCompare(volumeCache, v)) return; - } - const quint16 scaled = normalizedVolume * 0xFFFF; - DWORD vol = MAKELONG(scaled, scaled); - MMRESULT res = waveOutSetVolume(hWaveOut, vol); - if (res == MMSYSERR_NOERROR) - volumeCache = normalizedVolume; + + volumeCache = qBound(qreal(0), v, qreal(1)); } qreal QWindowsAudioOutput::volume() const diff --git a/src/plugins/wmf/decoder/decoder.pri b/src/plugins/wmf/decoder/decoder.pri index 992e710fe..7637ac848 100644 --- a/src/plugins/wmf/decoder/decoder.pri +++ b/src/plugins/wmf/decoder/decoder.pri @@ -1,7 +1,7 @@ INCLUDEPATH += $$PWD -LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 -lMf -lMfuuid -lMfplat \ - -lPropsys -lmfreadwrite -lwmcodecdspuuid +LIBS += -lmfreadwrite -lwmcodecdspuuid +QMAKE_USE += wmf HEADERS += \ $$PWD/mfdecoderservice.h \ @@ -11,4 +11,4 @@ HEADERS += \ SOURCES += \ $$PWD/mfdecoderservice.cpp \ $$PWD/mfdecodersourcereader.cpp \ - $$PWD/mfaudiodecodercontrol.cpp
\ No newline at end of file + $$PWD/mfaudiodecodercontrol.cpp diff --git a/src/plugins/wmf/mfstream.cpp b/src/plugins/wmf/mfstream.cpp index 3ae6324af..fd95bf20b 100644 --- a/src/plugins/wmf/mfstream.cpp +++ b/src/plugins/wmf/mfstream.cpp @@ -236,7 +236,7 @@ STDMETHODIMP MFStream::Seek( break; } bool seekOK = m_stream->seek(pos); - if (*pqwCurrentPosition) + if (pqwCurrentPosition) *pqwCurrentPosition = pos; if (seekOK) return S_OK; diff --git a/src/plugins/wmf/mfactivate.cpp b/src/plugins/wmf/player/mfactivate.cpp index e06906584..e06906584 100644 --- a/src/plugins/wmf/mfactivate.cpp +++ b/src/plugins/wmf/player/mfactivate.cpp diff --git a/src/plugins/wmf/mfactivate.h b/src/plugins/wmf/player/mfactivate.h index 3243296e8..3243296e8 100644 --- a/src/plugins/wmf/mfactivate.h +++ b/src/plugins/wmf/player/mfactivate.h diff --git a/src/plugins/wmf/mftvideo.cpp b/src/plugins/wmf/player/mftvideo.cpp index 747fe6aea..747fe6aea 100644 --- a/src/plugins/wmf/mftvideo.cpp +++ b/src/plugins/wmf/player/mftvideo.cpp diff --git a/src/plugins/wmf/mftvideo.h b/src/plugins/wmf/player/mftvideo.h index ffcb80b32..ffcb80b32 100644 --- a/src/plugins/wmf/mftvideo.h +++ b/src/plugins/wmf/player/mftvideo.h diff --git a/src/plugins/wmf/player/player.pri b/src/plugins/wmf/player/player.pri index c24370eea..38ccb82a6 100644 --- a/src/plugins/wmf/player/player.pri +++ b/src/plugins/wmf/player/player.pri @@ -1,6 +1,7 @@ INCLUDEPATH += $$PWD -LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lgdi32 -luser32 -lole32 -loleaut32 -lMf -lMfuuid -lMfplat -lPropsys +LIBS += -lgdi32 -luser32 +QMAKE_USE += wmf DEFINES += QMEDIA_MEDIAFOUNDATION_PLAYER @@ -13,7 +14,10 @@ HEADERS += \ $$PWD/mfmetadatacontrol.h \ $$PWD/mfaudioprobecontrol.h \ $$PWD/mfvideoprobecontrol.h \ - $$PWD/mfevrvideowindowcontrol.h + $$PWD/mfevrvideowindowcontrol.h \ + $$PWD/samplegrabber.h \ + $$PWD/mftvideo.h \ + $$PWD/mfactivate.h SOURCES += \ $$PWD/mfplayerservice.cpp \ @@ -24,6 +28,9 @@ SOURCES += \ $$PWD/mfmetadatacontrol.cpp \ $$PWD/mfaudioprobecontrol.cpp \ $$PWD/mfvideoprobecontrol.cpp \ - $$PWD/mfevrvideowindowcontrol.cpp + $$PWD/mfevrvideowindowcontrol.cpp \ + $$PWD/samplegrabber.cpp \ + $$PWD/mftvideo.cpp \ + $$PWD/mfactivate.cpp include($$PWD/../../common/evr.pri) diff --git a/src/plugins/wmf/samplegrabber.cpp b/src/plugins/wmf/player/samplegrabber.cpp index d137335f3..d137335f3 100644 --- a/src/plugins/wmf/samplegrabber.cpp +++ b/src/plugins/wmf/player/samplegrabber.cpp diff --git a/src/plugins/wmf/samplegrabber.h b/src/plugins/wmf/player/samplegrabber.h index 9ca673a1b..9ca673a1b 100644 --- a/src/plugins/wmf/samplegrabber.h +++ b/src/plugins/wmf/player/samplegrabber.h diff --git a/src/plugins/wmf/sourceresolver.cpp b/src/plugins/wmf/sourceresolver.cpp index 78163e97f..f10f68c42 100644 --- a/src/plugins/wmf/sourceresolver.cpp +++ b/src/plugins/wmf/sourceresolver.cpp @@ -37,12 +37,13 @@ ** ****************************************************************************/ -#include "mfplayersession.h" #include "mfstream.h" #include "sourceresolver.h" #include <Mferror.h> #include <nserror.h> #include <QtCore/qfile.h> +#include <QtCore/qdebug.h> +#include <QtMultimedia/qmediaplayer.h> /* SourceResolver is separated from MFPlayerSession to handle the work of resolving a media source diff --git a/src/plugins/wmf/wmf.pro b/src/plugins/wmf/wmf.pro index e83c51595..c75efe28c 100644 --- a/src/plugins/wmf/wmf.pro +++ b/src/plugins/wmf/wmf.pro @@ -10,24 +10,19 @@ INCLUDEPATH += . HEADERS += \ wmfserviceplugin.h \ mfstream.h \ - sourceresolver.h \ - samplegrabber.h \ - mftvideo.h \ - mfactivate.h + sourceresolver.h SOURCES += \ wmfserviceplugin.cpp \ mfstream.cpp \ - sourceresolver.cpp \ - samplegrabber.cpp \ - mftvideo.cpp \ - mfactivate.cpp + sourceresolver.cpp -include (player/player.pri) +contains(QT_CONFIG, wmf-backend): include (player/player.pri) include (decoder/decoder.pri) OTHER_FILES += \ - wmf.json + wmf.json \ + wmf_audiodecode.json PLUGIN_TYPE = mediaservice PLUGIN_CLASS_NAME = WMFServicePlugin diff --git a/src/plugins/wmf/wmf_audiodecode.json b/src/plugins/wmf/wmf_audiodecode.json new file mode 100644 index 000000000..2a65dd758 --- /dev/null +++ b/src/plugins/wmf/wmf_audiodecode.json @@ -0,0 +1,4 @@ +{ + "Keys": ["windowsmediafoundation"], + "Services": ["org.qt-project.qt.audiodecode"] +} diff --git a/src/plugins/wmf/wmfserviceplugin.cpp b/src/plugins/wmf/wmfserviceplugin.cpp index ada1c8069..e19154aee 100644 --- a/src/plugins/wmf/wmfserviceplugin.cpp +++ b/src/plugins/wmf/wmfserviceplugin.cpp @@ -97,9 +97,13 @@ void WMFServicePlugin::release(QMediaService *service) QMediaServiceProviderHint::Features WMFServicePlugin::supportedFeatures( const QByteArray &service) const { +#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER if (service == Q_MEDIASERVICE_MEDIAPLAYER) return QMediaServiceProviderHint::StreamPlayback; else +#else + Q_UNUSED(service); +#endif return QMediaServiceProviderHint::Features(); } diff --git a/src/plugins/wmf/wmfserviceplugin.h b/src/plugins/wmf/wmfserviceplugin.h index cd3000199..39b7b86d9 100644 --- a/src/plugins/wmf/wmfserviceplugin.h +++ b/src/plugins/wmf/wmfserviceplugin.h @@ -54,7 +54,11 @@ class WMFServicePlugin Q_INTERFACES(QMediaServiceSupportedDevicesInterface) Q_INTERFACES(QMediaServiceDefaultDeviceInterface) Q_INTERFACES(QMediaServiceFeaturesInterface) +#ifdef QMEDIA_MEDIAFOUNDATION_PLAYER Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "wmf.json") +#else + Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "wmf_audiodecode.json") +#endif public: QMediaService* create(QString const& key); void release(QMediaService *service); @@ -66,4 +70,4 @@ public: QString deviceDescription(const QByteArray &service, const QByteArray &device); }; -#endif // DSSERVICEPLUGIN_H +#endif // WMFSERVICEPLUGIN_H diff --git a/src/src.pro b/src/src.pro index 17f3266c5..97a053379 100644 --- a/src/src.pro +++ b/src/src.pro @@ -2,6 +2,9 @@ TEMPLATE = subdirs SUBDIRS += multimedia +include($$OUT_PWD/multimedia/qtmultimedia-config.pri) +QT_FOR_CONFIG += multimedia-private + # Everything else depends on multimedia src_qgsttools.subdir = gsttools src_qgsttools.depends = multimedia @@ -39,7 +42,7 @@ qtHaveModule(widgets) { src_qgsttools.depends += src_qtmmwidgets } -config_gstreamer { +qtConfig(gstreamer) { SUBDIRS += src_qgsttools # If gstreamer is present, then plugins should depend on it |