Merge tizen patch based on 1.12.2
[platform/upstream/gstreamer.git] / omx / gstomxbufferpool.c
index fa3f8e7..460c7c2 100755 (executable)
@@ -395,7 +395,6 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool,
     g_ptr_array_add (pool->buffers, buf);
 
     switch (GST_VIDEO_INFO_FORMAT (&pool->video_info)) {
-        GST_WARNING_OBJECT (pool, "GST_VIDEO_CAPS");
       case GST_VIDEO_FORMAT_ABGR:
       case GST_VIDEO_FORMAT_ARGB:
       case GST_VIDEO_FORMAT_RGB16:
@@ -418,7 +417,6 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool,
         break;
       case GST_VIDEO_FORMAT_SN12:
       case GST_VIDEO_FORMAT_ST12:
-        GST_WARNING_OBJECT (pool, "SN12SN12SN12SN12SN12");
         offset[0] = 0;
         stride[0] = pool->port->port_def.format.video.nStride;
         offset[1] = stride[0] * pool->port->port_def.format.video.nSliceHeight;
@@ -448,9 +446,11 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool,
           break;
         }
       }
-
       pool->need_copy = need_copy;
     }
+#ifdef TIZEN_FEATURE_OMX
+    pool->need_copy = FALSE;
+#endif
 
     if (pool->need_copy || pool->add_videometa) {
       /* We always add the videometa. It's the job of the user
@@ -469,6 +469,8 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool,
 
   *buffer = buf;
 
+  pool->num_buffers++;
+  GST_DEBUG_OBJECT (pool, "alloc buffers : %d %d", pool->num_buffers, pool->current_buffer_index);
   pool->current_buffer_index++;
 
   return GST_FLOW_OK;
@@ -492,6 +494,8 @@ gst_omx_buffer_pool_free_buffer (GstBufferPool * bpool, GstBuffer * buffer)
 
   GST_BUFFER_POOL_CLASS (gst_omx_buffer_pool_parent_class)->free_buffer (bpool,
       buffer);
+  GST_DEBUG_OBJECT (pool, "free buffers : %d %d", pool->num_buffers, pool->current_buffer_index);
+  pool->num_buffers--;
 }
 
 static GstFlowReturn
@@ -509,6 +513,8 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool,
     buf = g_ptr_array_index (pool->buffers, pool->current_buffer_index);
     g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR);
     *buffer = buf;
+    pool->num_buffers--;
+    GST_DEBUG_OBJECT (pool, "acquire buffers : %d %d", pool->num_buffers, pool->current_buffer_index);
     ret = GST_FLOW_OK;
 
     /* If it's our own memory we have to set the sizes */
@@ -545,6 +551,8 @@ gst_omx_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
         gst_omx_buffer_data_quark);
     if (pool->port->port_def.eDir == OMX_DirOutput && !omx_buf->used) {
       /* Release back to the port, can be filled again */
+      pool->num_buffers++;
+      GST_DEBUG_OBJECT (pool, "release buffers : %d %d", pool->num_buffers, pool->current_buffer_index);
       err = gst_omx_port_release_buffer (pool->port, omx_buf);
       if (err != OMX_ErrorNone) {
         GST_ELEMENT_ERROR (pool->element, LIBRARY, SETTINGS, (NULL),