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>
This commit is contained in:
committed by
The Qt Project
parent
b0c68a1a07
commit
d3ba2d6f3f
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user