[Live-devel] Infinit loop in DelayQue::synchronize on BasicTaskScheduler::createNew

Jeff Shanab jshanab at smartwire.com
Mon Nov 28 14:56:10 PST 2011


I think I was not clear.

I had a CRTSPClient that had a RTSPClient as a variable.

What I tried to do was inherit from both the RTSPClient and my IClient interface.

So I need to create the scheduler and environment before the ctor because of the basclass initializer needeing the env at time of ctor.
So I gave the class the two class static variables and they are guaranteed to initialize before the ctor runs.

It looks like this.....

namespace MVS
{


    TaskScheduler*      MVSRTSPClient::scheduler_  = BasicTaskScheduler::createNew();
    UsageEnvironment*   MVSRTSPClient::env_        = BasicUsageEnvironment::createNew(*scheduler_);

    const char* MVSRTSPClient::clientProtocolName = "RTSP";

    //boost::mutex MVSRTSPClient::handlerMutex_;

       MVSRTSPClient::MVSRTSPClient(CAMERA::stats* stats)
                                  :      IClient(),
                        RTSPClient(*env_, "rtspURL", 0, "MVSRTSPClient", 0),
                        durationSlop_(-1.0),
                        madeProgress_(False),
                        areAlreadyShuttingDown_(false),
                                         session_(NULL),
                        setupIter_(NULL),
                                         sessionTimerTask_(NULL),
                                         qosMeasurementTimerTask_(NULL),
                                         arrivalCheckTimerTask_(NULL),
                                         interPacketGapCheckTimerTask_(NULL),
                                         playContinuously_(False),
                                         syncStreams_(True),
                                         notifyOnPacketArrival_(True),
                                         interPacketGapMaxTime_(0),
                                         totNumPacketsReceived_(0),
                                         StreamName_("unnamed source")
       {

       }




From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: Monday, November 28, 2011 4:43 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Infinit loop in DelayQue::synchronize on BasicTaskScheduler::createNew

I am trying to use a subclass of RTSPClient and it has a static variable for the scheduler and environment

You don't need to do this.  Each subclass of "Medium" (which includes "RTSPClient") has a member function
            envir()
which returns its "UsageEnvironment".  And "UsageEnvironment" has a member function
            taskScheduler()
which returns its "TaskScheduler".

So you shouldn't need to add any fields for these.

Note that - each time you create a "TaskScheduler"/"UsageEnvironment" pair - you first create the "TaskScheduler"; then you create a "UsageEnvironment" that uses it.  (Note the numerous examples in "testProgs".)

Therefore, when deleting these objects, you should do so in reverse order:
            - First call "reclaim()" on the "UsageEnvironment" object
            - Then "delete" the "TaskScheduler" object.
            (Yes, this is rather ugly and inconsistent...)

    Ross.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111128/62c5890b/attachment-0001.html>


More information about the live-devel mailing list