linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] Rtp Header Extension


From: Diego Carvalho
Subject: Re: [Linphone-developers] Rtp Header Extension
Date: Mon, 3 Oct 2011 17:04:02 -0300

I wrote a patch to ignore the extension header. I just add six lines
in two files. The patch is:


diff --git a/include/ortp/rtp.h b/include/ortp/rtp.h
index 78351de..90a3875 100644
--- a/include/ortp/rtp.h
+++ b/include/ortp/rtp.h
@@ -55,6 +55,9 @@ typedef struct rtp_header
        uint32_t timestamp;
        uint32_t ssrc;
        uint32_t csrc[16];
+       uint16_t ext_profile;
+       uint16_t ext_length;
+       uint32_t hdr_ext[16];
 } rtp_header_t;


@@ -114,6 +117,7 @@ void rtp_add_csrc(mblk_t *mp ,uint32_t csrc);
 #define rtp_get_ssrc(mp)               (((rtp_header_t*)((mp)->b_rptr))->ssrc)
 #define rtp_get_cc(mp)         (((rtp_header_t*)((mp)->b_rptr))->cc)
 #define rtp_get_csrc(mp, idx)          
(((rtp_header_t*)((mp)->b_rptr))->csrc[idx])
+#define rtp_get_ext_length(mp) (((rtp_header_t*)((mp)->b_rptr))->ext_length)

 int rtp_get_payload(mblk_t *packet, unsigned char **start);

diff --git a/src/rtpsession.c b/src/rtpsession.c
index 39c4b43..e65c79c 100644
--- a/src/rtpsession.c
+++ b/src/rtpsession.c
@@ -1665,6 +1665,8 @@ void rtp_add_csrc(mblk_t *mp, uint32_t csrc)
 int rtp_get_payload(mblk_t *packet, unsigned char **start){
        unsigned char *tmp;
        int header_len=RTP_FIXED_HEADER_SIZE+(rtp_get_cc(packet)*4);
+       if (rtp_get_extbit(packet))
+               header_len+=4+rtp_get_ext_length(packet)*4;
        tmp=packet->b_rptr+header_len;
        if (tmp>packet->b_wptr){
                if (packet->b_cont!=NULL){



I haven't tested it yet because I could not build linphone on linux
but I'm sure that it will work because I had a similar problem on a
personal project. If somebody is able to test it I would appreciate.
BTW, how can I build linphone on linux (Ubuntu 10.04). Thanks.


2011/9/5 Simon Morlat <address@hidden>:
> Hi Diego,
>
> You are right, oRTP does not check the extension bit. We would greatly
> accept a patch for this.
>
> Simon
>
> On 02/09/2011 13:44, Diego Carvalho wrote:
>>
>> Hi all, in the RFC that defines the RTP protocol is defined an
>> extension to the normal header, called rtp header extension. It seems
>> that linphone (I'm using version 3.4.3, the latest) doesn't handle
>> packets with this extension properly. As it is used for individual
>> implementation, linphone should ignore this header. But if a packet
>> containing this extension reaches linphone it will not be able to
>> decode the video (I can see errors through the debug window). Probably
>> it's pointing to some data on the extension header "thinking" it is
>> pointing to the video data. Does anyone know anything about it?
>> Thanks.
>>
>> _______________________________________________
>> Linphone-developers mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/linphone-developers
>>
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]