msdkvpp: fix "failed to create new MSDK memory"
authorXu Guangxin <guangxin.xu@intel.com>
Tue, 19 May 2020 06:59:25 +0000 (14:59 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Mon, 1 Jun 2020 02:09:04 +0000 (02:09 +0000)
commit52be289847f0ae744d70506c4883288b9a6a33c3
tree52988373fc571e53cb70882ea08111749ee1fb11
parent275518f6613b0aaed29e9ffdc53d8c9e164a9607
msdkvpp: fix "failed to create new MSDK memory"

all msdk output surfaces come from out_alloc_resp, so the buffer count is not resizable.
we need set min_buffers, max_buffers to same size.

steps to reproduce
1. ffmpeg -f lavfi -i testsrc=duration=10:size=320x240:rate=30:decimals=3 -pix_fmt yuv420p -c:v libx265 ~/bits/hevc/test.265
2. GST_GL_PLATFORM=egl gst-launch-1.0 -v filesrc location=~/bits/hevc/test.265  ! h265parse ! msdkh265dec  ! msdkvpp ! queue ! glimagesink
you will see error like this:
ERROR                default gstmsdkvideomemory.c:77:gst_msdk_video_allocator_get_surface: failed to get surface available
ERROR         msdkbufferpool gstmsdkbufferpool.c:270:gst_msdk_buffer_pool_alloc_buffer:<msdkbufferpool2> failed to create new MSDK memory
ERROR                msdkvpp gstmsdkvpp.c:297:create_output_buffer:<msdkvpp0> failed to create output video buffer
ERROR                msdkdec gstmsdkdec.c:699:gst_msdkdec_finish_task:<msdkh265dec0> Failed to finish frame
ERROR                msdkdec gstmsdkdec.c:1085:gst_msdkdec_handle_frame:<msdkh265dec0> Failed to finish a task

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1278>
sys/msdk/gstmsdkvpp.c
sys/msdk/gstmsdkvpp.h