mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
camerabin2: Fix tag handling for videos
In video mode the tags should be pushed after sending the start capture to the source, this allows the video recording elements to be reset and leave the flushing state they were at after a previous capture. This fixes the problem where tags only work for the first video capture
This commit is contained in:
parent
ba9c1f055f
commit
dfdc6255f8
1 changed files with 23 additions and 17 deletions
|
@ -211,6 +211,29 @@ gst_camera_bin_start_capture (GstCameraBin * camerabin)
|
|||
GST_DEBUG_OBJECT (camerabin, "Received start-capture");
|
||||
GST_CAMERA_BIN_PROCESSING_INC (camerabin);
|
||||
|
||||
if (camerabin->mode == MODE_VIDEO && camerabin->audio_src) {
|
||||
gst_element_set_state (camerabin->audio_src, GST_STATE_READY);
|
||||
/* need to reset eos status (pads could be flushing) */
|
||||
gst_element_set_state (camerabin->audio_queue, GST_STATE_READY);
|
||||
gst_element_set_state (camerabin->audio_convert, GST_STATE_READY);
|
||||
gst_element_set_state (camerabin->audio_capsfilter, GST_STATE_READY);
|
||||
gst_element_set_state (camerabin->audio_volume, GST_STATE_READY);
|
||||
|
||||
gst_element_sync_state_with_parent (camerabin->audio_queue);
|
||||
gst_element_sync_state_with_parent (camerabin->audio_convert);
|
||||
gst_element_sync_state_with_parent (camerabin->audio_capsfilter);
|
||||
gst_element_sync_state_with_parent (camerabin->audio_volume);
|
||||
}
|
||||
|
||||
g_signal_emit_by_name (camerabin->src, "start-capture", NULL);
|
||||
if (camerabin->mode == MODE_VIDEO && camerabin->audio_src)
|
||||
gst_element_set_state (camerabin->audio_src, GST_STATE_PLAYING);
|
||||
|
||||
/*
|
||||
* We have to push tags after start capture because the video elements
|
||||
* might be flushing from the previous capture and are reset only on the
|
||||
* notify from ready for capture going to FALSE
|
||||
*/
|
||||
taglist = gst_tag_setter_get_tag_list (GST_TAG_SETTER (camerabin));
|
||||
if (taglist) {
|
||||
GstPad *active_pad;
|
||||
|
@ -231,23 +254,6 @@ gst_camera_bin_start_capture (GstCameraBin * camerabin)
|
|||
gst_object_unref (active_pad);
|
||||
}
|
||||
|
||||
if (camerabin->mode == MODE_VIDEO && camerabin->audio_src) {
|
||||
gst_element_set_state (camerabin->audio_src, GST_STATE_READY);
|
||||
/* need to reset eos status (pads could be flushing) */
|
||||
gst_element_set_state (camerabin->audio_queue, GST_STATE_READY);
|
||||
gst_element_set_state (camerabin->audio_convert, GST_STATE_READY);
|
||||
gst_element_set_state (camerabin->audio_capsfilter, GST_STATE_READY);
|
||||
gst_element_set_state (camerabin->audio_volume, GST_STATE_READY);
|
||||
|
||||
gst_element_sync_state_with_parent (camerabin->audio_queue);
|
||||
gst_element_sync_state_with_parent (camerabin->audio_convert);
|
||||
gst_element_sync_state_with_parent (camerabin->audio_capsfilter);
|
||||
gst_element_sync_state_with_parent (camerabin->audio_volume);
|
||||
}
|
||||
|
||||
g_signal_emit_by_name (camerabin->src, "start-capture", NULL);
|
||||
if (camerabin->mode == MODE_VIDEO && camerabin->audio_src)
|
||||
gst_element_set_state (camerabin->audio_src, GST_STATE_PLAYING);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue