<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<blockquote type="cite">
<pre style="white-space: pre-wrap; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">>><i> Btw, what is the correct sequence of closing the RTSP server and other classes from live555.
</i>
The easiest way is just to call:
exit(0);
However, if (for some reason) you want to keep the process around, even after you've destroyed the server, you can do so by:
- Calling "Medium::close()" on all of your 'source', 'sink', and 'RTCPInstance' objects.
- Calling "Medium::close()" on your RTSP server
- Deleting your 'Groupsock' objects.
- Calling env->reclaim();
- Doing delete scheduler;</pre>
</blockquote>
I need the process to stay alive after I'm done with streaming, so I
cannot call exit(0)<br>
<br>
I do closing like this. Signal done flag. Call stop playing on
Sinks. Close sources, sinks, RTCPInstance objects etc.<br>
<br>
I get an access violation error when closing VideoSink
(m_pRtpVideoSink).<br>
The error is in method "void FramedSource::stopGettingFrames()" when
calling "doStopGettingFrames<b>()</b>". Why could this be happening?<br>
<br>
m_pUsageEnv->taskScheduler().doEventLoop( &m_doneFlag ); //
does not return<br>
<br>
// Close everything<br>
//<br>
if(m_pRtpVideoSink != NULL)<br>
{<br>
m_pRtpVideoSink->stopPlaying(); <br>
}<br>
if(m_pRtpAudioSink != NULL)<br>
{<br>
m_pRtpAudioSink->stopPlaying();<br>
}<br>
<br>
Medium::close( m_pH264FramedSource );<br>
Medium::close( m_pAacFrameedSource );<br>
<br>
Medium::close( m_pRtpVideoSink );<br>
Medium::close( m_pRtpAudioSink );<br>
<br>
Medium::close(rtcp);<br>
Medium::close(rtcpAudio);<br>
<br>
Medium::close(rtspServer);<br>
<br>
rtpVideoGroupsock->removeAllDestinations();<br>
rtcpVideoGroupsock->removeAllDestinations();<br>
delete rtpVideoGroupsock;<br>
delete rtcpVideoGroupsock;<br>
<br>
rtpAudioGroupsock->removeAllDestinations();<br>
rtcpAudioGroupsock->removeAllDestinations();<br>
delete rtpAudioGroupsock;<br>
delete rtcpAudioGroupsock;<br>
<br>
m_pUsageEnv->reclaim();<br>
<br>
delete scheduler;<br>
<br>
</body>
</html>