diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-01-29 10:45:13 +0100 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-02-08 09:50:14 +0000 |
commit | 5fa4b2e448734da65ec24f2ce8234a4d3e4a832e (patch) | |
tree | 5314a008da9d1ddbf396c56f123731d8310f1c25 /src/plugins | |
parent | 26830d435d942ce580dfe17209563c47eb3da722 (diff) |
Gstreamer: Add support of avfvideosrc for camerabin
Gst Device Provider now can be used for macOS also.
Added support of avfvidesrc element to be used within camerabin.
Task-number: QTBUG-72125
Change-Id: I69205649c6e75432534e240656d8cb4748ee10cc
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinsession.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index 77178c322..f064c7c92 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -544,6 +544,9 @@ GstElement *CameraBinSession::buildCameraSource() if (!m_videoSrc) m_videoSrc = gst_element_factory_make("ksvideosrc", "camera_source"); + if (!m_videoSrc) + m_videoSrc = gst_element_factory_make("avfvideosrc", "camera_source"); + if (m_videoSrc) g_object_set(G_OBJECT(m_cameraSrc), "video-source", m_videoSrc, NULL); } @@ -554,6 +557,9 @@ GstElement *CameraBinSession::buildCameraSource() 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); + + if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSrc), "device-index")) + g_object_set(G_OBJECT(m_videoSrc), "device-index", m_inputDevice.toInt(), NULL); } } else if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_cameraSrc), "camera-device")) { if (m_inputDevice == QLatin1String("secondary")) { |