Custom GstMeta data dissapearing when received in a new pipeline

debruyn debruynels1 at gmail.com
Mon Jun 27 11:56:41 UTC 2016


Good day,

I am developing a system that receives a UDP stream from an ARM board. I
need to set my own custom metadata on each buffer that is being sent to the
PC (SIte ID and Camera ID). I already wrote a metadata API (implemented as a
shared library) for this based on this example :
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-allocation-meta.html
. The problem is when I set the metadata on the buffer it sets fine, but
when i receive the buffers on the other side the metadata is not there. Can
anybody please help with this problem. Is it even possible to implement
custom metadata like this?

Here is my code snippets for firstly setting the data and secondly reading
it. (attached is the source file of my Custom metadata)

Setting the metadata (On ARM):

/* This sets up a probe that will give any traffic information on any
incoming buffers on a specific pad */
gulong CamPipeline::setupBufferProbe (GstElement * _gstProbeElement)
{
    GstPad * gstPad;
    gulong gstProbeId;

    gstPad = gst_element_get_static_pad (_gstProbeElement, "src");
    gstProbeId = gst_pad_add_probe (gstPad, GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) bufferProbe, this, NULL);

    gst_object_unref (gstPad);

    return gstProbeId;
}

/* The actual stream buffer probe */
GstPadProbeReturn CamPipeline::bufferProbe(GstPad * _gstProbePad,
GstPadProbeInfo * _gstProbeInfo, gpointer _gstData)
{
    CamPipeline* oPipeObject = (CamPipeline*) _gstData;
    GstBuffer * gstBuffer = GST_PAD_PROBE_INFO_BUFFER(_gstProbeInfo);

    GstRcMeta* gstRcMeta;
    gchar deviceId[10] = "Site";
    gchar camId[10] = "Cam";
    gstRcMeta = gst_buffer_add_rc_meta(gstBuffer, deviceId, camId);

    return GST_PAD_PROBE_OK;
}

Reading the Metadata( On PC)

/* The actual event probe */
GstPadProbeReturn CamPipeline::eventProbe(GstPad * _gstProbePad,
GstPadProbeInfo * _gstProbeInfo, gpointer _gstData)
{
	GstEvent * gstEvent = GST_PAD_PROBE_INFO_EVENT(_gstProbeInfo);
    printf ("Got event data on device : %s\n",GST_EVENT_TYPE_NAME
(gstEvent));

	return GST_PAD_PROBE_OK;
}

/* The actual stream buffer probe */
GstPadProbeReturn CamPipeline::bufferProbe(GstPad * _gstProbePad,
GstPadProbeInfo * _gstProbeInfo, gpointer _gstData)
{
	GstBuffer * gstBuffer = GST_PAD_PROBE_INFO_BUFFER(_gstProbeInfo);

    CamPipeline* oPipeObject = (CamPipeline*) _gstData;
    //oPipeObject->debug("Meta received");

    GstRcMeta* gstRcMeta;
    gstRcMeta = gst_buffer_get_rc_meta(gstBuffer);
    if(gstRcMeta != NULL)
    {
        cout << gstRcMeta->deviceID << "   " << gstRcMeta->camID <<endl;
    }
    else
    {
        cout <<" NOPE  " <<endl;
    }
}
<nabble_a href="gstrcmeta.cpp">gstrcmeta.cpp 




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Custom-GstMeta-data-dissapearing-when-received-in-a-new-pipeline-tp4678272.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list