diff options
Diffstat (limited to 'src/plugins/gstreamer')
14 files changed, 27 insertions, 266 deletions
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/camerabin/camerabuttonlistener_meego.h b/src/plugins/gstreamer/camerabin/camerabuttonlistener_meego.h deleted file mode 100644 index 776640ed4..000000000 --- a/src/plugins/gstreamer/camerabin/camerabuttonlistener_meego.h +++ /dev/null @@ -1,67 +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 CAMERABUTTONLISTENER_MEEGO_H -#define CAMERABUTTONLISTENER_MEEGO_H - -#include <QtCore/qobject.h> -#include <qmsystem2/qmkeys.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; -}; - -QT_END_NAMESPACE - -#endif // CAMERABUTTONLISTENER_MEEGO_H 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"); |