diff options
author | Yoann Lopes <yoann.lopes@qt.io> | 2016-09-21 12:01:23 +0300 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@qt.io> | 2016-09-21 13:13:28 +0000 |
commit | 6b94b3ca91df6ee047e99c63061dc33b1fb1c0f7 (patch) | |
tree | be0272f08c7bb6805ceeff9f3c53748646ee5f05 /src/plugins/gstreamer | |
parent | 4bae7697257e5294721211fdd0b9bad5731f70c9 (diff) | |
download | qtmultimedia-6b94b3ca91df6ee047e99c63061dc33b1fb1c0f7.tar.gz |
GStreamer: print a warning when the camerabin plugin is missing
Don't create the camera service when the camerabin plugin is not
available on the system and print a warning.
Task-number: QTBUG-50775
Change-Id: I56c7e6297bebe4b90596cb3c0323f1d38231bceb
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/plugins/gstreamer')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp index bee81a953..0658b0af0 100644 --- a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp @@ -60,8 +60,19 @@ QMediaService* CameraBinServicePlugin::create(const QString &key) { QGstUtils::initializeGst(); - if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) + if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) { + if (!CameraBinService::isCameraBinAvailable()) { + guint major, minor, micro, nano; + gst_version(&major, &minor, µ, &nano); + qWarning("Error: cannot create camera service, the 'camerabin' plugin is missing for " + "GStreamer %u.%u." + "\nPlease install the 'bad' GStreamer plugin package.", + major, minor); + return Q_NULLPTR; + } + return new CameraBinService(sourceFactory()); + } qWarning() << "Gstreamer camerabin service plugin: unsupported key:" << key; return 0; |