Async encoding and management of dynamically alloced SEI data (and even NV_ENC_PIC_PARAMS)

I can’t find any specific info about how nvEncEncodePicture handles the NV_ENC_PIC_PARAMS pointer that is handed in when in async mode.

ffmpeg’s sample code avoids the issue by not running async - they hand in ptr to a local NV_ENC_PIC_PARAMS variable, and they malloc an NV_ENC_SEI_PAYLOAD and the the payload object inside it.

But if we are running async, is there any documentation that indicates if the nvEncEncodePicture call copies all of this data before returning (in which case we could safely free it), or doesn’t (in which case we have to track the data along with the corresponding completion events to know when it is safe to free). Not just the NV_ENC_PIC_PARAMS, but, for instance the payload attached to NV_ENC_SEI_PAYLOAD inside the NV_ENC_PIC_PARAMS_H264 on the NV_ENC_PIC_PARAMS (which is dynamically alloced in all the examples I find)?

Anyone have any reliable sources of info on this?

I have tested zeroing the data out immediately after the nvEncEncodePicture call returns (running async with buffer depth 3), and the sei data is still successfully encoded, but I would love to see the info in print somewhere to avoid “fun” debugging later due to a race.

thx for any info/leads