Hi Luc,
  The RTSP server is probably one level higher from the RTP streaming server 
I've created but this is how I end the RTP session:
(I think I have this code in the VideoLiveMediaRtpSocket.cpp of my tutorial)

//variables dynamically allocated, initialized and used when streaming:
char mEventLoopController = 0;
RTPSink          *mVideoSenderSink;   //my H264 RTP Sink
MediaSource      *mVideoSenderSource; //my H264 Framed Source
Port             *mRtpPort;           //port for RTP
Port             *mRtcpPort;          //port for RTCP
Groupsock        *mRtpGroupsock;      //socket for RTP
Groupsock        *mRtcpGroupsock;     //socket for RTCP
RTCPInstance*     mRtcpInstance;
UsageEnvironment *mEnv; 
TaskScheduler    *mScheduler;

//line below runs in its own thread of execution
void ThreadExecute()
{
   mEnv->taskScheduler().doEventLoop(&mEventLoopController); 
}

//Stop function called by user or a signal (like Ctrl-C) to end session
void Stop()
{
   //set this variable to non-zero to allow doEventLoop to return
   //you may have to introduce a dummy delayed task to ensure doEventLoop 
return (see FAQ)
   mEventLoopController = 0xFF;
   //also stop the thread by calling pthread_join() on the thread mentioned 
above
   mVideoSenderSink->stopPlaying();
   Medium::close(mVideoSenderSource);
   Medium::close(mVideoSenderSink);
   Medium::close(mRtcpInstance);         //I had problem with this call on 
server side, client side can call this with no problem though

   delete mScheduler;
   mEnv->reclaim();
   delete mRtpPort;
   delete mRtcpPort;
   delete mRtpGroupsock;
   delete mRtcpGroupsock;
}


-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Luc Roels
Sent: Fri 6/29/2007 1:53 AM
To: [EMAIL PROTECTED]
Subject: [Live-devel] Server shutdown
 

Hi Ross,
 
One more question, what is the proper way to shutdown the LIVE555 media server. 
The demo source just enters an 
endless loop, and if the program is forced to exit you get lots of memory 
leaks. Could you enlight me with the proper
shutdown procedure?
_________________________________________________________________
Ontdek Windows Live Hotmail, het ultieme online mailprogramma!
http://get.live.com/mail/overview

<<winmail.dat>>

_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to