|
1 /* |
|
2 * Copyright (c) 2006 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 MCESTREAMBUNDLE_H |
|
22 #define MCESTREAMBUNDLE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <mcedefs.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CMceMediaStream; |
|
32 class CMceSession; |
|
33 class RWriteStream; |
|
34 class CMceComStreamBundle; |
|
35 class MMceComSerializationContext; |
|
36 class CMceMediaSink; |
|
37 class MMceEndPointProxy; |
|
38 |
|
39 |
|
40 /** |
|
41 * Class for handling grouping of Mce streams (i.e. grouping of media lines). |
|
42 * |
|
43 * Can be used for example to synchronize audio and video streams. |
|
44 * |
|
45 * If streams are added to the bundle or removed from it after the bundle |
|
46 * has been added to the session, the session has to be updated with |
|
47 * CMceSEssion::UpdateL() function in order to complete the changes. |
|
48 * |
|
49 * @lib mceclient.lib |
|
50 */ |
|
51 class CMceStreamBundle: public CBase |
|
52 { |
|
53 public: // Bundle types |
|
54 |
|
55 enum TMceStreamBundleType |
|
56 { |
|
57 ELS, |
|
58 EFID |
|
59 }; |
|
60 |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 */ |
|
66 IMPORT_C static CMceStreamBundle* NewL( TMceStreamBundleType aType ); |
|
67 |
|
68 /** |
|
69 * Two-phased constructor. |
|
70 */ |
|
71 IMPORT_C static CMceStreamBundle* NewLC( TMceStreamBundleType aType ); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 IMPORT_C ~CMceStreamBundle(); |
|
77 |
|
78 public: |
|
79 |
|
80 /** |
|
81 * Type of the bundle |
|
82 * @param aParent the parent |
|
83 */ |
|
84 IMPORT_C TMceStreamBundleType Type() const; |
|
85 |
|
86 /** |
|
87 * Adds stream to the bundle. |
|
88 * @param aStream, stream to be added |
|
89 */ |
|
90 IMPORT_C void AddStreamL( CMceMediaStream& aStream ); |
|
91 |
|
92 /** |
|
93 * Removes stream from the bundle. |
|
94 * @param aStream, stream to be removed |
|
95 */ |
|
96 IMPORT_C void RemoveStreamL( CMceMediaStream& aStream ); |
|
97 |
|
98 /** |
|
99 * Returns the streams belonging to the bundle. |
|
100 * @return streams of the bundle. |
|
101 */ |
|
102 IMPORT_C const RPointerArray< CMceMediaStream >& Streams(); |
|
103 |
|
104 |
|
105 public: // from MMceComSerializable |
|
106 |
|
107 /** |
|
108 * Returns serialization id |
|
109 * @return serialization id |
|
110 */ |
|
111 TUint64 SerializationId() const; |
|
112 |
|
113 /** |
|
114 * Internalizes flat data |
|
115 * @param aReadStream read stream |
|
116 */ |
|
117 void InternalizeFlatL( RReadStream& aReadStream ); |
|
118 |
|
119 /** |
|
120 * Externalizes flat data |
|
121 * @param aWriteStream write stream |
|
122 */ |
|
123 void ExternalizeFlatL( RWriteStream& aWriteStream ); |
|
124 |
|
125 /** |
|
126 * Internalizes |
|
127 * @param aSerCtx context for serialization |
|
128 */ |
|
129 void InternalizeL( MMceComSerializationContext& aSerCtx ); |
|
130 |
|
131 /** |
|
132 * Externalizes |
|
133 * @param aSerCtx context for serialization |
|
134 */ |
|
135 void ExternalizeL( MMceComSerializationContext& aSerCtx ); |
|
136 |
|
137 public: |
|
138 |
|
139 /** |
|
140 * Initializes |
|
141 * @param aParent the parent |
|
142 */ |
|
143 void InitializeL( CMceSession& aParent ); |
|
144 |
|
145 /** |
|
146 * Called when bundle has beed added to session |
|
147 */ |
|
148 void AddedL(); |
|
149 |
|
150 |
|
151 private: //methods |
|
152 |
|
153 /** |
|
154 * C++ default constructor. |
|
155 */ |
|
156 CMceStreamBundle(); |
|
157 |
|
158 /** |
|
159 * second-phase constructor |
|
160 */ |
|
161 void ConstructL( TMceStreamBundleType aType ); |
|
162 |
|
163 void AddedSinkL( CMceMediaStream& aStream, |
|
164 CMceMediaSink*& aCurrentSink, |
|
165 MMceEndPointProxy*& aProxy ); |
|
166 |
|
167 |
|
168 protected: // NOT owned data |
|
169 |
|
170 /** |
|
171 * session |
|
172 */ |
|
173 CMceSession* iSession; |
|
174 |
|
175 protected://data |
|
176 |
|
177 /** |
|
178 * flat data container |
|
179 */ |
|
180 CMceComStreamBundle* iFlatData; |
|
181 |
|
182 private: // Data |
|
183 |
|
184 /** |
|
185 * Bundled streams, streams are not owned |
|
186 */ |
|
187 RPointerArray< CMceMediaStream > iStreams; |
|
188 |
|
189 RPointerArray< CMceMediaStream > iTempStreams; |
|
190 |
|
191 //for testing |
|
192 |
|
193 MCE_UNIT_TEST_DEFS |
|
194 |
|
195 }; |
|
196 |
|
197 #endif |