17 |
17 |
18 |
18 |
19 #ifndef MUSHENGREVEIVESESSION_H |
19 #ifndef MUSHENGREVEIVESESSION_H |
20 #define MUSHENGREVEIVESESSION_H |
20 #define MUSHENGREVEIVESESSION_H |
21 |
21 |
22 |
22 // INCLUDES |
23 |
|
24 #include "musengmcesession.h" |
23 #include "musengmcesession.h" |
25 #include "musenguriparser.h" |
24 #include "musenguriparser.h" |
26 #include "musunittesting.h" |
25 #include "musunittesting.h" |
27 |
|
28 #include <mcemediasink.h> |
26 #include <mcemediasink.h> |
29 |
27 |
|
28 // FORWARD DECLARATIONS |
30 class MMusEngReceiveSessionObserver; |
29 class MMusEngReceiveSessionObserver; |
31 class CMceInSession; |
30 class CMceInSession; |
32 |
31 class CMusEngRemoteVideoPlayer; |
33 class CMusEngReceiveSession : public CMusEngMceSession |
32 |
|
33 |
|
34 class CMusEngReceiveSession : |
|
35 public CMusEngMceSession |
34 { |
36 { |
35 MUS_UNITTEST( UT_CMusEngMceSession ) |
37 MUS_UNITTEST( UT_CMusEngMceSession ) |
36 MUS_UNITTEST( UT_CMusEngReceiveSession ) |
38 MUS_UNITTEST( UT_CMusEngReceiveSession ) |
37 |
39 |
38 public: // Contructors and destructor |
40 public: // Contructors and destructor |
39 |
41 |
40 /** |
42 /** |
41 * Creates new MultimediaSharing Receive session. |
43 * Creates new MultimediaSharing Receive session. |
42 * |
|
43 * @param aRect UI drawing area. It is allowed handle from engine |
|
44 * @param aEngObserver Engine specific callbacks |
|
45 * @param aSessionObserver Session specific callbacks |
|
46 * @return CMusEngReceiveSession* New instanse of specified class |
44 * @return CMusEngReceiveSession* New instanse of specified class |
47 */ |
45 */ |
48 IMPORT_C static CMusEngReceiveSession* NewL( |
46 static CMusEngReceiveSession* NewL(); |
49 const TRect& aRect, |
47 |
50 MMusEngSessionObserver& aSessionObserver, |
|
51 MMusEngReceiveSessionObserver& aReceiveSessionObserver ); |
|
52 /** |
48 /** |
53 * Destructor |
49 * Destructor |
54 * |
50 * |
55 * @since S60 v3.2 |
51 * @since S60 v3.2 |
56 */ |
52 */ |
57 ~CMusEngReceiveSession(); |
53 ~CMusEngReceiveSession(); |
58 |
|
59 |
|
60 public: // API |
|
61 |
|
62 /** |
|
63 * Accept or deny processed invitation |
|
64 * |
|
65 * @param aAccept ETrue if session is to be accepted and EFalse if |
|
66 * to be rejected. |
|
67 */ |
|
68 IMPORT_C void AcceptInvitationL(const TBool& aAccept); |
|
69 |
54 |
70 |
55 public: // From MLcSession |
71 private: // Overrides function in CMusEngMceSession |
56 |
|
57 TLcSessionState LcSessionState() const; |
|
58 |
|
59 void EstablishLcSessionL(); |
|
60 |
|
61 void TerminateLcSessionL(); |
|
62 |
|
63 MLcVideoPlayer* RemoteVideoPlayer(); |
|
64 |
|
65 const TDesC& RemoteDisplayName(); |
|
66 |
|
67 protected: // Overrides function in CMusEngMceSession |
72 |
68 |
73 /** |
69 /** |
74 * The state of the session has changed. |
70 * The state of the session has changed. |
75 * |
71 * |
76 * @since S60 v3.2 |
72 * @since S60 v3.2 |
84 * Sets Multimediasharing specific video codec settings like keepalive |
80 * Sets Multimediasharing specific video codec settings like keepalive |
85 * timer. This functions gets called for every video codec in |
81 * timer. This functions gets called for every video codec in |
86 * session. This function overrides function in base class. |
82 * session. This function overrides function in base class. |
87 * Function calls also overridden version. |
83 * Function calls also overridden version. |
88 */ |
84 */ |
89 virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec ); |
85 virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, |
|
86 TMceSourceType aSourceType ); |
90 |
87 |
91 /** |
88 /** |
92 * Sets Multimediasharing specific audio codec settings like keepalive |
89 * Sets Multimediasharing specific audio codec settings like keepalive |
93 * timer. This functions gets called for every audio |
90 * timer. This functions gets called for every audio |
94 * codec in session. This function overrides function in base class. |
91 * codec in session. This function overrides function in base class. |
102 * Removes all the H.263 codecs if any AVC codecs found. Prefers |
99 * Removes all the H.263 codecs if any AVC codecs found. Prefers |
103 * non-interleaved AVC over single NAL AVC |
100 * non-interleaved AVC over single NAL AVC |
104 * @param aVideoStream |
101 * @param aVideoStream |
105 */ |
102 */ |
106 virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream ); |
103 virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream ); |
107 |
104 |
108 |
105 protected: // from MMceInSessionObserver |
109 private: // from MMceInSessionObserver |
106 // overrides the function in CMusEngMceSession |
110 // overrides the function in CMusEngMceSession |
|
111 |
107 |
112 /** |
108 /** |
113 * Incoming session invitation. The CMCEInSession is given to the |
109 * Incoming session invitation. The CMCEInSession is given to the |
114 * application as a callback. |
110 * application as a callback. |
115 * @param aSession, pointer to the incoming session. Ownership is |
111 * @param aSession, pointer to the incoming session. Ownership is |
136 CMceSession& aOrigSession, |
132 CMceSession& aOrigSession, |
137 CMceInSession* aUpdatedSession, |
133 CMceInSession* aUpdatedSession, |
138 TMceTransactionDataContainer* aContainer ); |
134 TMceTransactionDataContainer* aContainer ); |
139 |
135 |
140 |
136 |
141 private: // from MMceStreamObserver, |
137 protected: // from MMceStreamObserver, |
142 // overrides the function in CMusEngMceSession |
138 // overrides the function in CMusEngMceSession |
143 |
139 |
144 /** |
140 /** |
145 * The state of the stream has changed. |
141 * The state of the stream has changed. |
146 * |
142 * |
147 * @since S60 v3.2 |
143 * @since S60 v3.2 |
148 * @param aStream, the stream that uses the source. |
144 * @param aStream, the stream that uses the source. |
149 */ |
145 */ |
150 void StreamStateChanged( CMceMediaStream& aStream ); |
146 void StreamStateChanged( CMceMediaStream& aStream ); |
151 |
147 |
152 |
148 protected: // from MMceRtpObserver |
153 private: // CONSTRUCTORS |
149 |
154 |
150 void InactivityTimeout( CMceMediaStream& aStream, |
155 CMusEngReceiveSession( |
151 CMceRtpSource& aSource ); |
156 MMusEngSessionObserver& aSessionObserver, |
152 |
157 MMusEngReceiveSessionObserver& aReceiveSessionObserver, |
153 |
158 const TRect& aRect ); |
154 |
|
155 protected: // CONSTRUCTORS |
|
156 |
|
157 CMusEngReceiveSession(); |
159 |
158 |
160 void ConstructL(); |
159 void ConstructL(); |
161 |
160 |
162 private: // HELPERS |
161 protected: // HELPERS |
163 |
162 |
164 CMceInSession* InSession(); |
163 CMceInSession* InSession(); |
165 |
164 |
166 void PrepareToRequire100RelL( |
165 void PrepareToRequire100RelL( |
167 TMceTransactionDataContainer* aContainer); |
166 TMceTransactionDataContainer* aContainer ); |
168 |
167 |
169 void CompleteSessionStructureL(); |
168 virtual void CompleteSessionStructureL(); |
170 |
169 |
171 /** |
170 /** |
172 * Parse P-Asserted-Identity header. |
171 * Parse P-Asserted-Identity header. |
173 * Tries to fetch the telephone number from tel uri, |
172 * Tries to fetch the telephone number from tel uri, |
174 * if tel uri not found it suppose that telephone number |
173 * if tel uri not found it suppose that telephone number |
175 * is in sip url. |
174 * is in sip url. |
176 */ |
175 */ |
177 void ParseAssertedIdentity( |
176 void ParseAssertedIdentity( TMceTransactionDataContainer* aContainer ); |
178 TMceTransactionDataContainer* aContainer ); |
177 /* |
179 |
178 * Checks for buffering event happened & receiving already not started |
180 private: // DATA |
179 * If yes, start the RTP inactivity timer and indicate to observer |
181 |
180 * about videoplayer state change. |
182 MMusEngReceiveSessionObserver& iReceiveSessionObserver; |
181 * else will not do anything. Bascially ignores the event. |
|
182 */ |
|
183 void ReceivingStarted(); |
|
184 |
|
185 /** |
|
186 * Checks for receiving already started and display sink is enabled |
|
187 * If yes ETrue else otherwise. |
|
188 */ |
|
189 TBool IsDisplayActive(); |
|
190 |
|
191 protected: // DATA |
183 |
192 |
184 // Set to ETrue if CMceInSession::RingL has already been called |
193 // Set to ETrue if CMceInSession::RingL has already been called |
185 TBool iRingLCalled; |
194 TBool iRingLCalled; |
186 |
195 |
187 // identity of originator parsed form P-Asserted-Identity field |
196 // identity of originator parsed form P-Asserted-Identity field |
188 TBuf8<KMaxUriLength> iIdentity; |
197 TBuf8<KMaxUriLength> iIdentity; |
|
198 |
|
199 HBufC8* iOriginator; |
|
200 |
|
201 HBufC* iRemoteDisplayName; |
|
202 |
|
203 /// The remote video player implementing MLcVideoPlayer |
|
204 CMusEngRemoteVideoPlayer* iRemoteVideoPlayer; |
|
205 |
|
206 TUint32 iReceivingInactivityTimeout; |
|
207 |
|
208 TUint8 iKeepaliveTimer; |
|
209 |
|
210 private: |
|
211 /* Flag for whether receiving started. It will go EFalse |
|
212 * when RTP inactivity timeout happen. |
|
213 */ |
|
214 TBool iReceiving; |
|
215 /* Flag to indicate buffering event happened. This flag is for |
|
216 * optimization purpose since buffering event is the only place |
|
217 * we can be sure about some packets were received. |
|
218 */ |
|
219 TBool iBuffered; |
189 }; |
220 }; |
190 |
221 |
191 #endif |
222 #endif |
192 |
223 |