I make a gstreamer plugin with nvosd lib to overlay text on the video. While when I try to overlay text in a video stream which selected from several video streams using gst-input-selector plugin, the text would flash several seconds and then disappear. The Error is
NvMapMemCacheMaint:1075334668 failed 
And look the kernal log, it outputs something likes:
WARNING: All NvMap Allocations must have a tag to identify the subsystem allocating memory.Please pass the tag to the API call NvRmMemHanldeAllocAttr() or relevant.
Any help to correct this would be appreciated, thanks.
The code will be called for different fds ( e.g. four different dmabuf_fds will input into the function ) in a thread. If this is the correct way to call jetson multimedia api, or what I can do to call the apis correctly. Thanks.
More details, when I use diffrent camera sources (hdmi + ipc) as input , this issue always happens. And when I use one type of cameras ( e.g. three ipc cameras ) as input, sometimes it works well and sometimes the text disappears .
Thank you for your timely reply. I will try to construct a test code for replicating the issue. And I will try the solution of cairo.
And as I say before, the vic_freq is too high, means that I do too much video format transformation. Because textovley only support RGBA format, and the video format in my case must be I420, so I want to transform I420->RGBA, textoverlay and then RGBA->I420 using cuda. I know I can get egl image from NvBuffer by NvEGLImageFromFd(), and then map it to cuda memory. In my opinion, the I420 buffer and the RGBA buffer in cuda/NvBuffer/EglImage have different byte size. I must allocate a new buffer for transforming I420 to RGBA (or RGBA to I420). There are two questions:
How can I copy the new allocated cuda memory to the NvBuffer (dmabuf fd) ?
Whether I must call NvBufferCreateEx to create a new NvBuffer for accepting transformed cuda data ?
cairo APIs should work same as nvosd_put_text() since we support only MODE_CPU:
* Overlays clock and given text at given location on a buffer.
* To overlay the clock, you must set clock params using
* You must ensure that the length of @a text_params_list is at least
* @a num_strings.
* @note Currently only #MODE_CPU is supported. Specifying other modes wil have
* no effect.
* @param[in] nvosd_ctx A pointer to NvOSD context.
* @param[in] mode Mode selection to draw the text.
* @param[in] fd DMABUF FD of buffer on which text is to be overlayed.
* @param[in] num_strings Number of strings to be overlayed.
* @param[in] text_params_list A pointer to an array of NvOSD_TextParams
* structure for the clock and text to be overlayed.
* @returns 0 for success, -1 for failure.
int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
MODE_GPU does not work. We may miss to return error when the mode is not supported.