0032-Omxdec-Use-strde-and-slice-form-decoder-to-calculate.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From d077e89380593feafd82e96a293b26fb2d02aba2 Mon Sep 17 00:00:00 2001
  2. From: Som Qin <som.qin@starfivetech.com>
  3. Date: Thu, 21 Sep 2023 16:06:09 +0800
  4. Subject: [PATCH] Omxdec: Use strde and slice form decoder to calculate avframe
  5. buffer linesize
  6. Signed-off-by: Som Qin <som.qin@starfivetech.com>
  7. ---
  8. libavcodec/omxdec.c | 4 ++--
  9. 1 file changed, 2 insertions(+), 2 deletions(-)
  10. diff --git a/libavcodec/omxdec.c b/libavcodec/omxdec.c
  11. index 6cb0d98..0edca36 100755
  12. --- a/libavcodec/omxdec.c
  13. +++ b/libavcodec/omxdec.c
  14. @@ -509,6 +509,8 @@ static OMX_ERRORTYPE event_handler(OMX_HANDLETYPE component, OMX_PTR app_data, O
  15. s->dec_out_width = out_port_params.format.video.nFrameWidth;
  16. s->dec_out_height = out_port_params.format.video.nFrameHeight;
  17. s->dec_pix_fmt = out_port_params.format.video.eColorFormat;
  18. + s->stride = out_port_params.format.video.nStride;
  19. + s->plane_size = out_port_params.format.video.nSliceHeight;
  20. av_log(s->avctx, AV_LOG_VERBOSE, "w:%d, h:%d, fmt:%d\n", s->dec_out_width, s->dec_out_height, s->dec_pix_fmt);
  21. if (!s->num_out_buffers) {
  22. @@ -1339,8 +1341,6 @@ static int omx_decode_frame(AVCodecContext *avctx, void *data,
  23. avctx->width = s->dec_out_width;
  24. avctx->height = s->dec_out_height;
  25. avctx->pix_fmt = omx_map_color_format(avctx, s->dec_pix_fmt);
  26. - s->stride = avctx->width;
  27. - s->plane_size = avctx->height;
  28. if (buffer->nFlags & OMX_BUFFERFLAG_EOS)
  29. s->got_eos = 1;
  30. --
  31. 2.25.1