Re: A newbie question about receiver report

Federico Montesino Pouzols <[email protected]>
Newsgroups gmane.comp.gnu.ccrtp.devel
Message-ID <20051112131555.GA3826@paraguas>
Hi, after a quick look at the code, I think the problem is your main
loop exits when there are no packets in the reception queue. Suppose
your program starts and no packet has been receive before:

>         while(socket->isWaiting()) {
>              receive(socket);
>         }

And suppose a number of packets are available, but after processing
them the queue becomes empty. I would try an infinite loop like
"for(;;)".

On Sun, Nov 06, 2005 at 09:27:26AM +0800, ?? ???Z wrote:
> Hi:
>  I write a simple program to receive rtp packets from
> a ip cam(SNC-DF40N).  However, my program can't
> receive
>  packets continually.  Do I forget anythine esle?
> 
> Thanks for help.
> 
> Jeff
> 
> 
> my source: (If I use JRTPLIB, it can work fine)
> --------------------------------------------------------------------------
> #include <iostream>
> #include <cstdlib>     
> #include <ccrtp/rtp.h>
> 
> using namespace std;
> using namespace ost;
> 
> void receive(RTPSession *socket)
> {
>         int ts = socket->getFirstTimestamp();
>         const AppDataUnit* adu;
>         adu = socket->getData(ts);
>         if ( adu != NULL ) {
>                 cout<<"packet type:
> "<<adu->getType()<<endl;
>         }
>         delete adu;
> }
> int main()
> {
>         RTPSession *socket = new
> RTPSession(InetHostAddress("0.0.0.0"), 30000);
>        
> socket->addDestination(InetHostAddress("192.168.4.100"),
> 50000);
>         socket->startRunning();
>             
>         while(socket->isWaiting()) {
>              receive(socket);
>         }
>         
>         delete socket;
> }
> 
> 
> ___________________________________________________  ?????? Yahoo!???????r???? 7.0 beta?????M?W??????????????  http://messenger.yahoo.com.tw/beta.html
> 
> 
> _______________________________________________
> Ccrtp-devel mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/ccrtp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.