From d7a0f1f9971afd46a9d126dab531d60498bf02d0 Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen Date: Tue, 5 Jan 2010 15:13:02 +0200 Subject: [PATCH] camerabin: Fix capturing flag handling after image has been captured Make sure capturing flag is unset and image-captured message is sent before sending eos event to image bin and saving the image to a file. --- gst/camerabin/gstcamerabin.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 3d525a58e0..646176a014 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -1748,16 +1748,6 @@ gst_camerabin_have_src_buffer (GstPad * pad, GstBuffer * buffer, GST_LOG_OBJECT (camera, "got image buffer %p with size %d", buffer, GST_BUFFER_SIZE (buffer)); - /* We can't send real EOS event, since it would switch the image queue - into "draining mode". Therefore we send our own custom eos and - catch & drop it later in queue's srcpad data probe */ - GST_DEBUG_OBJECT (camera, "sending img-eos to image queue"); - gst_camerabin_send_img_queue_custom_event (camera, - gst_structure_new ("img-eos", NULL)); - - /* our work is done, disconnect */ - gst_pad_remove_buffer_probe (pad, camera->image_captured_id); - g_mutex_lock (camera->capture_mutex); camera->capturing = FALSE; g_cond_signal (camera->cond); @@ -1773,6 +1763,16 @@ gst_camerabin_have_src_buffer (GstPad * pad, GstBuffer * buffer, "This element has no bus, therefore no message sent!"); } + /* We can't send real EOS event, since it would switch the image queue + into "draining mode". Therefore we send our own custom eos and + catch & drop it later in queue's srcpad data probe */ + GST_DEBUG_OBJECT (camera, "sending img-eos to image queue"); + gst_camerabin_send_img_queue_custom_event (camera, + gst_structure_new ("img-eos", NULL)); + + /* our work is done, disconnect */ + gst_pad_remove_buffer_probe (pad, camera->image_captured_id); + return TRUE; }