|
1 /* |
|
2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef RtpRecvStream_H |
|
22 #define RtpRecvStream_H |
|
23 |
|
24 #include "rtpstream.h" // parent class |
|
25 #include "rtpsdes.h" |
|
26 #include "rtpstreamdef.h" |
|
27 |
|
28 /** |
|
29 * Derived class for RTP receive stream. |
|
30 * |
|
31 * @lib RtpService.dll |
|
32 */ |
|
33 class CRtpRecvStream : public CRtpStream |
|
34 { |
|
35 #if defined( _DEBUG ) && defined( RTP_UNIT_TEST ) |
|
36 //Friend class used for testing |
|
37 friend class CRtpUtRtpStream; |
|
38 friend class CRtpUtRtpSession; |
|
39 #endif |
|
40 public: |
|
41 static CRtpRecvStream* NewL( const TRtpPayloadType aPayloadType, |
|
42 const TRtpId aSessionID, |
|
43 const TRtpId aRcvStreamID, |
|
44 MRtpObserver** aRtpObserver, |
|
45 MRtcpObserver* aRtcpObserver, |
|
46 const TUint32* aProfileRTPTimeRates, |
|
47 MSsrcCheckCallback* aCallback ); |
|
48 ~CRtpRecvStream(); |
|
49 |
|
50 TInt RtpStreamUpdateParamL( TRtpPacketType pType, |
|
51 TRtpPacketStreamParam* aStreamParam ); |
|
52 |
|
53 void SetReceivedRTPPackets( TBool aFlag ); |
|
54 |
|
55 void RegisterRtpObserver(MRtpObserver* aRtpObserver); |
|
56 void UnRegisterRtpObserver(); |
|
57 |
|
58 |
|
59 TInt RtpStreamProcessRtpPacketL( CRtpPacket* aPktRcv, |
|
60 TBool aAssignStream ); |
|
61 |
|
62 TBool ReceivedRTPPackets() const; |
|
63 |
|
64 TInt GetRemoteStreamInfo( TRtpSdesParams& aSdes ); |
|
65 |
|
66 TRtpSSRC GetRemoteSSRC(); |
|
67 |
|
68 public: // from CRtpStream |
|
69 TInt ResetStreamStat(); |
|
70 TInt GetStreamStat( TRtpPeerStat& aStat ); |
|
71 TRtpRtcpEnum RtpStreamProcessRtcpReportSectionL( CRtpPacket* aPkt ); |
|
72 void RtpStreamCreateRtcpReportSection( CRtpPacket* aPkt ); |
|
73 |
|
74 |
|
75 public: |
|
76 CRtpSDES* iRemoteSDES; |
|
77 |
|
78 private: |
|
79 CRtpRecvStream( MSsrcCheckCallback* aCallback, |
|
80 const TRtpPayloadType aPayloadType, |
|
81 const TRtpId aSessionID, |
|
82 const TRtpId aRcvStreamID, |
|
83 MRtpObserver** aRtpObserver, |
|
84 MRtcpObserver* aRtcpObserver, |
|
85 const TUint32* aProfileRTPTimeRates ); |
|
86 void ConstructL(); |
|
87 |
|
88 void RtpStreamUpdateJitter( TRtpTimeStamp aCurrentTimeStamp ); |
|
89 void RtpStreamSyncInfoInit(); |
|
90 void RtpStreamJitterInit(); |
|
91 |
|
92 private: |
|
93 // flag to indicate if a packet was received since last RTCP packet |
|
94 TBool iFlagReceivedRTPPackets; |
|
95 |
|
96 TRtpTimeJitter iSyncJitter; |
|
97 |
|
98 // QoS statistics |
|
99 TUint32 iNumReceivedPackets; |
|
100 TUint32 iNumWrapAround; // number of wrap around for |
|
101 |
|
102 // backup of reported values for lost fraction calculation |
|
103 TUint32 iLastRR_numExpectedPackets; |
|
104 TUint32 iLastRR_numReceivedPackets; |
|
105 |
|
106 MRtpObserver** iRtpObserver; // RTP receive callback |
|
107 TRtpRecvHeader iHdr; // Header of received RTP packet |
|
108 TRtpHeaderExtension iHeaderExtension; // Header extension of RTP packet |
|
109 MSsrcCheckCallback* iCallback; // callback to CRtpSession |
|
110 TRtpSSRC iRemoteSSRC; |
|
111 private: |
|
112 #ifdef EUNIT_TESTING |
|
113 friend class UT_CRtpStream; |
|
114 friend class UT_CRtpSession; |
|
115 #endif |
|
116 |
|
117 }; |
|
118 |
|
119 |
|
120 #endif // RtpRecvStream_H |