Hi,

Thanks again, that's very helpful.

One remaining issue, the 'getRTPSinkandRTCP' method in returns *const*​ 
pointers, but the RTPSink member 'getTotalBitrate' is not a const method, so 
can't be called from these pointers.

Is there any reason these are const? I see the comment in the header about not 
starting or stopping from these pointers, which I guess could be the reason?

Thanks as ever.

Andy









Andy Hawkins


Senior Software
  Engineer
































Office:






+44 1635 35111








Email:






andy.hawk...@uniguest.com








Address:






64 Greenham Road, Newbury, Berkshire, RG14 7HX UK

















UNIGUEST.COM















From: live-devel <live-devel-boun...@us.live555.com> on behalf of Ross 
Finlayson <finlay...@live555.com>
Sent: 07 November 2023 18:35
To: LIVE555 Streaming Media - development & use <live-de...@us.live555.com>
Subject: Re: [Live-devel] Retrieving stats for ProxyServerMediaSession



> On Nov 7, 2023, at 2:57 AM, Andy Hawkins <andy.hawk...@uniguest.com> wrote:
>
> Ok, I'm now successfully iterating over the ClientConnections and 
> ClientSessions, how can I get the amount of data transmitted to each of these?

First, you don’t do anything with the “RTSPClientConnection” objects; those 
represent only the TCP connections that clients use to send RTSP commands.  
What you need are the “RTSPClientSession” objects.

If you haven’t already done so, you will need to subclass “RTSPClientSession”, 
then, in a member function of your subclass (because this code accesses 
‘protected’ member variables), do:
        for (unsigned i = 0; i < fNumStreamStates; ++i) {
                RTPSink const* rtpSink;
                RTCPInstance const* rtcpInstance; // not used

                getRTPSinkandRTCP(fStreamStates[i].streamToken, rtpSink, 
rtcpInstance);
                if (rtpSink != NULL) {
                        // There are several functions you can call on 
“rtpSink” to get data transmission stats:
                        //      packetCount(): the total number of RTP packets 
sent
                        //      octetCount(): the total number of ‘payload’ 
bytes sent - i.e., not including RTP headers
                        // Note that these two functions return 32-bit 
integers, so they will often wrap around

                        // You can also call:
                        //      getTotalBitrate() (see 
“liveMedia/include/RTPSink.hh”), which returns the total amount of data that 
was sent (including RTP
                        //              headers, but not IP and UDP headers) 
since the last time that function was called.  (This also returns the time that 
has
                        //              elapsed since then, so you can divide 
the count by the time to get a bitrate in bytes-per-second.)
                }
        }


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


_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to