[Live-devel] propery way to reseting camera on frame timeout

Sadjad University najmeh.eghbal at sadjad.ac.ir
Sat Dec 7 04:14:18 PST 2019


hi,i am using live555 (testRTSPClient) inside my program to get frame from camera. sometime network connection may lost i want to resume capturing frame from camera. 

is 60000 millisecond good for timeout? 
beacause my network has some failure rapidly on some time and if they occur in one 600000 millisecond then the number of session to camera may be more than that it can be respond; 

i am using the code below for resetting connection.is it work? 

Boolean DummySink::continuePlaying() { 
envir().taskScheduler().unscheduleDelayedTask(watch_dog_timer_token); 
if (fSource == NULL) return False; 
// sanity check (should not happen)// Request the next frame of data from our input source. "afterGettingFrame() " will get called later, when it arrives: 
fSource->getNextFrame(fReceiveBuffer, DUMMY_SINK_RECEIVE_BUFFER_SIZE,afterGettingFrame, this,onSourceClosure, this); 
int64_t millesecond = 60000; 
int64_t microsecond_watch_dog_timer = 1000 * millesecond;watch_dog_timer_token = envir().taskScheduler().scheduleDelayedTask(microsecond_watch_dog_timer,(TaskFunc*)(DummySink::watch_dog_timer),this); 
return True; 
} 
void DmmySink::watch_dog_timer(void* clientData) 
{ 
DummySink* dummy_sink = (DummySink*)clientData;MyEnv * _env = dynamic_cast<MyEnv*(&dummy_sink->envir()); 
shutdownStream(_env->_client); 
//access the client to be shutdown// shutdownStream(void *clientData,int exitcode = 0) 
eventLoopWatchvariableVariable = -1; 
} 

Najmeh Eghbal, 
Assistant Professor, 
Department of Electrical EngineeringSadjad University of Technology 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20191207/ed41dcb6/attachment.htm>


More information about the live-devel mailing list