Adding/Inserting a GstBuffer or Mat image to the GstBuffer Pool

deepg799 deepg799 at gmail.com
Thu Sep 24 13:17:46 UTC 2020


Hello experts,

I have created a GstBuffer Pool to share the couple of Gstbuffer with the
downstream element.

I am struggling to find out *How do I can insert/add the Gstbuffer data to
the GstBuffer Pool*?

Could anyone help me on the same. below is the code description for the
above problem.

*// GstPool configuration*

    pool = gst_buffer_pool_new();
    config = gst_buffer_pool_get_config(pool); // Get the configuration.
    size = 420*420*3; // size of the pool buffer
    min_ = 1;
    max_ = 5;
    //caps = gst_caps_from_string(VIDEO_SRC_CAPS ",width = (int) [1, 420],
height = (int) [1, 420]");
    caps = gst_caps_from_string("video/x-raw");
    gst_buffer_pool_config_set_params (config, caps, size, min_, max_);
    gst_caps_unref(caps);
    gst_buffer_pool_set_config (pool, config);
    
*// video frame creation*
   
   cv::Mat img = frame_rx; // opencv Mat image data.
 *  GstBuffer *buf=  gst_buffer_new_wrapped(sub_img.data,(sub_img.total()*
sub_img.elemSize())); // convert Mat to GstBuffer*
   
 * The above buf video data frame I wanted to add in GstBuffer pool*.






    



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list