|
1 /* |
|
2 * Copyright (c) 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: See class definition below. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CTcMCEMultimediaAPIObserver_H__ |
|
21 #define __CTcMCEMultimediaAPIObserver_H__ |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <MCESessionObserver.h> |
|
27 #include <MceInSessionObserver.h> |
|
28 #include <MceStreamObserver.h> |
|
29 #include <MceRtpObserver.h> |
|
30 #include <mcetransactionobserver.h> |
|
31 #include <mceintransactionobserver.h> |
|
32 #include "CTcMCEReceiveQueue.h" |
|
33 |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CTcMCEContext; |
|
37 class CTcMCEReceived; |
|
38 class TMceTransactionDataContainer; |
|
39 |
|
40 // CLASS DEFINITION |
|
41 /** |
|
42 * CTcMCEMultimediaAPIObserver observes all events defined in |
|
43 * multimedia API. |
|
44 */ |
|
45 |
|
46 class CTcMCEMultimediaAPIObserver |
|
47 : public CBase, |
|
48 public MMceSessionObserver, |
|
49 public MMceInSessionObserver, |
|
50 public MMceStreamObserver, |
|
51 public MMceRtpObserver, |
|
52 public MMceTransactionObserver, |
|
53 public MMceInTransactionObserver |
|
54 { |
|
55 |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Static constructor. |
|
60 * |
|
61 * @param aContext Reference to test context object. |
|
62 * @return An initialized instance of this class. |
|
63 */ |
|
64 static CTcMCEMultimediaAPIObserver* NewL( CTcMCEContext& aContext ); |
|
65 |
|
66 /// Destructor |
|
67 ~CTcMCEMultimediaAPIObserver(); |
|
68 |
|
69 private: |
|
70 |
|
71 /** |
|
72 * Constructor. |
|
73 * |
|
74 * @param aContext Reference to test context object. |
|
75 */ |
|
76 CTcMCEMultimediaAPIObserver( CTcMCEContext& aContext ); |
|
77 |
|
78 /// Default constructor. Not implemented. |
|
79 CTcMCEMultimediaAPIObserver(); |
|
80 |
|
81 /// 2nd phase constructor |
|
82 void ConstructL(); |
|
83 |
|
84 public: // new functions |
|
85 |
|
86 /** |
|
87 * Returns the first item off the session receive queue (FIFO). |
|
88 * If no items are present, the function will wait for aTimeout seconds |
|
89 * and then try fetching again. |
|
90 * |
|
91 * @param aTimeOut Time in seconds waited for items to arrive. |
|
92 */ |
|
93 CTcMCEReceived& ReceivedSessionItemL( TInt aTimeout ); |
|
94 |
|
95 CTcMCEReceived& ReceivedUpdatedSessionItemL( TInt aTimeout ); |
|
96 |
|
97 /** |
|
98 * Returns the first item off the Stream receive queue (FIFO). |
|
99 * If no items are present, the function will wait for aTimeout seconds |
|
100 * and then try fetching again. |
|
101 * |
|
102 * @param aTimeOut Time in seconds waited for items to arrive. |
|
103 */ |
|
104 CTcMCEReceived& ReceivedStreamItemL( TInt aTimeout ); |
|
105 |
|
106 /** |
|
107 * Returns the first item off the RTP receive queue (FIFO). |
|
108 * If no items are present, the function will wait for aTimeout seconds |
|
109 * and then try fetching again. |
|
110 * |
|
111 * @param aTimeOut Time in seconds waited for items to arrive. |
|
112 */ |
|
113 CTcMCEReceived& ReceivedRTPItemL( TInt aTimeout ); |
|
114 |
|
115 |
|
116 public: // from MMceInSessionObserver |
|
117 |
|
118 void IncomingSession( |
|
119 CMceInSession* aSession, |
|
120 TMceTransactionDataContainer* aContainer ); |
|
121 void IncomingUpdate( |
|
122 CMceSession& aOrigSession, |
|
123 CMceInSession* aUpdatedSession, |
|
124 TMceTransactionDataContainer* aContainer ) ; |
|
125 |
|
126 public: // fron MMceSessionObserver |
|
127 |
|
128 void SessionStateChanged( |
|
129 CMceSession& aSession, |
|
130 TMceTransactionDataContainer* aContainer ); |
|
131 |
|
132 void SessionConnectionStateChanged( |
|
133 CMceSession& aSession, |
|
134 TBool aActive); |
|
135 |
|
136 void Failed( CMceSession& aSession, TInt aError ); |
|
137 |
|
138 void UpdateFailed( |
|
139 CMceSession& aSession, |
|
140 TMceTransactionDataContainer* aContainer ) ; |
|
141 |
|
142 public: // from MMceStreamObserver |
|
143 |
|
144 void StreamStateChanged( |
|
145 CMceMediaStream& aStream); |
|
146 |
|
147 void StreamStateChanged( |
|
148 CMceMediaStream& aStream, |
|
149 CMceMediaSink& aSink); |
|
150 |
|
151 void StreamStateChanged( |
|
152 CMceMediaStream& aStream, |
|
153 CMceMediaSource& aSource); |
|
154 |
|
155 public: // from MMceRtpObserver |
|
156 |
|
157 void SRReceived( |
|
158 CMceSession& aSession, |
|
159 CMceMediaStream& aStream); |
|
160 |
|
161 void RRReceived( |
|
162 CMceSession& aSession, |
|
163 CMceMediaStream& aStream); |
|
164 |
|
165 void InactivityTimeout( |
|
166 CMceMediaStream& aStream, |
|
167 CMceRtpSource& aSource); |
|
168 |
|
169 void SsrcAdded( |
|
170 CMceMediaStream& aStream, |
|
171 CMceRtpSource& aSource, |
|
172 TUint aSsrc ); |
|
173 |
|
174 void SsrcRemoved( |
|
175 CMceMediaStream& aStream, |
|
176 CMceRtpSource& aSource, |
|
177 TUint aSsrc ); |
|
178 |
|
179 public: // from MMceTransactionObserver |
|
180 |
|
181 void TransactionResponse( |
|
182 CMceSession& aSession, |
|
183 TMceTransactionId aTransactionId, |
|
184 TMceTransactionDataContainer* aContainer ); |
|
185 |
|
186 void TransactionFailed( |
|
187 CMceSession& aSession, |
|
188 TMceTransactionId aTransactionId, |
|
189 TInt aError ); |
|
190 |
|
191 public: // from MMceInTransactionObserver |
|
192 |
|
193 void IncomingRequest( |
|
194 const TDesC8& aMethod, |
|
195 CMceSession& aSession, |
|
196 TMceTransactionId aTransactionId, |
|
197 TMceTransactionDataContainer* aContainer ); |
|
198 |
|
199 private: // data |
|
200 |
|
201 /// Reference to the test context. Not owned. |
|
202 CTcMCEContext& iContext; |
|
203 |
|
204 CTcMCEReceiveQueue* iSessionQueue; |
|
205 CTcMCEReceiveQueue* iUpdatedSessionQueue; |
|
206 CTcMCEReceiveQueue* iStreamQueue; |
|
207 CTcMCEReceiveQueue* iRTPQueue; |
|
208 |
|
209 }; |
|
210 |
|
211 #endif // __CTcMCEMultimediaAPIObserver_H__ |