summaryrefslogtreecommitdiff
path: root/src/multimedia/gsttools_headers
diff options
context:
space:
mode:
authorJonas Rabbe <jonas.rabbe@nokia.com>2012-03-22 11:04:03 +1000
committerQt by Nokia <qt-info@nokia.com>2012-04-27 09:22:09 +0200
commita3b6eabd45b452b98c5b7c45df8a332ad018b8f1 (patch)
tree9f3a3fd7bfd6c514a472ad0103037476da4c6e0f /src/multimedia/gsttools_headers
parente44bcf0a384c15e7df593ec3f3cee30775f3f1ef (diff)
downloadqtmultimedia-a3b6eabd45b452b98c5b7c45df8a332ad018b8f1.tar.gz
qtmultimedia-a3b6eabd45b452b98c5b7c45df8a332ad018b8f1.tar.bz2
qtmultimedia-a3b6eabd45b452b98c5b7c45df8a332ad018b8f1.zip
Split gstreamer plugin into smaller plugins providing fewer services
The gstreamer blob has been split into four plugins: audiodecoder, camerabin, mediacapture, and mediaplayer. Note: camerabin is still disabled because it is untested camerabin2 implementation. A new qmake configuration use_gstreamer_camera has been introduced and is needed for the mediacapture plugin to expose the camera service. This configuration has been disabled by default. Shared functionality has been moved to the internal gsttools library. Change-Id: Ifb2604f440cfa97513d39f5d7978766c88eaec45 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'src/multimedia/gsttools_headers')
-rw-r--r--src/multimedia/gsttools_headers/gstvideoconnector_p.h87
-rw-r--r--src/multimedia/gsttools_headers/qgstappsrc_p.h106
-rw-r--r--src/multimedia/gsttools_headers/qgstcodecsinfo_p.h72
-rw-r--r--src/multimedia/gsttools_headers/qgstreameraudioinputendpointselector_p.h78
-rw-r--r--src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h71
-rw-r--r--src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h132
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h78
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h117
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h75
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h81
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h75
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideowidget_p.h114
-rw-r--r--src/multimedia/gsttools_headers/qgstreamervideowindow_p.h133
-rw-r--r--src/multimedia/gsttools_headers/qgstutils_p.h5
-rw-r--r--src/multimedia/gsttools_headers/qx11videosurface_p.h117
15 files changed, 1341 insertions, 0 deletions
diff --git a/src/multimedia/gsttools_headers/gstvideoconnector_p.h b/src/multimedia/gsttools_headers/gstvideoconnector_p.h
new file mode 100644
index 00000000..1ac973f4
--- /dev/null
+++ b/src/multimedia/gsttools_headers/gstvideoconnector_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTVIDEOCONNECTOR_H
+#define QGSTVIDEOCONNECTOR_H
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_VIDEO_CONNECTOR \
+ (gst_video_connector_get_type())
+#define GST_VIDEO_CONNECTOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_CONNECTOR, GstVideoConnector))
+#define GST_VIDEO_CONNECTOR_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VIDEO_CONNECTOR, GstVideoConnectorClass))
+#define GST_IS_VIDEO_CONNECTOR(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_CONNECTOR))
+#define GST_IS_VIDEO_CONNECTOR_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VIDEO_CONNECTOR))
+
+typedef struct _GstVideoConnector GstVideoConnector;
+typedef struct _GstVideoConnectorClass GstVideoConnectorClass;
+
+struct _GstVideoConnector {
+ GstElement element;
+
+ GstPad *srcpad;
+ GstPad *sinkpad;
+
+ gboolean relinked;
+ gboolean failedSignalEmited;
+ GstSegment segment;
+ GstBuffer *latest_buffer;
+};
+
+struct _GstVideoConnectorClass {
+ GstElementClass parent_class;
+
+ /* action signal to resend new segment */
+ void (*resend_new_segment) (GstElement * element, gboolean emitFailedSignal);
+};
+
+GType gst_video_connector_get_type (void);
+
+G_END_DECLS
+
+#endif
+
diff --git a/src/multimedia/gsttools_headers/qgstappsrc_p.h b/src/multimedia/gsttools_headers/qgstappsrc_p.h
new file mode 100644
index 00000000..dc817e8f
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstappsrc_p.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTAPPSRC_H
+#define QGSTAPPSRC_H
+
+#include <QtCore/qobject.h>
+#include <QtCore/qiodevice.h>
+
+#include <gst/gst.h>
+#include <gst/app/gstappsrc.h>
+#include <gst/app/gstappbuffer.h>
+
+class QGstAppSrc : public QObject
+{
+ Q_OBJECT
+public:
+ QGstAppSrc(QObject *parent = 0);
+ ~QGstAppSrc();
+
+ bool setup(GstElement *);
+ bool isReady() const { return m_setup; }
+
+ void setStream(QIODevice *);
+ QIODevice *stream() const;
+
+ GstAppSrc *element();
+
+ qint64 queueSize() const { return m_maxBytes; }
+
+ bool& enoughData() { return m_enoughData; }
+ bool& dataRequested() { return m_dataRequested; }
+ unsigned int& dataRequestSize() { return m_dataRequestSize; }
+
+ bool isStreamValid() const
+ {
+ return m_stream != 0 &&
+ m_stream->isOpen();
+ }
+
+private slots:
+ void pushDataToAppSrc();
+ bool doSeek(qint64);
+ void onDataReady();
+
+ void streamDestroyed();
+private:
+ static gboolean on_seek_data(GstAppSrc *element, guint64 arg0, gpointer userdata);
+ static void on_enough_data(GstAppSrc *element, gpointer userdata);
+ static void on_need_data(GstAppSrc *element, uint arg0, gpointer userdata);
+ static void destroy_notify(gpointer data);
+
+ void sendEOS();
+
+ QIODevice *m_stream;
+ GstAppSrc *m_appSrc;
+ bool m_sequential;
+ GstAppStreamType m_streamType;
+ GstAppSrcCallbacks m_callbacks;
+ qint64 m_maxBytes;
+ bool m_setup;
+ unsigned int m_dataRequestSize;
+ bool m_dataRequested;
+ bool m_enoughData;
+ bool m_forceData;
+};
+
+#endif
diff --git a/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h b/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h
new file mode 100644
index 00000000..58e843bc
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstcodecsinfo_p.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTCODECSINFO_H
+#define QGSTCODECSINFO_H
+
+#include <QtCore/qmap.h>
+#include <QtCore/qstringlist.h>
+
+#include <gst/gst.h>
+
+class QGstCodecsInfo
+{
+public:
+ enum ElementType { AudioEncoder, VideoEncoder, Muxer };
+
+ QGstCodecsInfo(ElementType elementType);
+
+ QStringList supportedCodecs() const;
+ QString codecDescription(const QString &codec) const;
+
+#if GST_CHECK_VERSION(0,10,31)
+ static GstCaps* supportedElementCaps(GstElementFactoryListType elementType,
+ GstRank minimumRank = GST_RANK_MARGINAL,
+ GstPadDirection padDirection = GST_PAD_SRC);
+#endif
+
+private:
+ QStringList m_codecs;
+ QMap<QString,QString> m_codecDescriptions;
+};
+
+
+#endif
diff --git a/src/multimedia/gsttools_headers/qgstreameraudioinputendpointselector_p.h b/src/multimedia/gsttools_headers/qgstreameraudioinputendpointselector_p.h
new file mode 100644
index 00000000..5d5bc715
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreameraudioinputendpointselector_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H
+#define QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H
+
+#include <qaudioendpointselector.h>
+#include <QtCore/qstringlist.h>
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerAudioInputEndpointSelector : public QAudioEndpointSelector
+{
+Q_OBJECT
+public:
+ QGstreamerAudioInputEndpointSelector(QObject *parent);
+ ~QGstreamerAudioInputEndpointSelector();
+
+ QList<QString> availableEndpoints() const;
+ QString endpointDescription(const QString& name) const;
+ QString defaultEndpoint() const;
+ QString activeEndpoint() const;
+
+public Q_SLOTS:
+ void setActiveEndpoint(const QString& name);
+
+private:
+ void update();
+ void updateAlsaDevices();
+ void updateOssDevices();
+ void updatePulseDevices();
+
+ QString m_audioInput;
+ QList<QString> m_names;
+ QList<QString> m_descriptions;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H
diff --git a/src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h b/src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h
new file mode 100644
index 00000000..beb6dca1
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreameraudioprobecontrol_p.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERAUDIOPROBECONTROL_H
+#define QGSTREAMERAUDIOPROBECONTROL_H
+
+#include <gst/gst.h>
+#include <qmediaaudioprobecontrol.h>
+#include <QtCore/qmutex.h>
+#include <qaudiobuffer.h>
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerAudioProbeControl : public QMediaAudioProbeControl
+{
+ Q_OBJECT
+public:
+ explicit QGstreamerAudioProbeControl(QObject *parent);
+ virtual ~QGstreamerAudioProbeControl();
+
+ void bufferProbed(GstBuffer* buffer);
+
+private slots:
+ void bufferProbed();
+
+private:
+ QAudioBuffer m_pendingBuffer;
+ QMutex m_bufferMutex;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGSTREAMERAUDIOPROBECONTROL_H
diff --git a/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h b/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h
new file mode 100644
index 00000000..f18b74b8
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERGLTEXTURERENDERER_H
+#define QGSTREAMERGLTEXTURERENDERER_H
+
+#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/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h b/src/multimedia/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h
new file mode 100644
index 00000000..f51a9c82
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamervideoinputdevicecontrol_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERVIDEOINPUTDEVICECONTROL_H
+#define QGSTREAMERVIDEOINPUTDEVICECONTROL_H
+
+#include <qvideodevicecontrol.h>
+#include <QtCore/qstringlist.h>
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerVideoInputDeviceControl : public QVideoDeviceControl
+{
+Q_OBJECT
+public:
+ QGstreamerVideoInputDeviceControl(QObject *parent);
+ ~QGstreamerVideoInputDeviceControl();
+
+ int deviceCount() const;
+
+ QString deviceName(int index) const;
+ QString deviceDescription(int index) const;
+
+ int defaultDevice() const;
+ int selectedDevice() const;
+
+public Q_SLOTS:
+ void setSelectedDevice(int index);
+
+private:
+ void update();
+
+ int m_selectedDevice;
+ QStringList m_names;
+ QStringList m_descriptions;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGSTREAMERAUDIOINPUTDEVICECONTROL_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h b/src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h
new file mode 100644
index 00000000..c92c5fff
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERVIDEOOVERLAY_H
+#define QGSTREAMERVIDEOOVERLAY_H
+
+#include <qvideowindowcontrol.h>
+
+#include "qgstreamervideorendererinterface_p.h"
+
+QT_BEGIN_NAMESPACE
+class QAbstractVideoSurface;
+QT_END_NAMESPACE
+class QX11VideoSurface;
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerVideoOverlay : public QVideoWindowControl, public QGstreamerVideoRendererInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QGstreamerVideoRendererInterface)
+public:
+ QGstreamerVideoOverlay(QObject *parent = 0);
+ ~QGstreamerVideoOverlay();
+
+ WId winId() const;
+ void setWinId(WId id);
+
+ QRect displayRect() const;
+ void setDisplayRect(const QRect &rect);
+
+ bool isFullScreen() const;
+ void setFullScreen(bool fullScreen);
+
+ QSize nativeSize() const;
+
+ Qt::AspectRatioMode aspectRatioMode() const;
+ void setAspectRatioMode(Qt::AspectRatioMode mode);
+
+ void repaint();
+
+ 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);
+
+ QAbstractVideoSurface *surface() const;
+
+ GstElement *videoSink();
+
+ bool isReady() const { return winId() != 0; }
+
+signals:
+ void sinkChanged();
+ void readyChanged(bool);
+
+private slots:
+ void surfaceFormatChanged();
+
+private:
+ void setScaledDisplayRect();
+
+ QX11VideoSurface *m_surface;
+ GstElement *m_videoSink;
+ Qt::AspectRatioMode m_aspectRatioMode;
+ QRect m_displayRect;
+ bool m_fullScreen;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h b/src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h
new file mode 100644
index 00000000..062040fc
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamervideoprobecontrol_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERVIDEOPROBECONTROL_H
+#define QGSTREAMERVIDEOPROBECONTROL_H
+
+#include <gst/gst.h>
+#include <qmediavideoprobecontrol.h>
+#include <QtCore/qmutex.h>
+#include <qvideoframe.h>
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerVideoProbeControl : public QMediaVideoProbeControl
+{
+ Q_OBJECT
+public:
+ explicit QGstreamerVideoProbeControl(QObject *parent);
+ virtual ~QGstreamerVideoProbeControl();
+
+ void bufferProbed(GstBuffer* buffer);
+ void startFlushing();
+ void stopFlushing();
+
+private slots:
+ void frameProbed();
+
+private:
+ bool m_flushing;
+ bool m_frameProbed; // true if at least one frame was probed
+ QVideoFrame m_pendingFrame;
+ QMutex m_frameMutex;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGSTREAMERVIDEOPROBECONTROL_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h b/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h
new file mode 100644
index 00000000..76a10815
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERVIDEORENDERER_H
+#define QGSTREAMERVIDEORENDERER_H
+
+#include <qvideorenderercontrol.h>
+#include <private/qvideosurfacegstsink_p.h>
+
+#include "qgstreamervideorendererinterface_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerVideoRenderer : public QVideoRendererControl, public QGstreamerVideoRendererInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QGstreamerVideoRendererInterface)
+public:
+ QGstreamerVideoRenderer(QObject *parent = 0);
+ virtual ~QGstreamerVideoRenderer();
+
+ QAbstractVideoSurface *surface() const;
+ void setSurface(QAbstractVideoSurface *surface);
+
+ GstElement *videoSink();
+
+ bool isReady() const { return m_surface != 0; }
+
+signals:
+ void sinkChanged();
+ void readyChanged(bool);
+
+private slots:
+ void handleFormatChange();
+
+private:
+ QVideoSurfaceGstSink *m_videoSink;
+ QAbstractVideoSurface *m_surface;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGSTREAMERVIDEORENDRER_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h b/src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h
new file mode 100644
index 00000000..42f6d5d5
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamervideorendererinterface_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERVIDEOOUTPUTCONTROL_H
+#define QGSTREAMERVIDEOOUTPUTCONTROL_H
+
+#include <gst/gst.h>
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerVideoRendererInterface
+{
+public:
+ virtual ~QGstreamerVideoRendererInterface();
+ virtual GstElement *videoSink() = 0;
+
+ //stopRenderer() is called when the renderer element is stopped.
+ //it can be reimplemented when video renderer can't detect
+ //changes to NULL state but has to free video resources.
+ virtual void stopRenderer() {}
+
+ //the video output is configured, usually after the first paint event
+ //(winId is known,
+ virtual bool isReady() const { return true; }
+
+ //signals:
+ //void sinkChanged();
+ //void readyChanged(bool);
+};
+
+#define QGstreamerVideoRendererInterface_iid "org.qt-project.qt.gstreamervideorenderer/5.0"
+Q_DECLARE_INTERFACE(QGstreamerVideoRendererInterface, QGstreamerVideoRendererInterface_iid)
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h b/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h
new file mode 100644
index 00000000..ab0d4937
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERVIDEOWIDGET_H
+#define QGSTREAMERVIDEOWIDGET_H
+
+#include <qvideowidgetcontrol.h>
+
+#include "qgstreamervideorendererinterface_p.h"
+#include <private/qgstreamerbushelper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerVideoWidget;
+
+class QGstreamerVideoWidgetControl
+ : public QVideoWidgetControl
+ , public QGstreamerVideoRendererInterface
+ , public QGstreamerSyncMessageFilter
+ , public QGstreamerBusMessageFilter
+{
+ Q_OBJECT
+ Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter)
+public:
+ QGstreamerVideoWidgetControl(QObject *parent = 0);
+ virtual ~QGstreamerVideoWidgetControl();
+
+ GstElement *videoSink();
+
+ QWidget *videoWidget();
+
+ Qt::AspectRatioMode aspectRatioMode() const;
+ void setAspectRatioMode(Qt::AspectRatioMode mode);
+
+ bool isFullScreen() const;
+ void setFullScreen(bool fullScreen);
+
+ 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);
+
+ void setOverlay();
+
+ bool eventFilter(QObject *object, QEvent *event);
+ bool processSyncMessage(const QGstreamerMessage &message);
+ bool processBusMessage(const QGstreamerMessage &message);
+
+public slots:
+ void updateNativeVideoSize();
+
+signals:
+ void sinkChanged();
+ void readyChanged(bool);
+
+private:
+ void createVideoWidget();
+ void windowExposed();
+
+ GstElement *m_videoSink;
+ QGstreamerVideoWidget *m_widget;
+ WId m_windowId;
+ Qt::AspectRatioMode m_aspectRatioMode;
+ bool m_fullScreen;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGSTREAMERVIDEOWIDGET_H
diff --git a/src/multimedia/gsttools_headers/qgstreamervideowindow_p.h b/src/multimedia/gsttools_headers/qgstreamervideowindow_p.h
new file mode 100644
index 00000000..da8af5a8
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qgstreamervideowindow_p.h
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGSTREAMERVIDEOWINDOW_H
+#define QGSTREAMERVIDEOWINDOW_H
+
+#include <qvideowindowcontrol.h>
+
+#include "qgstreamervideorendererinterface_p.h"
+#include <private/qgstreamerbushelper_p.h>
+#include <QtGui/qcolor.h>
+
+QT_BEGIN_NAMESPACE
+class QAbstractVideoSurface;
+QT_END_NAMESPACE
+class QX11VideoSurface;
+
+QT_BEGIN_NAMESPACE
+
+class QGstreamerVideoWindow : public QVideoWindowControl,
+ public QGstreamerVideoRendererInterface,
+ public QGstreamerSyncMessageFilter
+{
+ Q_OBJECT
+ Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter)
+ Q_PROPERTY(QColor colorKey READ colorKey WRITE setColorKey)
+ Q_PROPERTY(bool autopaintColorKey READ autopaintColorKey WRITE setAutopaintColorKey)
+public:
+ QGstreamerVideoWindow(QObject *parent = 0, const char *elementName = 0);
+ ~QGstreamerVideoWindow();
+
+ WId winId() const;
+ void setWinId(WId id);
+
+ QRect displayRect() const;
+ void setDisplayRect(const QRect &rect);
+
+ bool isFullScreen() const;
+ void setFullScreen(bool fullScreen);
+
+ QSize nativeSize() const;
+
+ Qt::AspectRatioMode aspectRatioMode() const;
+ void setAspectRatioMode(Qt::AspectRatioMode mode);
+
+ QColor colorKey() const;
+ void setColorKey(const QColor &);
+
+ bool autopaintColorKey() const;
+ void setAutopaintColorKey(bool);
+
+ void repaint();
+
+ 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);
+
+ QAbstractVideoSurface *surface() const;
+
+ GstElement *videoSink();
+
+ bool processSyncMessage(const QGstreamerMessage &message);
+ bool isReady() const { return m_windowId != 0; }
+
+signals:
+ void sinkChanged();
+ void readyChanged(bool);
+
+private slots:
+ void updateNativeVideoSize();
+
+private:
+ static void padBufferProbe(GstPad *pad, GstBuffer *buffer, gpointer user_data);
+
+ GstElement *m_videoSink;
+ WId m_windowId;
+ Qt::AspectRatioMode m_aspectRatioMode;
+ QRect m_displayRect;
+ bool m_fullScreen;
+ QSize m_nativeSize;
+ mutable QColor m_colorKey;
+ int m_bufferProbeId;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/multimedia/gsttools_headers/qgstutils_p.h b/src/multimedia/gsttools_headers/qgstutils_p.h
index 45bf76e1..5a188c12 100644
--- a/src/multimedia/gsttools_headers/qgstutils_p.h
+++ b/src/multimedia/gsttools_headers/qgstutils_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qmap.h>
+#include <QtCore/qset.h>
#include <gst/gst.h>
#include <qaudioformat.h>
@@ -71,6 +72,10 @@ namespace QGstUtils {
QAudioFormat audioFormatForCaps(const GstCaps *caps);
QAudioFormat audioFormatForBuffer(GstBuffer *buffer);
GstCaps *capsForAudioFormat(QAudioFormat format);
+ void initializeGst();
+ QtMultimedia::SupportEstimate hasSupport(const QString &mimeType,
+ const QStringList &codecs,
+ const QSet<QString> &supportedMimeTypeSet);
}
QT_END_NAMESPACE
diff --git a/src/multimedia/gsttools_headers/qx11videosurface_p.h b/src/multimedia/gsttools_headers/qx11videosurface_p.h
new file mode 100644
index 00000000..243c0690
--- /dev/null
+++ b/src/multimedia/gsttools_headers/qx11videosurface_p.h
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QX11VIDEOSURFACE_H
+#define QX11VIDEOSURFACE_H
+
+#include <QtWidgets/qwidget.h>
+#include <qabstractvideosurface.h>
+
+#include <X11/Xlib.h>
+#include <X11/extensions/Xv.h>
+#include <X11/extensions/Xvlib.h>
+
+QT_BEGIN_NAMESPACE
+
+class QX11VideoSurface : public QAbstractVideoSurface
+{
+ Q_OBJECT
+public:
+ QX11VideoSurface(QObject *parent = 0);
+ ~QX11VideoSurface();
+
+ WId winId() const;
+ void setWinId(WId id);
+
+ QRect displayRect() const;
+ void setDisplayRect(const QRect &rect);
+
+ QRect viewport() const;
+ void setViewport(const QRect &rect);
+
+ 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);
+
+ QList<QVideoFrame::PixelFormat> supportedPixelFormats(
+ QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
+
+ bool start(const QVideoSurfaceFormat &format);
+ void stop();
+
+ bool present(const QVideoFrame &frame);
+
+private:
+ Display *display() const;
+
+ WId m_winId;
+ XvPortID m_portId;
+ GC m_gc;
+ XvImage *m_image;
+ QList<QVideoFrame::PixelFormat> m_supportedPixelFormats;
+ QVector<int> m_formatIds;
+ QRect m_viewport;
+ QRect m_displayRect;
+ QPair<int, int> m_brightnessRange;
+ QPair<int, int> m_contrastRange;
+ QPair<int, int> m_hueRange;
+ QPair<int, int> m_saturationRange;
+
+ bool findPort();
+ void querySupportedFormats();
+
+ int getAttribute(const char *attribute, int minimum, int maximum) const;
+ void setAttribute(const char *attribute, int value, int minimum, int maximum);
+
+ static int redistribute(int value, int fromLower, int fromUpper, int toLower, int toUpper);
+};
+
+QT_END_NAMESPACE
+
+#endif