[Live-devel] Crash on TaskScheduler DoEventLoop

Josep Aguilera jaguilera at a5security.com
Thu Dec 10 04:04:34 PST 2009


Hi Ross,

 

We implemented a code to obtain raw data from cameras IP via RTSP using Live
555.

In order to obtain it, we create a class which each time a new camera it is
connected

a new thread of the class is started. You can see the code below which is
working properly

where each time the function AfterReadingFrame is called a frame in the
variable m_FrameBuffer

is available.

 

The problem comes when we want to stop and restart the class. Then we assign
to the variable blockingValue a value

different to 0 and it crash the function 

 

env->taskScheduler().doEventLoop(&blockingValue);

 

with the following debug info as output

 

memmove(unsigned char * 0x00000000, unsigned char * 0x07e6db04, unsigned
long 1460) line 171

GRABADORA5! BufferedPacket::use(unsigned char *,unsigned int,unsigned int
&,unsigned int &,unsigned short &,unsigned int &,struct timeval &,unsigned
int &,unsigned int &) + 110 bytes

GRABADORA5! MultiFramedRTPSource::doGetNextFrame1(void) + 232 bytes

GRABADORA5! MultiFramedRTPSource::networkReadHandler(class
MultiFramedRTPSource *,int) + 577 bytes

GRABADORA5! BasicTaskScheduler::SingleStep(unsigned int) + 441 bytes

GRABADORA5! BasicTaskScheduler0::doEventLoop(char *) + 26 bytes

CRTSPCamera::ThreadFunc(void * 0x07e53840) line 376 + 39 bytes

GRABADORA5! const DelayQueue::`vftable' address 0x0069ed28

GRABADORA5! BasicTaskScheduler0::~BasicTaskScheduler0(void) + 47 bytes

 

I checked in the mailing lists and it seems that it is working well to
everybody! 

I also called a dummy function before the doEventLoop obtaining the same
crash.

 

Thank you in advance! 

 

 

 ---- Source Code --------------------------------------------

 

void CRTSP_PlayerDlg::dummyTask(void* pData) 

{

   // Call this again, after a brief delay:

   CRTSP_PlayerDlg *pDlg = (CRTSP_PlayerDlg*) pData;

   if(pDlg)

   {

                               int uSecsToDelay = 100000; // 100 ms

 
pDlg->env->taskScheduler().scheduleDelayedTask(uSecsToDelay,(TaskFunc*)dummy
Task, NULL);

   }

}

 

 

char blockingValue = 0;

 

UINT CRTSP_PlayerDlg::ThreadFunc(LPVOID pParam)

{

 

                CRTSP_PlayerDlg *pCaptureFrame = (CRTSP_PlayerDlg *)pParam;

 

                MediaSubsessionIterator
iter(*(pCaptureFrame->mediaSession));

                iter.reset();

                while ((subsession = iter.next()) != NULL)

                {

                                if( subsession->readSource() == NULL )
continue;

                               else

                               {

                                               unsigned flags = 0;

                                               if
(strcmp(subsession->mediumName(), "audio") == 0) 

                                               {

                                               } 

                                               else if
(strcmp(subsession->mediumName(), "video") == 0) 

                                               {

 
subsession->readSource()->getNextFrame(m_FrameBuffer,MAX_RTP_FRAME_SIZE,Afte
rReadingFrame,subsession,onSourceClosure,subsession);

                                               }

                               }

                }

 

//dummyTask(this);

                env->taskScheduler().doEventLoop(&blockingValue); 

 

return 1;

}

 

void CRTSP_PlayerDlg::AfterReadingFrame(void* clientData, unsigned
frameSize,

                                                unsigned
/*numTruncatedBytes*/,

                                                struct timeval
presentationTime,

                                                unsigned
/*durationInMicroseconds*/)

{                              

                MediaSubsession* bufferQueue = (MediaSubsession*)clientData;

                 ZeroMemory(m_FrameBuffer,frameSize);

                

 
bufferQueue->readSource()->getNextFrame(m_FrameBuffer,MAX_RTP_FRAME_SIZE,Aft
erReadingFrame,bufferQueue,onSourceClosure,bufferQueue);

}

 

 

Best Regards,

 

Josep Aguilera

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20091210/3bb86c15/attachment-0001.html>


More information about the live-devel mailing list