<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi,<BR>
<BR>
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. <BR>
<BR>
Here's a snippet from my reception routine... All very standard.<BR>
<BR><FONT color=#0000ff size=2>
while</FONT><FONT color=#000000 size=2>(</FONT><FONT color=#010001 size=2>m_bSourceActive</FONT><FONT size=2><FONT color=#000000>)</FONT><BR>
{ <BR>
</FONT><FONT color=#010001 size=2> g_cWatchVariable</FONT><FONT size=2> = 0x00;<BR></FONT><FONT size=2>
</FONT><FONT color=#010001 size=2></FONT> <BR>
<FONT color=#010001 size=2> psData</FONT><FONT size=2> = &</FONT><FONT color=#010001 size=2>m_sTrack</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>sPostReadData</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2> </FONT><BR>
<FONT color=#0000ff size=2> if</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>psData</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>iWaiting</FONT><FONT size=2>==0x00) { <BR>
</FONT><FONT color=#010001 size=2> psData</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>iWaiting</FONT><FONT size=2>= 0x01; <BR>
</FONT><FONT color=#010001 size=2> psData</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>uiSize</FONT><FONT size=2> = 0;<BR>
</FONT><FONT color=#010001 size=2> m_sTrack</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>poSource</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>getNextFrame</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>psData</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>pucBuffer</FONT><FONT size=2>,</FONT><FONT color=#010001 size=2>psData</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>iMaxBufLen</FONT><FONT size=2>,</FONT><FONT color=#010001 size=2>HandlePostRead</FONT><FONT size=2>,(</FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2>*)</FONT><FONT color=#010001 size=2> psData</FONT><FONT size=2>,</FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2>,</FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2>); <BR>
}<BR>
</FONT><FONT color=#008000 size=2> </FONT><BR>
<FONT color=#008000 size=2> // Create a task that will be called if no data is received for over 10 seconds<BR></FONT><FONT size=2>
</FONT><FONT color=#010001 size=2> task</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>m_poTaskScheduler</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>scheduleDelayedTask</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>i64TimeOut</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>NoDataReceived</FONT><FONT size=2>, (</FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2>*)</FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2> );<BR>
</FONT><FONT color=#008000 size=2></FONT> <BR>
<FONT color=#008000 size=2> // Stop the current thread of control from proceeding,<BR></FONT><FONT size=2>
</FONT><FONT color=#008000 size=2> // but allows delayed tasks (and/or background I/O handling) to proceed.<BR></FONT><FONT size=2>
</FONT><FONT color=#008000 size=2> // A 'g_cWatchVariable' != 0 resumes the program flow,<BR></FONT><FONT size=2>
</FONT><FONT color=#008000 size=2> // so HandlePostRead should set g_cWatchVariable to nonzero<BR></FONT><FONT size=2>
</FONT><FONT color=#010001 size=2> m_poTaskScheduler</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>doEventLoop</FONT><FONT size=2>(&</FONT><FONT color=#010001 size=2>g_cWatchVariable</FONT><FONT size=2>);<BR>
</FONT><FONT color=#008000 size=2> // Remove the task <BR></FONT><FONT size=2>
</FONT><FONT color=#010001 size=2> m_poTaskScheduler</FONT><FONT size=2>-></FONT><FONT color=#010001 size=2>unscheduleDelayedTask</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>task</FONT><FONT size=2> );</FONT><BR>
<FONT size=2> ....</FONT><BR>
<FONT size=2>}</FONT><BR>
<BR>
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?? ) <BR>
<BR>
best regards,<BR>
<BR>
Luc Roels<BR>
<FONT size=2></FONT> <BR>
<FONT size=2> <BR></FONT><br /><hr />Download nu gratis 30 super coole emoticons! <a href='http://www.messenger-emoticons.be/nl/ ' target='_new'>Meer plezier met Windows Live Messenger!</a></body>
</html>