How to set variables for dsexample for input and output?

Dear friends:
I have a problem. I hope getting an variable from outside of deepstream, the variable is used in dsexample, and after my algorithm, I hope to output another variable.

However, I find the stream in dsexample is GST stream, How could I do? Please give me some suggestion. Thank you very much.

What kind of variable? A picture, an integer or anything else? How much do you know about GStreamer(https://gstreamer.freedesktop.org/)?