22 #define MUSENGMCEUTILS_H |
22 #define MUSENGMCEUTILS_H |
23 |
23 |
24 |
24 |
25 #include <mcemediastream.h> |
25 #include <mcemediastream.h> |
26 #include <mcemediasink.h> |
26 #include <mcemediasink.h> |
|
27 #include <mcemediasource.h> |
27 |
28 |
28 |
29 |
29 class CMceSession; |
30 class CMceSession; |
30 class CMceDisplaySink; |
31 class CMceDisplaySink; |
31 class CMceCameraSource; |
32 class CMceCameraSource; |
32 class CMceFileSource; |
33 class CMceFileSource; |
33 class CMceVideoStream; |
34 class CMceVideoStream; |
34 class CMceSpeakerSink; |
35 class CMceSpeakerSink; |
35 |
36 |
|
37 const TUint KMusEngNoAssociatedSourceType = KMaxTUint; |
36 |
38 |
37 /** |
39 /** |
38 * Static class including utility methods to locate and manipulate MCE |
40 * Static class including utility methods to locate and manipulate MCE |
39 * sessions, streams, sources and sinks |
41 * sessions, streams, sources and sinks |
40 * @lib musengine.lib |
42 * @lib musengine.lib |
91 static CMceVideoStream* GetRecordingStream( CMceSession& aSession ); |
101 static CMceVideoStream* GetRecordingStream( CMceSession& aSession ); |
92 |
102 |
93 /** |
103 /** |
94 * Gets handle to a media sink of spesified type contained by |
104 * Gets handle to a media sink of spesified type contained by |
95 * a mediastream. If there are several sink instances, first one is |
105 * a mediastream. If there are several sink instances, first one is |
96 * returned. Ownership is not transferred. |
106 * returned. If associated source type is defined, sink in stream having |
|
107 * the source is tried to be searched. If no such match, first matching |
|
108 * sink is returned. Ownership is not transferred. |
97 * |
109 * |
98 * @return Media sink of the spesified type. NULL if none exists |
110 * @return Media sink of the spesified type. NULL if none exists |
99 */ |
111 */ |
100 static CMceMediaSink* GetMediaSink( CMceMediaStream& aStream, |
112 static CMceMediaSink* GetMediaSink( |
101 TMceSinkType aType ); |
113 CMceMediaStream& aStream, |
|
114 TMceSinkType aType, |
|
115 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType ); |
102 |
116 |
103 /** |
117 /** |
104 * Gets handle to a media sink of spesified type contained by |
118 * Gets handle to a media sink of spesified type contained by |
105 * a mediastream. If there are several sink instances, first one is |
119 * a mediastream. If there are several sink instances, first one is |
106 * returned. Ownership is not transferred. |
120 * returned. If associated source type is defined, sink in stream having |
|
121 * the source is tried to be searched. If no such match, first matching |
|
122 * sink is returned. Ownership is not transferred. |
107 * |
123 * |
108 * @return Media sink of the spesified type. |
124 * @return Media sink of the spesified type. |
109 * @leave KErrNotFound if there is no sink of spesified type |
125 * @leave KErrNotFound if there is no sink of spesified type |
110 */ |
126 */ |
111 static CMceMediaSink* GetMediaSinkL( CMceMediaStream& aStream, |
127 static CMceMediaSink* GetMediaSinkL( |
112 TMceSinkType aType ); |
128 CMceMediaStream& aStream, |
|
129 TMceSinkType aType, |
|
130 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType ); |
113 |
131 |
114 /** |
132 /** |
115 * Gets handle to a media sink of spesified type contained by |
133 * Gets handle to a media sink of spesified type contained by |
116 * a session. If there are several sink instances, first one is |
134 * a session. If there are several sink instances, first one is |
117 * returned. Ownership is not transferred. |
135 * returned. If associated source type is defined, sink in stream having |
|
136 * the source is tried to be searched. If no such match, first matching |
|
137 * sink is returned. Ownership is not transferred. |
118 * |
138 * |
119 * @return Media sink of the spesified type. NULL if none exists |
139 * @return Media sink of the spesified type. NULL if none exists |
120 */ |
140 */ |
121 static CMceMediaSink* GetMediaSink( CMceSession& aSession, |
141 static CMceMediaSink* GetMediaSink( |
122 TMceSinkType aType ); |
142 CMceSession& aSession, |
|
143 TMceSinkType aType, |
|
144 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType, |
|
145 TBool aStrictMatch = EFalse ); |
123 |
146 |
124 /** |
147 /** |
125 * Gets handle to a media sink of spesified type contained by |
148 * Gets handle to a media sink of spesified type contained by |
126 * a session. If there are several sink instances, first one is |
149 * a session. If there are several sink instances, first one is |
127 * returned. Ownership is not transferred. |
150 * returned. If associated source type is defined, sink in stream having |
|
151 * the source is tried to be searched. If no such match, first matching |
|
152 * sink is returned. Ownership is not transferred. |
128 * |
153 * |
129 * @return Media sink of the spesified type. |
154 * @return Media sink of the spesified type. |
130 * @leave KErrNotFound if there is no sink of spesified type |
155 * @leave KErrNotFound if there is no sink of spesified type |
131 */ |
156 */ |
132 static CMceMediaSink* GetMediaSinkL( CMceSession& aSession, |
157 static CMceMediaSink* GetMediaSinkL( |
133 TMceSinkType aType ); |
158 CMceSession& aSession, |
|
159 TMceSinkType aType, |
|
160 TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType, |
|
161 TBool aStrictMatch = EFalse ); |
134 |
162 |
135 /** |
163 /** |
136 * Gets handle to a speaker sink contained by specified stream |
164 * Gets handle to a speaker sink contained by specified stream |
137 * or its' bound stream. Ownership is not transferred. |
165 * or its' bound stream. Ownership is not transferred. |
138 * |
166 * |
159 /** |
187 /** |
160 * Gets handle to a display sink. Ownership is not transferred. |
188 * Gets handle to a display sink. Ownership is not transferred. |
161 * |
189 * |
162 * @return Display sink, NULL if none exists |
190 * @return Display sink, NULL if none exists |
163 */ |
191 */ |
164 static CMceDisplaySink* GetDisplay( CMceSession& aSession ); |
192 static CMceDisplaySink* GetDisplay( CMceSession& aSession, |
|
193 TBool aPreferViewFinder = ETrue ); |
165 |
194 |
166 /** |
195 /** |
167 * Gets handle to a display sink. If there are several display |
196 * Gets handle to a display sink. If there are several display |
168 * sink instances, first one is returned. |
197 * sink instances view finder is preferred with default arguments. |
169 * Ownership is not transferred. |
198 * Ownership is not transferred. |
170 * |
199 * |
171 * @return Display sink |
200 * @return Display sink |
172 * @leave KErrNotFound if there is no display |
201 * @leave KErrNotFound if there is no display |
173 */ |
202 */ |
174 static CMceDisplaySink* GetDisplayL( CMceSession& aSession ); |
203 static CMceDisplaySink* GetDisplayL( CMceSession& aSession, |
175 |
204 TBool aPreferViewFinder = ETrue ); |
|
205 |
|
206 /** |
|
207 * Gets handle to a display sink. Ownership is not transferred. |
|
208 * |
|
209 * @return Display sink, NULL if none exists |
|
210 */ |
|
211 static CMceDisplaySink* GetReceivingDisplay( CMceSession& aSession ); |
|
212 |
|
213 /** |
|
214 * Gets handle to a receiving display sink. Ownership is not transferred. |
|
215 * |
|
216 * @return Display sink |
|
217 * @leave KErrNotFound if there is no display |
|
218 */ |
|
219 static CMceDisplaySink* GetReceivingDisplayL( CMceSession& aSession ); |
|
220 |
|
221 /** |
|
222 * Gets handle to a viewfinder display sink. Ownership is not transferred. |
|
223 * |
|
224 * @return Display sink |
|
225 * @leave KErrNotFound if there is no display |
|
226 */ |
|
227 static CMceDisplaySink* GetVfDisplay( CMceSession& aSession ); |
|
228 |
176 /** |
229 /** |
177 * Adds display sink to specified stream if one does not exist already. |
230 * Adds display sink to specified stream if one does not exist already. |
178 * Display rect is set in both cases to a specified one. |
231 * Display rect is set in both cases to a specified one. |
179 * Display is disabled by default. |
232 * Display is disabled by default. |
180 * |
233 * |