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