Hi Julien and Christian,

I got a patch attached to fix the "fillout" problem, and please review.


But we still need to fix transcoding issue with interlaced as true. Our 
transcode support tunneling, basic the decode buffer will be used directly for 
encode.


Thanks,

Leo



________________________________
From: Julien Isorce <julien.iso...@gmail.com>
Sent: June 27, 2016 4:54:07 PM
To: Liu, Leo
Cc: ML mesa-dev; Gurkirpal Singh; Koenig, Christian
Subject: Re: [Mesa-dev] [PATCH 2/3] st/omx: add support for nouveau / interlaced

Hi Leo,

Sorry for the inconvenience, could you let me know how to reproduce the problem 
?
I have been playing with some gst pipelines and they all work but I can only 
test with nouveau driver.

Cheers
Julien


On 27 June 2016 at 21:35, Leo Liu <leo....@amd.com<mailto:leo....@amd.com>> 
wrote:
This patch break omx decode to file, it got seg fault. Will take look further.

Regards,
Leo



On 06/27/2016 04:16 AM, Julien Isorce wrote:
Signed-off-by: Julien Isorce <j.iso...@samsung.com<mailto:j.iso...@samsung.com>>
---
  src/gallium/state_trackers/omx/vid_dec.c | 51 ++++++++++++++++----------------
  1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/src/gallium/state_trackers/omx/vid_dec.c 
b/src/gallium/state_trackers/omx/vid_dec.c
index 564ca2f..85ffb88 100644
--- a/src/gallium/state_trackers/omx/vid_dec.c
+++ b/src/gallium/state_trackers/omx/vid_dec.c
@@ -48,6 +48,7 @@
  #include "pipe/p_video_codec.h"
  #include "util/u_memory.h"
  #include "util/u_surface.h"
+#include "vl/vl_video_buffer.h"
  #include "vl/vl_vlc.h"
    #include "entrypoint.h"
@@ -515,34 +516,34 @@ static void vid_dec_FillOutput(vid_dec_PrivateType *priv, 
struct pipe_video_buff
     OMX_VIDEO_PORTDEFINITIONTYPE *def = &port->sPortParam.format.video;
       struct pipe_sampler_view **views;
-   struct pipe_transfer *transfer;
-   struct pipe_box box = { };
-   uint8_t *src, *dst;
+   unsigned i, j;
+   unsigned width, height;
       views = buf->get_sampler_view_planes(buf);
  -   dst = output->pBuffer;
-
-   box.width = def->nFrameWidth;
-   box.height = def->nFrameHeight;
-   box.depth = 1;
-
-   src = priv->pipe->transfer_map(priv->pipe, views[0]->texture, 0,
-                                  PIPE_TRANSFER_READ, &box, &transfer);
-   util_copy_rect(dst, views[0]->texture->format, def->nStride, 0, 0,
-                  box.width, box.height, src, transfer->stride, 0, 0);
-   pipe_transfer_unmap(priv->pipe, transfer);
-
-   dst = ((uint8_t*)output->pBuffer) + (def->nStride * box.height);
-
-   box.width = def->nFrameWidth / 2;
-   box.height = def->nFrameHeight / 2;
-
-   src = priv->pipe->transfer_map(priv->pipe, views[1]->texture, 0,
-                                  PIPE_TRANSFER_READ, &box, &transfer);
-   util_copy_rect(dst, views[1]->texture->format, def->nStride, 0, 0,
-                  box.width, box.height, src, transfer->stride, 0, 0);
-   pipe_transfer_unmap(priv->pipe, transfer);
+   for (i = 0; i < 2 /* NV12 */; i++) {
+      if (!views[i]) continue;
+      width = buf->width;
+      height = buf->height;
+      vl_video_buffer_adjust_size(&width, &height, i, buf->interlaced, 
buf->chroma_format);
+      for (j = 0; j < views[i]->texture->array_size; ++j) {
+         struct pipe_box box = {0, 0, j, width, height, 1};
+         struct pipe_transfer *transfer;
+         uint8_t *map, *dst;
+         map = priv->pipe->transfer_map(priv->pipe, views[i]->texture, 0,
+                  PIPE_TRANSFER_READ, &box, &transfer);
+         if (!map)
+            return;
+
+         dst = ((uint8_t*)output->pBuffer + output->nOffset) + j * 
def->nStride + i * buf->width * buf->height;
+         util_copy_rect(dst,
+            views[i]->texture->format,
+            def->nStride * views[i]->texture->array_size, 0, 0,
+            box.width, box.height, map, transfer->stride, 0, 0);
+
+         pipe_transfer_unmap(priv->pipe, transfer);
+      }
+   }
  }
    static void vid_dec_FrameDecoded(OMX_COMPONENTTYPE *comp, 
OMX_BUFFERHEADERTYPE* input,


From 8c06114545d63cd435834b1f7664e68bc0189a77 Mon Sep 17 00:00:00 2001
From: Leo Liu <leo....@amd.com>
Date: Mon, 27 Jun 2016 20:40:30 -0400
Subject: [PATCH] st/omx: fix decoder fillout for the OMX result buffer

The call for vl_video_buffer_adjust_size is with wrong order of
arguments, apparently it will have problem when interlaced false;

The size of OMX result buffer depends on real size of clips, vl buffer
dimension is aligned with 16, so 1080p(1920*1080) video will overflow
the OMX buffer

Signed-off-by: Leo Liu <leo....@amd.com>
---
 src/gallium/state_trackers/omx/vid_dec.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/omx/vid_dec.c b/src/gallium/state_trackers/omx/vid_dec.c
index 85ffb88..a989c10 100644
--- a/src/gallium/state_trackers/omx/vid_dec.c
+++ b/src/gallium/state_trackers/omx/vid_dec.c
@@ -523,9 +523,9 @@ static void vid_dec_FillOutput(vid_dec_PrivateType *priv, struct pipe_video_buff
 
    for (i = 0; i < 2 /* NV12 */; i++) {
       if (!views[i]) continue;
-      width = buf->width;
-      height = buf->height;
-      vl_video_buffer_adjust_size(&width, &height, i, buf->interlaced, buf->chroma_format);
+      width = def->nFrameWidth;
+      height = def->nFrameHeight;
+      vl_video_buffer_adjust_size(&width, &height, i, buf->chroma_format, buf->interlaced);
       for (j = 0; j < views[i]->texture->array_size; ++j) {
          struct pipe_box box = {0, 0, j, width, height, 1};
          struct pipe_transfer *transfer;
@@ -535,7 +535,8 @@ static void vid_dec_FillOutput(vid_dec_PrivateType *priv, struct pipe_video_buff
          if (!map)
             return;
 
-         dst = ((uint8_t*)output->pBuffer + output->nOffset) + j * def->nStride + i * buf->width * buf->height;
+         dst = ((uint8_t*)output->pBuffer + output->nOffset) + j * def->nStride +
+               i * def->nFrameWidth * def->nFrameHeight;
          util_copy_rect(dst,
             views[i]->texture->format,
             def->nStride * views[i]->texture->array_size, 0, 0,
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to