camerabin2: Also reset video/audio filters before capturing

Video and audio custom filter element should also be reset before
starting a new capture, otherwise we get wrong-state errors
This commit is contained in:
Thiago Santos 2011-11-18 03:31:32 -03:00
parent 7664e28a0c
commit 524c478fa1

View file

@ -984,6 +984,10 @@ gst_camera_bin_video_reset_elements (gpointer u_data)
/* reset element states to clear eos/flushing pads */
gst_element_set_state (camerabin->video_encodebin, GST_STATE_READY);
gst_element_set_state (camerabin->videobin_capsfilter, GST_STATE_READY);
if (camerabin->video_filter) {
gst_element_set_state (camerabin->video_filter, GST_STATE_READY);
gst_element_sync_state_with_parent (camerabin->video_filter);
}
gst_element_sync_state_with_parent (camerabin->videobin_capsfilter);
gst_element_sync_state_with_parent (camerabin->video_encodebin);
@ -999,6 +1003,11 @@ gst_camera_bin_video_reset_elements (gpointer u_data)
* and running until we really need them */
gst_element_set_state (camerabin->audio_src, GST_STATE_NULL);
if (camerabin->audio_filter) {
gst_element_set_state (camerabin->audio_filter, GST_STATE_READY);
gst_element_sync_state_with_parent (camerabin->audio_filter);
}
gst_element_sync_state_with_parent (camerabin->audio_capsfilter);
gst_element_sync_state_with_parent (camerabin->audio_volume);