[Live-devel] ScheduleDelayedTask
Luc Roels
lroels at hotmail.com
Sun Sep 16 23:42:41 PDT 2007
Hi,
I am expiriencing a strange problem. I have written a video client capable of receiving up to 16 simultaneous video streams, decode and display them.
Here's a snippet from my reception routine... All very standard.
while(m_bSourceActive)
{
g_cWatchVariable = 0x00;
psData = &m_sTrack.sPostReadData;
if(psData->iWaiting==0x00) {
psData->iWaiting= 0x01;
psData->uiSize = 0;
m_sTrack.poSource->getNextFrame(psData->pucBuffer,psData->iMaxBufLen,HandlePostRead,(void*) psData,NULL,NULL);
}
// Create a task that will be called if no data is received for over 10 seconds
task = m_poTaskScheduler->scheduleDelayedTask( i64TimeOut, NoDataReceived, (void*)this );
// Stop the current thread of control from proceeding,
// but allows delayed tasks (and/or background I/O handling) to proceed.
// A 'g_cWatchVariable' != 0 resumes the program flow,
// so HandlePostRead should set g_cWatchVariable to nonzero
m_poTaskScheduler->doEventLoop(&g_cWatchVariable);
// Remove the task
m_poTaskScheduler->unscheduleDelayedTask( task );
....
}
The reception routine runs in a thread, so when decoding 16 video streams I have 16 simultaneous threads running. It all works fine for a while ( sometimes several hours ) but then occasionally I fall into the NoDataReceived callback, which would mean I have not received any data for over 10 seconds. However, if I point the camera at myself I see real time movement up to the moment that the callback is triggered, so there is no way I could have had no reception of data for more than 10 seconds. Any ideas what could be wrong? Is the scheduleDelayedTask malfunctioning under certain conditions ( heavy CPU load?? )
best regards,
Luc Roels
_________________________________________________________________
Ontwerp je eigen Space op het net en deel wat je lief is met je vrienden!
http://spaces.live.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20070916/1c32e6e9/attachment.html
More information about the live-devel
mailing list