unref still image buffer in signal based capture.
authorMarko Ollonen <marko.ollonen@ixonos.com>
Mon, 13 May 2013 08:17:58 +0000 (11:17 +0300)
committerTelle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
Wed, 15 May 2013 07:19:09 +0000 (10:19 +0300)
This will fix leaking file descriptor, one per picture.
in addtion fd's are closed also it will now free pool memory.

Change-Id: I7bca6456326b3698f46239b272f70607ecf33736

gst-libs/gst/camera/gstmfldcamerasrc.c
gst/mfldv4l2cam/gstv4l2camsrc.h
gst/mfldv4l2cam/v4l2camsrc_calls.c
packaging/gst-plugins-atomisp.changes
packaging/gst-plugins-atomisp.spec

index b177a7b..de56cde 100644 (file)
@@ -2309,7 +2309,7 @@ start_over:
       GST_LOG_OBJECT (camerasrc, "RETURN: capture callback");
       g_mutex_lock (camerasrc->state_lock);
 
-
+       gst_buffer_unref (temp);
        if(--camerasrc->capture_counter > 0) {
           camerasrc->photo_capture_phase = GST_CAMERA_CAPTURE_START;
           GST_DEBUG_OBJECT (camerasrc, "do some more captures count %d",camerasrc->capture_counter);
index 8144d1a..51ecd66 100644 (file)
@@ -217,6 +217,7 @@ struct _GstMFLDV4l2CamSrcBufferPool
   guint *queued;
   GCond* data_cond;
   gboolean is_vaapi_sharing;
+  gboolean is_still_sharing;
 };
 
 struct cached_gst_caps {
index b59eca6..da79a5d 100644 (file)
@@ -187,7 +187,8 @@ gst_v4l2camsrc_buffer_finalize (GstV4l2Buffer * buffer)
         buffer->gbuffer = NULL;
       } else {
         /* It was allocated with posix_memalign */
-        free (GST_BUFFER_DATA (buffer));
+        if(!pool->is_still_sharing)
+          free (GST_BUFFER_DATA (buffer));
       }
     }
 
@@ -305,6 +306,7 @@ gst_v4l2camsrc_buffer_new (GstMFLDV4l2CamSrcBufferPool * pool,
           GST_BUFFER_DATA(buf_cap_signal2), GST_BUFFER_SIZE(buf_cap_signal2));
       GST_BUFFER_DATA (ret) = GST_BUFFER_DATA(buf_cap_signal2);
       gst_buffer_unref(buf_cap_signal2);
+      pool->is_still_sharing = TRUE;
 
     } else {
       if (gst_pad_is_linked (pad)) {
@@ -457,6 +459,7 @@ gst_v4l2camsrc_buffer_pool_init (GstMFLDV4l2CamSrcBufferPool * pool,
   pool->num_live_buffers = 0;
   pool->data_cond = g_cond_new ();
   pool->is_vaapi_sharing = FALSE;
+  pool->is_still_sharing = FALSE;
   pool->frame_byte_size = 0;
 }
 
index ca755e6..0658c4d 100644 (file)
@@ -1,3 +1,6 @@
+* Mon May 13 2013 Marko Ollonen <marko.ollonen@ixonos.com> accepted/tizen_2.0/20130307.195130@b43a6e2
+- unref still image buffer in signal based capture, TZSP-6410.
+
 * Thu Apr 25 2013 Jussi Saavalainen <jussi.saavalainen@ixonos.com> submit/trunk/20130320.111929@0f792bc
 - Detach 3A thread on creation
 - Allow pausing of 3A thread instead of recreating it each time
index 3c21ffa..3498437 100644 (file)
@@ -1,6 +1,6 @@
 Name:       gst-plugins-atomisp
 Summary:    Camera source component for Intel Medfield ISP
-Version:    0.60
+Version:    0.61
 Release:    1
 Group:      Applications/Multimedia
 License:    LGPLv2+