Do not build related stuff if not found.
Makes GStreamer support available on Hurd.
Task-number: QTBUG-39762
Change-Id: I1f70b6975e5bef99ab2441aac4d90508bc8b64bd
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
--- /dev/null
+SOURCES += main.cpp
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <linux/videodev2.h>
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
qtCompileTest(gstreamer_photography)
qtCompileTest(gstreamer_encodingprofiles)
qtCompileTest(gstreamer_appsrc)
+ qtCompileTest(linux_v4l)
}
qtCompileTest(resourcepolicy)
qtCompileTest(gpu_vivante)
LIBS_PRIVATE += -lgstapp-0.10
}
+config_linux_v4l: DEFINES += USE_V4L
+
HEADERS += $$PRIVATE_HEADERS
DESTDIR = $$QT.multimedia.libs
#include <QtCore/QDebug>
#include <private/qcore_unix_p.h>
+
+#if defined(USE_V4L)
#include <linux/videodev2.h>
+#endif
QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(QObject *parent)
:QVideoDeviceSelectorControl(parent), m_source(0), m_selectedDevice(0)
return;
}
+#if defined(USE_V4L)
QDir devDir("/dev");
devDir.setFilter(QDir::System);
}
qt_safe_close(fd);
}
+#endif
}
DEFINES += GST_USE_UNSTABLE_API #prevents warnings because of unstable photography API
}
+config_linux_v4l: DEFINES += USE_V4L
+
OTHER_FILES += \
camerabin.json
#include <private/qgstutils_p.h>
#include <private/qcore_unix_p.h>
+
+#if defined(USE_V4L)
#include <linux/videodev2.h>
+#endif
QT_BEGIN_NAMESPACE
m_cameraDevices.clear();
m_cameraDescriptions.clear();
+#if defined(USE_V4L)
QDir devDir("/dev");
devDir.setFilter(QDir::System);
if (!m_cameraDevices.isEmpty())
m_defaultCameraDevice = m_cameraDevices.first();
+#endif
}
QT_END_NAMESPACE
$$PWD/qgstreamerrecordercontrol.h \
$$PWD/qgstreamermediacontainercontrol.h \
$$PWD/qgstreamercameracontrol.h \
- $$PWD/qgstreamerv4l2input.h \
$$PWD/qgstreamercapturemetadatacontrol.h \
$$PWD/qgstreamerimagecapturecontrol.h \
$$PWD/qgstreamerimageencode.h \
$$PWD/qgstreamerrecordercontrol.cpp \
$$PWD/qgstreamermediacontainercontrol.cpp \
$$PWD/qgstreamercameracontrol.cpp \
- $$PWD/qgstreamerv4l2input.cpp \
$$PWD/qgstreamercapturemetadatacontrol.cpp \
$$PWD/qgstreamerimagecapturecontrol.cpp \
$$PWD/qgstreamerimageencode.cpp \
# Camera usage with gstreamer needs to have
#CONFIG += use_gstreamer_camera
-use_gstreamer_camera {
-DEFINES += USE_GSTREAMER_CAMERA
+use_gstreamer_camera:config_linux_v4l {
+ DEFINES += USE_GSTREAMER_CAMERA
+
+ OTHER_FILES += \
+ mediacapturecamera.json
+
+ HEADERS += \
+ $$PWD/qgstreamerv4l2input.h
+ SOURCES += \
+ $$PWD/qgstreamerv4l2input.cpp
-OTHER_FILES += \
- mediacapturecamera.json
} else {
-OTHER_FILES += \
- mediacapture.json
+ OTHER_FILES += \
+ mediacapture.json
}
-
#include "qgstreamerimageencode.h"
#include "qgstreamercameracontrol.h"
#include <private/qgstreamerbushelper_p.h>
-#include "qgstreamerv4l2input.h"
#include "qgstreamercapturemetadatacontrol.h"
+#if defined(USE_GSTREAMER_CAMERA)
+#include "qgstreamerv4l2input.h"
+#endif
+
#include "qgstreamerimagecapturecontrol.h"
#include <private/qgstreameraudioinputselector_p.h>
#include <private/qgstreamervideoinputdevicecontrol_p.h>
m_cameraControl = 0;
m_metaDataControl = 0;
+#if defined(USE_GSTREAMER_CAMERA)
m_videoInput = 0;
+#endif
m_audioInputSelector = 0;
m_videoInputDevice = 0;
m_captureSession = new QGstreamerCaptureSession(QGstreamerCaptureSession::Audio, this);
}
+#if defined(USE_GSTREAMER_CAMERA)
if (service == Q_MEDIASERVICE_CAMERA) {
m_captureSession = new QGstreamerCaptureSession(QGstreamerCaptureSession::AudioAndVideo, this);
m_cameraControl = new QGstreamerCameraControl(m_captureSession);
#endif
m_imageCaptureControl = new QGstreamerImageCaptureControl(m_captureSession);
}
+#endif
m_audioInputSelector = new QGstreamerAudioInputSelector(this);
connect(m_audioInputSelector, SIGNAL(activeInputChanged(QString)), m_captureSession, SLOT(setCaptureDevice(QString)));
QGstreamerCaptureSession *m_captureSession;
QGstreamerCameraControl *m_cameraControl;
+#if defined(USE_GSTREAMER_CAMERA)
QGstreamerV4L2Input *m_videoInput;
+#endif
QGstreamerCaptureMetaDataControl *m_metaDataControl;
QAudioInputSelectorControl *m_audioInputSelector;
#include <private/qgstutils_p.h>
#include <private/qcore_unix_p.h>
+
+#if defined(USE_GSTREAMER_CAMERA)
#include <linux/videodev2.h>
+#endif
QMediaService* QGstreamerCaptureServicePlugin::create(const QString &key)
{
}
# v4l is turned off because it is not supported in Qt 5
- # !maemo*:SUBDIRS += v4l
+ # config_linux_v4l {
+ # !maemo*:SUBDIRS += v4l
+ # }
}
mac:!simulator {