fixed crash issue when omx core is released from drc contents 47/117747/4
authorSejun Park <sejun79.park@samsung.com>
Tue, 7 Mar 2017 08:57:47 +0000 (17:57 +0900)
committerSejun Park <sejun79.park@samsung.com>
Wed, 8 Mar 2017 03:59:48 +0000 (12:59 +0900)
Change-Id: I45b52d679b9acd54d645d5a2cdd17fa17d1c6048

omx/gstomx.c
omx/gstomxvideodec.c

index b2081df..7010b03 100755 (executable)
@@ -1422,10 +1422,12 @@ gst_omx_port_release_buffer (GstOMXPort * port, GstOMXBuffer * buf)
   buf->used = TRUE;
 
   if (port->port_def.eDir == OMX_DirInput) {
-    GST_LOG_OBJECT (comp->parent,"Calling OMX_EmptyThisBuffer. BufHeader:[%p]\n",buf->omx_buf);
+    GST_LOG_OBJECT (comp->parent,"Calling OMX_EmptyThisBuffer. dmabuf_fd : [%d(%p)0x%02x, 0x%02x], nFilledLen : %d\n",
+      buf->mm_vbuffer->handle.dmabuf_fd[0], buf, buf->omx_buf->pBuffer[4], buf->omx_buf->pBuffer[10], buf->omx_buf->nFilledLen);
     err = OMX_EmptyThisBuffer (comp->handle, buf->omx_buf);
   } else {
-      GST_LOG_OBJECT (comp->parent,"Calling OMX_FillThisBuffer. BufHeader:[%p]\n",buf->omx_buf);
+    GST_LOG_OBJECT (comp->parent,"Calling OMX_FillThisBuffer. dmabuf_fd : [%d(%p)]\n",
+         buf->mm_vbuffer->handle.dmabuf_fd[0], buf);
     err = OMX_FillThisBuffer (comp->handle, buf->omx_buf);
   }
   GST_DEBUG_OBJECT (comp->parent, "Released buffer %p to %s port %u: %s "
@@ -1749,8 +1751,9 @@ gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufMgr, int
       mm_vbuffer[i]->type = MM_VIDEO_BUFFER_TYPE_TBM_BO;
 
       GST_INFO_OBJECT (comp->parent,
-          "Allocating %d buffer[%p] for %s port %u", i,
-           mm_vbuffer[i]->handle.bo[0], comp->name, (guint) port->index);
+        "Allocating %d buffer bo[0]:%p fd[0]:%d size[0]:%d for %s port %u",
+        i, mm_vbuffer[i]->handle.bo[0], mm_vbuffer[i]->handle.dmabuf_fd[0],
+        mm_vbuffer[i]->size[0], comp->name, (guint) port->index);
       } else { /* output port */
         y_size = gst_omx_calculate_y_size(eCompressionFormat,
                  port->port_def.format.video.nStride, port->port_def.format.video.nSliceHeight);
@@ -1776,9 +1779,9 @@ gst_omx_port_tbm_allocate_dec_buffers (GstOMXPort * port, tbm_bufmgr bufMgr, int
         mm_vbuffer[i]->plane_num = 2;
 
         GST_INFO_OBJECT (comp->parent,
-            "Allocating %d buffer bo[0]:%p bo[1]:%p fd[0]:%d fd[1]:%d size[0]:%d size[1]:%d for %s port %u", i,
-            mm_vbuffer[i]->handle.bo[0], mm_vbuffer[i]->handle.bo[0], mm_vbuffer[i]->handle.dmabuf_fd[0], mm_vbuffer[i]->handle.dmabuf_fd[1],
-            mm_vbuffer[i]->size[0], mm_vbuffer[i]->size[1], comp->name, (guint) port->index);
+          "Allocating %d buffer bo[0]:%p bo[1]:%p fd[0]:%d fd[1]:%d size[0]:%d size[1]:%d for %s port %u", i,
+          mm_vbuffer[i]->handle.bo[0], mm_vbuffer[i]->handle.bo[1], mm_vbuffer[i]->handle.dmabuf_fd[0], mm_vbuffer[i]->handle.dmabuf_fd[1],
+          mm_vbuffer[i]->size[0], mm_vbuffer[i]->size[1], comp->name, (guint) port->index);
 
       }
       buffers = g_list_append(buffers,(gpointer)mm_vbuffer[i]);
index a12315d..cce0852 100755 (executable)
@@ -2080,6 +2080,9 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
       if (!gst_omx_video_dec_open (GST_VIDEO_DECODER (self)))
         return FALSE;
       needs_disable = FALSE;
+#ifdef TIZEN_FEATURE_OMX
+      gst_omx_port_get_port_definition (self->dec_in_port, &port_def);
+#endif
     } else {
 #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
       if (self->eglimage) {