epoc32/include/mw/rtcp.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/rtcp.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // 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
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef RTCP_H
    17 #define RTCP_H
    18 
    19 #include <e32std.h>
    20 
    21 /** @file
    22 
    23 RTCP is a protocol that only makes sense in the context of RTP, so
    24 the RTCP implementation is an extension of the RTP code, and most
    25 of the relevant classes are defined in rtp.h
    26 */
    27 
    28 class TRtcpRRItem;
    29 class TRtcpRRPart;
    30 class TRtcpSRPart;
    31 
    32 /**
    33 @publishedPartner
    34 @released
    35 
    36 A handle to an RR (Receiver Report) RTP packet.
    37 
    38 An instance of this class represents the reception report of one host
    39 about another host; it may have come from either a SR (Sender Report) or
    40 a RR (Receiver Report) packet, which may contain
    41 other RRs (Receiver Reports) as well.
    42 
    43 An object of this type is returned from a call to the RRtcpRRPart
    44 indexing operator and specifying the index of the required RR.
    45 
    46 Note that resources accessed thorugh this handle are owned by other objects
    47 and therefore has no Close() member function.
    48 
    49 @see RRtcpRRPart
    50 */
    51 class RRtcpRRItem 
    52 	{
    53 public:
    54     /**
    55     Default constructor.
    56     */
    57 	IMPORT_C RRtcpRRItem();
    58 
    59     /**
    60     Gets the sender's SSRC, i.e. the sender's 32-bit numeric
    61     synchronisation source identifier.
    62     
    63     @return The sender's SSRC.
    64     */
    65 	IMPORT_C TUint SenderSSRC() const;
    66 
    67 
    68     /**
    69     Gets the number of packets lost.
    70     
    71     @return The number of packets lost.
    72     */
    73 	IMPORT_C TUint PacketsLost() const;
    74 
    75 
    76 	/** 
    77 	Gets the SSRC related to this packet.
    78 	
    79 	@return The sender's SSRC.
    80 	*/
    81 	IMPORT_C TUint AboutSSRC() const;
    82 
    83 
    84 	/**
    85 	Gets the number of packets lost, in 256ths of the total number.
    86 	
    87 	@return The number of last packets, in 256ths of the total number.
    88 	*/
    89 	IMPORT_C TUint FractionLost() const;
    90 
    91 
    92 	/**
    93 	Gets the extended highest sequence number recieved.
    94 	
    95 	@return The extended highest sequence number.
    96 	*/
    97 	IMPORT_C TUint ExtendedHighestSequenceNumber() const;
    98      
    99      
   100 	/**
   101 	Gets the interarrival jitter value.
   102 	
   103 	@return The interarrival jitter value.
   104 
   105 	*/
   106 	IMPORT_C TUint InterarrivalJitter() const;
   107 
   108 
   109 	/**
   110 	Gets the time of the last received SR (Sender Report)
   111 	
   112 	@return The time of the last received SR.
   113 	*/
   114 	IMPORT_C TUint LastSRTimestamp() const;
   115 
   116 
   117 	/**
   118     Gets the time between the receipt of the last SR (Sender Report) and 
   119   	the time when this packet was sent.
   120   	
   121   	@return The tme difference in 65,536ths of a second. 
   122 	*/
   123 	IMPORT_C TUint DelaySinceLastSR() const;
   124 
   125 private:
   126 	friend class RRtcpRRPart;
   127 	TRtcpRRItem* iPtr;
   128 	};
   129 
   130 /**
   131 @publishedPartner
   132 @released
   133 
   134 An array containing the most recent RRs (Receiver Reports) from
   135 all hosts who are reporting on our send stream.
   136 
   137 An object of this type is returned by calling RRs() on a handle to
   138 an RTP session (an RRtpSession object).
   139 
   140 @see RRtpSession::RRs()
   141 */	
   142 class RRtcpRRPart
   143 	{
   144 public:
   145 	IMPORT_C RRtcpRRPart(TRtcpRRPart& aRR);
   146  	/**
   147 	Gets the number of Receiver Reports.
   148 	
   149 	@return The number fo receiver reports.
   150 	*/
   151 	IMPORT_C TInt Count() const;
   152 
   153 	IMPORT_C TUint SenderSSRC() const;
   154 
   155 	/**
   156 	Gets a specific RR (Receiver Report) as identified by
   157 	the specified index value.
   158 	
   159 	@param aIndex An index value identifying the specific RR.
   160 	              The index is relative to zero, i.e. zero implies
   161 	              the first RR report.
   162 	              The value must not be negative and must be less than
   163 	              the the value returned by Count().
   164 	
   165 	@return A handle to the RR (Receiver Report).
   166 	*/
   167 	IMPORT_C RRtcpRRItem operator [](TInt aIndex) const;
   168 private:
   169 	TRtcpRRPart&		iRRPart;
   170 	};
   171 
   172 /**
   173 @publishedPartner
   174 @released
   175 
   176 A handle to a SR (Sender Report) packet.
   177 
   178 RRs (Receiver Reports) received as part of a SR (Sender Report) are classified
   179 with the RRs. The resources accessed through this handle are owned by 
   180 the receive stream object, a RRtpReceiveStream instance, and therefore has no
   181 Close() member function.
   182 */
   183 class RRtcpSRPart
   184 	{
   185  public:
   186     /**
   187     Default constructor.
   188     */
   189 	IMPORT_C RRtcpSRPart(TRtcpSRPart& aSr);
   190 
   191 
   192 	/**
   193 	Gets the absolute time when this SR was sent, in TTime format.
   194 	
   195 	@return The time in NTP format. 
   196 	*/
   197 	IMPORT_C void NTPTimestamp(TTime& aTime) const;
   198 
   199 
   200 	/**
   201 	Gets the RTP time when this packet was sent.
   202 	
   203 	Note that RTP time is profile dependant and may have an arbitrary start
   204 	time, but this is useful for tying the SR with the timestamps in the
   205 	data stream 
   206 	
   207 	@return The time when the packet was sent.
   208 	*/
   209 	IMPORT_C TUint RTPTimestamp() const;
   210 
   211 
   212 	/**
   213 	Gets the number of packets that have been sent.
   214 	
   215 	@return The number of packets.
   216     */
   217 	IMPORT_C TUint PacketCount() const;
   218 
   219 
   220 	/**
   221 	Gets the number of bytes that have been sent.
   222 	
   223 	@return The number of bytes sent.
   224 	*/
   225 	IMPORT_C TUint ByteCount() const;
   226 
   227 
   228 	/**
   229 	Gets the profile-specific extension.
   230 	
   231 	@return An un-modifiable descriptor reference to the extension data.
   232 	*/
   233 	IMPORT_C const TDesC8& Extension();
   234 	
   235 	/**
   236 	// added as Fix to Defect PDEF101761  
   237 	Gets the timestamp when this SR was sent, in seconds and fraction
   238 	
   239 	@ return The time in Seconds  and Fraction
   240 	*/
   241 	IMPORT_C void NTPTimestamp(TUint32& aSec,TUint32& aFrac) const;
   242 
   243 
   244 private:
   245 	TRtcpSRPart& iSrPtr;
   246 	};
   247 
   248 #endif // RTCP_H