ccrtp-devel
[Top][All Lists]
Advanced

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

[Ccrtp-devel] problem while reducing the seding rate


From: Dinil Divakaran
Subject: [Ccrtp-devel] problem while reducing the seding rate
Date: Wed, 11 May 2005 14:43:04 +0530 (IST)


Hi all,

I was working on an example for transmitting an audio file using ccrtp (http://www.gnu.org/software/ccrtp/doc/refman/html/audiotx_8cpp-example.html)

The following lines are from the above example. In this code, packets are
sent and then thread sleeps for a time of 'PERIOD' milliseconds. I changed
the value of PERIOD to 100 (milliseconds) and found that even though the
program says that the packets are sent; the packets weren't actually sent.
'tcpdump' showed that only the first packet was sent; and thereafter only
RTCP packets were sent (with still lesser frequency). When I changed the
value of 'PERIOD' to 50, the packets were sent successfully.

Can anyone please tell me where have I gone wrong ?

--------------------------------------------------------------------------
                              .
                              .
                              .

        cout << "Transmitting " << PACKET_SIZE
             << " octects long packets "
             << "every " << PERIOD << " milliseconds..." << endl;

        unsigned char buffer[PACKET_SIZE];
        int count=PACKET_SIZE;

        // This will be useful for periodic execution
        TimerPort::setTimer(PERIOD);

        setCancel(cancelImmediate);
        // This is the main loop, where packets are transmitted.
        for( int i = 0 ; (!sendingfile || count > 0) ; i++ ){

            count = ::read(audioinput,buffer,PACKET_SIZE);
            if( count > 0 ){
                // send an RTP packet, providing timestamp,
                // payload type and payload.
                socket->putData(PACKET_SIZE * i, buffer, PACKET_SIZE);
            }
            cout << "." << flush;

            // Let's wait for the next cycle
            Thread::sleep(TimerPort::getTimer());
            TimerPort::incTimer(PERIOD);
        }
        cout << endl << "I have got no more data to send. " <<endl;

                              .
                              .
                              .
                              .
--------------------------------------------------------------------------

- Dinil





reply via email to

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