[Live-devel] Application crashed when stop streaming to Darwin streaming server

Sunrose Cheng sunrose at gmail.com
Tue Feb 21 17:17:41 PST 2006


Hi All:

I would like to stream live video (encoded from my webcam) to the
Darwinstreaming server, and I started from testMPEG4VideoToDarwin
project in
testprog. But there is one problem when trying to stop the project.

Here is the code I modified in testMPEG4VideoToDarwin.cpp



char ThreadFlag = 0;

int live_streamer_main(const char *program_name, const char *server_ip)

{

  TaskScheduler* scheduler = BasicTaskScheduler::createNew();

  env = BasicUsageEnvironment::createNew(*scheduler);

  DarwinInjector* injector = DarwinInjector::createNew(*env, programName);

  /* Create 'groupsocks' for RTP and RTCP here.*/

  videoSink = MPEG4ESVideoRTPSink::createNew(*env, &rtpGroupsockVideo, 96);

  play();

  awaitConfigInfo(videoSink);

  /* Create (and start) a 'RTCP instance' for this RTP sink here: */

  injector->addStream(videoSink, videoRTCP);

  injector->setDestination(dssNameOrAddress, remoteStreamName,

                                programName, "LIVE555 Streaming Media");



  env->taskScheduler().doEventLoop(&ThreadFlag);

  afterPlaying(NULL);

  return 0; // only to prevent compiler warning

}



void afterPlaying(void* clientData) {

  videoSink->stopPlaying();

  Medium::close(videoSource);

}



void play() {

  videofileSource

    = DeviceSource::createNew(*env,
*DeviceParameters::createNew(inputvideoFileName,10));

  videoES = videofileSource;

  videoSource = MPEG4VideoStreamFramer::createNew(*env, videoES);

  videoSink->startPlaying(*videoSource, afterPlaying, videoSink);

}



When I set the ThreadFlag as -1, the program run to the afterplaying(), and
crashed in the Medium::close(videoSource). I have traced the code and found
it crashed in destructor of StreamParser. Is there something I forgot to
stop? Please help me~



Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20060221/45bf452f/attachment.html


More information about the live-devel mailing list