[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
回覆: Re: [Ccrtp-devel] A newbie question abou t receiver report
From: |
陳 祐凡 |
Subject: |
回覆: Re: [Ccrtp-devel] A newbie question abou t receiver report |
Date: |
Mon, 14 Nov 2005 10:53:28 +0800 (CST) |
Hi, after verify, isWaiting() is a blocking function.
Thus this while look is a infinite loop.
Thanks for your response.
Jeff
--- Federico Montesino Pouzols <address@hidden>
說:
>
> 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
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/ccrtp-devel
>
___________________________________________________ 郔陔唳 Yahoo!✽藻撈�r籵�� 7.0
betaㄛ轎愐鋒繚����¦斕湖ㄐ http://messenger.yahoo.com.tw/beta.html