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