]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/commitdiff
[FIX] Defer buffer lock till calling process
authorPradeep Venkatasubbarao <pradeepv@ti.com>
Tue, 11 Mar 2014 12:45:41 +0000 (18:15 +0530)
committerPradeep Venkatasubbarao <pradeepv@ti.com>
Tue, 11 Mar 2014 12:45:41 +0000 (18:15 +0530)
Fix for issue OMAPS00301600.

The output buffers need to be locked (pinned to tiler) before calling
VIDDEC3_process.

Earlier this call, dce_buf_lock, was getting called much earlier.
So, in case of an error scenario, the buffers were not being unlocked
as dce_buf_unlock was not getting called.

This patch fixes the issue by defering the locking call till
before calling VIDDEC3_process.

Signed-off-by: Pradeep Venkatasubbarao <pradeepv@ti.com>
src/gstducatividdec.c

index 687b0e54cbc134b1a1e56cf876c4f98704e03df4..3b3c9db48bad7fccea6db791ad17990508872935 100644 (file)
@@ -392,6 +392,7 @@ codec_process (GstDucatiVidDec * self, gboolean send, gboolean flush,
   GstClockTime t;
   GstBuffer *outbuf = NULL;
   gint i;
+  SizeT fd;
   GstDucatiVidDecClass *klass = GST_DUCATIVIDDEC_GET_CLASS (self);
   GstFlowReturn ret = GST_FLOW_OK;
   if (flow_ret)
@@ -401,6 +402,11 @@ codec_process (GstDucatiVidDec * self, gboolean send, gboolean flush,
   memset (&self->outArgs->outputID, 0, sizeof (self->outArgs->outputID));
   memset (&self->outArgs->freeBufID, 0, sizeof (self->outArgs->freeBufID));
 
+  /* Get dmabuf fd of the buffer to lock it*/
+  fd = gst_dma_buf_get_fd(gst_buffer_get_dma_buf((GstBuffer *) self->inArgs->inputID));
+  /* Must lock all the buffer passed to ducati */
+  dce_buf_lock(1,&fd);
+
   GST_DEBUG ("Calling VIDDEC3_process");
   t = gst_util_get_timestamp ();
   err = VIDDEC3_process (self->codec,
@@ -1216,10 +1222,6 @@ allocate_buffer:
    * things in case we need to renegotiate */
   self->inArgs->inputID =
       codec_prepare_outbuf (self, &outbuf, self->first_out_buffer);
-  /* Get dmabuf fd of the buffer to lock it*/
-  fd = gst_dma_buf_get_fd(gst_buffer_get_dma_buf((GstBuffer *) self->inArgs->inputID));
-  /* Must lock all the buffer passed to ducati */
-  dce_buf_lock(1,&fd);
   if (!self->inArgs->inputID) {
     GST_ERROR_OBJECT (self, "could not prepare output buffer");
     gst_buffer_unref (buf);