VABuffer is recyclable?
by Hirokazu Honda
Hi all.
I am thinking to recycle VABuffers in video processing.
A VABuffer created by vaCreateBuffer() intuitively only has to be
destroyed when a buffer is no longer needed, that is, in the end of
the processing.
I checked gstreamer-vaapi code today. VABuffer used on video encoding
is always created and destroyed in encoding each frame [1].
There is a comment.
> /* XXX: vaRenderPicture() is meant to destroy the VA buffer implicitly */
If this is true, we cannot reuse VABuffers during video processing.
Besides, I am curious if we really need to vaUnmap before a driver
reads a content modified by an application.
VA-API documents vaUnamp needs to be called in order to notify a
driver can consume the buffer by the driver [2].
But, in this way, we need to map/unmap in every buffer modification. I
wonder if we can have SyncBuffer, similar to SyncSurface, to avoid
map/unmap.
What do you think?
[1] https://github.com/GStreamer/gstreamer-vaapi/blob/1c3b02daf2fed53fa9ca726...
[2] http://intel.github.io/libva/group__api__core.html#gae9b81871416c64b07e81...
Thanks in advance,
-Hiro
2 years, 6 months