msdkdec: make sure mfx frame width/height meets MSDK's requirement
authorHaihao Xiang <haihao.xiang@intel.com>
Tue, 23 Jul 2019 05:16:36 +0000 (13:16 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Wed, 24 Jul 2019 00:41:13 +0000 (08:41 +0800)
commit20f61db2e52870e045c10e6030fea8099cd1c34b
tree12ff0a9dadde873fc08f6775b8ef844d23aaebb3
parent8145a2236d60542eaa0512daf13b0225eced44d1
msdkdec: make sure mfx frame width/height meets MSDK's requirement

It is possible that the output region size (e.g. 192x144) is different
from the coded picture size (e.g. 192x256). We may adjust the alignment
parameters so that the padding is respected in GstVideoInfo and use
GstVideoInfo to calculate mfx frame width and height

This fixes the error below when decoding a stream which has different
output region size and coded picture size

0:00:00.057726900 28634 0x55df6c3220a0 ERROR                msdkdec
gstmsdkdec.c:1065:gst_msdkdec_handle_frame:<msdkh265dec0>
DecodeFrameAsync failed (failed to allocate memory)

Sample pipeline:

gst-launch-1.0 filesrc location=output.h265 ! h265parse ! msdkh265dec !
glimagesink
sys/msdk/gstmsdkbufferpool.c
sys/msdk/gstmsdkdec.c
sys/msdk/gstmsdkenc.c
sys/msdk/gstmsdkvpp.c
sys/msdk/msdk.c
sys/msdk/msdk.h