st/omx/dec: disable tunnel for size different case
authorLeo Liu <leo.liu@amd.com>
Mon, 24 Oct 2016 18:03:11 +0000 (14:03 -0400)
committerLeo Liu <leo.liu@amd.com>
Mon, 31 Oct 2016 15:45:29 +0000 (11:45 -0400)
When the video coded size is different from frame size, we need the result
buffers are same as coded size, which are not size compatible with encode
required size, so that simply use no tunnel for this case instead of frame
by frame converting.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/omx/vid_dec.c
src/gallium/state_trackers/omx/vid_dec.h
src/gallium/state_trackers/omx/vid_dec_h265.c

index e51a747699f80d99eea5b804bb33e5e8e4f38ce0..9a6efb8e2877a08db1dfbfec26a6ffc297424639 100644 (file)
@@ -621,7 +621,7 @@ static void vid_dec_FrameDecoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE*
    }
 
    if (input->pInputPortPrivate) {
-      if (output->pInputPortPrivate) {
+      if (output->pInputPortPrivate && !priv->disable_tunnel) {
          struct pipe_video_buffer *tmp, *vbuf, *new_vbuf;
 
          tmp = output->pOutputPortPrivate;
index 35a575899c615f10ce3b1efbcf36c9a59bd51e72..90acf7b46e58e3dff7df73ff96844fd33bb8d037 100644 (file)
@@ -129,6 +129,7 @@ DERIVEDCLASS(vid_dec_PrivateType, omx_base_filter_PrivateType)
    bool frame_started; \
    unsigned bytes_left; \
    const void *slice; \
+   bool disable_tunnel; \
    struct vl_compositor compositor; \
    struct vl_compositor_state cstate;
 ENDCLASS(vid_dec_PrivateType)
index b9ac654e876a9f82e67f586dcd04268a01e78956..3242dbe11c864e04a5e664b304d69da7877c4f99 100644 (file)
@@ -614,6 +614,8 @@ static void vid_dec_h265_BeginFrame(vid_dec_PrivateType *priv)
 
    if (!priv->codec) {
       struct pipe_video_codec templat = {};
+      omx_base_video_PortType *port = (omx_base_video_PortType *)
+         priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
 
       templat.profile = priv->profile;
       templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
@@ -623,6 +625,13 @@ static void vid_dec_h265_BeginFrame(vid_dec_PrivateType *priv)
       templat.height = priv->codec_data.h265.pic_height_in_luma_samples;
       templat.level =  priv->codec_data.h265.level_idc;
       priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
+
+      /* disable transcode tunnel if video size is different from coded size */
+      if (priv->codec_data.h265.pic_width_in_luma_samples !=
+          port->sPortParam.format.video.nFrameWidth ||
+          priv->codec_data.h265.pic_height_in_luma_samples !=
+          port->sPortParam.format.video.nFrameHeight)
+         priv->disable_tunnel = true;
    }
 
    vid_dec_NeedTarget(priv);