Skip to content

Commit

Permalink
turn QGstTools into a proper private module
Browse files Browse the repository at this point in the history
This patch moves the QGstTools lib to a private Qt module and marks
the needed classes and functions with Q_DECL*, to improve
cross-platform abilities. It's the first step to use the GStreamer
backend on macOS and Windows platform.

Change-Id: Idc23c72bcccb52dd501e169e9dfdc227856787fa
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
  • Loading branch information
jsee23 committed Jun 12, 2017
1 parent 7fdb88a commit ab6ebd3
Show file tree
Hide file tree
Showing 21 changed files with 163 additions and 77 deletions.
15 changes: 6 additions & 9 deletions src/gsttools/gsttools.pro
@@ -1,7 +1,6 @@
TEMPLATE = lib

TARGET = qgsttools_p
QPRO_PWD = $$PWD
TARGET = QtMultimediaGstTools
MODULE = multimediagsttools
CONFIG += internal_module

QT = core-private multimedia-private gui-private

Expand Down Expand Up @@ -36,7 +35,8 @@ PRIVATE_HEADERS += \
qgstreamervideoprobecontrol_p.h \
qgstreameraudioprobecontrol_p.h \
qgstreamervideowindow_p.h \
qgstreamervideooverlay_p.h
qgstreamervideooverlay_p.h \
qgsttools_global_p.h

SOURCES += \
qgstreamerbushelper.cpp \
Expand Down Expand Up @@ -101,7 +101,4 @@ qtConfig(gstreamer_app) {

HEADERS += $$PRIVATE_HEADERS

DESTDIR = $$QT.multimedia.libs
target.path = $$[QT_INSTALL_LIBS]

INSTALLS += target
load(qt_module)
8 changes: 5 additions & 3 deletions src/multimedia/gsttools_headers/gstvideoconnector_p.h
Expand Up @@ -51,6 +51,8 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>

#include <gst/gst.h>

G_BEGIN_DECLS
Expand All @@ -69,7 +71,7 @@ G_BEGIN_DECLS
typedef struct _GstVideoConnector GstVideoConnector;
typedef struct _GstVideoConnectorClass GstVideoConnectorClass;

struct _GstVideoConnector {
struct Q_GSTTOOLS_EXPORT _GstVideoConnector {
GstElement element;

GstPad *srcpad;
Expand All @@ -81,14 +83,14 @@ struct _GstVideoConnector {
GstBuffer *latest_buffer;
};

struct _GstVideoConnectorClass {
struct Q_GSTTOOLS_EXPORT _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);
GType Q_GSTTOOLS_EXPORT gst_video_connector_get_type (void);

G_END_DECLS

Expand Down
3 changes: 2 additions & 1 deletion src/multimedia/gsttools_headers/qgstappsrc_p.h
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <QtCore/qobject.h>
#include <QtCore/qiodevice.h>

Expand All @@ -63,7 +64,7 @@

QT_BEGIN_NAMESPACE

class QGstAppSrc : public QObject
class Q_GSTTOOLS_EXPORT QGstAppSrc : public QObject
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/multimedia/gsttools_headers/qgstbufferpoolinterface_p.h
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <qabstractvideobuffer.h>
#include <qvideosurfaceformat.h>
#include <QtCore/qobject.h>
Expand All @@ -65,7 +66,7 @@ const QLatin1String QGstBufferPoolPluginKey("bufferpool");
/*!
Abstract interface for video buffers allocation.
*/
class QGstBufferPoolInterface
class Q_GSTTOOLS_EXPORT QGstBufferPoolInterface
{
public:
virtual ~QGstBufferPoolInterface() {}
Expand Down
3 changes: 2 additions & 1 deletion src/multimedia/gsttools_headers/qgstcodecsinfo_p.h
Expand Up @@ -51,14 +51,15 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <QtCore/qmap.h>
#include <QtCore/qstringlist.h>

#include <gst/gst.h>

QT_BEGIN_NAMESPACE

class QGstCodecsInfo
class Q_GSTTOOLS_EXPORT QGstCodecsInfo
{
public:
enum ElementType { AudioEncoder, VideoEncoder, Muxer };
Expand Down
Expand Up @@ -51,12 +51,13 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <qaudioinputselectorcontrol.h>
#include <QtCore/qstringlist.h>

QT_BEGIN_NAMESPACE

class QGstreamerAudioInputSelector : public QAudioInputSelectorControl
class Q_GSTTOOLS_EXPORT QGstreamerAudioInputSelector : public QAudioInputSelectorControl
{
Q_OBJECT
public:
Expand Down
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <gst/gst.h>
#include <qmediaaudioprobecontrol.h>
#include <QtCore/qmutex.h>
Expand All @@ -61,7 +62,7 @@

QT_BEGIN_NAMESPACE

class QGstreamerAudioProbeControl
class Q_GSTTOOLS_EXPORT QGstreamerAudioProbeControl
: public QMediaAudioProbeControl
, public QGstreamerBufferProbe
, public QSharedData
Expand Down
4 changes: 3 additions & 1 deletion src/multimedia/gsttools_headers/qgstreamerbufferprobe_p.h
Expand Up @@ -51,13 +51,15 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <gst/gst.h>

#include <QtCore/qglobal.h>


QT_BEGIN_NAMESPACE

class QGstreamerBufferProbe
class Q_GSTTOOLS_EXPORT QGstreamerBufferProbe
{
public:
enum Flags
Expand Down
4 changes: 3 additions & 1 deletion src/multimedia/gsttools_headers/qgstreamerbushelper_p.h
Expand Up @@ -51,9 +51,11 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <QObject>

#include "qgstreamermessage_p.h"

#include <gst/gst.h>

QT_BEGIN_NAMESPACE
Expand All @@ -78,7 +80,7 @@ Q_DECLARE_INTERFACE(QGstreamerBusMessageFilter, QGstreamerBusMessageFilter_iid)

class QGstreamerBusHelperPrivate;

class QGstreamerBusHelper : public QObject
class Q_GSTTOOLS_EXPORT QGstreamerBusHelper : public QObject
{
Q_OBJECT
friend class QGstreamerBusHelperPrivate;
Expand Down
3 changes: 2 additions & 1 deletion src/multimedia/gsttools_headers/qgstreamermessage_p.h
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <QMetaType>

#include <gst/gst.h>
Expand All @@ -60,7 +61,7 @@ QT_BEGIN_NAMESPACE
// Required for QDoc workaround
class QString;

class QGstreamerMessage
class Q_GSTTOOLS_EXPORT QGstreamerMessage
{
public:
QGstreamerMessage();
Expand Down
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <qvideodeviceselectorcontrol.h>
#include <QtCore/qstringlist.h>

Expand All @@ -59,7 +60,7 @@

QT_BEGIN_NAMESPACE

class QGstreamerVideoInputDeviceControl : public QVideoDeviceSelectorControl
class Q_GSTTOOLS_EXPORT QGstreamerVideoInputDeviceControl : public QVideoDeviceSelectorControl
{
Q_OBJECT
public:
Expand Down
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <gst/gst.h>
#include <gst/video/video.h>
#include <qmediavideoprobecontrol.h>
Expand All @@ -62,7 +63,7 @@

QT_BEGIN_NAMESPACE

class QGstreamerVideoProbeControl
class Q_GSTTOOLS_EXPORT QGstreamerVideoProbeControl
: public QMediaVideoProbeControl
, public QGstreamerBufferProbe
, public QSharedData
Expand Down
3 changes: 2 additions & 1 deletion src/multimedia/gsttools_headers/qgstreamervideorenderer_p.h
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <qvideorenderercontrol.h>
#include <private/qvideosurfacegstsink_p.h>
#include <qabstractvideosurface.h>
Expand All @@ -59,7 +60,7 @@

QT_BEGIN_NAMESPACE

class QGstreamerVideoRenderer : public QVideoRendererControl, public QGstreamerVideoRendererInterface
class Q_GSTTOOLS_EXPORT QGstreamerVideoRenderer : public QVideoRendererControl, public QGstreamerVideoRendererInterface
{
Q_OBJECT
Q_INTERFACES(QGstreamerVideoRendererInterface)
Expand Down
5 changes: 3 additions & 2 deletions src/multimedia/gsttools_headers/qgstreamervideowidget_p.h
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <qvideowidgetcontrol.h>

#include "qgstreamervideorendererinterface_p.h"
Expand All @@ -59,9 +60,9 @@

QT_BEGIN_NAMESPACE

class QGstreamerVideoWidget;
class Q_GSTTOOLS_EXPORT QGstreamerVideoWidget;

class QGstreamerVideoWidgetControl
class Q_GSTTOOLS_EXPORT QGstreamerVideoWidgetControl
: public QVideoWidgetControl
, public QGstreamerVideoRendererInterface
, public QGstreamerSyncMessageFilter
Expand Down
3 changes: 2 additions & 1 deletion src/multimedia/gsttools_headers/qgstreamervideowindow_p.h
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <private/qgsttools_global_p.h>
#include <qvideowindowcontrol.h>

#include "qgstreamervideorendererinterface_p.h"
Expand All @@ -61,7 +62,7 @@
QT_BEGIN_NAMESPACE
class QAbstractVideoSurface;

class QGstreamerVideoWindow :
class Q_GSTTOOLS_EXPORT QGstreamerVideoWindow :
public QVideoWindowControl,
public QGstreamerVideoRendererInterface,
public QGstreamerSyncMessageFilter,
Expand Down
70 changes: 70 additions & 0 deletions src/multimedia/gsttools_headers/qgsttools_global_p.h
@@ -0,0 +1,70 @@
/****************************************************************************
**
** Copyright (C) 2017 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 QGSTTOOLS_GLOBAL_H
#define QGSTTOOLS_GLOBAL_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 <QtCore/qglobal.h>

QT_BEGIN_NAMESPACE

#ifndef QT_STATIC
# if defined(QT_BUILD_MULTIMEDIAGSTTOOLS_LIB)
# define Q_GSTTOOLS_EXPORT Q_DECL_EXPORT
# else
# define Q_GSTTOOLS_EXPORT Q_DECL_IMPORT
# endif
#else
# define Q_GSTTOOLS_EXPORT
#endif

QT_END_NAMESPACE

#endif // QGSTTOOLS_GLOBAL_H

0 comments on commit ab6ebd3

Please sign in to comment.