49
|
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 |
|
|
20 |
|
|
21 |
#ifndef CMCECOMMESSAGESTREAM_H
|
|
22 |
#define CMCECOMMESSAGESTREAM_H
|
|
23 |
|
|
24 |
#include <e32std.h>
|
|
25 |
#include "mcecommediastream.h"
|
|
26 |
#include <mcemessagestream.h>
|
|
27 |
|
|
28 |
|
|
29 |
class CMceComMessageCodec;
|
|
30 |
|
|
31 |
/**
|
|
32 |
*
|
|
33 |
*
|
|
34 |
* @lib
|
|
35 |
*/
|
|
36 |
class CMceComMessageStream : public CMceComMediaStream
|
|
37 |
{
|
|
38 |
|
|
39 |
public: // Constructors and destructor
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Constructor
|
|
43 |
*/
|
|
44 |
static CMceComMessageStream* NewL();
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Constructor
|
|
48 |
*/
|
|
49 |
static CMceComMessageStream* NewLC();
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Destructor.
|
|
53 |
*/
|
|
54 |
~CMceComMessageStream();
|
|
55 |
|
|
56 |
public: // Functions
|
|
57 |
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Removes codec from the stream.
|
|
61 |
* @param aCodec codec to be added to the stream.
|
|
62 |
* Ownership is transferred.
|
|
63 |
*/
|
|
64 |
void RemoveCodecL( CMceComCodec* aCodec );
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Clears list of codecs and deletes each codec in it.
|
|
68 |
*/
|
|
69 |
void DestroyCodecs();
|
|
70 |
/**
|
|
71 |
* Searches for codec matching with input codec instance or sdp name
|
|
72 |
* @param aCodec the search term
|
|
73 |
* @return matching codec or NULL if not found
|
|
74 |
*/
|
|
75 |
CMceComCodec* FindCodecL( CMceComCodec& aCodec );
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Adds codec to the stream.
|
|
79 |
* @param aCodec codec to be added to the stream.
|
|
80 |
* Ownership is transferred.
|
|
81 |
*/
|
|
82 |
void AddCodecL( CMceComCodec* aCodec);
|
|
83 |
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Returns the available codecs to the session.
|
|
87 |
* @return codecs available for the session.
|
|
88 |
*/
|
|
89 |
RPointerArray<CMceComMessageCodec>& Codecs();
|
|
90 |
void ReorderCodecs();
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Return pointer to codec from the list of codecs.
|
|
94 |
* aIndex index of codec to get.
|
|
95 |
*/
|
|
96 |
CMceComMessageCodec* CodecL( TInt aIndex ) const;
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Returns number of codecs in the stream.
|
|
100 |
*/
|
|
101 |
TInt CodecCount() const;
|
|
102 |
|
|
103 |
|
|
104 |
public: // from CMceComMediaStream
|
|
105 |
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Internalizes flat data
|
|
109 |
* @param aReadStream read stream
|
|
110 |
*/
|
|
111 |
void InternalizeFlatL( RReadStream& aReadStream );
|
|
112 |
|
|
113 |
/**
|
|
114 |
* Externalizes flat data
|
|
115 |
* @param aWriteStream write stream
|
|
116 |
*/
|
|
117 |
void ExternalizeFlatL( RWriteStream& aWriteStream );
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Internalizes
|
|
121 |
* @param aReadStream read stream
|
|
122 |
*/
|
|
123 |
void InternalizeL( MMceComSerializationContext& aSerCtx );
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Externalizes
|
|
127 |
* @param aWriteStream write stream
|
|
128 |
*/
|
|
129 |
void ExternalizeL( MMceComSerializationContext& aSerCtx );
|
|
130 |
|
|
131 |
|
|
132 |
public://from CMceComMediaStream
|
|
133 |
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Initializes
|
|
137 |
* @param aParent the parent
|
|
138 |
*/
|
|
139 |
void InitializeL( CMceComSession& aParent );
|
|
140 |
|
|
141 |
/**
|
|
142 |
* Updates
|
|
143 |
* @param aStream new stream
|
|
144 |
*/
|
|
145 |
void UpdateL( CMceComMediaStream& aStream );
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Clones
|
|
149 |
*/
|
|
150 |
CMceComMediaStream* CloneL();
|
|
151 |
|
|
152 |
|
|
153 |
#ifdef MCE_COMMON_SERVER_SIDE
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Synchronizes stream's codecs
|
|
157 |
* @param aRoleAnswerer is answerer
|
|
158 |
*/
|
|
159 |
void SynchronizeL( TBool aRoleAnswerer );
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Update default codec to reflect current negotiation
|
|
163 |
*/
|
|
164 |
void UpdateDefaultCodecL();
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Prepares stream for offer/answer
|
|
168 |
*/
|
|
169 |
void PrepareL();
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Return mcc stream type
|
|
173 |
* @return mcc stream type
|
|
174 |
*/
|
|
175 |
TInt MccStreamType() const;
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Return mcc link type
|
|
179 |
* @return mcc link type
|
|
180 |
*/
|
|
181 |
TInt MccLinkType() const;
|
|
182 |
|
|
183 |
|
|
184 |
#endif//MCE_COMMON_SERVER_SIDE
|
|
185 |
|
|
186 |
public:
|
|
187 |
TBool iUseMsrpPathAttrForHostAddrAndPort;
|
|
188 |
CMceMessageStream::TConnSetup iConnSetup;
|
|
189 |
TBool iMsrpConnUsage;
|
|
190 |
|
|
191 |
protected: // Functions
|
|
192 |
|
|
193 |
/**
|
|
194 |
* Constructor
|
|
195 |
*/
|
|
196 |
CMceComMessageStream();
|
|
197 |
|
|
198 |
|
|
199 |
/**
|
|
200 |
* second-phase constructor
|
|
201 |
*/
|
|
202 |
void ConstructL();
|
|
203 |
|
|
204 |
/**
|
|
205 |
* second-phase copy constructor
|
|
206 |
*/
|
|
207 |
void ConstructL( CMceComMessageStream& aStream );
|
|
208 |
|
|
209 |
|
|
210 |
protected: // Owned data
|
|
211 |
|
|
212 |
/**
|
|
213 |
* codecs
|
|
214 |
*/
|
|
215 |
//The data path will not be handled in MCC for message type streams
|
|
216 |
RPointerArray<CMceComMessageCodec> iCodecs;
|
|
217 |
|
|
218 |
};
|
|
219 |
|
|
220 |
|
|
221 |
|
|
222 |
#endif
|