Search
SailfishOS Open Build Service
>
Projects
>
home:abranson
:
branches:nemo:devel:hw:native-common
>
gstreamer1.0-plugins-bad
> _service:tar_git:0002-Keep-video-branch-in-NULL-state.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:0002-Keep-video-branch-in-NULL-state.patch of Package gstreamer1.0-plugins-bad
From 359974b7c1a1ca47310d37bbe4c5b4617e24c929 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer <msameer@foolab.org> Date: Mon, 14 Apr 2014 22:26:45 +0300 Subject: [PATCH 2/5] Keep video branch in NULL state We are locking the state of video branch to NULL and move it to PLAYING only when we start recording. This is to avoid the 5 seconds timeout issue with qualcomm omx encoders: If we move to NULL state without encoding any buffers then kernel driver waits for 5 seconds until the encoding task (which is not running) to stop. --- gst/camerabin2/gstcamerabin2.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index c101637..87d293d 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -387,6 +387,15 @@ gst_camera_bin_start_capture (GstCameraBin2 * camerabin) g_free (location); } + if (camerabin->mode == MODE_VIDEO) { + if (camerabin->video_filter) { + 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); + } + g_signal_emit_by_name (camerabin->src, "start-capture", NULL); if (camerabin->mode == MODE_VIDEO) { camerabin->audio_send_newseg = TRUE; @@ -957,10 +966,15 @@ gst_camera_bin_video_reset_elements (gpointer u_data) gst_element_set_state (camerabin->videobin_capsfilter, GST_STATE_NULL); if (camerabin->video_filter) { gst_element_set_state (camerabin->video_filter, GST_STATE_NULL); +#if 0 gst_element_sync_state_with_parent (camerabin->video_filter); +#endif } + +#if 0 gst_element_sync_state_with_parent (camerabin->videobin_capsfilter); gst_element_sync_state_with_parent (camerabin->video_encodebin); +#endif if (camerabin->audio_src) { gst_element_set_state (camerabin->audio_capsfilter, GST_STATE_READY); @@ -1647,6 +1661,7 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera) */ gst_element_set_locked_state (camera->videosink, TRUE); gst_element_set_locked_state (camera->imagesink, TRUE); + gst_element_set_locked_state (camera->video_encodebin, TRUE); g_object_set (camera->videosink, "location", camera->location, NULL); g_object_set (camera->imagesink, "location", camera->location, NULL); -- 1.8.4.rc3