diff options
author | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-01-04 11:21:41 +0100 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-01-17 13:52:13 +0000 |
commit | 5c91cfff5a8d7a5797c252beaf7493610a971d71 (patch) | |
tree | 4bc4f1b913d574ab57810104f3409307f2b79f02 /src/plugins | |
parent | 94921e0fd8b9904e7472ae9546fa82e3eca55407 (diff) |
Gstreamer: add support for ksvideosrc within camerabin
Task-number: QTBUG-72125
Change-Id: I12bc684a796c6abb6af3a51edca52011495f4ac9
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinsession.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index ebb797189..f4559de81 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -541,13 +541,20 @@ GstElement *CameraBinSession::buildCameraSource() if (!m_videoSrc) m_videoSrc = gst_element_factory_make("v4l2src", "camera_source"); + if (!m_videoSrc) + m_videoSrc = gst_element_factory_make("ksvideosrc", "camera_source"); + if (m_videoSrc) g_object_set(G_OBJECT(m_cameraSrc), "video-source", m_videoSrc, NULL); } - if (m_videoSrc) - g_object_set(G_OBJECT(m_videoSrc), "device", m_inputDevice.toUtf8().constData(), NULL); + if (m_videoSrc) { + if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSrc), "device")) + g_object_set(G_OBJECT(m_videoSrc), "device", m_inputDevice.toUtf8().constData(), NULL); + if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSrc), "device-path")) + g_object_set(G_OBJECT(m_videoSrc), "device-path", m_inputDevice.toUtf8().constData(), NULL); + } } else if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_cameraSrc), "camera-device")) { if (m_inputDevice == QLatin1String("secondary")) { g_object_set(G_OBJECT(m_cameraSrc), "camera-device", 1, NULL); |