summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-04-03 15:17:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-07 11:50:29 +0200
commitd3ba2d6f3f7cbdd8a4e41a7967874f53a2caaec3 (patch)
tree53529d761162fc454de57481cbc01ad89e04dd5f
parentb0c68a1a07f546fe22a7d76b1a15bb2b39aa550f (diff)
GStreamer: cleanup system includes.
Replaced some linux includes with <private/qcore_unix_p.h> to be more portable. Use qt_safe_open() and qt_safe_close() instead of ::open() and ::close(). Task-number: QTBUG-38061 Change-Id: Idb3f50d070ec1701cafba98e79e2e85824653a3a Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Christian Stromme <christian.stromme@digia.com>
-rw-r--r--src/gsttools/gsttools.pro2
-rw-r--r--src/gsttools/qgstreamervideoinputdevicecontrol.cpp15
-rw-r--r--src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp13
-rw-r--r--src/plugins/gstreamer/camerabin/camerabincontrol.cpp12
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp16
-rw-r--r--src/plugins/gstreamer/common.pri2
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp16
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp11
-rw-r--r--src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp14
9 files changed, 12 insertions, 89 deletions
diff --git a/src/gsttools/gsttools.pro b/src/gsttools/gsttools.pro
index 46184965c..2a0933bb3 100644
--- a/src/gsttools/gsttools.pro
+++ b/src/gsttools/gsttools.pro
@@ -2,7 +2,7 @@ TEMPLATE = lib
TARGET = qgsttools_p
QPRO_PWD = $$PWD
-QT = core multimedia-private gui-private
+QT = core-private multimedia-private gui-private
!static:DEFINES += QT_MAKEDLL
diff --git a/src/gsttools/qgstreamervideoinputdevicecontrol.cpp b/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
index ad61aefad..e4e202caf 100644
--- a/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
+++ b/src/gsttools/qgstreamervideoinputdevicecontrol.cpp
@@ -44,16 +44,7 @@
#include <QtCore/QDir>
#include <QtCore/QDebug>
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
+#include <private/qcore_unix_p.h>
#include <linux/videodev2.h>
QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(QObject *parent)
@@ -135,7 +126,7 @@ void QGstreamerVideoInputDeviceControl::update()
foreach( const QFileInfo &entryInfo, entries ) {
//qDebug() << "Try" << entryInfo.filePath();
- int fd = ::open(entryInfo.filePath().toLatin1().constData(), O_RDWR );
+ int fd = qt_safe_open(entryInfo.filePath().toLatin1().constData(), O_RDWR );
if (fd == -1)
continue;
@@ -165,6 +156,6 @@ void QGstreamerVideoInputDeviceControl::update()
m_names.append(entryInfo.filePath());
m_descriptions.append(name);
}
- ::close(fd);
+ qt_safe_close(fd);
}
}
diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp
index 3085d1391..e6d24216f 100644
--- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp
+++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp
@@ -49,19 +49,6 @@
#include <QtCore/QDir>
#include <QtCore/QDebug>
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <linux/videodev2.h>
-#include <gst/gst.h>
-
// #define QT_SUPPORTEDMIMETYPES_DEBUG
QMediaService* QGstreamerAudioDecoderServicePlugin::create(const QString &key)
diff --git a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp
index c84ebc41a..2ba9b07e8 100644
--- a/src/plugins/gstreamer/camerabin/camerabincontrol.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabincontrol.cpp
@@ -50,18 +50,6 @@
#include <QtCore/qfile.h>
#include <QtCore/qmetaobject.h>
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <linux/videodev2.h>
-
QT_BEGIN_NAMESPACE
//#define CAMEABIN_DEBUG 1
diff --git a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
index 37641b001..3decd6070 100644
--- a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
@@ -50,18 +50,8 @@
#include "camerabinservice.h"
#include <private/qgstutils_p.h>
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
+#include <private/qcore_unix_p.h>
#include <linux/videodev2.h>
-#include <gst/gst.h>
QT_BEGIN_NAMESPACE
@@ -148,7 +138,7 @@ void CameraBinServicePlugin::updateDevices() const
QFileInfoList entries = devDir.entryInfoList(QStringList() << "video*");
foreach (const QFileInfo &entryInfo, entries) {
- int fd = ::open(entryInfo.filePath().toLatin1().constData(), O_RDWR );
+ int fd = qt_safe_open(entryInfo.filePath().toLatin1().constData(), O_RDWR );
if (fd == -1)
continue;
@@ -178,7 +168,7 @@ void CameraBinServicePlugin::updateDevices() const
m_cameraDevices.append(entryInfo.filePath().toLocal8Bit());
m_cameraDescriptions.append(name);
}
- ::close(fd);
+ qt_safe_close(fd);
}
if (!m_cameraDevices.isEmpty())
diff --git a/src/plugins/gstreamer/common.pri b/src/plugins/gstreamer/common.pri
index 98e427d71..8b421b8d1 100644
--- a/src/plugins/gstreamer/common.pri
+++ b/src/plugins/gstreamer/common.pri
@@ -1,5 +1,5 @@
-QT += multimedia-private network
+QT += core-private multimedia-private network
CONFIG += no_private_qt_headers_warning
qtHaveModule(widgets) {
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
index 657b9806f..8b88fbb71 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamercaptureserviceplugin.cpp
@@ -51,18 +51,8 @@
#include "qgstreamercaptureservice.h"
#include <private/qgstutils_p.h>
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
+#include <private/qcore_unix_p.h>
#include <linux/videodev2.h>
-#include <gst/gst.h>
QMediaService* QGstreamerCaptureServicePlugin::create(const QString &key)
{
@@ -155,7 +145,7 @@ void QGstreamerCaptureServicePlugin::updateDevices() const
foreach( const QFileInfo &entryInfo, entries ) {
//qDebug() << "Try" << entryInfo.filePath();
- int fd = ::open(entryInfo.filePath().toLatin1().constData(), O_RDWR );
+ int fd = qt_safe_open(entryInfo.filePath().toLatin1().constData(), O_RDWR );
if (fd == -1)
continue;
@@ -185,7 +175,7 @@ void QGstreamerCaptureServicePlugin::updateDevices() const
m_cameraDevices.append(entryInfo.filePath().toLocal8Bit());
m_cameraDescriptions.append(name);
}
- ::close(fd);
+ qt_safe_close(fd);
}
if (!m_cameraDevices.isEmpty())
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp b/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp
index b618ab997..450bc51ea 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp
@@ -44,16 +44,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qfile.h>
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
+#include <private/qcore_unix_p.h>
#include <linux/videodev2.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp
index b2ad24899..a9052ca4b 100644
--- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp
+++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayerserviceplugin.cpp
@@ -51,20 +51,6 @@
#include "qgstreamerplayerservice.h"
#include <private/qgstutils_p.h>
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <linux/videodev2.h>
-#include <gst/gst.h>
-
-
QMediaService* QGstreamerPlayerServicePlugin::create(const QString &key)
{
QGstUtils::initializeGst();