|
1 /* |
|
2 * Copyright (c) 2004-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: Media interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MVTENGMEDIA_H |
|
21 #define MVTENGMEDIA_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MVtEngLocalVideoDisplay; |
|
28 class CFbsBitmap; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Media interface for defining data types for media transport and |
|
34 * presentation of it locally as well methods for obtaining current |
|
35 * configuration. |
|
36 * |
|
37 * @lib videoteleng.lib |
|
38 * @since Series 60 2.6 |
|
39 */ |
|
40 class MVtEngMedia |
|
41 { |
|
42 public: // New functions. |
|
43 |
|
44 enum TMediaType |
|
45 { |
|
46 EMediaAudio = (1 << 0 ), |
|
47 EMediaVideo = ( 1 << 1 ), |
|
48 EMediaAudioPreparing = ( 1 << 2 ), |
|
49 EMediaVideoPreparing = ( 1 << 3 ), |
|
50 // Status of audio channel, applicable only for outgoing audio. |
|
51 EMediaAudioChannelOpen = ( 1 << 4 ), |
|
52 // Status of video channel, applicable only for outgoing video. |
|
53 EMediaVideoChannelOpen = ( 1 << 5 ) |
|
54 }; |
|
55 |
|
56 /** |
|
57 * ESourceCapsPrimaryCamera |
|
58 * primary camera can be selected. |
|
59 * ESourceCapsSecondaryCamera |
|
60 * secondary camera can be selected. |
|
61 * ESourceCapsStillImage |
|
62 * still image can be selected. |
|
63 */ |
|
64 enum TSourceCapsFlags |
|
65 { |
|
66 ESourceCapsPrimaryCamera = ( 1 << 0 ), |
|
67 ESourceCapsSecondaryCamera = ( 1 << 1 ), |
|
68 ESourceCapsStillImage = ( 1 << 2 ) |
|
69 }; |
|
70 |
|
71 /** |
|
72 * EMediaOutgoing |
|
73 * outbound media |
|
74 * EMediaIncoming |
|
75 * inbound media |
|
76 */ |
|
77 enum TMediaDirection |
|
78 { |
|
79 EMediaOutgoing, |
|
80 EMediaIncoming |
|
81 }; |
|
82 |
|
83 /** |
|
84 * EMediaNone |
|
85 * No media source selected. |
|
86 * EMediaCamera |
|
87 * Camera selected |
|
88 * EMediaCameraPri |
|
89 * Primary camera selected. |
|
90 * Camera is inwards |
|
91 * EMediaCameraSec |
|
92 * Secondary camera selected. |
|
93 * Camera is outwards |
|
94 * EMediaStillImage |
|
95 * Still image as source. |
|
96 * EMediaVideoStream |
|
97 * Video stream selected. |
|
98 */ |
|
99 enum TMediaSource |
|
100 { |
|
101 EMediaNone, |
|
102 EMediaCamera, |
|
103 EMediaCameraPri, |
|
104 EMediaCameraSec, |
|
105 EMediaStillImage, |
|
106 EMediaVideoStream, |
|
107 EMediaShare |
|
108 }; |
|
109 |
|
110 /** |
|
111 * EPrimaryCamera |
|
112 * Primary camera is inwards faced. |
|
113 * ESecondaryCamera |
|
114 * Camera is facing outwards. |
|
115 */ |
|
116 enum TCameraId |
|
117 { |
|
118 EPrimaryCamera, |
|
119 ESecondaryCamera |
|
120 }; |
|
121 |
|
122 /** |
|
123 * Camera information (zoom mainly). |
|
124 */ |
|
125 struct TCameraInfo |
|
126 { |
|
127 TInt iMinZoom; |
|
128 TInt iMaxZoom; |
|
129 TInt iMaxDigitalZoom; |
|
130 TInt iMajorZoomStepCount; |
|
131 }; |
|
132 |
|
133 /** |
|
134 * |
|
135 * Video quality enumeration. |
|
136 * |
|
137 * EVideoQualityUndefined video quality has not been set |
|
138 * yet. |
|
139 * EVideoQualityDetail means slow frame rate, good image |
|
140 * quality.. |
|
141 * EVideoQualityNormal smoother video with somewhat lower |
|
142 * image quality than EVideoQualityDetail. |
|
143 * EVideoQualityMotion the smoothest video with the worst |
|
144 * image quality. |
|
145 */ |
|
146 enum TVideoQuality |
|
147 { |
|
148 EVideoQualityUndefined, |
|
149 EVideoQualityDetail, |
|
150 EVideoQualityNormal, |
|
151 EVideoQualityMotion |
|
152 }; |
|
153 |
|
154 /** |
|
155 * Enumerates object sharing state. |
|
156 * |
|
157 * ENotAbleToShare Is not able to share any objects (engine in wrong |
|
158 * state) |
|
159 * ENotSharing Is not sharing anything |
|
160 * EInitializingShareImage Initializing still image sharing. |
|
161 * ESharingImage Is sharing image |
|
162 * ESharingVideoClip Is sharing video clip |
|
163 */ |
|
164 enum TShareObjectState |
|
165 { |
|
166 ENotAbleToShare, |
|
167 ENotSharing, |
|
168 EInitializingShareImage, |
|
169 EInitializingShareVideoClip, |
|
170 ESharingImage, |
|
171 ESharingVideoClip |
|
172 }; |
|
173 |
|
174 /** |
|
175 * Defines layout (screen orientation) used by |
|
176 * Video Telephone application per active camera. |
|
177 * Each camera has one of the following values: |
|
178 * |
|
179 * EOrientationLandscape Layout is always landscape. |
|
180 * EOrientationPortrait Layout is always portrait. |
|
181 * EOrientationObeyLayoutSwitch Obey layout in specific device mode. |
|
182 */ |
|
183 enum TCameraOrientation |
|
184 { |
|
185 EOrientationLandscape, |
|
186 EOrientationPortrait, |
|
187 EOrientationObeyLayoutSwitch |
|
188 }; |
|
189 |
|
190 /** |
|
191 * Command parameters for Image sharing. |
|
192 */ |
|
193 typedef TFileName TShareObjectImageParameters; |
|
194 |
|
195 /** |
|
196 * Command parameters for Video Clip sharing. |
|
197 */ |
|
198 typedef TFileName TShareObjectVideoClipParameters; |
|
199 |
|
200 /** |
|
201 * Parameters for Prepare Camera. |
|
202 */ |
|
203 struct TPrepareCameraParams |
|
204 { |
|
205 TMediaSource iMediaSource; |
|
206 TBool iInitialize; |
|
207 }; |
|
208 |
|
209 /** |
|
210 * Returns state of transmission local video/audio to remote end. |
|
211 * |
|
212 * @param aMediaDirection |
|
213 * @param aActiveMedia returns active media as bitmap (see TMediaType). |
|
214 * @return Symbian OS error code. |
|
215 */ |
|
216 virtual TInt GetMediaState( |
|
217 const TMediaDirection aMediaDirection, |
|
218 TInt& aActiveMedia ) const = 0; |
|
219 |
|
220 /** |
|
221 * Returns active source for video transmission and |
|
222 * local display. |
|
223 * @param aSource source in return |
|
224 * @return Symbian OS error code |
|
225 */ |
|
226 virtual TInt GetSource( TMediaSource& aSource ) const = 0; |
|
227 |
|
228 /** |
|
229 * Returns source capabilities. |
|
230 * @param combination of capability flags |
|
231 * @return Symbian OS error code |
|
232 */ |
|
233 virtual TInt GetSourcesCaps( TInt& aCaps ) const = 0; |
|
234 |
|
235 /** |
|
236 * Returns currently active camera. |
|
237 * @param returns current camera id. |
|
238 * @return Symbian OS error code. |
|
239 * KErrNotReady if the engine is not ready or it's in wrong state, |
|
240 * KErrInUse if camera is used by other application. |
|
241 * Camera must be initialized, by async KVtEngPrepareCamera command or |
|
242 * KVtEngSetSource command with camera parameter, in order to get |
|
243 * KErrInUse indication. |
|
244 */ |
|
245 virtual TInt GetCurrentCameraId( TCameraId& aId ) const = 0; |
|
246 |
|
247 /** |
|
248 * Returns camera information. |
|
249 * @param aId camera to query information for. |
|
250 * @param aInfo returns camera information |
|
251 * @return Symbian OS error code. If camera is not |
|
252 * available returns KErrNotFound. |
|
253 */ |
|
254 virtual TInt GetCameraInfo( |
|
255 const TCameraId aId, |
|
256 TCameraInfo& aInfo ) const = 0; |
|
257 |
|
258 /** |
|
259 * Gets current zoom step |
|
260 * @param aCurrentStep current zoom step |
|
261 * @return Symbian OS error code. |
|
262 */ |
|
263 virtual TInt GetCurrentZoomStep( TInt& aCurrentStep ) = 0; |
|
264 |
|
265 /** |
|
266 * Gets maximum zoom value that may be passed to camera. |
|
267 * @param aMaxZoomStep maximum zoom step. |
|
268 * @return Symbian OS error code. |
|
269 */ |
|
270 virtual TInt GetMaxZoomStep( TInt& aMaxZoomStep ) = 0; |
|
271 |
|
272 /** |
|
273 * Gets number of major zoom level leaps. |
|
274 * Less than or equal to maximum digital zoom steps. |
|
275 * @param aCount number of leaps |
|
276 * @return Symbian OS error code. |
|
277 */ |
|
278 virtual TInt GetMajorZoomStepCount( TInt& aCount ) = 0; |
|
279 |
|
280 /** |
|
281 * Maps major zoom leap step to corresponding step index. |
|
282 * @param aIndex major zoom step. |
|
283 * @param aStep zoom step |
|
284 */ |
|
285 virtual void GetMajorZoomStep( TInt aIndex, TInt& aStep ) = 0; |
|
286 |
|
287 /** |
|
288 * Gets freeze support status. |
|
289 * @param aFreezeSupported ETrue if freeze is supported, EFalse otherwise. |
|
290 * @return KErrNotReady if provider is not ready yet. |
|
291 * @since S60 3.1 |
|
292 */ |
|
293 virtual TInt GetFreezeSupported( TBool& aFreezeSupported ) const = 0; |
|
294 |
|
295 /** |
|
296 * Gets freeze current status. |
|
297 * @param aFreezeSupported ETrue if active provider is frozen, EFalse otherwise. |
|
298 * @return KErrNotReady if provider is not ready yet. |
|
299 * @since S60 3.1 |
|
300 */ |
|
301 virtual TInt GetFreezeState( TBool& aFrozen ) const = 0; |
|
302 |
|
303 /** |
|
304 * Returns state of DSA drawing, whether is active or not. |
|
305 * @param aMediaDirection in or out direction |
|
306 * @param aState returns state of Direct Screen Access |
|
307 * @return Symbian OS error code |
|
308 */ |
|
309 virtual TInt GetDsaState( |
|
310 const TMediaDirection aMediaDirection, |
|
311 TBool& aActive ) const = 0; |
|
312 |
|
313 /** |
|
314 * Returns state of VideoCall, whether is connected or not. |
|
315 * @return state |
|
316 */ |
|
317 virtual TBool VideoCallConnected () const = 0; |
|
318 |
|
319 /** |
|
320 * Returns ETrue if rendering has been started. |
|
321 * |
|
322 * @param aDirection specifies the rendering direction to check |
|
323 * @return ETrue if rendering has been started. |
|
324 */ |
|
325 virtual TBool RenderingStarted( const TMediaDirection |
|
326 aDirection ) const = 0; |
|
327 |
|
328 /** |
|
329 * Gets current local video quality setting. |
|
330 * @param aVideoQuality Current local video quality settings. |
|
331 * @since S60 3.1 |
|
332 */ |
|
333 virtual void GetVideoQuality( TVideoQuality& aVideoQuality ) const = 0; |
|
334 |
|
335 /** |
|
336 * Gets current object sharing state. |
|
337 * @param aObjectSharingState On return contains current object sharing |
|
338 * state. @see MVtEngMedia::TShareObjectState. |
|
339 * @since S60 3.1 |
|
340 */ |
|
341 virtual void GetObjectSharingState( |
|
342 TShareObjectState& aObjectSharingState ) const = 0; |
|
343 |
|
344 /** |
|
345 * Gets camera orientations for primary and secondary camera. |
|
346 * @see MVtEngMedia::TCameraOrientation |
|
347 * @param aPrimaryCameraOrientation priamry camera orientation. |
|
348 * @param aSecondaryCameraOrientation secondary camera orientation. |
|
349 */ |
|
350 virtual void GetCameraOrientations( |
|
351 TCameraOrientation& aPrimaryCameraOrientation, |
|
352 TCameraOrientation& aSecondaryCameraOrientation ) const = 0; |
|
353 }; |
|
354 |
|
355 #endif // MVTENGMEDIA_H |
|
356 |
|
357 // End of File |