Custom GstMeta data dissapearing when received in a new pipeline

Tim Müller tim at centricular.com
Wed Jun 29 09:43:12 UTC 2016


On Wed, 2016-06-29 at 01:29 -0700, debruyn wrote:

Hi,

> So I have been looking into things, so what i am attempting to do is
> to catch the buffers as they are being passed down. This being done
> with a pad probe.
> The pipe on the board is simple : rtspsrc -> Queue2 -> udpsink. Have
> a few questions on some logistics. 
> 
> 1. Am i correct in stating that the rtspsrc contains a rtpbin element
> that will make the RTPBuffers for me?

I think there may be a misunderstanding about the GstRTPBuffer API.
There are no RTPBuffers flowing through the pipeline. There will be
normal GstBuffers flowing through the pipeline containing RTP packet
data.

GstRTPBuffer is just a convenience API to parse a GstBuffer that
contains an RTP packet into the various constituent bits and bobs
(header, flags, header extension, payload, etc.); or to create an RTP
packet.


> 2. I am having problems to convert a gstBuffer to a gstRTPBuffer, or
> just in general to obtain the RTPBufferbeing sent to the udpsink. I
> just want to test if there are already any extension data set(thus
> meaning I have access to the buffer and can write to it).Here is my
> code for that part:

See above.

> /* 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);
> 
>     GstRTPBuffer * gstRtpBuffer = ((GstRTPBuffer*) gstBuffer);

You can't just cast, that's not how it works. Try something like this:

  GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;

  if (gst_rtp_buffer_map (gstBuffer, GST_MAP_READ, &rtp)) {
    ...
    g_print ("extension: %d\n", gst_rtp_buffer_get_extension (&rtp));

    gst_rtp_buffer_unmap (&rtp);
  }

Cheers
 -Tim

-- 

Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list