Dynamic allocate GstVaapiSurface to reduce video memory consumption
Submitted by Zhao, Halley
we calculate out a max number ('capacity' of surface pool) for reference frame count . however, many stream don't use so many ref frames in reality.
it means, if we allocate surface with capacity number, it reserve more video memory than the real demand.
if we initiate surface pool with a smaller number, and allocate new surface when it is really required. it reduces video memory consumption.
the 1080P kauai stream, 14 surface is used in reality though the capacity number is 17.
gst-launch-1.0 filesrc location=/home/halley/media/video/kauai_1080p_H.264_AAC_9478Kbps_30FPS_5m30s.mp4 ! qtdemux ! vaapidecode ! vaapisink
however, playbin doesn't benefit, because queue element always try to request more surface.
I don't have good idea on it; or said, I don't find a good way to set the length of queue inside playbin.