sl@0
|
1 |
// Copyright (c) 2008-2009 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 "mmfvideosubtitlecustomcommands.h"
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@internalComponent
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
enum TMMFSubtitleSupportMessages
|
sl@0
|
22 |
{
|
sl@0
|
23 |
EMMFSubtitleSupportAvailable,
|
sl@0
|
24 |
EMMFSubtitleSupportEnable,
|
sl@0
|
25 |
EMMFSubtitleSupportDisable,
|
sl@0
|
26 |
EMMFSubtitleSupportGetLanguageSupportCount,
|
sl@0
|
27 |
EMMFSubtitleSupportGetLanguageSupportData,
|
sl@0
|
28 |
EMMFSubtitleSupportSetLanguage,
|
sl@0
|
29 |
EMMFSubtitleSupportGetLanguage,
|
sl@0
|
30 |
EMMFSubtitleSupportUpdateSubtitleConfig,
|
sl@0
|
31 |
EMMFSubtitleSupportAddSubtitleConfig,
|
sl@0
|
32 |
EMMFSubtitleSupportRemoveSubtitleConfig,
|
sl@0
|
33 |
EMMFSubtitleSupportGetCrpParameter
|
sl@0
|
34 |
};
|
sl@0
|
35 |
|
sl@0
|
36 |
/**
|
sl@0
|
37 |
@internalComponent
|
sl@0
|
38 |
*/
|
sl@0
|
39 |
class TCrpParameters
|
sl@0
|
40 |
{
|
sl@0
|
41 |
public:
|
sl@0
|
42 |
TCrpParameters() : iId(TWsGraphicId::EUninitialized) {}
|
sl@0
|
43 |
|
sl@0
|
44 |
TWsGraphicId iId;
|
sl@0
|
45 |
TRect iCrpRect;
|
sl@0
|
46 |
};
|
sl@0
|
47 |
|
sl@0
|
48 |
/**
|
sl@0
|
49 |
* Constructor.
|
sl@0
|
50 |
*
|
sl@0
|
51 |
* @param aController The client side controller object to be used by this custom
|
sl@0
|
52 |
* command interface.
|
sl@0
|
53 |
*/
|
sl@0
|
54 |
EXPORT_C RMMFVideoPlaySubtitleSupportCustomCommands::RMMFVideoPlaySubtitleSupportCustomCommands(RMMFController& aController)
|
sl@0
|
55 |
: RMMFCustomCommandsBase(aController, KUidInterfaceMMFVideoPlaySubtitleSupport)
|
sl@0
|
56 |
{
|
sl@0
|
57 |
}
|
sl@0
|
58 |
|
sl@0
|
59 |
/**
|
sl@0
|
60 |
* Adds subtitle configuration data for a window.
|
sl@0
|
61 |
*
|
sl@0
|
62 |
* @param aConfig Subtitle configuration data for a window.
|
sl@0
|
63 |
* @return KErrNone if completed succesfully, otherwise one of the system wide error codes.
|
sl@0
|
64 |
*/
|
sl@0
|
65 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::AddSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig)
|
sl@0
|
66 |
{
|
sl@0
|
67 |
TPckgBuf<TMMFSubtitleWindowConfig> configPckg(aConfig);
|
sl@0
|
68 |
|
sl@0
|
69 |
return iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
70 |
EMMFSubtitleSupportAddSubtitleConfig,
|
sl@0
|
71 |
configPckg,
|
sl@0
|
72 |
KNullDesC8);
|
sl@0
|
73 |
}
|
sl@0
|
74 |
|
sl@0
|
75 |
/**
|
sl@0
|
76 |
* Removes the subtitle configuration data associated with the given window.
|
sl@0
|
77 |
*
|
sl@0
|
78 |
* @param aWindowId Unique identifier of the window associated with the
|
sl@0
|
79 |
* configuration data being removed.
|
sl@0
|
80 |
* @return KErrNone if completed succesfully, otherwise one of the system wide error codes.
|
sl@0
|
81 |
*/
|
sl@0
|
82 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::RemoveSubtitleConfig(TInt aWindowId)
|
sl@0
|
83 |
{
|
sl@0
|
84 |
TPckgBuf<TInt> windowPckg(aWindowId);
|
sl@0
|
85 |
|
sl@0
|
86 |
return iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
87 |
EMMFSubtitleSupportRemoveSubtitleConfig,
|
sl@0
|
88 |
windowPckg,
|
sl@0
|
89 |
KNullDesC8);
|
sl@0
|
90 |
}
|
sl@0
|
91 |
|
sl@0
|
92 |
/**
|
sl@0
|
93 |
* Reconfigures subtitle configuration.
|
sl@0
|
94 |
*
|
sl@0
|
95 |
* @param aConfig Subtitle configuration data for a window.
|
sl@0
|
96 |
* @return KErrNone if completed succesfully, otherwise one of the system wide error codes.
|
sl@0
|
97 |
*/
|
sl@0
|
98 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::UpdateSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig)
|
sl@0
|
99 |
{
|
sl@0
|
100 |
TPckgBuf<TMMFSubtitleWindowConfig> configPckg(aConfig);
|
sl@0
|
101 |
|
sl@0
|
102 |
return iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
103 |
EMMFSubtitleSupportUpdateSubtitleConfig,
|
sl@0
|
104 |
configPckg,
|
sl@0
|
105 |
KNullDesC8);
|
sl@0
|
106 |
}
|
sl@0
|
107 |
|
sl@0
|
108 |
/**
|
sl@0
|
109 |
* Checks if subtitles are available in the current video stream.
|
sl@0
|
110 |
*
|
sl@0
|
111 |
* @param aAvailable When this function returns, this is set to ETrue if the
|
sl@0
|
112 |
* controller supports subtitle extensions and subtitles are available in the
|
sl@0
|
113 |
* current video stream.
|
sl@0
|
114 |
* @return KErrNone if subtitles are supported by the controller; KErrNotSupported
|
sl@0
|
115 |
* if the controller does not support subtitles; otherwise other system error code.
|
sl@0
|
116 |
*/
|
sl@0
|
117 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::GetSubtitlesAvailable(TBool& aAvailable)
|
sl@0
|
118 |
{
|
sl@0
|
119 |
TPckgBuf<TBool> avail;
|
sl@0
|
120 |
|
sl@0
|
121 |
TInt err = iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
122 |
EMMFSubtitleSupportAvailable,
|
sl@0
|
123 |
KNullDesC8,
|
sl@0
|
124 |
KNullDesC8,
|
sl@0
|
125 |
avail);
|
sl@0
|
126 |
|
sl@0
|
127 |
aAvailable = (KErrNone == err) && avail();
|
sl@0
|
128 |
return err;
|
sl@0
|
129 |
}
|
sl@0
|
130 |
|
sl@0
|
131 |
/**
|
sl@0
|
132 |
* Disables subtitles during video playback.
|
sl@0
|
133 |
*
|
sl@0
|
134 |
* @return KErrNone if completed succesfully, otherwise one of the system wide error codes.
|
sl@0
|
135 |
*/
|
sl@0
|
136 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::DisableSubtitles()
|
sl@0
|
137 |
{
|
sl@0
|
138 |
return iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
139 |
EMMFSubtitleSupportDisable,
|
sl@0
|
140 |
KNullDesC8,
|
sl@0
|
141 |
KNullDesC8);
|
sl@0
|
142 |
}
|
sl@0
|
143 |
|
sl@0
|
144 |
/**
|
sl@0
|
145 |
* Enables subtitles during video playback.
|
sl@0
|
146 |
*
|
sl@0
|
147 |
* @return KErrNone if subtitles are supported; KErrNotSupported if
|
sl@0
|
148 |
* controller does not support subtitles; KErrNotFound if subtitle data
|
sl@0
|
149 |
* not found; otherwise other system error code.
|
sl@0
|
150 |
*/
|
sl@0
|
151 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::EnableSubtitles()
|
sl@0
|
152 |
{
|
sl@0
|
153 |
return iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
154 |
EMMFSubtitleSupportEnable,
|
sl@0
|
155 |
KNullDesC8,
|
sl@0
|
156 |
KNullDesC8);
|
sl@0
|
157 |
}
|
sl@0
|
158 |
|
sl@0
|
159 |
/**
|
sl@0
|
160 |
* Gets the CRP parameters associated with a display
|
sl@0
|
161 |
*
|
sl@0
|
162 |
* @param aWindowId The window id used in the query.
|
sl@0
|
163 |
* @param aId Return the CRP id associated with the given display id
|
sl@0
|
164 |
* @param aCrpRect Return the subtitle region for drawing the CRP
|
sl@0
|
165 |
*
|
sl@0
|
166 |
* @return KErrNone on success; system wide error code otherwise.
|
sl@0
|
167 |
*/
|
sl@0
|
168 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::GetCrpParameters(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect)
|
sl@0
|
169 |
{
|
sl@0
|
170 |
TPckgBuf<TInt> windowIdPckg(aWindowId);
|
sl@0
|
171 |
TPckgBuf<TCrpParameters> parameterPckg;
|
sl@0
|
172 |
|
sl@0
|
173 |
TInt err = iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
174 |
EMMFSubtitleSupportGetCrpParameter,
|
sl@0
|
175 |
windowIdPckg,
|
sl@0
|
176 |
KNullDesC8,
|
sl@0
|
177 |
parameterPckg);
|
sl@0
|
178 |
|
sl@0
|
179 |
if (KErrNone == err)
|
sl@0
|
180 |
{
|
sl@0
|
181 |
aId = parameterPckg().iId;
|
sl@0
|
182 |
aCrpRect = parameterPckg().iCrpRect;
|
sl@0
|
183 |
}
|
sl@0
|
184 |
|
sl@0
|
185 |
return err;
|
sl@0
|
186 |
}
|
sl@0
|
187 |
|
sl@0
|
188 |
/**
|
sl@0
|
189 |
* Gets the current subtitle language
|
sl@0
|
190 |
*
|
sl@0
|
191 |
* @param aLanguage On return, set the the current language.
|
sl@0
|
192 |
* @return KErrNone on success. KErrNotSupported when the enabled subtitle does not
|
sl@0
|
193 |
* contain language information. Otherwise system wide error code.
|
sl@0
|
194 |
*/
|
sl@0
|
195 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::GetSubtitleLanguage(TLanguage& aLanguage)
|
sl@0
|
196 |
{
|
sl@0
|
197 |
TPckgBuf<TLanguage> languagePckg;
|
sl@0
|
198 |
TInt err = iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
199 |
EMMFSubtitleSupportGetLanguage,
|
sl@0
|
200 |
KNullDesC8,
|
sl@0
|
201 |
KNullDesC8,
|
sl@0
|
202 |
languagePckg);
|
sl@0
|
203 |
|
sl@0
|
204 |
if (KErrNone == err)
|
sl@0
|
205 |
{
|
sl@0
|
206 |
aLanguage = languagePckg();
|
sl@0
|
207 |
}
|
sl@0
|
208 |
|
sl@0
|
209 |
return err;
|
sl@0
|
210 |
}
|
sl@0
|
211 |
|
sl@0
|
212 |
/**
|
sl@0
|
213 |
* Gets a list of all available languages.
|
sl@0
|
214 |
*
|
sl@0
|
215 |
* @param aAvailable Array of available languages
|
sl@0
|
216 |
* @leave KErrNotSupported If the current controller does not support subtitles.
|
sl@0
|
217 |
* @leave KErrNotFound If the controller cannot find subtitle data.
|
sl@0
|
218 |
* @leave Otherwise leaves with any of the system wide error codes.
|
sl@0
|
219 |
*/
|
sl@0
|
220 |
EXPORT_C void RMMFVideoPlaySubtitleSupportCustomCommands::GetSupportedSubtitleLanguagesL(RArray<TLanguage>& aSubtitleLanguages)
|
sl@0
|
221 |
{
|
sl@0
|
222 |
aSubtitleLanguages.Reset();
|
sl@0
|
223 |
|
sl@0
|
224 |
TPckgBuf<TInt> countPckg;
|
sl@0
|
225 |
User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
226 |
EMMFSubtitleSupportGetLanguageSupportCount,
|
sl@0
|
227 |
KNullDesC8,
|
sl@0
|
228 |
KNullDesC8,
|
sl@0
|
229 |
countPckg));
|
sl@0
|
230 |
|
sl@0
|
231 |
TInt count = countPckg();
|
sl@0
|
232 |
|
sl@0
|
233 |
if (count > 0)
|
sl@0
|
234 |
{
|
sl@0
|
235 |
HBufC8* buf = HBufC8::NewLC(count * sizeof(TLanguage));
|
sl@0
|
236 |
TPtr8 ptr = buf->Des();
|
sl@0
|
237 |
|
sl@0
|
238 |
User::LeaveIfError(iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
239 |
EMMFSubtitleSupportGetLanguageSupportData,
|
sl@0
|
240 |
KNullDesC8,
|
sl@0
|
241 |
KNullDesC8,
|
sl@0
|
242 |
ptr));
|
sl@0
|
243 |
|
sl@0
|
244 |
TPckgBuf<TLanguage> langPckg;
|
sl@0
|
245 |
RDesReadStream stream(ptr);
|
sl@0
|
246 |
CleanupClosePushL(stream);
|
sl@0
|
247 |
|
sl@0
|
248 |
for (TInt i = 0; i < count; i++)
|
sl@0
|
249 |
{
|
sl@0
|
250 |
stream.ReadL(langPckg);
|
sl@0
|
251 |
aSubtitleLanguages.AppendL(langPckg());
|
sl@0
|
252 |
}
|
sl@0
|
253 |
|
sl@0
|
254 |
CleanupStack::PopAndDestroy(2, buf); //stream, buf
|
sl@0
|
255 |
}
|
sl@0
|
256 |
}
|
sl@0
|
257 |
|
sl@0
|
258 |
/**
|
sl@0
|
259 |
* Sets the current subtitle language
|
sl@0
|
260 |
*
|
sl@0
|
261 |
* @param aSubtitleLanguage Language to be used for subtitle stream.
|
sl@0
|
262 |
* @return KErrNone on success. KErrNotSupported when the enabled subtitle
|
sl@0
|
263 |
* does not contain language information. Otherwise system wide error code.
|
sl@0
|
264 |
*/
|
sl@0
|
265 |
EXPORT_C TInt RMMFVideoPlaySubtitleSupportCustomCommands::SetSubtitleLanguage(TLanguage aSubtitleLanguage)
|
sl@0
|
266 |
{
|
sl@0
|
267 |
TPckgBuf<TLanguage> languagePckg(aSubtitleLanguage);
|
sl@0
|
268 |
|
sl@0
|
269 |
return iController.CustomCommandSync(iDestinationPckg,
|
sl@0
|
270 |
EMMFSubtitleSupportSetLanguage,
|
sl@0
|
271 |
languagePckg,
|
sl@0
|
272 |
KNullDesC8);
|
sl@0
|
273 |
}
|
sl@0
|
274 |
|
sl@0
|
275 |
/**
|
sl@0
|
276 |
* Creates a new custom command parser capable of handling subtitle support commands.
|
sl@0
|
277 |
*
|
sl@0
|
278 |
* @param aImplementor A reference to the controller plugin that owns this new
|
sl@0
|
279 |
* object.
|
sl@0
|
280 |
*
|
sl@0
|
281 |
* @return A pointer to the object created.
|
sl@0
|
282 |
*/
|
sl@0
|
283 |
EXPORT_C CMMFVideoPlaySubtitleSupportCustomCommandParser* CMMFVideoPlaySubtitleSupportCustomCommandParser::NewL(
|
sl@0
|
284 |
MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor)
|
sl@0
|
285 |
{
|
sl@0
|
286 |
return new(ELeave) CMMFVideoPlaySubtitleSupportCustomCommandParser(aImplementor);
|
sl@0
|
287 |
}
|
sl@0
|
288 |
|
sl@0
|
289 |
CMMFVideoPlaySubtitleSupportCustomCommandParser::CMMFVideoPlaySubtitleSupportCustomCommandParser(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor) :
|
sl@0
|
290 |
CMMFCustomCommandParserBase(KUidInterfaceMMFVideoPlaySubtitleSupport),
|
sl@0
|
291 |
iImplementor(aImplementor)
|
sl@0
|
292 |
{
|
sl@0
|
293 |
}
|
sl@0
|
294 |
|
sl@0
|
295 |
/**
|
sl@0
|
296 |
* Destructor.
|
sl@0
|
297 |
*/
|
sl@0
|
298 |
EXPORT_C CMMFVideoPlaySubtitleSupportCustomCommandParser::~CMMFVideoPlaySubtitleSupportCustomCommandParser()
|
sl@0
|
299 |
{
|
sl@0
|
300 |
iAvailableLanguages.Close();
|
sl@0
|
301 |
}
|
sl@0
|
302 |
|
sl@0
|
303 |
/**
|
sl@0
|
304 |
* Handles a request from the client. Called by the controller framework.
|
sl@0
|
305 |
*
|
sl@0
|
306 |
* @param aMessage The message to be handled.
|
sl@0
|
307 |
*/
|
sl@0
|
308 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
|
sl@0
|
309 |
{
|
sl@0
|
310 |
if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFVideoPlaySubtitleSupport)
|
sl@0
|
311 |
{
|
sl@0
|
312 |
TRAPD(error, DoHandleRequestL(aMessage));
|
sl@0
|
313 |
aMessage.Complete(error);
|
sl@0
|
314 |
}
|
sl@0
|
315 |
else
|
sl@0
|
316 |
{
|
sl@0
|
317 |
aMessage.Complete(KErrNotSupported);
|
sl@0
|
318 |
}
|
sl@0
|
319 |
}
|
sl@0
|
320 |
|
sl@0
|
321 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoHandleRequestL(TMMFMessage& aMessage)
|
sl@0
|
322 |
{
|
sl@0
|
323 |
switch (aMessage.Function())
|
sl@0
|
324 |
{
|
sl@0
|
325 |
case EMMFSubtitleSupportAvailable:
|
sl@0
|
326 |
DoGetSubtitlesAvailableL(aMessage);
|
sl@0
|
327 |
break;
|
sl@0
|
328 |
case EMMFSubtitleSupportEnable:
|
sl@0
|
329 |
DoEnableSubtitlesL(aMessage);
|
sl@0
|
330 |
break;
|
sl@0
|
331 |
case EMMFSubtitleSupportDisable:
|
sl@0
|
332 |
DoDisableSubtitlesL(aMessage);
|
sl@0
|
333 |
break;
|
sl@0
|
334 |
case EMMFSubtitleSupportGetLanguageSupportCount:
|
sl@0
|
335 |
DoGetSupportedLanguagesCountL(aMessage);
|
sl@0
|
336 |
break;
|
sl@0
|
337 |
case EMMFSubtitleSupportGetLanguageSupportData:
|
sl@0
|
338 |
DoGetSupportedLanguagesDataL(aMessage);
|
sl@0
|
339 |
break;
|
sl@0
|
340 |
case EMMFSubtitleSupportGetLanguage:
|
sl@0
|
341 |
DoGetSubtitleLanguageL(aMessage);
|
sl@0
|
342 |
break;
|
sl@0
|
343 |
case EMMFSubtitleSupportSetLanguage:
|
sl@0
|
344 |
DoSetSubtitleLanguageL(aMessage);
|
sl@0
|
345 |
break;
|
sl@0
|
346 |
case EMMFSubtitleSupportUpdateSubtitleConfig:
|
sl@0
|
347 |
DoUpdateSubtitleConfigL(aMessage);
|
sl@0
|
348 |
break;
|
sl@0
|
349 |
case EMMFSubtitleSupportAddSubtitleConfig:
|
sl@0
|
350 |
DoAddSubtitleConfigL(aMessage);
|
sl@0
|
351 |
break;
|
sl@0
|
352 |
case EMMFSubtitleSupportRemoveSubtitleConfig:
|
sl@0
|
353 |
DoRemoveSubtitleConfigL(aMessage);
|
sl@0
|
354 |
break;
|
sl@0
|
355 |
case EMMFSubtitleSupportGetCrpParameter:
|
sl@0
|
356 |
DoGetCrpParametersL(aMessage);
|
sl@0
|
357 |
break;
|
sl@0
|
358 |
default:
|
sl@0
|
359 |
User::Leave(KErrNotSupported);
|
sl@0
|
360 |
break;
|
sl@0
|
361 |
}
|
sl@0
|
362 |
}
|
sl@0
|
363 |
|
sl@0
|
364 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoGetSubtitlesAvailableL(TMMFMessage& aMessage)
|
sl@0
|
365 |
{
|
sl@0
|
366 |
TBool avail;
|
sl@0
|
367 |
iImplementor.MvpsusGetSubtitlesAvailableL(avail);
|
sl@0
|
368 |
TPckgBuf<TBool> availPckg(avail);
|
sl@0
|
369 |
aMessage.WriteDataToClientL(availPckg);
|
sl@0
|
370 |
}
|
sl@0
|
371 |
|
sl@0
|
372 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoUpdateSubtitleConfigL(TMMFMessage& aMessage)
|
sl@0
|
373 |
{
|
sl@0
|
374 |
TPckgBuf<TMMFSubtitleWindowConfig> configPckg;
|
sl@0
|
375 |
aMessage.ReadData1FromClientL(configPckg);
|
sl@0
|
376 |
iImplementor.MvpsusUpdateSubtitleConfigL(configPckg());
|
sl@0
|
377 |
}
|
sl@0
|
378 |
|
sl@0
|
379 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoAddSubtitleConfigL(TMMFMessage& aMessage)
|
sl@0
|
380 |
{
|
sl@0
|
381 |
TPckgBuf<TMMFSubtitleWindowConfig> configPckg;
|
sl@0
|
382 |
aMessage.ReadData1FromClientL(configPckg);
|
sl@0
|
383 |
iImplementor.MvpsusAddSubtitleConfigL(configPckg());
|
sl@0
|
384 |
}
|
sl@0
|
385 |
|
sl@0
|
386 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoRemoveSubtitleConfigL(TMMFMessage& aMessage)
|
sl@0
|
387 |
{
|
sl@0
|
388 |
TPckgBuf<TInt> windowPckg;
|
sl@0
|
389 |
aMessage.ReadData1FromClientL(windowPckg);
|
sl@0
|
390 |
iImplementor.MvpsusRemoveSubtitleConfigL(windowPckg());
|
sl@0
|
391 |
}
|
sl@0
|
392 |
|
sl@0
|
393 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoDisableSubtitlesL(TMMFMessage& /*aMessage*/)
|
sl@0
|
394 |
{
|
sl@0
|
395 |
iImplementor.MvpsusDisableSubtitlesL();
|
sl@0
|
396 |
}
|
sl@0
|
397 |
|
sl@0
|
398 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoEnableSubtitlesL(TMMFMessage& /*aMessage*/)
|
sl@0
|
399 |
{
|
sl@0
|
400 |
iImplementor.MvpsusEnableSubtitlesL();
|
sl@0
|
401 |
}
|
sl@0
|
402 |
|
sl@0
|
403 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoGetSupportedLanguagesDataL(TMMFMessage& aMessage)
|
sl@0
|
404 |
{
|
sl@0
|
405 |
HBufC8* buf = HBufC8::NewLC(iAvailableLanguages.Count() * sizeof(TLanguage));
|
sl@0
|
406 |
TPtr8 ptr = buf->Des();
|
sl@0
|
407 |
RDesWriteStream stream(ptr);
|
sl@0
|
408 |
CleanupClosePushL(stream);
|
sl@0
|
409 |
|
sl@0
|
410 |
for (TInt i = 0; i < iAvailableLanguages.Count(); i++)
|
sl@0
|
411 |
{
|
sl@0
|
412 |
TPckgBuf<TLanguage> langPckg(iAvailableLanguages[i]);
|
sl@0
|
413 |
stream.WriteL(langPckg);
|
sl@0
|
414 |
}
|
sl@0
|
415 |
|
sl@0
|
416 |
stream.CommitL();
|
sl@0
|
417 |
aMessage.WriteDataToClientL(ptr);
|
sl@0
|
418 |
CleanupStack::PopAndDestroy(2, buf); // stream, buf
|
sl@0
|
419 |
}
|
sl@0
|
420 |
|
sl@0
|
421 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoGetSupportedLanguagesCountL(TMMFMessage& aMessage)
|
sl@0
|
422 |
{
|
sl@0
|
423 |
iAvailableLanguages.Reset();
|
sl@0
|
424 |
iImplementor.MvpsusGetSupportedSubtitleLanguagesL(iAvailableLanguages);
|
sl@0
|
425 |
|
sl@0
|
426 |
TPckgBuf<TInt> countPckg(iAvailableLanguages.Count());
|
sl@0
|
427 |
aMessage.WriteDataToClientL(countPckg);
|
sl@0
|
428 |
}
|
sl@0
|
429 |
|
sl@0
|
430 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoGetSubtitleLanguageL(TMMFMessage& aMessage)
|
sl@0
|
431 |
{
|
sl@0
|
432 |
TLanguage lang;
|
sl@0
|
433 |
iImplementor.MvpsusGetSubtitleLanguageL(lang);
|
sl@0
|
434 |
TPckgBuf<TLanguage> langPckg(lang);
|
sl@0
|
435 |
aMessage.WriteDataToClientL(langPckg);
|
sl@0
|
436 |
}
|
sl@0
|
437 |
|
sl@0
|
438 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoSetSubtitleLanguageL(TMMFMessage& aMessage)
|
sl@0
|
439 |
{
|
sl@0
|
440 |
TPckgBuf<TLanguage> langPckg;
|
sl@0
|
441 |
aMessage.ReadData1FromClientL(langPckg);
|
sl@0
|
442 |
iImplementor.MvpsusSetSubtitleLanguageL(langPckg());
|
sl@0
|
443 |
}
|
sl@0
|
444 |
|
sl@0
|
445 |
void CMMFVideoPlaySubtitleSupportCustomCommandParser::DoGetCrpParametersL(TMMFMessage& aMessage)
|
sl@0
|
446 |
{
|
sl@0
|
447 |
TCrpParameters crpParams;
|
sl@0
|
448 |
TPckgBuf<TInt> displayPckg;
|
sl@0
|
449 |
aMessage.ReadData1FromClientL(displayPckg);
|
sl@0
|
450 |
iImplementor.MvpsusGetCrpParametersL(displayPckg(), crpParams.iId, crpParams.iCrpRect);
|
sl@0
|
451 |
|
sl@0
|
452 |
TPckgBuf<TCrpParameters> paramPckg(crpParams);
|
sl@0
|
453 |
aMessage.WriteDataToClientL(paramPckg);
|
sl@0
|
454 |
}
|