Have you tried to use appsrc element? https://gstreamer.freedesktop.org/documentation/app/appsrc.html?gi-language=c
You can add data from your RAM to an appsrc element using its signal need-data
: https://gstreamer.freedesktop.org/documentation/app/appsrc.html#appsrc::need-data
There are many examples on how the appsrc element can be used. I suggest to look into the official GStreamer tutorial: https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html?gi-language=c