[Live-devel] Server shutdown

Mojtaba Hosseini MHosseini at newheights.com
Fri Jun 29 06:01:34 PDT 2007


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: live-devel-bounces at ns.live555.com on behalf of Luc Roels
Sent: Fri 6/29/2007 1:53 AM
To: live-devel at ns.live555.com
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3669 bytes
Desc: not available
Url : http://lists.live555.com/pipermail/live-devel/attachments/20070629/4f1b20be/attachment-0001.bin 


More information about the live-devel mailing list