[Live-devel] Stopping an RTP stream safely/Deleting objects
Emile Semmes
emile.semmes at e6group.com
Mon Nov 14 18:02:38 PST 2011
Hi all,
I'm streaming an MPEG-2 TS file using code very similar to
testMPEG2TransportStreamer.cpp. In one of my use cases, I need to stop
the stream immediately instead of allowing it to complete. I'm doing
this currently by passing a watch variable to the
taskScheduler().doEventLoop() call and allowing another thread to set
that variable when I need to stop playback.
My question is what do I need to do after that to safely stop and delete
my related objects (UsageEnvironment, RTPSink, etc) if I leave the
doEventLoop() early? I'm assuming calling Medium::close() on the object
created by MPEG2TransportStreamFramer::createNew() is correct, but I'm
not sure what I should call to destroy the object created by
SimpleRTPSink::createNew(). The destructor is protected so delete is
forbidden.
Also, should I make a call to RTPSink::stopPlaying() and if so, when?
I'd like to reuse the RTPsink but give it different parameters on a
subsequent use.
Thanks,
Emile
--
--
Emile Semmes
Software Engineer
e6 Group, LLC
www.e6group.com
More information about the live-devel
mailing list