[Live-devel] Accessing RR stats

Ross Finlayson finlayson at live555.com
Thu Jan 12 22:41:43 PST 2012


> Would I access the RTPTransmissionStatsDB in function RTSPServer::RTSPClientSession:noteLiveness() in RTSPServer.cpp?

No; that function is used only by the RTCP implementation (when it receives an incoming "RR" packet).  It's not a function that you would call (or modify) yourself.


> Alternatively, is there another (cleaner) way to do this without modifying core library code i.e. RTSPServer.cpp?

Yes.  Note that each "RTPTransmissionStatsDB" object (a 'database of RTP transmission stats') is for a particular "RTPSink" object (and accessed using "RTPSink::transmissionStatsDB()"); therefore, you access these stats by first accessing a "RTPSink" object.

Note that a "RTPSink" object is used for a particular server->client (sub)session - i.e., for a particular media substream (audio or video) of a particular server->client stream.  Therefore, you access a "RTPSink" object via a "RTSPServer::RTSPClientSession" object.  So, you need to do the following:
1/ Subclass "RTSPServer::RTSPClientSession".
2/ Subclass "RTSPServer" (only to redefine the "createNewClientSession()" virtual function to create objects of your new "RTSPServer::RTSPClientSession" subclass, rather than just the "RTSPServer::RTSPClientSession" base class (the default behavior)).
3/ In your "RTSPServer::RTSPClientSession" subclass - whenever you wish to access the transmission stats (e.g., you might choose to do this periodically, using a timer) - you would do so using code like the following:
      for (unsigned i = 0; i < fNumStreamStates; ++i) {
        (StreamState*)streamState = (StreamState*)fStreamStates[i].streamToken;
          // we can do this cast because we know that we are using "OnDemandServerMediaSubsession"s
        RTPTransmissionStatsDB& transmissionStatesDB = streamState->rtpSink()->transmissionStatsDB();
      }


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120112/6fc610aa/attachment.html>


More information about the live-devel mailing list