williamr@2: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef RTCP_H williamr@2: #define RTCP_H williamr@2: williamr@2: #include williamr@2: williamr@2: /** @file williamr@2: williamr@2: RTCP is a protocol that only makes sense in the context of RTP, so williamr@2: the RTCP implementation is an extension of the RTP code, and most williamr@2: of the relevant classes are defined in rtp.h williamr@2: */ williamr@2: williamr@2: class TRtcpRRItem; williamr@2: class TRtcpRRPart; williamr@2: class TRtcpSRPart; williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @released williamr@2: williamr@2: A handle to an RR (Receiver Report) RTP packet. williamr@2: williamr@2: An instance of this class represents the reception report of one host williamr@2: about another host; it may have come from either a SR (Sender Report) or williamr@2: a RR (Receiver Report) packet, which may contain williamr@2: other RRs (Receiver Reports) as well. williamr@2: williamr@2: An object of this type is returned from a call to the RRtcpRRPart williamr@2: indexing operator and specifying the index of the required RR. williamr@2: williamr@2: Note that resources accessed thorugh this handle are owned by other objects williamr@2: and therefore has no Close() member function. williamr@2: williamr@2: @see RRtcpRRPart williamr@2: */ williamr@2: class RRtcpRRItem williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Default constructor. williamr@2: */ williamr@2: IMPORT_C RRtcpRRItem(); williamr@2: williamr@2: /** williamr@2: Gets the sender's SSRC, i.e. the sender's 32-bit numeric williamr@2: synchronisation source identifier. williamr@2: williamr@2: @return The sender's SSRC. williamr@2: */ williamr@2: IMPORT_C TUint SenderSSRC() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the number of packets lost. williamr@2: williamr@2: @return The number of packets lost. williamr@2: */ williamr@2: IMPORT_C TUint PacketsLost() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the SSRC related to this packet. williamr@2: williamr@2: @return The sender's SSRC. williamr@2: */ williamr@2: IMPORT_C TUint AboutSSRC() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the number of packets lost, in 256ths of the total number. williamr@2: williamr@2: @return The number of last packets, in 256ths of the total number. williamr@2: */ williamr@2: IMPORT_C TUint FractionLost() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the extended highest sequence number recieved. williamr@2: williamr@2: @return The extended highest sequence number. williamr@2: */ williamr@2: IMPORT_C TUint ExtendedHighestSequenceNumber() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the interarrival jitter value. williamr@2: williamr@2: @return The interarrival jitter value. williamr@2: williamr@2: */ williamr@2: IMPORT_C TUint InterarrivalJitter() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the time of the last received SR (Sender Report) williamr@2: williamr@2: @return The time of the last received SR. williamr@2: */ williamr@2: IMPORT_C TUint LastSRTimestamp() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the time between the receipt of the last SR (Sender Report) and williamr@2: the time when this packet was sent. williamr@2: williamr@2: @return The tme difference in 65,536ths of a second. williamr@2: */ williamr@2: IMPORT_C TUint DelaySinceLastSR() const; williamr@2: williamr@2: private: williamr@2: friend class RRtcpRRPart; williamr@2: TRtcpRRItem* iPtr; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @released williamr@2: williamr@2: An array containing the most recent RRs (Receiver Reports) from williamr@2: all hosts who are reporting on our send stream. williamr@2: williamr@2: An object of this type is returned by calling RRs() on a handle to williamr@2: an RTP session (an RRtpSession object). williamr@2: williamr@2: @see RRtpSession::RRs() williamr@2: */ williamr@2: class RRtcpRRPart williamr@2: { williamr@2: public: williamr@2: IMPORT_C RRtcpRRPart(TRtcpRRPart& aRR); williamr@2: /** williamr@2: Gets the number of Receiver Reports. williamr@2: williamr@2: @return The number fo receiver reports. williamr@2: */ williamr@2: IMPORT_C TInt Count() const; williamr@2: williamr@2: IMPORT_C TUint SenderSSRC() const; williamr@2: williamr@2: /** williamr@2: Gets a specific RR (Receiver Report) as identified by williamr@2: the specified index value. williamr@2: williamr@2: @param aIndex An index value identifying the specific RR. williamr@2: The index is relative to zero, i.e. zero implies williamr@2: the first RR report. williamr@2: The value must not be negative and must be less than williamr@2: the the value returned by Count(). williamr@2: williamr@2: @return A handle to the RR (Receiver Report). williamr@2: */ williamr@2: IMPORT_C RRtcpRRItem operator [](TInt aIndex) const; williamr@2: private: williamr@2: TRtcpRRPart& iRRPart; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @released williamr@2: williamr@2: A handle to a SR (Sender Report) packet. williamr@2: williamr@2: RRs (Receiver Reports) received as part of a SR (Sender Report) are classified williamr@2: with the RRs. The resources accessed through this handle are owned by williamr@2: the receive stream object, a RRtpReceiveStream instance, and therefore has no williamr@2: Close() member function. williamr@2: */ williamr@2: class RRtcpSRPart williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Default constructor. williamr@2: */ williamr@2: IMPORT_C RRtcpSRPart(TRtcpSRPart& aSr); williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the absolute time when this SR was sent, in TTime format. williamr@2: williamr@2: @return The time in NTP format. williamr@2: */ williamr@2: IMPORT_C void NTPTimestamp(TTime& aTime) const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the RTP time when this packet was sent. williamr@2: williamr@2: Note that RTP time is profile dependant and may have an arbitrary start williamr@2: time, but this is useful for tying the SR with the timestamps in the williamr@2: data stream williamr@2: williamr@2: @return The time when the packet was sent. williamr@2: */ williamr@2: IMPORT_C TUint RTPTimestamp() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the number of packets that have been sent. williamr@2: williamr@2: @return The number of packets. williamr@2: */ williamr@2: IMPORT_C TUint PacketCount() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the number of bytes that have been sent. williamr@2: williamr@2: @return The number of bytes sent. williamr@2: */ williamr@2: IMPORT_C TUint ByteCount() const; williamr@2: williamr@2: williamr@2: /** williamr@2: Gets the profile-specific extension. williamr@2: williamr@2: @return An un-modifiable descriptor reference to the extension data. williamr@2: */ williamr@2: IMPORT_C const TDesC8& Extension(); williamr@2: williamr@2: /** williamr@2: // added as Fix to Defect PDEF101761 williamr@2: Gets the timestamp when this SR was sent, in seconds and fraction williamr@2: williamr@2: @ return The time in Seconds and Fraction williamr@2: */ williamr@2: IMPORT_C void NTPTimestamp(TUint32& aSec,TUint32& aFrac) const; williamr@2: williamr@2: williamr@2: private: williamr@2: TRtcpSRPart& iSrPtr; williamr@2: }; williamr@2: williamr@2: #endif // RTCP_H