linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] rtp_session_recv_with_ts and buffer length


From: Nicholas J Humfrey
Subject: Re: [Linphone-developers] rtp_session_recv_with_ts and buffer length
Date: Thu, 23 Feb 2006 00:56:25 +0000


Yes - I was incrementing by 160 each time. The reason I didn't know what size buffer I needed was because I have been writing a perl module, which uses oRTP. So I wanted to be able to write:

my $data = $rtp->recv_with_ts( $timestamp );

For the time being I have just added a $bytes parameter to indicate the desired number of bytes:

my $data = $rtp->recv_with_ts( $timestamp, $bytes );


I have just released the first version of the perl module:

http://search.cpan.org/dist/Net-RTP/

I will continue working on it to implement some of the lower level oRTP API too, as I have described in the README file. It will include a Net::RTP::Packet package, to receive packets rtp_session_recvm_with_ts() style.


Using perl to do RTP does indeed seem a little odd - my main intention was to use it for testing and debugging. However I have written a little perl script called rtpsendbeeps.pl - which I have had multicasting beeps to VLC and QuickTime.


nick.


On 20 Feb 2006, at 11:58, Simon Morlat wrote:

Hi,

Are you incrementing the timestamp by 160 each time ?
If you want to get the exact buffer for the packet, you can use the
rtp_session_recvm_with_ts(). It returns you the rtp packet:

while(1){       
        mblk_t *mp=rtp_session_recvm_with_ts(session, ts);
        if (mp!=NULL){
                //the rtp header is between mp->b_rptr and mp->b_wptr
//the rtp payload is between mp->b_cont->b_rptr and mp->b_cont- >b_wptr
                mblk_t *payload=mp->b_cont;
                int len=payload->b_wptr-payload->b_rptr;
                output_to_sound_device(payload->b_rptr,len);
        }
        ts+=160;
}

Simon

Le Jeudi 16 Février 2006 23:25, Nicholas J Humfrey a écrit :
Hi,

I have been calling rtp_session_recv_with_ts (with scheduling and
blocking mode turned on) with a buffer bigger than I am actually
expecting data for.  eg (passing a 1024 byte buffer, when expecting
160 PCMU bytes back).

I was expecting to only get enough data for the timestamp I was
asking for, but instead it seems to be giving me more data than I was
expecting and then later getting confused that it doesn't have enough
data for me and dropping out.

Is this a bug or a feature?  I was hoping to only have to think about
timestamps and like oRTP work out how much data there is available
for that timestamp....


Thanks,

nick.



_______________________________________________
Linphone-developers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/linphone-developers





reply via email to

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