Assigning SSRC of RTP Packets dynamically

priyanka kataria priyanka.kataria86 at gmail.com
Wed Jun 5 03:56:26 UTC 2019


Hello All,

I want to assign the SSRC of RTP Packets dynamically.

The scenario is as below:
I have funneled multiple streams into one. At runtime I check if the frame
is 1st input source, I assign SSRC as 1, if the frame is from 2nd input
source, I assign SSRC as 2 and so on..

To assign the SSRC, I use probe on "src" pad of "rtph264pay" element.
The code snippet for the probe is shown below:

static GstPadProbeReturn setssrc(GstPad *pad, GstPadProbeInfo *info,
gpointer user_data)
{
 GstBuffer *buffer = NULL;
 buffer = GST_PAD_PROBE_INFO_BUFFER(info);
 GstRTPBuffer rtpBuffer;
 memset(&rtpBuffer, 0, sizeof(GstRTPBuffer));
 if (buffer != NULL)
 {
  if (gst_rtp_buffer_map(buffer, (GstMapFlags)GST_MAP_READWRITE,
&rtpBuffer))
  {
   g_print("buffer mapped\n");
   gst_rtp_buffer_set_ssrc(&rtpBuffer, 222);
   gst_rtp_buffer_unmap(&rtpBuffer);
  }
  else
   g_print("buffer not mapped\n");
 }
 return GST_PAD_PROBE_OK;
}

This code sets SSRC only for some of the packets and the output at the
receiver side (by using gst_rtp_buffer_get_ssrc)) is as below:
-145555887
222
222
222
222
-145555887
-145555887
-145555887
-145555887

Can anyone please tell me where is the problem and how to resolve it?

Thanks,
Priyanka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190605/ba8e89bd/attachment.html>


More information about the gstreamer-devel mailing list