|
1 /* |
|
2 * Copyright (c) 2008 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: RTP observer for SVP |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SVPRTPOBSERVERREQUEST_H |
|
20 #define SVPRTPOBSERVERREQUEST_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "svptimerobserver.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CSVPSessionBase; |
|
28 class CMceSession; |
|
29 class CMceMediaStream; |
|
30 class CSVPTimer; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * CSVPRtpObserverRequest |
|
36 * |
|
37 */ |
|
38 class CSVPRtpObserverRequest : public CBase, public MSVPTimerObserver |
|
39 { |
|
40 public: // Data types |
|
41 |
|
42 // Enumeration to determine RTCP activitytype |
|
43 enum TReceivedRtcpPacket |
|
44 { |
|
45 ERtcpRrPacket = 0, |
|
46 ERtcpSrPacket = 1 |
|
47 }; |
|
48 |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CSVPRtpObserverRequest(); |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 */ |
|
59 static CSVPRtpObserverRequest* NewL( CSVPSessionBase& aSession ); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 static CSVPRtpObserverRequest* NewLC( CSVPSessionBase& aSession ); |
|
65 |
|
66 public: // New functions |
|
67 |
|
68 /** |
|
69 * Returns the SVP session associated to this request. |
|
70 * @since S60 v3.2 |
|
71 * @return CSVPSessionBase |
|
72 */ |
|
73 const CSVPSessionBase* SvpSession() const; |
|
74 |
|
75 /** |
|
76 * Returns the MCE session associated to this request. |
|
77 * @since S60 v3.2 |
|
78 * @return CMceSession |
|
79 */ |
|
80 const CMceSession* MceSession() const; |
|
81 |
|
82 /** |
|
83 * Called when RTCP RR or SR packet has been received. |
|
84 * @since S60 v3.2 |
|
85 * @aPacket RTCP packet type |
|
86 * @aSession MCE session |
|
87 * @aStream MCE media stream. |
|
88 */ |
|
89 void RtcpPacketReceived( TReceivedRtcpPacket aPacket, |
|
90 CMceSession& aSession, CMceMediaStream& aStream ); |
|
91 |
|
92 /** |
|
93 * Called when associated session's state has changed. |
|
94 * @since S60 3.2 |
|
95 */ |
|
96 void Reset(); |
|
97 |
|
98 |
|
99 public: // Functions from base classes |
|
100 |
|
101 // From MSVPTimerObserver |
|
102 void TimedOut( TInt aTimerId ); |
|
103 |
|
104 private: // New functions |
|
105 |
|
106 /** |
|
107 * Determines the RTCP timeout value based on the media stream and |
|
108 * it's associated codecs. Returns default value (35 seconds) if |
|
109 * error is encountered. |
|
110 * @since S60 v3.2 |
|
111 * @param aStream Stream from where to search the timeout value |
|
112 * @return TInt RTCP timeout value in milliseconds |
|
113 */ |
|
114 TInt DetermineTimeoutValue( CMceMediaStream& aStream ) const; |
|
115 |
|
116 /** |
|
117 * Returns ETrue if the associated session is currently in Hold state |
|
118 * @since S60 v3.2.3 |
|
119 * @return TBool value |
|
120 */ |
|
121 TBool IsSessionInHoldState(); |
|
122 |
|
123 private: // Consturctors |
|
124 |
|
125 /** |
|
126 * Constructor for performing 1st stage construction |
|
127 */ |
|
128 CSVPRtpObserverRequest( CSVPSessionBase& aSession ); |
|
129 |
|
130 /** |
|
131 * EPOC default constructor for performing 2nd stage construction |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 private: // Data |
|
136 |
|
137 /** |
|
138 * SVP session associated to this observing request |
|
139 * Not own |
|
140 */ |
|
141 CSVPSessionBase& iSession; |
|
142 |
|
143 /** |
|
144 * Timer for determining RTCP timeout. |
|
145 * Own |
|
146 */ |
|
147 CSVPTimer* iTimer; |
|
148 |
|
149 /** |
|
150 * Flag to indicate that 'disconnect' state has been informed. |
|
151 */ |
|
152 TBool iDisconnectSent; |
|
153 |
|
154 public: // For testing purposes |
|
155 friend class UT_CSVPRtpObserverRequest; |
|
156 }; |
|
157 |
|
158 #endif // SVPRTPOBSERVERREQUEST_H |
|
159 |