|
1 /* |
|
2 * Copyright (c) 2002-2004 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: RTCP receiver for Mcc RTP Datasource |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MCCRTCPRECEIVER_H |
|
22 #define MCCRTCPRECEIVER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <mmf/common/mmfcontrollerframework.h> |
|
27 #include "rtpdef.h" |
|
28 #include "rtpapi.h" |
|
29 #include "mmccevents.h" |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // MACROS |
|
34 |
|
35 // DATA TYPES |
|
36 |
|
37 // FUNCTION PROTOTYPES |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class MAsyncEventHandler; |
|
41 class MMccResources; |
|
42 class CMccRtpManager; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 /** |
|
47 * RTCP receiver for Mcc RTP Datasource. |
|
48 * @lib MccRtpSourceSink.dll |
|
49 * @since Series 60 3.0 |
|
50 */ |
|
51 #ifdef EKA2 |
|
52 NONSHARABLE_CLASS( CMccRtcpReceiver ) : public CBase, |
|
53 public MRtcpObserver, |
|
54 public MNonRTPDataObserver |
|
55 #else |
|
56 class CMccRtcpReceiver : public CBase, |
|
57 public MRtcpObserver, |
|
58 public MNonRTPDataObserver |
|
59 #endif |
|
60 { |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 */ |
|
66 static CMccRtcpReceiver* NewL( CMccRtpManager* aRtpManager, |
|
67 MAsyncEventHandler& aEventHandler, |
|
68 MMccResources& aMccResources, |
|
69 CRtpAPI& aRtpAPI ); |
|
70 |
|
71 /** |
|
72 * Destructor |
|
73 */ |
|
74 virtual ~CMccRtcpReceiver(); |
|
75 |
|
76 public: // New functions |
|
77 |
|
78 TInt HandleReceiving( TRtpId aSessionId, TBool aEnableReceiving ); |
|
79 |
|
80 public: // Functions from base classes |
|
81 |
|
82 /** |
|
83 * From MRtcpObserver |
|
84 */ |
|
85 void SdesReceived( TRtpSSRC aSSRC, const TRtpSdesParams& aParams ); |
|
86 |
|
87 /** |
|
88 * From MRtcpObserver |
|
89 */ |
|
90 void ByeReceived( TRtpId aStreamId, TRtpSSRC aSSRC, |
|
91 const TDesC8& aReason ); |
|
92 |
|
93 /** |
|
94 * From MRtcpObserver |
|
95 */ |
|
96 void AppReceived( TRtpId aStreamId, TRtpSSRC aSSRC, |
|
97 const TRtcpApp& aApp ); |
|
98 |
|
99 /** |
|
100 * From MRtcpObserver |
|
101 */ |
|
102 void SrReceived( TRtpId aStreamId, TRtpSSRC aSSRC, |
|
103 const TTimeStamps& aTimeStamps ); |
|
104 |
|
105 /** |
|
106 * From MRtcpObserver |
|
107 */ |
|
108 void RrReceived( TRtpId aStreamId, TRtpSSRC aSSRC ); |
|
109 |
|
110 /** |
|
111 * From MNonRTPDataObserver |
|
112 */ |
|
113 void NonRTPDataReceived( TUint aPort, TBool aRTPPort, |
|
114 const TDesC8& aNonRTPData ); |
|
115 |
|
116 protected: // New functions |
|
117 |
|
118 protected: // Functions from base classes |
|
119 |
|
120 private: // Constructors |
|
121 |
|
122 /** |
|
123 * C++ default constructor. |
|
124 */ |
|
125 CMccRtcpReceiver( CMccRtpManager* aRtpManager, |
|
126 MAsyncEventHandler& aEventHandler, |
|
127 MMccResources& aMccResources, |
|
128 CRtpAPI& aRtpAPI ); |
|
129 |
|
130 /** |
|
131 * By default Symbian 2nd phase constructor is private. |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 private: // New functions |
|
136 |
|
137 TInt SendRtcpEventWithPacketDataToClient( TMccRtcpPacketType aPacketType, |
|
138 const TRtpSSRC& aSSRC, |
|
139 const TDesC8& aData, |
|
140 TBool aResolveEndpointBySsrc ); |
|
141 |
|
142 void SendRtcpEventToClient( TMccRtcpPacketType aPacketType, |
|
143 TBool aResolveEndpointBySsrc, |
|
144 TBool aResolveEndpointByRtpStreamId ); |
|
145 |
|
146 void DoSdesMemberCopy( TPtrC8& aDestination, |
|
147 TUint8** aCurrentPtr, |
|
148 TInt& aCurrentPos, |
|
149 TDes8& aRtcpPacketData, |
|
150 const TDesC8& aSource ); |
|
151 |
|
152 void ClearEventData(); |
|
153 |
|
154 |
|
155 public: // Data |
|
156 |
|
157 protected: // Data |
|
158 |
|
159 private: // Data |
|
160 |
|
161 // Stream ID for the RTCP |
|
162 TRtpId iStream; |
|
163 |
|
164 // Callback for RTCP |
|
165 MAsyncEventHandler& iEventHandler; |
|
166 |
|
167 MMccResources& iMccResources; |
|
168 |
|
169 // RTP stack API reference |
|
170 CRtpAPI& iRtpAPI; |
|
171 |
|
172 TRtpPeerStat iPeerstat; |
|
173 |
|
174 // Used for storing data of received event temporarily (one at a time) |
|
175 TMccRtcpEventData iEventData; |
|
176 |
|
177 TBool iEnableRtcp; |
|
178 |
|
179 TRtpId iSessionId; |
|
180 |
|
181 CMccRtpManager* iRtpManager; |
|
182 |
|
183 |
|
184 public: // Friend classes |
|
185 |
|
186 protected: // Friend classes |
|
187 |
|
188 private: // Friend classes |
|
189 }; |
|
190 |
|
191 #endif // MCCRTCPRECEIVER_H |
|
192 |
|
193 // End of File |