|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSHENGMCEOUTSESSION_H |
|
20 #define MUSHENGMCEOUTSESSION_H |
|
21 |
|
22 // USER |
|
23 #include "musengmcesession.h" |
|
24 #include "musunittesting.h" |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MMusEngOutSessionObserver; |
|
29 class CMceStreamBundle; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * Class for handling MCE out sessions. Direct inherit classes are |
|
34 * CMusEngLiveSession and CMusEngClipSession. |
|
35 * |
|
36 * @lib musengine.lib |
|
37 */ |
|
38 class CMusEngMceOutSession : public CMusEngMceSession |
|
39 { |
|
40 MUS_UNITTEST( UT_CMusEngOutSession ) |
|
41 |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 ~CMusEngMceOutSession(); |
|
48 |
|
49 |
|
50 public: // NEW API FUNCTIONS |
|
51 |
|
52 /** |
|
53 * Sends invite to specified address. Session establishment is done in |
|
54 * pause mode meaning that no RTP will be sent to network as a |
|
55 * consequence of established session. PlayL() can be called any time |
|
56 * during session establishment or after that in order to allow |
|
57 * RTP sending. |
|
58 * @leave KErrAlreadyExists if session establishment is already |
|
59 * in progress |
|
60 */ |
|
61 IMPORT_C void InviteL( const TDesC& aRecipient ); |
|
62 |
|
63 /** |
|
64 * Cancels Invite. |
|
65 * @pre Invite is sent |
|
66 */ |
|
67 IMPORT_C void CancelInviteL( ); |
|
68 |
|
69 /** |
|
70 * If codecs supported by recipient are known e.g. because of OPTIONS |
|
71 * query, they can be communicated to engine via this function |
|
72 * @param aVideoCodecs Comma separated list of supported codecs |
|
73 */ |
|
74 IMPORT_C void SetSupportedVideoCodecListL( const TDesC& aVideoCodecs ); |
|
75 |
|
76 |
|
77 public: // VIRTUAL API |
|
78 |
|
79 /** |
|
80 * Resumes previously paused session. Exact behavior depends on |
|
81 * exact session type. |
|
82 */ |
|
83 virtual void PlayL() = 0; |
|
84 |
|
85 /** |
|
86 * Pauses session. Exact behavior depends on exact session type. |
|
87 */ |
|
88 virtual void PauseL() = 0; |
|
89 |
|
90 /** |
|
91 * Tells whether session is paused or not |
|
92 * @pre Call of InviteL has been completed |
|
93 */ |
|
94 virtual TBool IsPlayingL() = 0; |
|
95 |
|
96 |
|
97 protected: // Must be implemented in derived class |
|
98 |
|
99 /** |
|
100 * @param aLocalBundle All local streams are supposed to be added to |
|
101 * this bundle |
|
102 */ |
|
103 virtual void CompleteSessionStructureL( |
|
104 CMceStreamBundle& aLocalBundle ) = 0; |
|
105 |
|
106 |
|
107 protected: // May be overridden in derived classes |
|
108 |
|
109 /** |
|
110 * Calls EstablishL-function of class CMceOutSession with feature tag |
|
111 * in Accept-Contact header. Functions also adjusts stream and codec |
|
112 * settings by calling CMusEngMceSession::AdjustStreamsAndCodecsL. |
|
113 * Intention of the function is to provide subclasses means to set |
|
114 * preconditions to establishment, e.g. succesfull transcoding. |
|
115 */ |
|
116 virtual void EstablishSessionL(); |
|
117 |
|
118 |
|
119 protected: // helper function inherited from CMusEngMceSession |
|
120 |
|
121 /** |
|
122 * Function handling MCE session termination. |
|
123 */ |
|
124 void HandleTermination( TInt aStatusCode, const TDesC8& aReasonPhrase ); |
|
125 |
|
126 /** |
|
127 * Sets Multimediasharing specific video codec settings like video |
|
128 * payload types. This functions gets called for every video codec in |
|
129 * session. This function overrides function in base class and may |
|
130 * be further overridden. Function calls also overridden version. |
|
131 */ |
|
132 void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec ); |
|
133 |
|
134 /** |
|
135 * Sets Multimediasharing specific audio codec settings like audio and |
|
136 * video payload types. This functions gets called for every audio |
|
137 * codec in session. This function overrides function in base class and |
|
138 * may be further overridden. Function calls also overridden version. |
|
139 */ |
|
140 void AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ); |
|
141 |
|
142 |
|
143 protected: |
|
144 |
|
145 /** |
|
146 * Constructor |
|
147 */ |
|
148 CMusEngMceOutSession( const TRect& aRect, |
|
149 MMusEngSessionObserver& aSessionObserver, |
|
150 MMusEngOutSessionObserver& aOutSessionObserver ); |
|
151 |
|
152 /** |
|
153 * Second-phase constructor |
|
154 */ |
|
155 void ConstructL( TUint aSipProfileId ); |
|
156 |
|
157 |
|
158 private: |
|
159 |
|
160 /** |
|
161 * |
|
162 */ |
|
163 void CreateMceSessionStructureL(); |
|
164 |
|
165 /** |
|
166 * Add privacy sip header if call privacy is switched on else otherwise. |
|
167 */ |
|
168 void AddPrivacyHeaderL( CDesC8Array& aHeaders ); |
|
169 |
|
170 |
|
171 protected: // DATA |
|
172 |
|
173 /** |
|
174 * Callback reference to outsession observer interface. |
|
175 */ |
|
176 MMusEngOutSessionObserver& iOutSessionObserver; |
|
177 |
|
178 /** |
|
179 * ETrue if operator specific behavior is expected |
|
180 */ |
|
181 TBool iPrivate; |
|
182 |
|
183 /** |
|
184 * ETrue if private number is turn on |
|
185 */ |
|
186 TBool iPrivateNumber; |
|
187 |
|
188 |
|
189 protected: // DATA |
|
190 |
|
191 /** |
|
192 * Recipient of session to be constructed |
|
193 */ |
|
194 HBufC8* iRecipient; |
|
195 |
|
196 HBufC8* iVideoCodecList; |
|
197 |
|
198 |
|
199 private: |
|
200 |
|
201 MUS_UNITTEST ( UT_CMusEngOutSession ) |
|
202 |
|
203 }; |
|
204 #endif //MUSHENGMCESESSION_H |