summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@qt.io>2016-09-21 12:01:23 +0300
committerYoann Lopes <yoann.lopes@qt.io>2016-09-21 13:13:28 +0000
commit6b94b3ca91df6ee047e99c63061dc33b1fb1c0f7 (patch)
treebe0272f08c7bb6805ceeff9f3c53748646ee5f05
parent4bae7697257e5294721211fdd0b9bad5731f70c9 (diff)
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>
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp b/src/plugins/gstreamer/camerabin/camerabinserviceplugin.cpp
index bee81a95..0658b0af 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, &micro, &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;