diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-03-29 04:21:11 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-03-29 05:22:51 (GMT) |
commit | 131c96bb02fd584af04cd765aec46d9198ebeca8 (patch) | |
tree | 28afe5acbb00822443ad99cf8a9e448bf3bf02cc /src | |
parent | 9cb2cae5d24000871070b3b952f2e833ff3a5f8e (diff) | |
download | Qt-131c96bb02fd584af04cd765aec46d9198ebeca8.zip Qt-131c96bb02fd584af04cd765aec46d9198ebeca8.tar.gz Qt-131c96bb02fd584af04cd765aec46d9198ebeca8.tar.bz2 |
Change availabilty of camera related code.
Reviewed-by: Dmytro Poplavskiy
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp | 9 | ||||
-rw-r--r-- | src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp index 589d2b5..98068ac 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp @@ -52,9 +52,9 @@ #ifdef QMEDIA_GSTREAMER_CAPTURE #include "qgstreamercaptureservice.h" #endif - #include <QtMultimedia/qmediaserviceprovider.h> +#ifdef QMEDIA_GSTREAMER_CAPTURE #include <linux/types.h> #include <sys/time.h> #include <sys/ioctl.h> @@ -66,6 +66,7 @@ #include <stdlib.h> #include <sys/mman.h> #include <linux/videodev2.h> +#endif QT_BEGIN_NAMESPACE @@ -109,18 +110,21 @@ void QGstreamerServicePlugin::release(QMediaService *service) QList<QByteArray> QGstreamerServicePlugin::devices(const QByteArray &service) const { +#ifdef QMEDIA_GSTREAMER_CAPTURE if (service == Q_MEDIASERVICE_CAMERA) { if (m_cameraDevices.isEmpty()) updateDevices(); return m_cameraDevices; } +#endif return QList<QByteArray>(); } QString QGstreamerServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) { +#ifdef QMEDIA_GSTREAMER_CAPTURE if (service == Q_MEDIASERVICE_CAMERA) { if (m_cameraDevices.isEmpty()) updateDevices(); @@ -129,12 +133,14 @@ QString QGstreamerServicePlugin::deviceDescription(const QByteArray &service, co if (m_cameraDevices[i] == device) return m_cameraDescriptions[i]; } +#endif return QString(); } void QGstreamerServicePlugin::updateDevices() const { +#ifdef QMEDIA_GSTREAMER_CAPTURE m_cameraDevices.clear(); m_cameraDescriptions.clear(); @@ -178,6 +184,7 @@ void QGstreamerServicePlugin::updateDevices() const } ::close(fd); } +#endif } Q_EXPORT_PLUGIN2(gstengine, QGstreamerServicePlugin); diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp index 406cefe11..4ecf10b 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp @@ -117,6 +117,7 @@ void QGstreamerVideoInputDeviceControl::update() m_names.clear(); m_descriptions.clear(); +#ifdef QMEDIA_GSTREAMER_CAPTURE QDir devDir("/dev"); devDir.setFilter(QDir::System); @@ -157,6 +158,7 @@ void QGstreamerVideoInputDeviceControl::update() } ::close(fd); } +#endif } QT_END_NAMESPACE |