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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user