mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
camerabin: Reset audiosrc timestamping
Reset audiosrc's timestamping data by setting it to NULL to reset the ringbuffer and then re-seting the clock that camerabin might not redistribute
This commit is contained in:
parent
0f99118141
commit
17a00123a4
1 changed files with 11 additions and 0 deletions
|
@ -1641,6 +1641,7 @@ static void
|
|||
gst_camerabin_start_video_recording (GstCameraBin * camera)
|
||||
{
|
||||
GstStateChangeReturn state_ret;
|
||||
GstCameraBinVideo *vidbin = (GstCameraBinVideo *) camera->vidbin;
|
||||
/* FIXME: how to ensure resolution and fps is supported by CPU?
|
||||
* use a queue overrun signal?
|
||||
*/
|
||||
|
@ -1654,9 +1655,14 @@ gst_camerabin_start_video_recording (GstCameraBin * camera)
|
|||
gst_camerabin_rewrite_tags (camera);
|
||||
|
||||
/* Pause the pipeline in order to distribute new clock in paused_to_playing */
|
||||
/* Audio source needs to go to null to reset the ringbuffer */
|
||||
if (vidbin->aud_src)
|
||||
gst_element_set_state (vidbin->aud_src, GST_STATE_NULL);
|
||||
state_ret = gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PAUSED);
|
||||
|
||||
if (state_ret != GST_STATE_CHANGE_FAILURE) {
|
||||
GstClock *clock = gst_element_get_clock (GST_ELEMENT (camera));
|
||||
|
||||
g_mutex_lock (camera->capture_mutex);
|
||||
camera->capturing = TRUE;
|
||||
g_mutex_unlock (camera->capture_mutex);
|
||||
|
@ -1672,6 +1678,11 @@ gst_camerabin_start_video_recording (GstCameraBin * camera)
|
|||
g_object_set (G_OBJECT (camera->src_vid_src), "capture-mode", 2, NULL);
|
||||
}
|
||||
|
||||
/* Clock might be distributed as NULL to audiosrc, messing timestamping */
|
||||
if (vidbin->aud_src)
|
||||
gst_element_set_clock (vidbin->aud_src, clock);
|
||||
gst_object_unref (clock);
|
||||
|
||||
/* videobin will not go to playing if file is not writable */
|
||||
if (gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PLAYING) ==
|
||||
GST_STATE_CHANGE_FAILURE) {
|
||||
|
|
Loading…
Reference in a new issue