How to obey the ptime-value in SDP-Answer for RTP-stream?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

A short update:
I've introduced a patch which seems to work OK for me. Any "ptime" attribute
in the remote SDP is now applied to the stream encoder. To have a good 30ms
payload (and other payloads), the media_cfg.audio_frame_ptime should be set
to 10. Using the default of 20 will give an unstable packet time (when using
null-audio device)

One comment...
While I was investigating, I got the feeling that the "ptime" is just
ignored. It is parsed from the SDP and stored, but it seems never been
applied. What IS applied is the more exotical "maxptime".
Is there a reason why "ptime" is ignored? Did I overlooked something?
I've introduced my patch at the same location as where the "maxptime" is
applied to the encoder settings.

The patch (applied on 1.5.5 release)

@session.c (pjmedia-tree ) pjmedia_stream_info_from_sdp(...) around line 530

    ...

    ...

    /* Get local fmtp for our decoder. */

    parse_fmtp(pool, local_m, si->fmt.pt, &si->param->setting.dec_fmtp);

+

+    /* Get the remote ptime for our encoder. */

+    attr = pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr,

+                          "ptime", NULL);

+    if (attr) {

+      pj_str_t tmp_val = attr->value;

+

+      pj_strltrim(&tmp_val);

+        si->param->setting.frm_per_pkt = (pj_uint8_t)(pj_strtoul(&tmp_val)
/ si->param->info.frm_ptime);

+

+        if ( si->param->setting.frm_per_pkt == 0 )

+        {

+            si->param->setting.frm_per_pkt = 1;

+        }

+    }



    /* Get remote maxptime for our encoder. */

    attr = pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr,

                          "maxptime", NULL);

    ...

    ...

With regards,
Eize
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20100915/144a6fe7/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux