Moved general gstreamer helper classes into separate library.

Cleaned up configuration of gstreamer with a separate config
test.

Change-Id: I1ec9ee466233687fbcfdc544a12d9fce578e4379
Reviewed-on: http://codereview.qt-project.org/6459
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Jonas Rabbe
2011-10-11 15:25:36 +10:00
committed by Qt by Nokia
parent 126addddb5
commit 48d95f0baa
37 changed files with 278 additions and 75 deletions

View File

@@ -0,0 +1,20 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
requires(unix)
# Input
SOURCES += main.cpp
CONFIG += link_pkgconfig
PKGCONFIG += \
gstreamer-0.10 \
gstreamer-base-0.10 \
gstreamer-interfaces-0.10 \
gstreamer-audio-0.10 \
gstreamer-video-0.10 \
gstreamer-pbutils-0.10

View File

@@ -0,0 +1,49 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** 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$
**
****************************************************************************/
#define GST_USE_UNSTABLE_API
#include <gst/gst.h>
int main(int argc, char** argv)
{
return 0;
}

67
src/gsttools/gsttools.pro Normal file
View File

@@ -0,0 +1,67 @@
TEMPLATE = lib
TARGET = qgsttools_p
QPRO_PWD = $$PWD
QT = core multimedia
!static:DEFINES += QT_MAKEDLL
unix:!maemo*:contains(QT_CONFIG, alsa) {
DEFINES += HAVE_ALSA
LIBS += \
-lasound
}
CONFIG += link_pkgconfig
PKGCONFIG += \
gstreamer-0.10 \
gstreamer-base-0.10 \
gstreamer-interfaces-0.10 \
gstreamer-audio-0.10 \
gstreamer-video-0.10 \
gstreamer-pbutils-0.10
maemo*:PKGCONFIG +=gstreamer-plugins-bad-0.10
contains(config_test_gstreamer_appsrc, yes): PKGCONFIG += gstreamer-app-0.10
contains(config_test_resourcepolicy, yes) {
DEFINES += HAVE_RESOURCE_POLICY
PKGCONFIG += libresourceqt1
}
# Header files must go inside source directory of a module
# to be installed by syncqt.
INCLUDEPATH += ../multimedia/gsttools_headers/
DEPENDPATH += ../multimedia/gsttools_headers/
PRIVATE_HEADERS += \
qabstractgstbufferpool_p.h \
qgstreamerbushelper_p.h \
qgstreamermessage_p.h \
qgstutils_p.h \
qgstvideobuffer_p.h \
qvideosurfacegstsink_p.h \
SOURCES += \
qgstreamerbushelper.cpp \
qgstreamermessage.cpp \
qgstutils.cpp \
qgstvideobuffer.cpp \
qvideosurfacegstsink.cpp \
!win32:!contains(QT_CONFIG,embedded):!mac:!simulator:!contains(QT_CONFIG, qpa) {
LIBS += -lXv -lX11 -lXext
PRIVATE_HEADERS += \
qgstxvimagebuffer_p.h \
SOURCES += \
qgstxvimagebuffer.cpp \
}
HEADERS += $$PRIVATE_HEADERS
DESTDIR = $$QT.multimedia.libs

View File

@@ -44,7 +44,7 @@
#include <QtCore/qmutex.h>
#include <QtCore/qlist.h>
#include "qgstreamerbushelper.h"
#include "qgstreamerbushelper_p.h"
#ifndef QT_NO_GLIB

View File

@@ -41,7 +41,7 @@
#include <gst/gst.h>
#include "qgstreamermessage.h"
#include "qgstreamermessage_p.h"
static int wuchi = qRegisterMetaType<QGstreamerMessage>();

View File

@@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qgstutils.h"
#include "qgstutils_p.h"
#include <QtCore/qdatetime.h>
#include <QtCore/qbytearray.h>

View File

@@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qgstvideobuffer.h"
#include "qgstvideobuffer_p.h"
QGstVideoBuffer::QGstVideoBuffer(GstBuffer *buffer, int bytesPerLine)

View File

@@ -44,9 +44,9 @@
#include <QtCore/qvariant.h>
#include <QtWidgets/qx11info_x11.h>
#include "qgstxvimagebuffer.h"
#include "qvideosurfacegstsink.h"
#include "qgstvideobuffer.h"
#include "qgstxvimagebuffer_p.h"
#include "qvideosurfacegstsink_p.h"
#include "qgstvideobuffer_p.h"
#ifndef QT_NO_XVIDEO

View File

@@ -46,14 +46,14 @@
#include <QDebug>
#include <QThread>
#include "qgstvideobuffer.h"
#include "qgstvideobuffer_p.h"
#if defined(Q_WS_X11) && !defined(QT_NO_XVIDEO)
#include <QtWidgets/qx11info_x11.h>
#include "qgstxvimagebuffer.h"
#include "qgstxvimagebuffer_p.h"
#endif
#include "qvideosurfacegstsink.h"
#include "qvideosurfacegstsink_p.h"
//#define DEBUG_VIDEO_SURFACE_SINK

View File

@@ -39,8 +39,19 @@
**
****************************************************************************/
#ifndef QGSTBUFFERPOOL_H
#define QGSTBUFFERPOOL_H
#ifndef QGSTBUFFERPOOL_P_H
#define QGSTBUFFERPOOL_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 <qabstractvideobuffer.h>
#include <qvideosurfaceformat.h>

View File

@@ -39,12 +39,23 @@
**
****************************************************************************/
#ifndef QGSTREAMERBUSHELPER_H
#define QGSTREAMERBUSHELPER_H
#ifndef QGSTREAMERBUSHELPER_P_H
#define QGSTREAMERBUSHELPER_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 <QObject>
#include <qgstreamermessage.h>
#include "qgstreamermessage_p.h"
#include <gst/gst.h>
class QGstreamerSyncMessageFilter {

View File

@@ -39,8 +39,19 @@
**
****************************************************************************/
#ifndef QGSTREAMERMESSAGE_H
#define QGSTREAMERMESSAGE_H
#ifndef QGSTREAMERMESSAGE_P_H
#define QGSTREAMERMESSAGE_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 <QMetaType>

View File

@@ -39,8 +39,19 @@
**
****************************************************************************/
#ifndef QGSTUTILS_H
#define QGSTUTILS_H
#ifndef QGSTUTILS_P_H
#define QGSTUTILS_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 <QtCore/qmap.h>
#include <gst/gst.h>

View File

@@ -39,8 +39,19 @@
**
****************************************************************************/
#ifndef QGSTVIDEOBUFFER_H
#define QGSTVIDEOBUFFER_H
#ifndef QGSTVIDEOBUFFER_P_H
#define QGSTVIDEOBUFFER_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 <qabstractvideobuffer.h>
#include <QtCore/qvariant.h>

View File

@@ -39,8 +39,19 @@
**
****************************************************************************/
#ifndef QGSTXVIMAGEBUFFER_H
#define QGSTXVIMAGEBUFFER_H
#ifndef QGSTXVIMAGEBUFFER_P_H
#define QGSTXVIMAGEBUFFER_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 <qabstractvideobuffer.h>
#include <qvideosurfaceformat.h>
@@ -60,7 +71,7 @@
#include <gst/gst.h>
#include "qabstractgstbufferpool.h"
#include "qabstractgstbufferpool_p.h"
class QGstXvImageBufferPool;

View File

@@ -39,8 +39,19 @@
**
****************************************************************************/
#ifndef VIDEOSURFACEGSTSINK_H
#define VIDEOSURFACEGSTSINK_H
#ifndef VIDEOSURFACEGSTSINK_P_H
#define VIDEOSURFACEGSTSINK_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 <gst/video/gstvideosink.h>
@@ -53,7 +64,7 @@
#include <qvideoframe.h>
#include <qabstractvideobuffer.h>
#include "qabstractgstbufferpool.h"
#include "qabstractgstbufferpool_p.h"
QT_BEGIN_NAMESPACE
class QAbstractVideoSurface;

View File

@@ -43,9 +43,9 @@
#include "camerabincapturedestination.h"
#include "camerabincapturebufferformat.h"
#include "camerabinsession.h"
#include "qgstvideobuffer.h"
#include "qvideosurfacegstsink.h"
#include "qgstutils.h"
#include <private/qgstvideobuffer_p.h>
#include <private/qvideosurfacegstsink_p.h>
#include <private/qgstutils_p.h>
#include <QtCore/qdebug.h>
#include <QtCore/qbuffer.h>
#include <QtGui/qimagereader.h>

View File

@@ -46,7 +46,6 @@
#include "camerabinaudioencoder.h"
#include "camerabinvideoencoder.h"
#include "camerabinimageencoder.h"
#include "qgstreamerbushelper.h"
#include "camerabincontrol.h"
#include "camerabinlocks.h"
#include "camerabinmetadata.h"
@@ -57,6 +56,7 @@
#include "camerabinimageprocessing.h"
#include "camerabincapturebufferformat.h"
#include "camerabincapturedestination.h"
#include <private/qgstreamerbushelper_p.h>
#include "qgstreameraudioinputendpointselector.h"
#include "qgstreamervideoinputdevicecontrol.h"

View File

@@ -51,7 +51,7 @@
#include "camerabinlocks.h"
#include "camerabincapturedestination.h"
#include "camerabincapturebufferformat.h"
#include "qgstreamerbushelper.h"
#include <private/qgstreamerbushelper_p.h>
#include "qgstreamervideorendererinterface.h"
#include <qmediarecorder.h>
#include <gst/interfaces/photography.h>

View File

@@ -8,6 +8,8 @@ PLUGIN_TYPE=mediaservice
load(qt_plugin)
DESTDIR = $$QT.multimedia.plugins/$${PLUGIN_TYPE}
LIBS += -lqgsttools_p
unix:!maemo*:contains(QT_CONFIG, alsa) {
DEFINES += HAVE_ALSA
LIBS += \
@@ -48,33 +50,22 @@ maemo6 {
# Input
HEADERS += \
qgstreamermessage.h \
qgstreamerbushelper.h \
qgstreamervideorendererinterface.h \
qgstreamerserviceplugin.h \
qgstreameraudioinputendpointselector.h \
qgstreamervideorenderer.h \
qgstvideobuffer.h \
qvideosurfacegstsink.h \
qgstreamervideoinputdevicecontrol.h \
gstvideoconnector.h \
qabstractgstbufferpool.h \
qgstcodecsinfo.h \
qgstutils.h
SOURCES += \
qgstreamermessage.cpp \
qgstreamerbushelper.cpp \
qgstreamervideorendererinterface.cpp \
qgstreamerserviceplugin.cpp \
qgstreameraudioinputendpointselector.cpp \
qgstreamervideorenderer.cpp \
qgstvideobuffer.cpp \
qvideosurfacegstsink.cpp \
qgstreamervideoinputdevicecontrol.cpp \
qgstcodecsinfo.cpp \
gstvideoconnector.c \
qgstutils.cpp
!win32:!contains(QT_CONFIG,embedded):!mac:!simulator:!contains(QT_CONFIG, qpa) {
@@ -85,14 +76,12 @@ SOURCES += \
qgstreamervideowindow.h \
qgstreamervideowidget.h \
qx11videosurface.h \
qgstxvimagebuffer.h
SOURCES += \
qgstreamervideooverlay.cpp \
qgstreamervideowindow.cpp \
qgstreamervideowidget.cpp \
qx11videosurface.cpp \
qgstxvimagebuffer.cpp
}
include(mediaplayer/mediaplayer.pri)
include(mediacapture/mediacapture.pri)

View File

@@ -46,8 +46,8 @@
#include "qgstreameraudioencode.h"
#include "qgstreamervideoencode.h"
#include "qgstreamerimageencode.h"
#include "qgstreamerbushelper.h"
#include "qgstreamercameracontrol.h"
#include <private/qgstreamerbushelper_p.h>
#include "qgstreamerv4l2input.h"
#include "qgstreamercapturemetadatacontrol.h"

View File

@@ -46,8 +46,8 @@
#include "qgstreameraudioencode.h"
#include "qgstreamervideoencode.h"
#include "qgstreamerimageencode.h"
#include "qgstreamerbushelper.h"
#include <qmediarecorder.h>
#include <private/qgstreamerbushelper_p.h>
#include <gst/gsttagsetter.h>
#include <gst/gstversion.h>

View File

@@ -49,7 +49,7 @@
#include <gst/gst.h>
#include "qgstreamerbushelper.h"
#include <private/qgstreamerbushelper_p.h>
QT_USE_NAMESPACE

View File

@@ -40,11 +40,11 @@
****************************************************************************/
#include "qgstreamerplayersession.h"
#include "qgstreamerbushelper.h"
#include <private/qgstreamerbushelper_p.h>
#include "qgstreamervideorendererinterface.h"
#include "gstvideoconnector.h"
#include "qgstutils.h"
#include <private/qgstutils_p.h>
#include <gst/gstvalue.h>
#include <gst/base/gstbasesrc.h>

View File

@@ -45,7 +45,7 @@
#include <QObject>
#include <QtNetwork/qnetworkrequest.h>
#include "qgstreamerplayercontrol.h"
#include "qgstreamerbushelper.h"
#include <private/qgstreamerbushelper_p.h>
#include <qmediaplayer.h>
#include <qmediastreamscontrol.h>

View File

@@ -39,9 +39,9 @@
**
****************************************************************************/
#include "qvideosurfacegstsink.h"
#include "qabstractvideosurface.h"
#include "qgstutils.h"
#include <private/qvideosurfacegstsink_p.h>
#include <qabstractvideosurface.h>
#include <private/qgstutils_p.h>
#include <QtGui/qevent.h>
#include <QtWidgets/qapplication.h>

View File

@@ -43,8 +43,8 @@
#define QGSTREAMERGLTEXTURERENDERER_H
#include <qvideorenderercontrol.h>
#include "qvideosurfacegstsink.h"
#include "qgstreamerbushelper.h"
#include <private/qvideosurfacegstsink_p.h>
#include <private/qgstreamerbushelper_p.h>
#include "qgstreamervideorendererinterface.h"
#include <QtGui/qcolor.h>

View File

@@ -40,11 +40,11 @@
****************************************************************************/
#include "qgstreamervideooverlay.h"
#include "qvideosurfacegstsink.h"
#include <private/qvideosurfacegstsink_p.h>
#include <qvideosurfaceformat.h>
#include "qx11videosurface.h"
#include <private/qx11videosurface_p.h>
#ifndef QT_NO_XVIDEO

View File

@@ -40,8 +40,8 @@
****************************************************************************/
#include "qgstreamervideorenderer.h"
#include "qvideosurfacegstsink.h"
#include "qabstractvideosurface.h"
#include <private/qvideosurfacegstsink_p.h>
#include <qabstractvideosurface.h>
#include <QEvent>
#include <QtWidgets/QApplication>

View File

@@ -43,7 +43,7 @@
#define QGSTREAMERVIDEORENDERER_H
#include <qvideorenderercontrol.h>
#include "qvideosurfacegstsink.h"
#include <private/qvideosurfacegstsink_p.h>
#include "qgstreamervideorendererinterface.h"

View File

@@ -40,7 +40,7 @@
****************************************************************************/
#include "qgstreamervideowidget.h"
#include "qgstutils.h"
#include <private/qgstutils_p.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qdebug.h>

View File

@@ -45,7 +45,7 @@
#include <qvideowidgetcontrol.h>
#include "qgstreamervideorendererinterface.h"
#include "qgstreamerbushelper.h"
#include <private/qgstreamerbushelper_p.h>
QT_USE_NAMESPACE

View File

@@ -40,7 +40,7 @@
****************************************************************************/
#include "qgstreamervideowindow.h"
#include "qgstutils.h"
#include <private/qgstutils_p.h>
#include <QtCore/qdebug.h>

View File

@@ -45,7 +45,7 @@
#include <qvideowindowcontrol.h>
#include "qgstreamervideorendererinterface.h"
#include "qgstreamerbushelper.h"
#include <private/qgstreamerbushelper_p.h>
QT_BEGIN_NAMESPACE
class QAbstractVideoSurface;

View File

@@ -20,14 +20,7 @@ win32 {
simulator: SUBDIRS += simulator
unix:!mac {
TMP_GST_LIBS = \
gstreamer-0.10 >= 0.10.19 \
gstreamer-base-0.10 >= 0.10.19 \
gstreamer-interfaces-0.10 >= 0.10.19 \
gstreamer-audio-0.10 >= 0.10.19 \
gstreamer-video-0.10 >= 0.10.19
system(pkg-config --exists \'$${TMP_GST_LIBS}\' --print-errors): {
contains(config_test_gstreamer, yes) {
SUBDIRS += gstreamer
} else {
SUBDIRS += audiocapture

View File

@@ -1,11 +1,18 @@
TEMPLATE = subdirs
CONFIG += ordered
library_qgsttools.subdir = $$IN_PWD/gsttools
library_qgsttools.depends = multimedia
library_qtmmwidgets.subdir = $$IN_PWD/multimediawidgets
library_qtmmwidgets.depends = multimedia
SUBDIRS += multimedia
contains(config_test_gstreamer, yes) {
SUBDIRS += library_qgsttools
}
SUBDIRS += library_qtmmwidgets
SUBDIRS += imports
SUBDIRS += plugins

View File

@@ -44,6 +44,7 @@
"evr" => {},
# Linux tests
"gstreamer" => {},
"gstreamer_photography" => {},
"gstreamer_appsrc" => {},
"pulseaudio" => {},