summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorThiago Santos <ts.santos@osg.samsung.com>2014-07-23 13:37:05 -0300
committerThiago Santos <ts.santos@osg.samsung.com>2014-07-23 13:58:26 -0300
commit19d5be4c3a584a55f1099782608fc00ad5e0f14d (patch)
treefcb7c62f08fd314f3cadff19defa66f6b0fd9d72 /gst
parent29dd2156493878d012c41ca2763c84209795ee33 (diff)
downloadgstreamer-plugins-bad-19d5be4c3a584a55f1099782608fc00ad5e0f14d.tar.gz
camerabin: handle EOS on the pipeline
Make camerabin handle EOS to the pipeline to allow standard pipeline close where an EOS is sent to the whole pipeline before setting it to NULL.
Diffstat (limited to 'gst')
-rw-r--r--gst/camerabin2/gstcamerabin2.c31
-rw-r--r--gst/camerabin2/gstwrappercamerabinsrc.c4
2 files changed, 19 insertions, 16 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index c77585a1e..f1b2f8762 100644
--- a/gst/camerabin2/gstcamerabin2.c
+++ b/gst/camerabin2/gstcamerabin2.c
@@ -1101,17 +1101,24 @@ gst_camera_bin_handle_message (GstBin * bin, GstMessage * message)
g_mutex_lock (&camerabin->video_capture_mutex);
GST_DEBUG_OBJECT (bin, "EOS from video branch");
- g_assert (camerabin->video_state == GST_CAMERA_BIN_VIDEO_FINISHING);
-
- if (!g_thread_try_new ("reset-element-thread",
- gst_camera_bin_video_reset_elements, gst_object_ref (camerabin),
- NULL)) {
- GST_WARNING_OBJECT (camerabin,
- "Failed to create thread to "
- "reset video elements' state, video recordings may not work "
- "anymore");
- gst_object_unref (camerabin);
- camerabin->video_state = GST_CAMERA_BIN_VIDEO_IDLE;
+ if (camerabin->video_state == GST_CAMERA_BIN_VIDEO_FINISHING) {
+ if (!g_thread_try_new ("reset-element-thread",
+ gst_camera_bin_video_reset_elements,
+ gst_object_ref (camerabin), NULL)) {
+ GST_WARNING_OBJECT (camerabin,
+ "Failed to create thread to "
+ "reset video elements' state, video recordings may not work "
+ "anymore");
+ gst_object_unref (camerabin);
+ camerabin->video_state = GST_CAMERA_BIN_VIDEO_IDLE;
+ }
+ } else if (camerabin->video_state == GST_CAMERA_BIN_VIDEO_IDLE) {
+ GST_DEBUG_OBJECT (camerabin, "Received EOS from video branch but "
+ "video recording is idle, ignoring");
+ } else {
+ GST_WARNING_OBJECT (camerabin, "Received EOS from video branch but "
+ "video is recording and stop-capture wasn't requested");
+ g_assert_not_reached ();
}
g_mutex_unlock (&camerabin->video_capture_mutex);
@@ -1760,7 +1767,7 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
G_CALLBACK (gst_camera_bin_src_notify_readyforcapture), camera);
if (!gst_element_link_pads (camera->src, "vfsrc",
- camera->viewfinderbin_queue, "sink")) {
+ camera->viewfinderbin_queue, "sink")) {
GST_ERROR_OBJECT (camera,
"Failed to link camera source's vfsrc pad to viewfinder queue");
goto fail;
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 32fb38ee0..b25b8ad10 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -312,10 +312,6 @@ gst_wrapper_camera_src_src_event_probe (GstPad * pad, GstPadProbeInfo * info,
GstEvent *evt = GST_EVENT (info->data);
switch (GST_EVENT_TYPE (evt)) {
- case GST_EVENT_EOS:
- /* drop */
- ret = GST_PAD_PROBE_DROP;
- break;
case GST_EVENT_SEGMENT:
if (self->drop_newseg) {
ret = GST_PAD_PROBE_DROP;