opencv data buffer to gst data buffer

After the video stream data is received and processed by opencv, it is planned to call GST encoding and upload. How can opencv’s data buffer define which GST buffer can be used directly or which GST function can be called to process the data stream between the two.
Thank you all.

Please check the sample in the link: