sl@0
|
1 |
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include <videoplayer.h>
|
sl@0
|
17 |
#include <videoplayer2.h>
|
sl@0
|
18 |
#include "mmfvideocallback.h"
|
sl@0
|
19 |
#include "VideoPlayerBody.h"
|
sl@0
|
20 |
|
sl@0
|
21 |
/**
|
sl@0
|
22 |
Creates a new instance of the video player utility. Unlike CVideoPlayerUtility::NewL(),
|
sl@0
|
23 |
the CVideoPlayerUtility2 factory does not require window handles and other video display
|
sl@0
|
24 |
information as its arguments. The client can set up rendering later with
|
sl@0
|
25 |
AddDisplayWindowL(), or optionally use the utility without a window, for example, for metadata
|
sl@0
|
26 |
query purposes.
|
sl@0
|
27 |
|
sl@0
|
28 |
@param aObserver
|
sl@0
|
29 |
A client class to receive notifications from the video player.
|
sl@0
|
30 |
@param aPriority
|
sl@0
|
31 |
The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and
|
sl@0
|
32 |
EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
|
sl@0
|
33 |
@param aPref
|
sl@0
|
34 |
The Priority Preference - an additional audio policy parameter. The suggested default is
|
sl@0
|
35 |
EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional
|
sl@0
|
36 |
values may be supported by given phones and/or platforms, but should not be depended upon by
|
sl@0
|
37 |
portable code.
|
sl@0
|
38 |
|
sl@0
|
39 |
@return A pointer to the new video player utility object.
|
sl@0
|
40 |
|
sl@0
|
41 |
@leave The method will leave if an error occurs. Typical error codes used:
|
sl@0
|
42 |
* KErrNoMemory if out of memory.
|
sl@0
|
43 |
|
sl@0
|
44 |
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
|
sl@0
|
45 |
several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference,
|
sl@0
|
46 |
the adaptation may consider other parameters such as the SecureId and Capabilities of the client process.
|
sl@0
|
47 |
Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may
|
sl@0
|
48 |
vary between different phones. Portable applications are advised not to assume any specific behaviour.
|
sl@0
|
49 |
|
sl@0
|
50 |
*/
|
sl@0
|
51 |
EXPORT_C CVideoPlayerUtility2* CVideoPlayerUtility2::NewL(MVideoPlayerUtilityObserver& aObserver,
|
sl@0
|
52 |
TInt aPriority,
|
sl@0
|
53 |
TInt aPref)
|
sl@0
|
54 |
{
|
sl@0
|
55 |
CVideoPlayerUtility2* s = new(ELeave) CVideoPlayerUtility2();
|
sl@0
|
56 |
CleanupStack::PushL(s);
|
sl@0
|
57 |
s->iBody = CVideoPlayerUtility::CBody::NewL(s, aObserver, aPriority, aPref);
|
sl@0
|
58 |
CleanupStack::Pop();
|
sl@0
|
59 |
return s;
|
sl@0
|
60 |
}
|
sl@0
|
61 |
|
sl@0
|
62 |
/**
|
sl@0
|
63 |
Destructor. Closes any open video clips and frees any resources held by the Video Player.
|
sl@0
|
64 |
*/
|
sl@0
|
65 |
CVideoPlayerUtility2::~CVideoPlayerUtility2()
|
sl@0
|
66 |
{
|
sl@0
|
67 |
}
|
sl@0
|
68 |
|
sl@0
|
69 |
/**
|
sl@0
|
70 |
Adds a new window for displaying the video picture. Client applications must use this method
|
sl@0
|
71 |
instead of SetDisplayWindowL() when using CVideoPlayerUtility2.
|
sl@0
|
72 |
|
sl@0
|
73 |
This method can only be called after opening the source is complete and the client has
|
sl@0
|
74 |
received an MvpuoOpenComplete() callback.
|
sl@0
|
75 |
|
sl@0
|
76 |
@param aWs
|
sl@0
|
77 |
The window server session for this window.
|
sl@0
|
78 |
@param aScreenDevice
|
sl@0
|
79 |
The screen device for the screen that the window is displayed on.
|
sl@0
|
80 |
@param aWindow
|
sl@0
|
81 |
The display window.
|
sl@0
|
82 |
@param aVideoExtent
|
sl@0
|
83 |
Video extent on the screen, relative to the window. Video picture position within
|
sl@0
|
84 |
the extent depends on the scaled picture and content alignment or offset. The video
|
sl@0
|
85 |
extent can be partially or completely outside the window.
|
sl@0
|
86 |
@param aWindowClipRect
|
sl@0
|
87 |
Window clipping rectangle, relative to the window. The clipping rectangle specifies
|
sl@0
|
88 |
the part of the window used for video display. The rectangle must be contained
|
sl@0
|
89 |
completely within the window.
|
sl@0
|
90 |
@leave The method will leave if an error occurs. Typical error codes used:
|
sl@0
|
91 |
* KErrNotReady if the source file, URL, or descriptor has not been opened.
|
sl@0
|
92 |
*/
|
sl@0
|
93 |
EXPORT_C void CVideoPlayerUtility2::AddDisplayWindowL(RWsSession& aWs, CWsScreenDevice& aScreenDevice,
|
sl@0
|
94 |
RWindow& aWindow, const TRect& aVideoExtent,
|
sl@0
|
95 |
const TRect& aWindowClipRect)
|
sl@0
|
96 |
{
|
sl@0
|
97 |
iBody->AddDisplayWindowL(aWs, aScreenDevice, aWindow, aVideoExtent, aWindowClipRect);
|
sl@0
|
98 |
}
|
sl@0
|
99 |
|
sl@0
|
100 |
/**
|
sl@0
|
101 |
A simplified variant of AddDisplayWindowL(). When this variant is used, the video extent and
|
sl@0
|
102 |
window clipping rectangle default to the whole window.
|
sl@0
|
103 |
|
sl@0
|
104 |
This method can only be called after opening the source is complete and the client has
|
sl@0
|
105 |
received an MvpuoOpenComplete() callback.
|
sl@0
|
106 |
|
sl@0
|
107 |
@param aWs
|
sl@0
|
108 |
The window server session for this window.
|
sl@0
|
109 |
@param aScreenDevice
|
sl@0
|
110 |
The screen device for the screen that the window is displayed on.
|
sl@0
|
111 |
@param aWindow
|
sl@0
|
112 |
The display window.
|
sl@0
|
113 |
@leave The method will leave if an error occurs. Typical error codes used:
|
sl@0
|
114 |
* KErrNotReady if the source file, URL, or descriptor has not been opened.
|
sl@0
|
115 |
*/
|
sl@0
|
116 |
EXPORT_C void CVideoPlayerUtility2::AddDisplayWindowL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindow& aWindow)
|
sl@0
|
117 |
{
|
sl@0
|
118 |
iBody->AddDisplayWindowL(aWs, aScreenDevice, aWindow);
|
sl@0
|
119 |
}
|
sl@0
|
120 |
|
sl@0
|
121 |
/**
|
sl@0
|
122 |
Removes a window that is currently being used to display the video picture. The window must
|
sl@0
|
123 |
have previously been added with AddDisplayWindowL().
|
sl@0
|
124 |
|
sl@0
|
125 |
Note Depending on underlying implementation it may also remove any graphics resources associated
|
sl@0
|
126 |
with video playback on this window.
|
sl@0
|
127 |
|
sl@0
|
128 |
This method cannot fail. If the window has not been added with AddDisplayWindowL(), the
|
sl@0
|
129 |
method call will be ignored.
|
sl@0
|
130 |
|
sl@0
|
131 |
@param aWindow
|
sl@0
|
132 |
The display window.
|
sl@0
|
133 |
*/
|
sl@0
|
134 |
EXPORT_C void CVideoPlayerUtility2::RemoveDisplayWindow(RWindow& aWindow)
|
sl@0
|
135 |
{
|
sl@0
|
136 |
iBody->RemoveDisplayWindow(aWindow);
|
sl@0
|
137 |
}
|
sl@0
|
138 |
|
sl@0
|
139 |
/**
|
sl@0
|
140 |
Sets the video extent on the screen, relative to the window. The extent specifies the area
|
sl@0
|
141 |
of screen in which the video picture is placed, and may be partially or completely outside of
|
sl@0
|
142 |
the video window. Video picture position within the extent depends on the picture size and
|
sl@0
|
143 |
content alignment or offset.
|
sl@0
|
144 |
|
sl@0
|
145 |
This method can only be called after opening the source is complete and the client has
|
sl@0
|
146 |
received an MvpuoOpenComplete() callback.
|
sl@0
|
147 |
|
sl@0
|
148 |
@param aWindow
|
sl@0
|
149 |
Window to set video extent for.
|
sl@0
|
150 |
@param aVideoExtent
|
sl@0
|
151 |
The new video extent, relative to the video window.
|
sl@0
|
152 |
@leave The method will leave if an error occurs. Typical error codes used:
|
sl@0
|
153 |
* KErrNotReady if the source file, URL, or descriptor has not been opened.
|
sl@0
|
154 |
*/
|
sl@0
|
155 |
EXPORT_C void CVideoPlayerUtility2::SetVideoExtentL(const RWindow& aWindow, const TRect& aVideoExtent)
|
sl@0
|
156 |
{
|
sl@0
|
157 |
iBody->SetVideoExtentL(aWindow, aVideoExtent);
|
sl@0
|
158 |
}
|
sl@0
|
159 |
|
sl@0
|
160 |
/**
|
sl@0
|
161 |
Sets the window clipping rectangle, relative to the window. The clipping rectangle specifies
|
sl@0
|
162 |
the part of the window used to display the video picture and must be fully contained within
|
sl@0
|
163 |
the window.
|
sl@0
|
164 |
|
sl@0
|
165 |
This method can only be called after opening the source is complete and the client has
|
sl@0
|
166 |
received an MvpuoOpenComplete() callback.
|
sl@0
|
167 |
|
sl@0
|
168 |
@param aWindow
|
sl@0
|
169 |
Window to set clipping rectangle for.
|
sl@0
|
170 |
@param aWindowClipRect
|
sl@0
|
171 |
The clipping rectangle to use for this window.
|
sl@0
|
172 |
@leave The method will leave if an error occurs. Typical error codes used:
|
sl@0
|
173 |
* KErrArgument if the rectangle is not contained within the window.
|
sl@0
|
174 |
* KErrNotReady if the source file, URL, or descriptor has not been opened.
|
sl@0
|
175 |
*/
|
sl@0
|
176 |
EXPORT_C void CVideoPlayerUtility2::SetWindowClipRectL(const RWindow& aWindow, const TRect& aWindowClipRect)
|
sl@0
|
177 |
{
|
sl@0
|
178 |
iBody->SetWindowClipRectL(aWindow, aWindowClipRect);
|
sl@0
|
179 |
}
|
sl@0
|
180 |
|
sl@0
|
181 |
/**
|
sl@0
|
182 |
Rotates the video image within the window. This is the preferred method to use with CVideoPlayerUtility2.
|
sl@0
|
183 |
|
sl@0
|
184 |
The rotation will replace any rotation set with CVideoPlayerUtility::SetRotationL.
|
sl@0
|
185 |
Likewise with setting the rotation with CVideoPlayerUtility::SetRotationL after a call to CVideoPlayerUtility2::SetRotationL has been
|
sl@0
|
186 |
made, then the rotation specified will replace any rotation set with CVideoPlayerUtility2::SetRotationL.
|
sl@0
|
187 |
|
sl@0
|
188 |
@param aWindow Window to set rotation for.
|
sl@0
|
189 |
@param aRotation The video rotation to use for aWindow.
|
sl@0
|
190 |
|
sl@0
|
191 |
@leave KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
|
sl@0
|
192 |
@leave KErrNotReady if controller hasn't been opened.
|
sl@0
|
193 |
|
sl@0
|
194 |
@see CVideoPlayerUtility::SetRotationL
|
sl@0
|
195 |
@see TVideoRotation
|
sl@0
|
196 |
*/
|
sl@0
|
197 |
|
sl@0
|
198 |
EXPORT_C void CVideoPlayerUtility2::SetRotationL(const RWindow& aWindow, TVideoRotation aRotation)
|
sl@0
|
199 |
{
|
sl@0
|
200 |
iBody->SetRotationL(aWindow, aRotation);
|
sl@0
|
201 |
}
|
sl@0
|
202 |
|
sl@0
|
203 |
/**
|
sl@0
|
204 |
Retrieves the video rotation set for a window. This is the preferred method to use with CVideoPlayerUtility2.
|
sl@0
|
205 |
|
sl@0
|
206 |
@param aWindow Window to retrieve rotation for.
|
sl@0
|
207 |
@return The video rotation.
|
sl@0
|
208 |
|
sl@0
|
209 |
@leave KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
|
sl@0
|
210 |
@leave KErrNotReady if controller hasn't been opened.
|
sl@0
|
211 |
|
sl@0
|
212 |
@see TVideoRotation
|
sl@0
|
213 |
@see CVideoPlayerUtility2::AddDisplayWindowL
|
sl@0
|
214 |
*/
|
sl@0
|
215 |
|
sl@0
|
216 |
EXPORT_C TVideoRotation CVideoPlayerUtility2::RotationL(const RWindow& aWindow)
|
sl@0
|
217 |
{
|
sl@0
|
218 |
return iBody->RotationL(aWindow);
|
sl@0
|
219 |
}
|
sl@0
|
220 |
|
sl@0
|
221 |
/**
|
sl@0
|
222 |
Scales the video image to a specified percentage of its original size within the window.
|
sl@0
|
223 |
This is the preferred method to use with CVideoPlayerUtility2.
|
sl@0
|
224 |
Setting scale factor will set auto scale to EAutoScaleNone for the window.
|
sl@0
|
225 |
|
sl@0
|
226 |
The scale factor will replace any scale factor set with CVideoPlayerUtility::SetScaleFactorL.
|
sl@0
|
227 |
Likewise with setting the scale factor with CVideoPlayerUtility::SetScaleFactorL after a call to CVideoPlayerUtility2::SetScaleFactorL has been
|
sl@0
|
228 |
made, then the scale factor specified will replace any scale factor set with CVideoPlayerUtility2::SetScaleFactorL.
|
sl@0
|
229 |
|
sl@0
|
230 |
@param aWindow Window to set scale factor for.
|
sl@0
|
231 |
@param aWidthPercentage
|
sl@0
|
232 |
The percentage (100 = original size) to be used to scale the width of the video image
|
sl@0
|
233 |
@param aHeightPercentage
|
sl@0
|
234 |
The percentage (100 = original size) to be used to scale the height of the video image.
|
sl@0
|
235 |
If this is not equal to aWidthPercentage then the image may be distorted.
|
sl@0
|
236 |
|
sl@0
|
237 |
@leave KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
|
sl@0
|
238 |
@leave KErrNotReady if controller hasn't been opened.
|
sl@0
|
239 |
|
sl@0
|
240 |
@see CVideoPlayerUtility::SetScaleFactorL
|
sl@0
|
241 |
*/
|
sl@0
|
242 |
|
sl@0
|
243 |
EXPORT_C void CVideoPlayerUtility2::SetScaleFactorL(const RWindow& aWindow, TReal32 aWidthPercentage, TReal32 aHeightPercentage)
|
sl@0
|
244 |
{
|
sl@0
|
245 |
iBody->SetScaleFactorL(aWindow, aWidthPercentage, aHeightPercentage);
|
sl@0
|
246 |
}
|
sl@0
|
247 |
|
sl@0
|
248 |
/**
|
sl@0
|
249 |
Retrieves the scale factor currently set for a window. This is the preferred method to use with CVideoPlayerUtility2.
|
sl@0
|
250 |
|
sl@0
|
251 |
@param aWindow Window to retrieve scale factor for.
|
sl@0
|
252 |
@param aWidthPercentage
|
sl@0
|
253 |
On function return, contains the current scaling percentage applied to the width of the
|
sl@0
|
254 |
video image (100 = original size).
|
sl@0
|
255 |
@param aHeightPercentage
|
sl@0
|
256 |
On function return, contains the current scaling percentage applied to the height
|
sl@0
|
257 |
of the video image (100 = original size).
|
sl@0
|
258 |
|
sl@0
|
259 |
@leave KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
|
sl@0
|
260 |
@leave KErrNotReady if controller hasn't been opened.
|
sl@0
|
261 |
*/
|
sl@0
|
262 |
|
sl@0
|
263 |
EXPORT_C void CVideoPlayerUtility2::GetScaleFactorL(const RWindow& aWindow, TReal32& aWidthPercentage, TReal32& aHeightPercentage)
|
sl@0
|
264 |
{
|
sl@0
|
265 |
iBody->GetScaleFactorL(aWindow, aWidthPercentage, aHeightPercentage);
|
sl@0
|
266 |
}
|
sl@0
|
267 |
|
sl@0
|
268 |
/**
|
sl@0
|
269 |
Set video automatic scaling. When automatic scaling is active, the
|
sl@0
|
270 |
video picture is scaled automatically to match the video extent,
|
sl@0
|
271 |
based on the scaling type. This variant of SetAutoScaleL() will
|
sl@0
|
272 |
always center the picture in the extent.
|
sl@0
|
273 |
|
sl@0
|
274 |
This is the preferred method to use with CVideoPlayerUtility2.
|
sl@0
|
275 |
|
sl@0
|
276 |
Calling SetAutoScaleL() will override any scaling factors set with
|
sl@0
|
277 |
SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic
|
sl@0
|
278 |
scaling.
|
sl@0
|
279 |
|
sl@0
|
280 |
@see TAutoScaleType, THorizontalAlign, TVerticalAlign
|
sl@0
|
281 |
|
sl@0
|
282 |
@param aWindow Window to set auto scaling options for.
|
sl@0
|
283 |
@param aScaleType Automatic scaling type
|
sl@0
|
284 |
|
sl@0
|
285 |
@pre The video clip has been opened by the client
|
sl@0
|
286 |
|
sl@0
|
287 |
@leave KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
|
sl@0
|
288 |
@leave KErrNotReady if controller hasn't been opened.
|
sl@0
|
289 |
*/
|
sl@0
|
290 |
|
sl@0
|
291 |
EXPORT_C void CVideoPlayerUtility2::SetAutoScaleL(const RWindow& aWindow, TAutoScaleType aScaleType)
|
sl@0
|
292 |
{
|
sl@0
|
293 |
iBody->SetAutoScaleL(aWindow, aScaleType);
|
sl@0
|
294 |
}
|
sl@0
|
295 |
|
sl@0
|
296 |
/**
|
sl@0
|
297 |
Set video automatic scaling. When automatic scaling is active, the
|
sl@0
|
298 |
video picture is scaled automatically to match the video extent,
|
sl@0
|
299 |
based on the scaling type, and positioned according to the
|
sl@0
|
300 |
parameters.
|
sl@0
|
301 |
|
sl@0
|
302 |
This is the preferred method to use with CVideoPlayerUtility2.
|
sl@0
|
303 |
|
sl@0
|
304 |
Calling SetAutoScaleL() will override any scaling factors set with
|
sl@0
|
305 |
SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic
|
sl@0
|
306 |
scaling.
|
sl@0
|
307 |
|
sl@0
|
308 |
@see TAutoScaleType, THorizontalAlign, TVerticalAlign
|
sl@0
|
309 |
|
sl@0
|
310 |
@param aWindow Window to set auto scaling options for.
|
sl@0
|
311 |
@param aScaleType Automatic scaling type
|
sl@0
|
312 |
@param aHorizPos Video picture horizontal position, relative to the
|
sl@0
|
313 |
video window. The value can be either a pixel offset
|
sl@0
|
314 |
(positive or negative) from the top left corner of the
|
sl@0
|
315 |
window to the top left corner of the picture, or an
|
sl@0
|
316 |
alignment constant from enum THorizontalAlign.
|
sl@0
|
317 |
@param aVertPos Video picture vertical position, relative to the
|
sl@0
|
318 |
video window. The value can be either a pixel offset
|
sl@0
|
319 |
(positive or negative) from the top left corner of the
|
sl@0
|
320 |
window to the top left corner of the picture, or an
|
sl@0
|
321 |
alignment constant from enum TVerticalAlign.
|
sl@0
|
322 |
|
sl@0
|
323 |
@pre The video clip has been opened by the client.
|
sl@0
|
324 |
|
sl@0
|
325 |
@leave KErrNotFound if aWindow isn't currently added to CVideoPlayerUtility2
|
sl@0
|
326 |
@leave KErrNotReady if controller hasn't been opened.
|
sl@0
|
327 |
*/
|
sl@0
|
328 |
|
sl@0
|
329 |
EXPORT_C void CVideoPlayerUtility2::SetAutoScaleL(const RWindow& aWindow, TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos)
|
sl@0
|
330 |
{
|
sl@0
|
331 |
iBody->SetAutoScaleL(aWindow, aScaleType, aHorizPos, aVertPos);
|
sl@0
|
332 |
}
|
sl@0
|
333 |
|
sl@0
|
334 |
/**
|
sl@0
|
335 |
Adds the specified display to the list of surface rendering targets.
|
sl@0
|
336 |
This API can be used in conjunction with AddDisplayWindowL calls.
|
sl@0
|
337 |
The caller is responsible for handling surface events generated for the specific display.
|
sl@0
|
338 |
A single graphics surface is created and shared between all windows and displays.
|
sl@0
|
339 |
Surface registration and de-registration is managed by the MMF framework.
|
sl@0
|
340 |
|
sl@0
|
341 |
@see AddDisplayWindowL
|
sl@0
|
342 |
|
sl@0
|
343 |
@param aWs Window server session.
|
sl@0
|
344 |
@param aDisplay Display to create graphics surface on.
|
sl@0
|
345 |
@param aEventHandler Call-back interface for receiving surface specific events.
|
sl@0
|
346 |
|
sl@0
|
347 |
@leave Any of the system wide error codes.
|
sl@0
|
348 |
@leave KErrNotReady if the source file, URL or descriptor has not been opened.
|
sl@0
|
349 |
@leave KErrInUse if the display has already been added by a previous AddDisplayL call.
|
sl@0
|
350 |
*/
|
sl@0
|
351 |
|
sl@0
|
352 |
EXPORT_C void CVideoPlayerUtility2::AddDisplayL(RWsSession& /* aWs */, TInt aDisplay, MMMFSurfaceEventHandler& aEventHandler)
|
sl@0
|
353 |
{
|
sl@0
|
354 |
iBody->AddDisplayL(aDisplay, aEventHandler);
|
sl@0
|
355 |
}
|
sl@0
|
356 |
|
sl@0
|
357 |
/**
|
sl@0
|
358 |
Removes the specified display from the list of surface rendering targets.
|
sl@0
|
359 |
|
sl@0
|
360 |
@param aDisplay Display id of display to remove
|
sl@0
|
361 |
*/
|
sl@0
|
362 |
|
sl@0
|
363 |
EXPORT_C void CVideoPlayerUtility2::RemoveDisplay(TInt aDisplay)
|
sl@0
|
364 |
{
|
sl@0
|
365 |
iBody->RemoveDisplay(aDisplay);
|
sl@0
|
366 |
}
|
sl@0
|
367 |
|
sl@0
|
368 |
/**
|
sl@0
|
369 |
When enabled sets automatic switching of surface to/from external display when it is connected/disconnected from the device.
|
sl@0
|
370 |
|
sl@0
|
371 |
Automatic switching is enabled by default, but only if the client thread that created this utility has an Active Scheduler
|
sl@0
|
372 |
installed and the device supports external display switching.
|
sl@0
|
373 |
|
sl@0
|
374 |
To use this function the client thread must have an Active Scheduler installed otherwise it will leave with KErrNotReady.
|
sl@0
|
375 |
|
sl@0
|
376 |
@param aControl
|
sl@0
|
377 |
ETrue to enable. EFalse to disable.
|
sl@0
|
378 |
@param aDisplay
|
sl@0
|
379 |
Display id of display to enable external switching for.
|
sl@0
|
380 |
@leave KErrNotSupported Device does not support external displays
|
sl@0
|
381 |
@leave KErrNotReady CActiveScheduler is not installed
|
sl@0
|
382 |
*/
|
sl@0
|
383 |
EXPORT_C void CVideoPlayerUtility2::SetExternalDisplaySwitchingL(TInt aDisplay, TBool aControl)
|
sl@0
|
384 |
{
|
sl@0
|
385 |
iBody->SetExternalDisplaySwitchingL(aDisplay, aControl);
|
sl@0
|
386 |
}
|
sl@0
|
387 |
|
sl@0
|
388 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
389 |
/**
|
sl@0
|
390 |
Check to see if subtitles are available with the current video stream and controller.
|
sl@0
|
391 |
|
sl@0
|
392 |
@return ETrue if subtitles can be enabled,
|
sl@0
|
393 |
EFalse if subtitles are not available with the current video stream or video clip has not been opened
|
sl@0
|
394 |
*/
|
sl@0
|
395 |
EXPORT_C TBool CVideoPlayerUtility2::SubtitlesAvailable()
|
sl@0
|
396 |
{
|
sl@0
|
397 |
return iBody->SubtitlesAvailable();
|
sl@0
|
398 |
}
|
sl@0
|
399 |
|
sl@0
|
400 |
/**
|
sl@0
|
401 |
Enable subtitles with the current video stream.
|
sl@0
|
402 |
|
sl@0
|
403 |
@pre The video clip has been opened by the client and SubtitlesAvailable() return ETrue.
|
sl@0
|
404 |
|
sl@0
|
405 |
@leave KErrNotReady if the video source file, URL, or descriptor has not been opened,
|
sl@0
|
406 |
or no window has been added to CVideoPlayerUtility2.
|
sl@0
|
407 |
@leave KErrNotSupported if underlying video player controller does not support subtitles.
|
sl@0
|
408 |
@leave KErrNotFound if the opened video source has no associated subtitle data.
|
sl@0
|
409 |
@leave KErrInUse if subtitle is already enabled.
|
sl@0
|
410 |
@leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
411 |
|
sl@0
|
412 |
@panic MMFVideoPlayUtil 1 In debug mode, if the video source file, URL, or descriptor has not been opened.
|
sl@0
|
413 |
@panic MMFVideoPlayUtil 2 In debug mode, if subtitle is not supported or not available.
|
sl@0
|
414 |
@panic MMFVideoPlayUtil 3 In debug mode, if no display window has been added.
|
sl@0
|
415 |
*/
|
sl@0
|
416 |
EXPORT_C void CVideoPlayerUtility2::EnableSubtitlesL()
|
sl@0
|
417 |
{
|
sl@0
|
418 |
iBody->EnableSubtitlesL();
|
sl@0
|
419 |
}
|
sl@0
|
420 |
|
sl@0
|
421 |
/**
|
sl@0
|
422 |
Disable subtitles.
|
sl@0
|
423 |
*/
|
sl@0
|
424 |
EXPORT_C void CVideoPlayerUtility2::DisableSubtitles()
|
sl@0
|
425 |
{
|
sl@0
|
426 |
iBody->DisableSubtitles();
|
sl@0
|
427 |
}
|
sl@0
|
428 |
|
sl@0
|
429 |
/**
|
sl@0
|
430 |
Get the current subtitle language.
|
sl@0
|
431 |
|
sl@0
|
432 |
@pre Subtitle has been enabled.
|
sl@0
|
433 |
@return The current subtitle language, or ELangNone if no language information is available
|
sl@0
|
434 |
|
sl@0
|
435 |
@leave KErrNotReady if subtitle has not been enabled.
|
sl@0
|
436 |
@leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
437 |
|
sl@0
|
438 |
@panic MMFVideoPlayUtil 4 In debug mode, if subtitle has not been enabled.
|
sl@0
|
439 |
*/
|
sl@0
|
440 |
EXPORT_C TLanguage CVideoPlayerUtility2::SubtitleLanguageL()
|
sl@0
|
441 |
{
|
sl@0
|
442 |
return iBody->SubtitleLanguageL();
|
sl@0
|
443 |
}
|
sl@0
|
444 |
|
sl@0
|
445 |
/**
|
sl@0
|
446 |
Return the subtitle languages available.
|
sl@0
|
447 |
|
sl@0
|
448 |
@pre Subtitles have been enabled.
|
sl@0
|
449 |
@return A array of the currently available languages, or an empty array if
|
sl@0
|
450 |
subtitle source does not contain any language information. Array is valid
|
sl@0
|
451 |
until subtitles are disabled.
|
sl@0
|
452 |
|
sl@0
|
453 |
@leave KErrNotReady if subtitles have not been enabled.
|
sl@0
|
454 |
@leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
455 |
|
sl@0
|
456 |
@panic MMFVideoPlayUtil 4 In debug mode, if subtitles have not been enabled.
|
sl@0
|
457 |
*/
|
sl@0
|
458 |
EXPORT_C TArray<TLanguage> CVideoPlayerUtility2::SupportedSubtitleLanguagesL()
|
sl@0
|
459 |
{
|
sl@0
|
460 |
return iBody->SupportedSubtitleLanguagesL();
|
sl@0
|
461 |
}
|
sl@0
|
462 |
|
sl@0
|
463 |
/**
|
sl@0
|
464 |
Set the current subtitle language.
|
sl@0
|
465 |
|
sl@0
|
466 |
@see CVideoPlayerUtility2::GetSupportedSubtitleLanguagesL()
|
sl@0
|
467 |
|
sl@0
|
468 |
@pre Subtitles have been enabled.
|
sl@0
|
469 |
@pre GetSupportedSubtitleLanguagesL() return a non empty array
|
sl@0
|
470 |
|
sl@0
|
471 |
@param aLanguage Language to be used for subtitle stream.
|
sl@0
|
472 |
|
sl@0
|
473 |
@leave KErrNotReady if subtitles have not been enabled.
|
sl@0
|
474 |
@leave KErrNotSupported if subtitle language is not supported
|
sl@0
|
475 |
@leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
476 |
|
sl@0
|
477 |
@panic MMFVideoPlayUtil 4 In debug mode, if subtitles have not been enabled.
|
sl@0
|
478 |
@panic MMFVideoPlayUtil 5 In debug mode, if subtitle language is not supported.
|
sl@0
|
479 |
*/
|
sl@0
|
480 |
EXPORT_C void CVideoPlayerUtility2::SetSubtitleLanguageL(TLanguage aLanguage)
|
sl@0
|
481 |
{
|
sl@0
|
482 |
iBody->SetSubtitleLanguageL(aLanguage);
|
sl@0
|
483 |
}
|
sl@0
|
484 |
|
sl@0
|
485 |
/**
|
sl@0
|
486 |
To be called when the video window is asked to redraw. E.g. For cone control, when CCoeControl::Draw() is called.
|
sl@0
|
487 |
|
sl@0
|
488 |
@param aWindow Handle to the video window to be redrawn.
|
sl@0
|
489 |
@param aRect The region of the control to be redrawn from aRect in CCodControl::Draw().
|
sl@0
|
490 |
*/
|
sl@0
|
491 |
EXPORT_C void CVideoPlayerUtility2::RedrawSubtitle(RWindow& aWindow, const TRect &aRect)
|
sl@0
|
492 |
{
|
sl@0
|
493 |
iBody->RedrawSubtitle(aWindow, aRect);
|
sl@0
|
494 |
}
|
sl@0
|
495 |
|
sl@0
|
496 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|