ptime information set in a codec is not automatically added in the SDP offer

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

 



Sorry, there is a typo, it should be "... To add attribute 'ptime' in
the SDP, I don't think you can use codec's frm_ptime ....".

Regards,
nanang


On Thu, Oct 23, 2008 at 8:29 PM, Nanang Izzuddin <nanang at pjsip.org> wrote:
> Hi,
>
> AFAIK, SDP attribute 'ptime' is rather debatable, since it will affect
> all the codecs in the media block while each codec may have different
> preference value of ptime (e.g: high bandwidth codecs may be better to
> use smaller ptime than low bandwidth codecs to avoid RTP packet size
> exceeding MTU, another 'bad' example: iLBC want ptime=30ms while other
> codec may not support 30ms). Along with some other reasons (e.g:
> negotiation complexity), I think by now it is not so urgent to use SDP
> attribute 'ptime'.
>
> To add attribute 'ptime' in the SDP, I don't think you cannot use
> codec's frm_ptime, since frm_ptime is decoder frame time (not packet
> time), while attribute ptime in the SDP refers to packet time (one or
> more frames), CMIIW. Perhaps you can use pjsua config
> 'media_cfg.ptime' (or default codec setting 'enc_ptime' while this may
> have different values among the codecs).
>
> Moreover, just FYI, pjmedia should be able to parse and decode
> multiple frames per packet, so without specifying 'ptime' attribute in
> the SDP, there should be no problem in the decoding direction.
>
> Regards,
> nanang
>
>
> On Thu, Oct 23, 2008 at 4:01 PM, Javier Rodriguez
> <javier.rodriguez at genaker.net> wrote:
>> Hi,
>>
>> It seems that the ptime information that is set in a codec is not added to
>> the SDP offer (endpoint#pjmedia_endpt_create_sdp()). I guess this can be
>> done by retrieving the ptime information from codec_param.info.frm_ptime .
>>
>> Best regards,
>> javier
>>
>> Index: pjproject/pjmedia/src/pjmedia/endpoint.c
>> ===================================================================
>> --- pjproject/pjmedia/src/pjmedia/endpoint.c    (revision 2351)
>> +++ pjproject/pjmedia/src/pjmedia/endpoint.c    (working copy)
>> @@ -373,7 +376,7 @@
>>
>>        pjmedia_codec_info *codec_info;
>>        pjmedia_sdp_rtpmap rtpmap;
>> -       char tmp_param[3];
>> +       char tmp_param[4];
>>        pjmedia_sdp_attr *attr;
>>        pjmedia_codec_param codec_param;
>>        pj_str_t *fmt;
>> @@ -474,9 +477,24 @@
>>            attr->name = pj_str("fmtp");
>>            attr->value = pj_strdup3(pool, buf);
>>            m->attr[m->attr_count++] = attr;
>> +
>> +
>>        }
>> +               //PJPATCH: Add ptime and maxptime to the endpt capabilities,
>> it feels like this should be aquired from the coded impl. TBI
>> +               attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
>> +               attr->name = pj_str("ptime");
>> +
>> +
>> pj_ansi_sprintf(tmp_param,"%d",(int)codec_param.info.frm_ptime);
>> +               attr->value = pj_strdup3(pool, tmp_param);
>> +           m->attr[m->attr_count++] = attr;
>> +
>> +               attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
>> +               attr->name = pj_str("maxptime");
>> +           attr->value = pj_strdup3(pool, "400");
>> +           m->attr[m->attr_count++] = attr;
>>     }
>>
>> +
>>     /* Add sendrecv attribute. */
>>     attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
>>     attr->name = STR_SENDRECV;
>>
>>
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>>
>> pjsip mailing list
>> pjsip at lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>
>>
>



[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