summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/camerabin/camerabinsession.cpp
diff options
context:
space:
mode:
authorZhang Xingtao <xingtao.zhang@yahoo.com>2016-04-12 23:48:35 +0800
committerYoann Lopes <yoann.lopes@qt.io>2016-04-28 12:24:41 +0000
commit20528da413e68cbff9d2eb1da3257c0e0025b4cd (patch)
tree90f1390a2e0179527d1f09d068079c2076c7b410 /src/plugins/gstreamer/camerabin/camerabinsession.cpp
parentcf44daa75499eecfee8f614837908d722d8741f3 (diff)
GStreamer camerabin: return the proper camera source
- return m_cameraSrc for function cameraSource() instead of m_videoSrc. m_videoSrc is not always assigned(default 0), it will crash on: if (g_object_class_find_property( G_OBJECT_GET_CLASS(m_session->cameraSource()), "exposure-mode")) { And as the function name says, it would be better to return the value m_cameraSrc. - make sure pointers are not NULL before using them. Change-Id: I8a56db34a805724b428409b87de7d072ee7bfa57 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinsession.cpp')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinsession.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
index 3dd200c54..96b31e1b3 100644
--- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp
@@ -514,7 +514,8 @@ GstElement *CameraBinSession::buildCameraSource()
if (!m_videoSrc)
m_videoSrc = gst_element_factory_make("v4l2src", "camera_source");
- g_object_set(G_OBJECT(m_cameraSrc), "video-source", m_videoSrc, NULL);
+ if (m_videoSrc)
+ g_object_set(G_OBJECT(m_cameraSrc), "video-source", m_videoSrc, NULL);
}
if (m_videoSrc)