Assigning SSRC of RTP Packets dynamically

Marc Leeman marc.leeman at gmail.com
Wed Jun 5 08:16:32 UTC 2019


By doing this, you are breaking the RFC, IIRC, the SSRC should be random.

On Wed, 5 Jun 2019 at 06:11, priyanka kataria <priyanka.kataria86 at gmail.com>
wrote:

> 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
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



-- 
g. Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190605/b1bc534e/attachment.html>


More information about the gstreamer-devel mailing list