summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gsttools/qgstreamerplayercontrol.cpp1
-rw-r--r--src/gsttools/qgstutils.cpp7
-rw-r--r--src/multimedia/camera/qcamera.cpp43
-rw-r--r--src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodercontrol.cpp1
-rw-r--r--src/plugins/gstreamer/camerabin/camerabincapturebufferformat.h2
-rw-r--r--src/plugins/gstreamer/camerabin/camerabincapturedestination.h2
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinexposure.h2
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinflash.h2
-rw-r--r--src/plugins/wmf/player/mfmetadatacontrol.cpp2
9 files changed, 29 insertions, 33 deletions
diff --git a/src/gsttools/qgstreamerplayercontrol.cpp b/src/gsttools/qgstreamerplayercontrol.cpp
index 053e5e408..73f43f0b9 100644
--- a/src/gsttools/qgstreamerplayercontrol.cpp
+++ b/src/gsttools/qgstreamerplayercontrol.cpp
@@ -52,7 +52,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
//#define DEBUG_PLAYBIN
diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp
index ab037d959..6960ff8f4 100644
--- a/src/gsttools/qgstutils.cpp
+++ b/src/gsttools/qgstutils.cpp
@@ -1308,7 +1308,8 @@ void QGstUtils::setMetaData(GstBin *bin, const QMap<QByteArray, QVariant> &data)
GstCaps *QGstUtils::videoFilterCaps()
{
- static GstStaticCaps staticCaps = GST_STATIC_CAPS(
+ static GstStaticCaps staticCaps = {
+ NULL,
#if GST_CHECK_VERSION(1,2,0)
"video/x-raw(ANY);"
#elif GST_CHECK_VERSION(1,0,0)
@@ -1320,7 +1321,9 @@ GstCaps *QGstUtils::videoFilterCaps()
"video/x-android-buffer;"
#endif
"image/jpeg;"
- "video/x-h264");
+ "video/x-h264",
+ GST_PADDING_INIT
+ };
return gst_caps_make_writable(gst_static_caps_get(&staticCaps));
}
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp
index 722c5b629..c7d64155c 100644
--- a/src/multimedia/camera/qcamera.cpp
+++ b/src/multimedia/camera/qcamera.cpp
@@ -347,18 +347,27 @@ QCamera::QCamera(const QByteArray& deviceName, QObject *parent):
Q_D(QCamera);
d->init();
- if (d->service != 0) {
- //pass device name to service
- if (d->deviceControl) {
- const QString name = QString::fromLatin1(deviceName);
- for (int i = 0; i < d->deviceControl->deviceCount(); i++) {
- if (d->deviceControl->deviceName(i) == name) {
- d->deviceControl->setSelectedDevice(i);
- break;
- }
+ bool found = false;
+ // Pass device name to service.
+ if (d->deviceControl) {
+ const QString name = QString::fromLatin1(deviceName);
+ for (int i = 0; i < d->deviceControl->deviceCount(); i++) {
+ if (d->deviceControl->deviceName(i) == name) {
+ d->deviceControl->setSelectedDevice(i);
+ found = true;
+ break;
}
}
}
+
+ // The camera should not be used if device with requested name does not exist.
+ if (!found) {
+ if (d->service && d->control)
+ d->service->releaseControl(d->control);
+ d->control = nullptr;
+ d->error = QCamera::ServiceMissingError;
+ d->errorString = QCamera::tr("The camera service is missing");
+ }
}
/*!
@@ -368,22 +377,8 @@ QCamera::QCamera(const QByteArray& deviceName, QObject *parent):
*/
QCamera::QCamera(const QCameraInfo &cameraInfo, QObject *parent)
- : QMediaObject(*new QCameraPrivate,
- parent,
- QMediaServiceProvider::defaultServiceProvider()->requestService(Q_MEDIASERVICE_CAMERA,
- QMediaServiceProviderHint(cameraInfo.deviceName().toLatin1())))
+ : QCamera(cameraInfo.deviceName().toLatin1(), parent)
{
- Q_D(QCamera);
- d->init();
-
- if (d->service != 0 && d->deviceControl) {
- for (int i = 0; i < d->deviceControl->deviceCount(); i++) {
- if (d->deviceControl->deviceName(i) == cameraInfo.deviceName()) {
- d->deviceControl->setSelectedDevice(i);
- break;
- }
- }
- }
}
/*!
diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodercontrol.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodercontrol.cpp
index 4b0e7afa4..e9a7a5332 100644
--- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodercontrol.cpp
+++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodercontrol.cpp
@@ -48,7 +48,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.h b/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.h
index a6cdc5297..7051913a7 100644
--- a/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.h
+++ b/src/plugins/gstreamer/camerabin/camerabincapturebufferformat.h
@@ -52,7 +52,7 @@ class CameraBinSession;
QT_USE_NAMESPACE
-class Q_MULTIMEDIA_EXPORT CameraBinCaptureBufferFormat : public QCameraCaptureBufferFormatControl
+class CameraBinCaptureBufferFormat : public QCameraCaptureBufferFormatControl
{
Q_OBJECT
public:
diff --git a/src/plugins/gstreamer/camerabin/camerabincapturedestination.h b/src/plugins/gstreamer/camerabin/camerabincapturedestination.h
index 460fd1aa3..bc24a23d8 100644
--- a/src/plugins/gstreamer/camerabin/camerabincapturedestination.h
+++ b/src/plugins/gstreamer/camerabin/camerabincapturedestination.h
@@ -49,7 +49,7 @@ class CameraBinSession;
QT_USE_NAMESPACE
-class Q_MULTIMEDIA_EXPORT CameraBinCaptureDestination : public QCameraCaptureDestinationControl
+class CameraBinCaptureDestination : public QCameraCaptureDestinationControl
{
Q_OBJECT
public:
diff --git a/src/plugins/gstreamer/camerabin/camerabinexposure.h b/src/plugins/gstreamer/camerabin/camerabinexposure.h
index c30da25ad..db16bed24 100644
--- a/src/plugins/gstreamer/camerabin/camerabinexposure.h
+++ b/src/plugins/gstreamer/camerabin/camerabinexposure.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
class CameraBinSession;
-class Q_MULTIMEDIA_EXPORT CameraBinExposure : public QCameraExposureControl
+class CameraBinExposure : public QCameraExposureControl
{
Q_OBJECT
diff --git a/src/plugins/gstreamer/camerabin/camerabinflash.h b/src/plugins/gstreamer/camerabin/camerabinflash.h
index 84177f122..0efd100a7 100644
--- a/src/plugins/gstreamer/camerabin/camerabinflash.h
+++ b/src/plugins/gstreamer/camerabin/camerabinflash.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
class CameraBinSession;
-class Q_MULTIMEDIA_EXPORT CameraBinFlash : public QCameraFlashControl
+class CameraBinFlash : public QCameraFlashControl
{
Q_OBJECT
public:
diff --git a/src/plugins/wmf/player/mfmetadatacontrol.cpp b/src/plugins/wmf/player/mfmetadatacontrol.cpp
index ac57ccfb5..74063f7d1 100644
--- a/src/plugins/wmf/player/mfmetadatacontrol.cpp
+++ b/src/plugins/wmf/player/mfmetadatacontrol.cpp
@@ -299,7 +299,7 @@ void MFMetaDataControl::updateSource(IMFPresentationDescriptor* sourcePD, IMFMed
m_availableMetaDatas.push_back(QMediaMetaData::SubTitle);
} else if (key == PKEY_ParentalRating) {
m_availableMetaDatas.push_back(QMediaMetaData::ParentalRating);
- } else if (key == PKEY_Comment) {
+ } else if (key == PKEY_Media_EncodingSettings) {
m_availableMetaDatas.push_back(QMediaMetaData::Description);
} else if (key == PKEY_Copyright) {
m_availableMetaDatas.push_back(QMediaMetaData::Copyright);