[Live-devel] Multiple RTSP sessions...

Keith Gurganus kgurganus at 650dialup.com
Mon Mar 22 10:14:01 PST 2004


Ross,
 
>> I'd like to implement multiple rtsp sessions within a single application
>> instance.  I've used openRTSP for a single instance but what would I need to
>> change for multiple instances?  I assume there are classes than can be
>> shared.  Can someone give me some pointers on what I would need to change?
> 
> Keith,
> 
> Just to be clear - are you talking about implementing multiple RTSP
> *client* sessions within your application?  If so, yes, you can do this -
> but note that you must use a separate "RTSPClient" object for each.  (The
> current "RTSPClient" implementation contains session-specific state that
> prevents a single "RTSPClient" object from being used to stream more than
> once session.)

OK.  I think I have done this but evidently I am missing something.  Here is
what I have done:

- Merged openRTSP and playCommon into one file called playURL.cpp and .h
- Made a class to wrap all of playCommon.
- For the callbacks that pass 'clientData', they now pass a ptr of the
playURL object.  Put all 'global' data into the class as members.
- Added a class function called 'idle' which calls the scheduler->SingeStep.
This is called per instance in a timer loop in my application.
- Made all the command like parameters class members of playURL.  I set them
in my application before calling a new class member 'OpenURL'.  It sets the
member variables that were set in 'main' via the command line.
- If playURL returns good, it then calls playURL->startPlayingStreams and
then the timer for the idle in my application calls playURL->Idle.
- Added a class function called 'CloseURL' which tears down the streams.  I
removed 'exit' and just return to the app and destroy the class and it does
not call idle for it anymore.
- I am outputing to a QuickTime file with a unique name which I pass in.

This technique works well for one stream.  However, if a make another
instance of my class PlayURL with another RTSP file, it does not fail to
connect, but it does not create a valid QuickTime file.  So, what I am
trying to do is create multiple instances of my class PlayURL and have each
output a QuickTime file.

Hope is not too confusing ;)

Thanks,

- Keith







More information about the live-devel mailing list