summaryrefslogtreecommitdiff
path: root/gst/camerabin2/gstwrappercamerabinsrc.c
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2014-12-26 23:05:43 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2014-12-26 23:07:39 -0300
commit882018e6dde95b80e51626d2de80b567fb38e1db (patch)
tree86e7522d6b24da2d73bbeafa16c80856573e58bf /gst/camerabin2/gstwrappercamerabinsrc.c
parent6fa077f4652541368346dd2458dec8099fa12c34 (diff)
downloadgstreamer-plugins-bad-882018e6dde95b80e51626d2de80b567fb38e1db.tar.gz
wrappercamerabinsrc: do not set source state with lock
It might be racy with the image probe thread as it uses the capture mutex just like the start-capture handler from camerabin. The start-capture would be waiting for the source's streaming thread to stop to be able to set the source state to ready while the probe would be blocked waiting to acquire the capture mutex. It causes a deadlock.
Diffstat (limited to 'gst/camerabin2/gstwrappercamerabinsrc.c')
-rw-r--r--gst/camerabin2/gstwrappercamerabinsrc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 5c08d0eb9..6023e442b 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -842,9 +842,13 @@ start_image_capture (GstWrapperCameraBinSrc * self)
peer = gst_pad_get_peer (pad);
gst_object_unref (pad);
gst_pad_query (peer, gst_query_new_drain ());
- gst_element_set_state (self->src_vid_src, GST_STATE_READY);
gst_object_unref (peer);
+ self->image_renegotiate = FALSE;
+
+ g_mutex_unlock (&bcamsrc->capturing_mutex);
+ gst_element_set_state (self->src_vid_src, GST_STATE_READY);
+
/* clean capsfilter caps so they don't interfere here */
g_object_set (self->src_filter, "caps", NULL, NULL);
if (self->src_zoom_filter)
@@ -862,8 +866,7 @@ start_image_capture (GstWrapperCameraBinSrc * self)
/* We caught this event in the src pad event handler and now we want to
* actually push it upstream */
gst_pad_send_event (self->outsel_imgpad, gst_event_new_reconfigure ());
-
- self->image_renegotiate = FALSE;
+ g_mutex_lock (&bcamsrc->capturing_mutex);
}
if (photography) {