author | hgs |
Fri, 25 Jun 2010 17:36:03 -0500 | |
changeset 28 | ebf79c79991a |
parent 25 | 6f7ceef7b1d1 |
child 43 | 9894ed580e4a |
permissions | -rw-r--r-- |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
25 | 2 |
* Copyright (c) 2009 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: |
|
15 |
* |
|
16 |
*/ |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#include <string.h> |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include <ctype.h> |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <uri8.h> |
19 | 21 |
#include <uri16.h> |
25 | 22 |
#include "cmmfbackendengine.h" |
19 | 23 |
#include "markerpositiontimer.h" |
24 |
#include "positionupdatetimer.h" |
|
25 |
#include "profileutilmacro.h" |
|
28 | 26 |
#include <mmf/common/mmfvideoenums.h> |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
|
25 | 28 |
extern "C" |
29 |
{ |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include "xaadaptationmmf.h" |
25 | 31 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
|
19 | 33 |
#define RET_IF_ERR(res, val) if (res != KErrNone) return val |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
|
19 | 35 |
const XAuint32 XA_PLAYSTATE_PLAYERUNINITIALIZED = 0; |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
CMMFBackendEngine* CMMFBackendEngine::NewL() |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
CMMFBackendEngine* self = new (ELeave) CMMFBackendEngine(); |
19 | 40 |
CleanupStack::PushL(self); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
self->ConstructL(); |
19 | 42 |
CleanupStack::Pop(self); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
return self; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
CMMFBackendEngine::~CMMFBackendEngine() |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
{ |
19 | 48 |
Close(); |
49 |
Destroy(); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
|
25 | 52 |
CMMFBackendEngine::CMMFBackendEngine() : |
53 |
iPositionUpdatePeriod(1000), /* default is 1000 millisec */ |
|
54 |
iUriPtr(NULL, 0) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
{ |
19 | 56 |
iRecordState = ERecorderNotReady; |
57 |
iPositionUpdateTimer = NULL; |
|
58 |
iMediaPlayerState = XA_PLAYSTATE_PLAYERUNINITIALIZED; |
|
59 |
iMMFPlayerState = EPlayerClosed; |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
void CMMFBackendEngine::ConstructL() |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
{ |
19 | 64 |
iAPIBeingUsed = ENoUtility; |
65 |
iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait; |
|
66 |
} |
|
67 |
||
20 | 68 |
void CMMFBackendEngine::InitAudioRecorderUtilityL() |
69 |
{ |
|
70 |
if (!iAudioRecorder) |
|
71 |
{ |
|
72 |
iBaseAudioRecorder = CMdaAudioRecorderUtility::NewL(*this); |
|
25 | 73 |
iAudioRecorder = (CMdaAudioRecorderUtility*) iBaseAudioRecorder; |
20 | 74 |
} |
75 |
} |
|
76 |
||
19 | 77 |
void CMMFBackendEngine::InitAudioPlayerUtilityL() |
78 |
{ |
|
79 |
if (!iAudioPlayer) |
|
80 |
{ |
|
81 |
iBaseAudioPlayer = CMdaAudioPlayerUtility::NewL(*this); |
|
25 | 82 |
iAudioPlayer = (CMdaAudioPlayerUtility*) iBaseAudioPlayer; |
19 | 83 |
} |
84 |
InitPlayerTimersL(); |
|
85 |
} |
|
86 |
||
87 |
void CMMFBackendEngine::InitVideoPlayerUtilityL() |
|
88 |
{ |
|
89 |
if (!iVideoPlayer) |
|
90 |
{ |
|
25 | 91 |
iBaseVideoPlayer = CVideoPlayerUtility2::NewL(*this, |
92 |
EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality); |
|
93 |
iVideoPlayer = (CVideoPlayerUtility2*) iBaseVideoPlayer; |
|
19 | 94 |
iVideoPlayer->RegisterForVideoLoadingNotification(*this); |
95 |
} |
|
96 |
InitPlayerTimersL(); |
|
97 |
} |
|
98 |
||
99 |
void CMMFBackendEngine::InitPlayerTimersL() |
|
100 |
{ |
|
101 |
if (!iMarkerPositionTimer) |
|
102 |
{ |
|
25 | 103 |
iMarkerPositionTimer = CMarkerPositionTimer::NewL(iAudioPlayer, |
104 |
iVideoPlayer); |
|
19 | 105 |
iMarkerPositionTimer->SetContext(iAdaptContext); |
106 |
} |
|
107 |
if (!iPlayItfPositionUpdateTimer) |
|
108 |
{ |
|
25 | 109 |
iPlayItfPositionUpdateTimer = CPositionUpdateTimer::NewL( |
110 |
iAudioPlayer, iVideoPlayer); |
|
19 | 111 |
iPlayItfPositionUpdateTimer->SetContext(iAdaptContext); |
112 |
} |
|
113 |
iMarkerPositionTimer->Stop(); |
|
114 |
iPlayItfPositionUpdateTimer->Stop(); |
|
115 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
|
25 | 117 |
TInt CMMFBackendEngine::SetFileName(char* uri, XAuint32 format, |
118 |
TFuncInUse func) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
TInt err(KErrNone); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
_LIT8(KFileSlash,"file:///"); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
TInt fileslashlen = KFileSlash().Length(); |
19 | 123 |
if (func == ERecord) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
{ |
19 | 125 |
if (iRecordState == ERecorderNotReady) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
iFileFormat = format; |
21 | 128 |
iAPIBeingUsed = DetermineAPIToUse(uri, ERecord); |
20 | 129 |
err = XA_RESULT_INTERNAL_ERROR; |
130 |
if (iAPIBeingUsed == EAudioRecorderUtility) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
{ |
20 | 132 |
/* Initialize URI as needed by MMF utilities */ |
133 |
err = InitializeURIForMMFUtil(uri); |
|
134 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
|
135 |
/* Initalize Recorder related objects */ |
|
136 |
TRAP(err, InitAudioRecorderUtilityL()); |
|
137 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
|
25 | 138 |
|
21 | 139 |
TRAP(err, iAudioRecorder->OpenFileL(iUriPtr)); |
20 | 140 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
141 |
/* Wait until we receive moscostatechanged callback */ |
|
25 | 142 |
if (iActiveSchedulerWait && !iActiveSchedulerWait->IsStarted()) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
iActiveSchedulerWait->Start(); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
} |
20 | 146 |
RET_IF_ERR(iErrorCode, XA_RESULT_INTERNAL_ERROR); |
25 | 147 |
} |
20 | 148 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
else |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
{ |
19 | 152 |
/* The second one is needed for dynamic source interface */ |
25 | 153 |
if ((iMediaPlayerState == XA_PLAYSTATE_PLAYERUNINITIALIZED) |
154 |
|| (iMediaPlayerState == XA_PLAYSTATE_STOPPED)) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
iFileFormat = format; |
19 | 157 |
iAPIBeingUsed = DetermineAPIToUse(uri, EPlay); |
158 |
err = XA_RESULT_INTERNAL_ERROR; |
|
159 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
|
160 |
{ |
|
161 |
/* Initialize URI as needed by MMF utilities */ |
|
162 |
err = InitializeURIForMMFUtil(uri); |
|
163 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
|
164 |
/* Initalize Player related objects */ |
|
165 |
TRAP(err, InitAudioPlayerUtilityL()); |
|
166 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
|
167 |
||
168 |
TAG_TIME_PROFILING_BEGIN; |
|
169 |
TRAP(err, iAudioPlayer->OpenFileL(iUriPtr)); |
|
25 | 170 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
171 |
TAG_TIME_PROFILING_END; |
|
19 | 172 |
PRINT_TO_CONSOLE_TIME_DIFF; |
173 |
||
174 |
/* Wait until we receive mapc init complete */ |
|
175 |
PRINT_TO_CONSOLE_HOME_TIME; |
|
25 | 176 |
if (iActiveSchedulerWait && !iActiveSchedulerWait->IsStarted()) |
19 | 177 |
{ |
178 |
iActiveSchedulerWait->Start(); |
|
179 |
} |
|
180 |
RET_IF_ERR(iErrorCode, XA_RESULT_INTERNAL_ERROR); |
|
181 |
} |
|
182 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
{ |
19 | 184 |
/* Initialize URI as needed by MMF utilities */ |
185 |
err = InitializeURIForMMFUtil(uri); |
|
186 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
|
187 |
/* Initalize Player related objects */ |
|
188 |
TRAP(err, InitVideoPlayerUtilityL()); |
|
189 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
|
190 |
||
25 | 191 |
if (iUriType == ELocal) |
21 | 192 |
{ |
193 |
/* Open file */ |
|
194 |
TAG_TIME_PROFILING_BEGIN; |
|
195 |
TRAP(err, iVideoPlayer->OpenFileL(iUriPtr)); |
|
25 | 196 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
197 |
TAG_TIME_PROFILING_END; |
|
21 | 198 |
PRINT_TO_CONSOLE_TIME_DIFF; |
199 |
} |
|
200 |
else |
|
201 |
{ |
|
202 |
/* Open URL */ |
|
203 |
TAG_TIME_PROFILING_BEGIN; |
|
204 |
TRAP(err, iVideoPlayer->OpenUrlL(iUriPtr)); |
|
25 | 205 |
RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR); |
206 |
TAG_TIME_PROFILING_END; |
|
21 | 207 |
PRINT_TO_CONSOLE_TIME_DIFF; |
208 |
} |
|
19 | 209 |
/* Wait until we receive MvpuoOpenComplete */ |
210 |
PRINT_TO_CONSOLE_HOME_TIME; |
|
25 | 211 |
if (iActiveSchedulerWait && !iActiveSchedulerWait->IsStarted()) |
19 | 212 |
{ |
213 |
iActiveSchedulerWait->Start(); |
|
214 |
} |
|
215 |
RET_IF_ERR(iErrorCode, XA_RESULT_INTERNAL_ERROR); |
|
216 |
||
217 |
/* Prepare utility */ |
|
218 |
TAG_TIME_PROFILING_BEGIN_NO_VAR_DEF; |
|
219 |
iVideoPlayer->Prepare(); |
|
25 | 220 |
TAG_TIME_PROFILING_END_NO_VAR_DEF; |
19 | 221 |
PRINT_TO_CONSOLE_TIME_DIFF; |
222 |
||
223 |
/* Wait until we receive MvpuoPrepareComplete */ |
|
224 |
PRINT_TO_CONSOLE_HOME_TIME_NO_VAR_DEF; |
|
25 | 225 |
if (iActiveSchedulerWait && !iActiveSchedulerWait->IsStarted()) |
19 | 226 |
{ |
227 |
iActiveSchedulerWait->Start(); |
|
228 |
} |
|
229 |
RET_IF_ERR(iErrorCode, XA_RESULT_INTERNAL_ERROR); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
} |
25 | 231 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
} |
19 | 233 |
if (err != KErrNone) |
234 |
{ |
|
235 |
err = XA_RESULT_INTERNAL_ERROR; |
|
236 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
TInt CMMFBackendEngine::DetermineAPIToUse(char* uri, TFuncInUse aFunc) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
{ |
19 | 242 |
char* dotPtr = NULL; |
25 | 243 |
char ext[MAX_EXTENSION_SIZE] = |
244 |
{ |
|
245 |
0 |
|
246 |
}; |
|
19 | 247 |
int extLen; |
248 |
||
21 | 249 |
int colpos; |
25 | 250 |
char urischeme[MAX_EXTENSION_SIZE] = |
251 |
{ |
|
252 |
0 |
|
253 |
}; |
|
21 | 254 |
int urischemeLen; |
255 |
||
25 | 256 |
dotPtr = strrchr(uri, (int) '.'); |
19 | 257 |
if (!dotPtr) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
{ |
19 | 259 |
return KErrNotFound; |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
} |
19 | 261 |
|
25 | 262 |
strncpy(ext, dotPtr, strlen(dotPtr)); |
19 | 263 |
/*Null terminate the string*/ |
264 |
ext[strlen(dotPtr)] = '\0'; |
|
265 |
extLen = sizeof(ext); |
|
25 | 266 |
for (unsigned int i = 0; i < extLen; i++) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
{ |
19 | 268 |
ext[i] = tolower(ext[i]); |
269 |
} |
|
270 |
||
25 | 271 |
colpos = strcspn(uri, ":"); |
21 | 272 |
|
25 | 273 |
strncpy(urischeme, uri, colpos + 1); |
21 | 274 |
/*Null terminate the string*/ |
25 | 275 |
urischeme[colpos + 1] = '\0'; |
21 | 276 |
urischemeLen = sizeof(urischeme); |
25 | 277 |
for (unsigned int i = 0; i < urischemeLen; i++) |
21 | 278 |
{ |
279 |
urischeme[i] = tolower(urischeme[i]); |
|
280 |
} |
|
25 | 281 |
|
19 | 282 |
if (aFunc == ERecord) |
283 |
{ |
|
284 |
return EAudioRecorderUtility; |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
286 |
else |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
{ |
25 | 288 |
if (!strcmp(urischeme, "file:")) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
289 |
{ |
25 | 290 |
if (!strcmp(ext, ".mp3") || !strcmp(ext, ".amr") |
291 |
|| !strcmp(ext, ".aac") || !strcmp(ext, ".mid") |
|
292 |
|| !strcmp(ext, ".wav") || !strcmp(ext, ".awb")) |
|
21 | 293 |
{ |
294 |
return EAudioPlayerUtility; |
|
295 |
} |
|
25 | 296 |
else |
21 | 297 |
{ |
298 |
return EVideoPlayerUtility; |
|
299 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
300 |
} |
21 | 301 |
else |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
return EVideoPlayerUtility; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
304 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
305 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
306 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
307 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
308 |
//From MVidePlayerUtilityObserver |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
309 |
void CMMFBackendEngine::MvpuoOpenComplete(TInt aError) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
310 |
{ |
19 | 311 |
PRINT_TO_CONSOLE_HOME_TIME; |
312 |
||
313 |
iErrorCode = aError; |
|
314 |
if (iErrorCode == KErrNone) |
|
315 |
{ |
|
316 |
iMMFPlayerState = EPlayerOpened; |
|
317 |
} |
|
25 | 318 |
if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted()) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
{ |
19 | 320 |
iActiveSchedulerWait->AsyncStop(); |
321 |
} |
|
322 |
} |
|
323 |
||
324 |
void CMMFBackendEngine::MvpuoPrepareComplete(TInt aError) |
|
325 |
{ |
|
326 |
PRINT_TO_CONSOLE_HOME_TIME; |
|
327 |
||
328 |
TAutoScaleType autoScale = EAutoScaleBestFit; |
|
329 |
iErrorCode = aError; |
|
330 |
iMediaPlayerState = XA_PLAYSTATE_PLAYERUNINITIALIZED; |
|
331 |
iMediaDuration = 0; |
|
332 |
iMarkerPositionTimer->ResetPlayer(); |
|
333 |
iPlayItfPositionUpdateTimer->ResetPlayer(); |
|
334 |
if (iErrorCode == KErrNone) |
|
335 |
{ |
|
336 |
iMMFPlayerState = EPlayerPrepared; |
|
337 |
TAG_TIME_PROFILING_BEGIN; |
|
25 | 338 |
TRAP(iErrorCode, iMediaDuration = iVideoPlayer->DurationL()); |
339 |
TAG_TIME_PROFILING_END; |
|
19 | 340 |
PRINT_TO_CONSOLE_TIME_DIFF; |
341 |
if (iErrorCode == KErrNone) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
{ |
19 | 343 |
iPlaybackHead = 0; |
344 |
iMediaPlayerState = XA_PLAYSTATE_STOPPED; |
|
345 |
iMarkerPositionTimer->UseVideoPlayer(); |
|
346 |
iPlayItfPositionUpdateTimer->UseVideoPlayer(); |
|
347 |
if (m_pWs && m_pScr && m_pWindow) |
|
348 |
{ |
|
349 |
TRect videoExtent = TRect(m_pWindow->Size()); |
|
25 | 350 |
TRect clipRect = TRect(m_pWindow->Size()); |
19 | 351 |
TAG_TIME_PROFILING_BEGIN; |
352 |
TRAP_IGNORE(iVideoPlayer->AddDisplayWindowL(*m_pWs, *m_pScr, *m_pWindow, videoExtent, clipRect)); |
|
25 | 353 |
TRAP_IGNORE(iVideoPlayer->SetAutoScaleL(*m_pWindow, autoScale)); |
354 |
TAG_TIME_PROFILING_END; |
|
19 | 355 |
PRINT_TO_CONSOLE_TIME_DIFF; |
356 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
357 |
} |
19 | 358 |
} |
25 | 359 |
if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted()) |
19 | 360 |
{ |
361 |
iActiveSchedulerWait->AsyncStop(); |
|
362 |
} |
|
363 |
} |
|
364 |
||
25 | 365 |
void CMMFBackendEngine::MvpuoFrameReady(CFbsBitmap& /*aFrame*/, TInt /*aError*/) |
19 | 366 |
{ |
367 |
||
368 |
} |
|
369 |
void CMMFBackendEngine::MvpuoPlayComplete(TInt aError) |
|
370 |
{ |
|
371 |
iErrorCode = aError; |
|
372 |
if (iErrorCode == KErrNone) |
|
373 |
{ |
|
374 |
iPlaybackHead = iMediaDuration; |
|
375 |
/* Per OpenMAX AL Spec, when playback is completed, media player stays in |
|
376 |
* paused state with playhead at the end of the media clip */ |
|
377 |
iMediaPlayerState = XA_PLAYSTATE_PAUSED; |
|
378 |
DoPostEvent(XA_PLAYEVENT_HEADATEND); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
379 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
380 |
else |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
381 |
{ |
19 | 382 |
iPlaybackHead = 0; |
383 |
iMediaPlayerState = XA_PLAYSTATE_STOPPED; |
|
25 | 384 |
XAAdaptEvent event = |
385 |
{ |
|
386 |
XA_PLAYITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL |
|
387 |
}; |
|
388 |
XAAdaptationBase_SendAdaptEvents( |
|
389 |
(XAAdaptationBaseCtx*) iAdaptContext, &event); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
} |
19 | 391 |
iMMFPlayerState = EPlayerPrepared; |
392 |
iMarkerPositionTimer->Stop(); |
|
393 |
iPlayItfPositionUpdateTimer->Stop(); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
void CMMFBackendEngine::MvpuoEvent(class TMMFEvent const & event) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
{ |
19 | 398 |
//RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent (0x%x %d)"), event.iEventType, event.iErrorCode); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
|
25 | 400 |
if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError |
401 |
&& event.iErrorCode == KErrHardwareNotAvailable) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
{ |
19 | 403 |
//RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Hardware Not Available")); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
|
25 | 406 |
else if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError |
407 |
&& event.iErrorCode == KErrMMPartialPlayback) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
{ |
19 | 409 |
//RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Partial playback")); |
25 | 410 |
} |
411 |
if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError |
|
412 |
&& event.iErrorCode == -12014) |
|
19 | 413 |
{ |
414 |
//RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Audio Device taken")); |
|
415 |
PausePlayback(); |
|
25 | 416 |
XAAdaptEvent event = |
417 |
{ |
|
418 |
XA_PLAYITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL |
|
419 |
}; |
|
420 |
XAAdaptationBase_SendAdaptEvents( |
|
421 |
(XAAdaptationBaseCtx*) iAdaptContext, &event); |
|
19 | 422 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
else if (event.iEventType == KMMFRefreshMetaData) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
{ |
19 | 425 |
//RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: EventType == KMMFRefreshMetaData")); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
427 |
else |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
{ |
19 | 429 |
//RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Unhandled event")); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
431 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
434 |
// From MRebufferCallback |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
void CMMFBackendEngine::MvloLoadingStarted() |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
439 |
void CMMFBackendEngine::MvloLoadingComplete() |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
441 |
//file playing |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
442 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
443 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
//MMdaAudioPlayerCallback |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
445 |
void CMMFBackendEngine::MapcInitComplete(TInt aError, |
25 | 446 |
const TTimeIntervalMicroSeconds& aDuration) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
{ |
19 | 448 |
PRINT_TO_CONSOLE_HOME_TIME; |
449 |
||
450 |
iErrorCode = aError; |
|
451 |
iMediaPlayerState = XA_PLAYSTATE_PLAYERUNINITIALIZED; |
|
452 |
iMMFPlayerState = EPlayerClosed; |
|
453 |
iMediaDuration = 0; |
|
454 |
iMarkerPositionTimer->ResetPlayer(); |
|
455 |
iPlayItfPositionUpdateTimer->ResetPlayer(); |
|
456 |
if (iErrorCode == KErrNone) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
{ |
19 | 458 |
iMediaDuration = aDuration; |
459 |
iPlaybackHead = 0; |
|
460 |
iMediaPlayerState = XA_PLAYSTATE_STOPPED; |
|
461 |
iMMFPlayerState = EPlayerOpened; |
|
462 |
iMarkerPositionTimer->UseAudioPlayer(); |
|
463 |
iPlayItfPositionUpdateTimer->UseAudioPlayer(); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
} |
25 | 465 |
if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted()) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
466 |
{ |
19 | 467 |
iActiveSchedulerWait->AsyncStop(); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
468 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
469 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
470 |
|
19 | 471 |
void CMMFBackendEngine::MapcPlayComplete(TInt aError) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
{ |
19 | 473 |
iErrorCode = aError; |
474 |
if (iErrorCode == KErrNone) |
|
475 |
{ |
|
476 |
/* Now we should have better value. Start using that */ |
|
477 |
iAudioPlayer->Duration(iMediaDuration); |
|
478 |
iPlaybackHead = iMediaDuration; |
|
479 |
/* Per OpenMAX AL Spec, when playback is completed, media player stays in |
|
480 |
* paused state with playhead at the end of the media clip */ |
|
481 |
iMediaPlayerState = XA_PLAYSTATE_PAUSED; |
|
482 |
DoPostEvent(XA_PLAYEVENT_HEADATEND); |
|
483 |
iMMFPlayerState = EPlayerOpened; |
|
484 |
} |
|
485 |
else |
|
486 |
{ |
|
487 |
iAudioPlayer->GetPosition(iPlaybackHead); |
|
488 |
iMediaPlayerState = XA_PLAYSTATE_PAUSED; |
|
489 |
iMMFPlayerState = EPlayerPaused; |
|
25 | 490 |
XAAdaptEvent event = |
491 |
{ |
|
492 |
XA_PLAYITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL |
|
493 |
}; |
|
494 |
XAAdaptationBase_SendAdaptEvents( |
|
495 |
(XAAdaptationBaseCtx*) iAdaptContext, &event); |
|
19 | 496 |
} |
497 |
iMarkerPositionTimer->Stop(); |
|
498 |
iPlayItfPositionUpdateTimer->Stop(); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
499 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
501 |
// from MMdaObjectStateChangeObserver |
25 | 502 |
void CMMFBackendEngine::MoscoStateChangeEvent(CBase* /*aObject*/, |
503 |
TInt aPreviousState, TInt aCurrentState, TInt aErrorCode) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
{ |
19 | 505 |
TInt err(KErrNone); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
506 |
iPreviousRecordState = aPreviousState; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
507 |
iCurrentRecordState = aCurrentState; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
508 |
iErrorCode = aErrorCode; |
19 | 509 |
//RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 1 Error[%d]"),aErrorCode); |
25 | 510 |
if (iCurrentRecordState == CMdaAudioClipUtility::EOpen) //EOpen |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
511 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
512 |
//outputfile is open and ready for recording |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
513 |
iRecordState = CMMFBackendEngine::ERecorderOpen; |
19 | 514 |
if (iErrorCode == KErrNone) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
515 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
516 |
if (iPreviousRecordState == CMdaAudioClipUtility::ENotReady) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
517 |
{ |
19 | 518 |
//RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 2")); |
21 | 519 |
TRAP(err,iAudioInputRecord = CAudioInput::NewL( *iAudioRecorder )); |
25 | 520 |
if (err == KErrNone) |
21 | 521 |
{ |
522 |
RArray<CAudioInput::TAudioInputPreference> inputArray; |
|
25 | 523 |
inputArray.Append(CAudioInput::EDefaultMic); |
21 | 524 |
// Set Audio Input |
525 |
TRAP(err, iAudioInputRecord->SetAudioInputL( inputArray.Array( ) )); |
|
526 |
inputArray.Close(); |
|
527 |
} |
|
25 | 528 |
TMMFMessageDestination destination( |
529 |
KUidMetaDataWriteCustomCommand); |
|
530 |
TMMFMessageDestinationPckg pckg = TMMFMessageDestinationPckg( |
|
531 |
destination); |
|
532 |
TInt ret = iAudioRecorder->RecordControllerCustomCommandSync( |
|
533 |
pckg, 0, KNullDesC8, KNullDesC8); |
|
19 | 534 |
//RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 3 [%d]"),ret); |
535 |
if (ret != KErrNone && iFileFormat == XA_CONTAINERTYPE_MP4) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
536 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
537 |
iPauseSupportMP4 = FALSE; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
538 |
} |
25 | 539 |
if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted()) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
540 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
541 |
iActiveSchedulerWait->AsyncStop(); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
542 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
543 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
544 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
545 |
else |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
546 |
{ |
25 | 547 |
XAAdaptEvent event = |
548 |
{ |
|
549 |
XA_RECORDITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL |
|
550 |
}; |
|
551 |
XAAdaptationBase_SendAdaptEvents( |
|
552 |
(XAAdaptationBaseCtx*) iAdaptContext, &event); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
553 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
554 |
} |
25 | 555 |
else if (iCurrentRecordState == CMdaAudioClipUtility::ERecording) //ERecording |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
556 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
557 |
iRecordState = CMMFBackendEngine::ERecorderRecording; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
iPositionUpdateTimer->Start(iTimerDelay); |
25 | 559 |
XAAdaptEvent event = |
560 |
{ |
|
561 |
XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADMOVING, 0, NULL |
|
562 |
}; |
|
563 |
XAAdaptationBase_SendAdaptEvents( |
|
564 |
(XAAdaptationBaseCtx*) iAdaptContext, &event); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
565 |
} |
25 | 566 |
else //ENotReady |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
567 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
568 |
//outputfile is not open |
19 | 569 |
iRecordState = CMMFBackendEngine::ERecorderNotReady; |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
570 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
571 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
572 |
|
25 | 573 |
TInt CMMFBackendEngine::SetRecorderState(TRecorderState state, |
574 |
XAboolean stopCalled) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
575 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
576 |
TInt err(KErrNone); |
20 | 577 |
|
578 |
if (iAPIBeingUsed != EAudioRecorderUtility) |
|
579 |
{ |
|
580 |
return XA_RESULT_INTERNAL_ERROR; |
|
581 |
} |
|
582 |
||
25 | 583 |
switch (state) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
584 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
585 |
case ERecorderNotReady: |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
586 |
iAudioRecorder->Close(); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
587 |
iRecordState = ERecorderNotReady; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
588 |
break; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
589 |
case ERecorderOpen: |
25 | 590 |
if (iFileFormat == XA_CONTAINERTYPE_MP4 && !iPauseSupportMP4 |
591 |
&& !stopCalled) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
592 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
593 |
err = KErrNotSupported; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
594 |
return err; |
19 | 595 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
596 |
iPositionUpdateTimer->Stop(); |
19 | 597 |
iAudioRecorder->Stop(); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
598 |
iRecordState = ERecorderOpen; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
599 |
break; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
600 |
case ERecorderRecording: |
25 | 601 |
TRAP(err, iAudioRecorder->RecordL()) |
602 |
; |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
603 |
break; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
604 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
605 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
606 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
607 |
|
19 | 608 |
void CMMFBackendEngine::Close() |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
609 |
{ |
19 | 610 |
if (iMarkerPositionTimer) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
611 |
{ |
19 | 612 |
iMarkerPositionTimer->Stop(); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
613 |
} |
19 | 614 |
if (iPlayItfPositionUpdateTimer) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
615 |
{ |
19 | 616 |
iPlayItfPositionUpdateTimer->Stop(); |
617 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
618 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
619 |
if (iBaseVideoPlayer && iVideoPlayer) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
620 |
{ |
25 | 621 |
switch (iMMFPlayerState) |
19 | 622 |
{ |
623 |
case EPlayerPlaying: |
|
624 |
case EPlayerPaused: |
|
625 |
case EPlayerPrepared: |
|
626 |
iVideoPlayer->Stop(); |
|
627 |
case EPlayerOpened: |
|
25 | 628 |
if (m_pWs && m_pScr && m_pWindow) |
629 |
{ |
|
630 |
iVideoPlayer->RemoveDisplayWindow(*m_pWindow); |
|
631 |
} |
|
19 | 632 |
iVideoPlayer->Close(); |
633 |
case EPlayerClosed: |
|
634 |
default: |
|
635 |
break; |
|
636 |
}; |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
637 |
} |
25 | 638 |
|
21 | 639 |
// deleting the AudioInput object |
25 | 640 |
if (iAudioInputRecord) |
21 | 641 |
{ |
25 | 642 |
delete iAudioInputRecord; |
643 |
iAudioInputRecord = NULL; |
|
21 | 644 |
} |
25 | 645 |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
646 |
if (iBaseAudioPlayer && iAudioPlayer) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
647 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
648 |
iAudioPlayer->Close(); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
649 |
} |
19 | 650 |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
651 |
if (iBaseAudioRecorder) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
652 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
653 |
iAudioRecorder->Close(); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
654 |
} |
19 | 655 |
|
25 | 656 |
if (iPositionUpdateTimer) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
657 |
{ |
19 | 658 |
iPositionUpdateTimer->Stop(); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
659 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
660 |
|
20 | 661 |
if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted()) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
662 |
{ |
20 | 663 |
iActiveSchedulerWait->AsyncStop(); |
19 | 664 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
665 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
666 |
|
19 | 667 |
void CMMFBackendEngine::Destroy() |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
668 |
{ |
19 | 669 |
delete iPositionUpdateTimer; |
670 |
iPositionUpdateTimer = NULL; |
|
671 |
delete iUri; |
|
672 |
iUri = NULL; |
|
673 |
delete iMarkerPositionTimer; |
|
674 |
iMarkerPositionTimer = NULL; |
|
675 |
delete iPlayItfPositionUpdateTimer; |
|
676 |
iPlayItfPositionUpdateTimer = NULL; |
|
677 |
delete iBaseVideoPlayer; |
|
678 |
iBaseVideoPlayer = NULL; |
|
679 |
iVideoPlayer = NULL; |
|
680 |
delete iBaseAudioPlayer; |
|
681 |
iBaseAudioPlayer = NULL; |
|
682 |
iAudioPlayer = NULL; |
|
683 |
delete iBaseAudioRecorder; |
|
684 |
iBaseAudioRecorder = NULL; |
|
685 |
iAudioRecorder = NULL; |
|
686 |
delete iActiveSchedulerWait; |
|
687 |
iActiveSchedulerWait = NULL; |
|
688 |
delete m_pScr; |
|
689 |
m_pScr = NULL; |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
690 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
691 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
692 |
TInt CMMFBackendEngine::GetRecordPosition(XAuint64* position) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
693 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
694 |
TInt err(KErrNone); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
695 |
*position = iAudioRecorder->Position().Int64(); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
696 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
697 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
698 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
699 |
TInt CMMFBackendEngine::SetPositionUpdatePerioed(XAmillisecond period) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
700 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
701 |
TInt err(KErrNone); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
702 |
iTimerDelay = period; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
703 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
704 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
705 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
706 |
TInt CMMFBackendEngine::SetAdaptContext(void* adaptcontext) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
707 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
708 |
TInt err(KErrNone); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
709 |
iAdaptContext = adaptcontext; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
710 |
TRAP(err, iPositionUpdateTimer = new (ELeave) LocalTimer(this, iAdaptContext)); |
19 | 711 |
if (!err) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
712 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
713 |
iPositionUpdateTimer->PostInit(); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
714 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
715 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
716 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
717 |
|
19 | 718 |
TInt CMMFBackendEngine::GetCodecId(XAuint32* codecid) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
719 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
720 |
TInt err(KErrNone); |
19 | 721 |
|
25 | 722 |
if (iAPIBeingUsed == EAudioRecorderUtility) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
723 |
{ |
25 | 724 |
if (iRecordState != CMMFBackendEngine::ERecorderNotReady) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
725 |
{ |
19 | 726 |
TFourCC dest; |
727 |
TRAP(err, dest = iAudioRecorder->DestinationDataTypeL()); |
|
25 | 728 |
if (err == KErrNone) |
19 | 729 |
{ |
730 |
*codecid = dest.FourCC(); |
|
731 |
} |
|
732 |
} |
|
733 |
} |
|
25 | 734 |
else if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 735 |
{ |
25 | 736 |
if (iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED) |
19 | 737 |
{ |
738 |
TMMFMessageDestinationPckg pckg(KUidInterfaceMMFAudioController); |
|
739 |
TPckgBuf<TMMFAudioConfig> configPackage; |
|
25 | 740 |
TInt err = iAudioPlayer->CustomCommandSync(pckg, |
741 |
EMMFAudioControllerGetSourceDataType, KNullDesC8, |
|
742 |
KNullDesC8, configPackage); |
|
743 |
if (err == KErrNone) |
|
19 | 744 |
{ |
745 |
*codecid = configPackage().iSourceDataTypeCode.FourCC(); |
|
746 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
747 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
748 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
749 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
750 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
751 |
|
19 | 752 |
TInt CMMFBackendEngine::GetBitRate(XAuint32* bitrate) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
753 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
754 |
TInt err(KErrNone); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
755 |
TUint br(0); |
25 | 756 |
if (iAPIBeingUsed == EAudioRecorderUtility) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
757 |
{ |
25 | 758 |
if (iRecordState != CMMFBackendEngine::ERecorderNotReady) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
759 |
{ |
19 | 760 |
TRAP(err, br = iAudioRecorder->DestinationBitRateL()); |
25 | 761 |
if (err == KErrNone) |
19 | 762 |
{ |
763 |
*bitrate = br; |
|
764 |
} |
|
765 |
} |
|
766 |
} |
|
25 | 767 |
else if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 768 |
{ |
25 | 769 |
if (iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED) |
19 | 770 |
{ |
25 | 771 |
TInt err = iAudioPlayer->GetBitRate(br); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
772 |
*bitrate = br; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
773 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
774 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
775 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
776 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
777 |
|
19 | 778 |
TInt CMMFBackendEngine::GetSampleRate(XAmilliHertz* samplerate) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
779 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
780 |
TInt err(KErrNone); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
781 |
TUint sr(0); |
25 | 782 |
if (iAPIBeingUsed == EAudioRecorderUtility) |
19 | 783 |
{ |
25 | 784 |
if (iRecordState != CMMFBackendEngine::ERecorderNotReady) |
19 | 785 |
{ |
786 |
TRAP(err, sr = iAudioRecorder->DestinationSampleRateL()); |
|
25 | 787 |
if (err == KErrNone) |
19 | 788 |
{ |
25 | 789 |
*samplerate = sr * 1000; |
19 | 790 |
} |
791 |
} |
|
792 |
} |
|
25 | 793 |
else if (iAPIBeingUsed == EAudioPlayerUtility) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
794 |
{ |
25 | 795 |
if (iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
796 |
{ |
19 | 797 |
TMMFMessageDestinationPckg pckg(KUidInterfaceMMFAudioController); |
798 |
TPckgBuf<TMMFAudioConfig> configPackage; |
|
25 | 799 |
TInt err = iAudioPlayer->CustomCommandSync(pckg, |
800 |
EMMFAudioControllerGetSourceSampleRate, KNullDesC8, |
|
801 |
KNullDesC8, configPackage); |
|
802 |
if (err == KErrNone) |
|
19 | 803 |
{ |
25 | 804 |
*samplerate = configPackage().iSampleRate * 1000; |
19 | 805 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
806 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
807 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
808 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
809 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
810 |
|
19 | 811 |
TInt CMMFBackendEngine::GetChannels(XAuint32* channels) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
812 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
813 |
TInt err(KErrNone); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
814 |
TUint ch(0); |
25 | 815 |
if (iAPIBeingUsed == EAudioRecorderUtility) |
19 | 816 |
{ |
25 | 817 |
if (iRecordState != CMMFBackendEngine::ERecorderNotReady) |
19 | 818 |
{ |
819 |
TRAP(err,ch = iAudioRecorder->DestinationNumberOfChannelsL()); |
|
25 | 820 |
if (err == KErrNone) |
19 | 821 |
{ |
822 |
*channels = ch; |
|
823 |
} |
|
824 |
} |
|
825 |
} |
|
25 | 826 |
else if (iAPIBeingUsed == EAudioPlayerUtility) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
827 |
{ |
25 | 828 |
if (iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
829 |
{ |
19 | 830 |
TMMFMessageDestinationPckg pckg(KUidInterfaceMMFAudioController); |
831 |
TPckgBuf<TMMFAudioConfig> configPackage; |
|
25 | 832 |
TInt err = iAudioPlayer->CustomCommandSync(pckg, |
833 |
EMMFAudioControllerGetSourceNumChannels, KNullDesC8, |
|
834 |
KNullDesC8, configPackage); |
|
835 |
if (err == KErrNone) |
|
19 | 836 |
{ |
837 |
*channels = configPackage().iChannels; |
|
838 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
839 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
840 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
841 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
842 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
843 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
844 |
TInt CMMFBackendEngine::SetDestinationBitRate(XAuint32* bitrate) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
845 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
846 |
TInt err(KErrNone); |
25 | 847 |
if (iRecordState == CMMFBackendEngine::ERecorderOpen) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
848 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
849 |
TRAP(err, iAudioRecorder->SetDestinationBitRateL(*bitrate)); |
25 | 850 |
if (err != KErrNone) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
851 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
852 |
return XA_RESULT_PARAMETER_INVALID; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
853 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
854 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
855 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
856 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
857 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
858 |
TInt CMMFBackendEngine::SetDestinationSampleRate(XAmilliHertz* samplerate) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
859 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
860 |
TInt err(KErrNone); |
25 | 861 |
if (iRecordState == CMMFBackendEngine::ERecorderOpen) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
862 |
{ |
21 | 863 |
TRAP(err, iAudioRecorder->SetDestinationSampleRateL(*samplerate/1000)); |
25 | 864 |
if (err != KErrNone) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
865 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
866 |
return XA_RESULT_PARAMETER_INVALID; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
867 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
868 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
869 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
870 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
871 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
872 |
TInt CMMFBackendEngine::SetDestinationChannels(XAuint32* channels) |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
873 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
874 |
TInt err(KErrNone); |
19 | 875 |
if (iRecordState == CMMFBackendEngine::ERecorderOpen) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
876 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
877 |
TRAP(err,iAudioRecorder->SetDestinationNumberOfChannelsL(*channels)); |
19 | 878 |
if (err != KErrNone) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
879 |
{ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
880 |
return XA_RESULT_PARAMETER_INVALID; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
881 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
882 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
883 |
return err; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
884 |
} |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
885 |
|
19 | 886 |
/* |
25 | 887 |
XAresult CMMFBackendEngine::SetWindowHandle(void* display_info) |
888 |
{ |
|
889 |
XADataLocator_NativeDisplay* nativeDisplay; |
|
890 |
XADataSink* videoSink = (XADataSink*)display_info; |
|
19 | 891 |
|
25 | 892 |
nativeDisplay = (XADataLocator_NativeDisplay*) (videoSink->pLocator); |
19 | 893 |
|
25 | 894 |
m_pWindow = ((RWindow*)(nativeDisplay->hWindow)); |
895 |
m_pWs = ((RWsSession*)(nativeDisplay->hDisplay)); |
|
19 | 896 |
|
25 | 897 |
m_bWindowReferencePassed = TRUE; |
898 |
return XA_RESULT_SUCCESS; |
|
899 |
} |
|
19 | 900 |
|
25 | 901 |
*/ |
19 | 902 |
XAresult CMMFBackendEngine::CreateAndConfigureWindowL() |
903 |
{ |
|
904 |
#ifdef USE_LOCAL_WINDOW_RESOURCES |
|
905 |
// create window for attaching the surface as its background |
|
906 |
//RWsSession ws; |
|
907 |
//TInt err2(KErrNone); |
|
908 |
TInt err2 = m_ws.Connect(); |
|
909 |
m_pScr = new(ELeave) CWsScreenDevice(m_ws); |
|
910 |
err2 = m_pScr->Construct(); |
|
911 |
CWindowGc* gc = NULL; |
|
912 |
err2 = m_pScr->CreateContext(gc); |
|
913 |
RWindowGroup grp(m_ws); |
|
914 |
err2 = grp.Construct(0xf00f00); |
|
915 |
const TSize KWinSize(320, 240); |
|
916 |
m_pWindow = new (ELeave) RWindow(m_ws); |
|
917 |
err2 = m_pWindow->Construct(grp, 0xfeefee); |
|
918 |
m_pWindow->SetExtent(TPoint(), KWinSize); |
|
919 |
m_pWindow->SetBackgroundColor(TRgb(255,0,0,128)); |
|
920 |
//win.SetBackgroundColor(TRgb(0,0,0,0)); |
|
921 |
m_pWindow->Activate(); |
|
922 |
m_pWindow->Invalidate(); |
|
923 |
m_pWindow->BeginRedraw(); |
|
924 |
gc->Activate(*m_pWindow); |
|
925 |
m_pWindow->EndRedraw(); |
|
926 |
m_ws.Flush(); |
|
927 |
||
928 |
//Create MediaClientUitlity for NGA Surfaces |
|
929 |
TInt displayId = m_pScr->GetScreenNumber(); |
|
930 |
||
931 |
// Add the display window |
|
932 |
m_cropRegion = TRect(m_pWindow->Size()); |
|
933 |
m_clipRect = TRect(m_pWindow->Size()); |
|
934 |
m_videoExtent = TRect(m_pWindow->Size()); |
|
935 |
m_rotation = EVideoRotationNone; |
|
936 |
#endif /* USE_LOCAL_WINDOW_RESOURCES */ |
|
937 |
||
938 |
return XA_RESULT_SUCCESS; |
|
939 |
} |
|
940 |
||
941 |
XAresult CMMFBackendEngine::SetNativeDisplayInformation(void* display_info) |
|
942 |
{ |
|
943 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
944 |
//display_info is of type XADataSink |
|
945 |
//display_info.pLocator is of type XADataLocator_NativeDisplay |
|
946 |
XADataLocator_NativeDisplay* nativeDisplay; |
|
25 | 947 |
XADataSink* videoSink = (XADataSink*) display_info; |
19 | 948 |
|
949 |
if (videoSink) |
|
950 |
{ |
|
951 |
nativeDisplay = (XADataLocator_NativeDisplay*) (videoSink->pLocator); |
|
25 | 952 |
m_pWindow = ((RWindow*) (nativeDisplay->hWindow)); |
953 |
m_pWs = ((RWsSession*) (nativeDisplay->hDisplay)); |
|
954 |
/* |
|
955 |
m_cropRegion = TRect(m_pWindow->Size()); |
|
956 |
m_videoExtent = TRect(m_pWindow->Size()); |
|
957 |
m_cropRect = TRect(m_pWindow->Size()); |
|
958 |
m_clipRect = TRect(m_pWindow->Size()); |
|
959 |
m_cropRegion = TRect(m_pWindow->Size()); |
|
960 |
*/ |
|
19 | 961 |
if (m_pWs) |
962 |
{ |
|
963 |
delete m_pScr; |
|
964 |
m_pScr = NULL; |
|
965 |
TRAPD(err, m_pScr = new CWsScreenDevice(*m_pWs)); |
|
966 |
RET_IF_ERR(err, XA_RESULT_MEMORY_FAILURE); |
|
967 |
m_pScr->Construct(); |
|
968 |
} |
|
969 |
} |
|
970 |
return retVal; |
|
971 |
} |
|
972 |
||
973 |
XAresult CMMFBackendEngine::ResumePlayback() |
|
974 |
{ |
|
975 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
976 |
TBool postHeadMovingEvent(EFalse); |
|
977 |
switch (iMediaPlayerState) |
|
978 |
{ |
|
979 |
case XA_PLAYSTATE_STOPPED: |
|
980 |
case XA_PLAYSTATE_PAUSED: |
|
981 |
/* If we are already at the end of clip, do nothing |
|
982 |
* check ::MapcPlayComplete for documentation */ |
|
25 | 983 |
if ((iPlaybackHead < iMediaDuration) && ((iAPIBeingUsed |
984 |
== EAudioPlayerUtility) || (iAPIBeingUsed |
|
985 |
== EVideoPlayerUtility))) |
|
19 | 986 |
{ |
987 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
|
988 |
{ |
|
989 |
TAG_TIME_PROFILING_BEGIN; |
|
990 |
iAudioPlayer->Play(); |
|
25 | 991 |
TAG_TIME_PROFILING_END; PRINT_TO_CONSOLE_TIME_DIFF; |
19 | 992 |
} |
993 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
994 |
{ |
|
995 |
TAG_TIME_PROFILING_BEGIN; |
|
996 |
//iVideoPlayer->Play( iPlaybackHead, iMediaDuration); |
|
997 |
iVideoPlayer->Play(); |
|
25 | 998 |
TAG_TIME_PROFILING_END; PRINT_TO_CONSOLE_TIME_DIFF; |
19 | 999 |
} |
1000 |
postHeadMovingEvent = ETrue; |
|
1001 |
iMediaPlayerState = XA_PLAYSTATE_PLAYING; |
|
1002 |
iMMFPlayerState = EPlayerPlaying; |
|
1003 |
iMarkerPositionTimer->Start(); |
|
1004 |
iPlayItfPositionUpdateTimer->Start(); |
|
1005 |
} |
|
1006 |
break; |
|
1007 |
case XA_PLAYSTATE_PLAYING: |
|
1008 |
break; |
|
1009 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1010 |
default: |
|
1011 |
retVal = XA_RESULT_INTERNAL_ERROR; |
|
1012 |
break; |
|
1013 |
} |
|
1014 |
||
1015 |
if (postHeadMovingEvent) |
|
1016 |
{ |
|
1017 |
DoPostEvent(XA_PLAYEVENT_HEADMOVING); |
|
1018 |
} |
|
1019 |
return retVal; |
|
1020 |
} |
|
1021 |
||
1022 |
XAresult CMMFBackendEngine::PausePlayback() |
|
1023 |
{ |
|
1024 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1025 |
switch (iMediaPlayerState) |
|
1026 |
{ |
|
1027 |
case XA_PLAYSTATE_PLAYING: |
|
1028 |
case XA_PLAYSTATE_STOPPED: |
|
25 | 1029 |
if ((iAPIBeingUsed == EAudioPlayerUtility) || (iAPIBeingUsed |
1030 |
== EVideoPlayerUtility)) |
|
19 | 1031 |
{ |
1032 |
TInt pauseOpRes(KErrNone); |
|
1033 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
|
1034 |
{ |
|
1035 |
TAG_TIME_PROFILING_BEGIN; |
|
1036 |
pauseOpRes = iAudioPlayer->Pause(); |
|
25 | 1037 |
TAG_TIME_PROFILING_END; PRINT_TO_CONSOLE_TIME_DIFF; |
19 | 1038 |
} |
1039 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1040 |
{ |
|
1041 |
TAG_TIME_PROFILING_BEGIN; |
|
1042 |
TRAP(pauseOpRes, iVideoPlayer->PauseL()); |
|
1043 |
if (pauseOpRes == KErrNone) |
|
1044 |
{ |
|
1045 |
TRAPD(err, iPlaybackHead = iVideoPlayer->PositionL()); |
|
1046 |
if (err != KErrNone) |
|
1047 |
{ |
|
1048 |
iPlaybackHead = 0; |
|
1049 |
} |
|
25 | 1050 |
} TAG_TIME_PROFILING_END; PRINT_TO_CONSOLE_TIME_DIFF; |
19 | 1051 |
} |
25 | 1052 |
if (pauseOpRes == KErrNone) |
19 | 1053 |
{ |
1054 |
iMediaPlayerState = XA_PLAYSTATE_PAUSED; |
|
1055 |
iMMFPlayerState = EPlayerPaused; |
|
1056 |
iMarkerPositionTimer->Stop(); |
|
1057 |
iPlayItfPositionUpdateTimer->Stop(); |
|
1058 |
} |
|
1059 |
} |
|
1060 |
break; |
|
1061 |
case XA_PLAYSTATE_PAUSED: |
|
1062 |
break; |
|
1063 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1064 |
default: |
|
1065 |
retVal = XA_RESULT_INTERNAL_ERROR; |
|
1066 |
break; |
|
1067 |
} |
|
1068 |
return retVal; |
|
1069 |
} |
|
1070 |
||
1071 |
XAresult CMMFBackendEngine::StopPlayback() |
|
1072 |
{ |
|
1073 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1074 |
switch (iMediaPlayerState) |
|
1075 |
{ |
|
1076 |
case XA_PLAYSTATE_PAUSED: |
|
1077 |
case XA_PLAYSTATE_PLAYING: |
|
25 | 1078 |
if ((iAPIBeingUsed == EAudioPlayerUtility) || (iAPIBeingUsed |
1079 |
== EVideoPlayerUtility)) |
|
19 | 1080 |
{ |
1081 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
|
1082 |
{ |
|
1083 |
TAG_TIME_PROFILING_BEGIN; |
|
1084 |
iAudioPlayer->Stop(); |
|
25 | 1085 |
TAG_TIME_PROFILING_END; PRINT_TO_CONSOLE_TIME_DIFF; |
19 | 1086 |
|
1087 |
iMMFPlayerState = EPlayerOpened; |
|
1088 |
} |
|
1089 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1090 |
{ |
|
1091 |
TAG_TIME_PROFILING_BEGIN; |
|
1092 |
iVideoPlayer->Stop(); |
|
25 | 1093 |
TAG_TIME_PROFILING_END; PRINT_TO_CONSOLE_TIME_DIFF; |
1094 |
||
19 | 1095 |
iMMFPlayerState = EPlayerPrepared; |
1096 |
} |
|
1097 |
iMediaPlayerState = XA_PLAYSTATE_STOPPED; |
|
1098 |
iPlaybackHead = 0; |
|
1099 |
iMarkerPositionTimer->Stop(); |
|
1100 |
iPlayItfPositionUpdateTimer->Stop(); |
|
1101 |
} |
|
1102 |
break; |
|
1103 |
case XA_PLAYSTATE_STOPPED: |
|
1104 |
break; |
|
1105 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1106 |
default: |
|
1107 |
retVal = XA_RESULT_INTERNAL_ERROR; |
|
1108 |
break; |
|
1109 |
} |
|
1110 |
return retVal; |
|
1111 |
} |
|
1112 |
XAresult CMMFBackendEngine::GetPlayState(XAuint32 *pState) |
|
1113 |
{ |
|
1114 |
XAresult retVal(XA_RESULT_INTERNAL_ERROR); |
|
1115 |
switch (iMediaPlayerState) |
|
1116 |
{ |
|
1117 |
case XA_PLAYSTATE_STOPPED: |
|
1118 |
case XA_PLAYSTATE_PAUSED: |
|
1119 |
case XA_PLAYSTATE_PLAYING: |
|
1120 |
*pState = iMediaPlayerState; |
|
1121 |
retVal = XA_RESULT_SUCCESS; |
|
1122 |
break; |
|
1123 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1124 |
default: |
|
1125 |
break; |
|
1126 |
} |
|
1127 |
return retVal; |
|
1128 |
} |
|
1129 |
||
1130 |
XAresult CMMFBackendEngine::GetDuration(XAmillisecond *pMsec) |
|
1131 |
{ |
|
1132 |
XAresult retVal(XA_RESULT_INTERNAL_ERROR); |
|
1133 |
/* to convert from microseconds to milliseconds */ |
|
1134 |
TInt64 divider(1000); |
|
1135 |
switch (iMediaPlayerState) |
|
1136 |
{ |
|
1137 |
case XA_PLAYSTATE_STOPPED: |
|
1138 |
case XA_PLAYSTATE_PAUSED: |
|
1139 |
case XA_PLAYSTATE_PLAYING: |
|
1140 |
/* TODO Check if we query from MMF*/ |
|
1141 |
*pMsec = iMediaDuration.Int64() / divider; |
|
1142 |
retVal = XA_RESULT_SUCCESS; |
|
1143 |
break; |
|
1144 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1145 |
default: |
|
1146 |
break; |
|
1147 |
} |
|
1148 |
return retVal; |
|
1149 |
} |
|
1150 |
||
1151 |
XAresult CMMFBackendEngine::GetPosition(XAmillisecond *pMsec) |
|
1152 |
{ |
|
1153 |
XAresult retVal(XA_RESULT_INTERNAL_ERROR); |
|
1154 |
TInt64 divider(1000); |
|
1155 |
TTimeIntervalMicroSeconds pos; |
|
1156 |
switch (iMediaPlayerState) |
|
1157 |
{ |
|
1158 |
case XA_PLAYSTATE_STOPPED: |
|
1159 |
case XA_PLAYSTATE_PAUSED: |
|
1160 |
case XA_PLAYSTATE_PLAYING: |
|
1161 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
|
1162 |
{ |
|
1163 |
if (iAudioPlayer->GetPosition(pos) == KErrNone) |
|
1164 |
{ |
|
1165 |
*pMsec = pos.Int64() / divider; |
|
1166 |
retVal = XA_RESULT_SUCCESS; |
|
1167 |
} |
|
1168 |
} |
|
1169 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1170 |
{ |
|
1171 |
TInt err(KErrNone); |
|
1172 |
TRAP(err, pos = iVideoPlayer->PositionL()); |
|
1173 |
if (err == KErrNone) |
|
1174 |
{ |
|
25 | 1175 |
*pMsec = pos.Int64() / divider; |
19 | 1176 |
retVal = XA_RESULT_SUCCESS; |
1177 |
} |
|
1178 |
} |
|
1179 |
break; |
|
1180 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1181 |
default: |
|
1182 |
break; |
|
1183 |
} |
|
1184 |
return retVal; |
|
1185 |
} |
|
1186 |
||
1187 |
XAresult CMMFBackendEngine::SetPosition(XAmillisecond pMsec) |
|
1188 |
{ |
|
1189 |
XAresult retVal(XA_RESULT_INTERNAL_ERROR); |
|
1190 |
TInt64 multiplier(1000); |
|
1191 |
TTimeIntervalMicroSeconds pos; |
|
1192 |
switch (iMediaPlayerState) |
|
1193 |
{ |
|
1194 |
case XA_PLAYSTATE_STOPPED: |
|
1195 |
case XA_PLAYSTATE_PAUSED: |
|
1196 |
case XA_PLAYSTATE_PLAYING: |
|
25 | 1197 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1198 |
{ |
1199 |
pos = pMsec * multiplier; |
|
1200 |
TAG_TIME_PROFILING_BEGIN; |
|
1201 |
iAudioPlayer->SetPosition(pos); |
|
25 | 1202 |
TAG_TIME_PROFILING_END; PRINT_TO_CONSOLE_TIME_DIFF; |
19 | 1203 |
|
1204 |
retVal = XA_RESULT_SUCCESS; |
|
1205 |
} |
|
1206 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1207 |
{ |
|
1208 |
pos = pMsec * multiplier; |
|
1209 |
TAG_TIME_PROFILING_BEGIN; |
|
25 | 1210 |
TRAPD(err, iVideoPlayer->SetPositionL(pos)); |
1211 |
TAG_TIME_PROFILING_END; |
|
19 | 1212 |
PRINT_TO_CONSOLE_TIME_DIFF; |
1213 |
if (err == KErrNone) |
|
1214 |
{ |
|
1215 |
retVal = XA_RESULT_SUCCESS; |
|
1216 |
} |
|
1217 |
} |
|
1218 |
break; |
|
1219 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1220 |
default: |
|
1221 |
break; |
|
1222 |
} |
|
1223 |
return retVal; |
|
1224 |
} |
|
1225 |
||
1226 |
XAresult CMMFBackendEngine::SetRepeats(XAboolean repeat) |
|
1227 |
{ |
|
1228 |
XAresult retVal(XA_RESULT_INTERNAL_ERROR); |
|
1229 |
TInt numRepeats(0); |
|
1230 |
switch (iMediaPlayerState) |
|
1231 |
{ |
|
1232 |
case XA_PLAYSTATE_STOPPED: |
|
1233 |
case XA_PLAYSTATE_PAUSED: |
|
1234 |
case XA_PLAYSTATE_PLAYING: |
|
25 | 1235 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1236 |
{ |
1237 |
numRepeats = repeat ? -2 : 0; |
|
1238 |
iAudioPlayer->SetRepeats(numRepeats, 0); |
|
1239 |
retVal = XA_RESULT_SUCCESS; |
|
1240 |
} |
|
1241 |
else |
|
1242 |
{ |
|
1243 |
} |
|
1244 |
break; |
|
1245 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1246 |
default: |
|
1247 |
break; |
|
1248 |
} |
|
1249 |
return retVal; |
|
1250 |
} |
|
1251 |
||
25 | 1252 |
XAresult CMMFBackendEngine::SetPlayWindow(XAmillisecond start, |
1253 |
XAmillisecond end) |
|
19 | 1254 |
{ |
1255 |
XAresult retVal(XA_RESULT_INTERNAL_ERROR); |
|
1256 |
TInt64 multiplier(1000); |
|
1257 |
TTimeIntervalMicroSeconds startpos(0); |
|
1258 |
TTimeIntervalMicroSeconds endpos(0); |
|
1259 |
||
1260 |
switch (iMediaPlayerState) |
|
1261 |
{ |
|
1262 |
case XA_PLAYSTATE_STOPPED: |
|
1263 |
case XA_PLAYSTATE_PAUSED: |
|
1264 |
case XA_PLAYSTATE_PLAYING: |
|
25 | 1265 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1266 |
{ |
1267 |
startpos = start * multiplier; |
|
1268 |
endpos = end * multiplier; |
|
25 | 1269 |
retVal = iAudioPlayer->SetPlayWindow(startpos, endpos); |
19 | 1270 |
} |
1271 |
else |
|
1272 |
{ |
|
1273 |
} |
|
1274 |
break; |
|
1275 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1276 |
default: |
|
1277 |
break; |
|
1278 |
} |
|
1279 |
return retVal; |
|
1280 |
} |
|
1281 |
||
1282 |
XAresult CMMFBackendEngine::SetPlayAdaptContext(void * adaptcontext) |
|
1283 |
{ |
|
1284 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1285 |
||
1286 |
iAdaptContext = adaptcontext; |
|
1287 |
||
1288 |
return retVal; |
|
1289 |
} |
|
1290 |
||
1291 |
XAresult CMMFBackendEngine::RegisterCallback(xaPlayCallback cbFunction) |
|
1292 |
{ |
|
1293 |
iPlayItfCBFunction = cbFunction; |
|
1294 |
return DoHandlePlayItfAttributesChanged(); |
|
1295 |
} |
|
1296 |
||
1297 |
XAresult CMMFBackendEngine::SetCallbackEventsMask(XAuint32 eventflags) |
|
1298 |
{ |
|
1299 |
iPlayItfEventFlags = eventflags; |
|
1300 |
return DoHandlePlayItfAttributesChanged(); |
|
1301 |
} |
|
1302 |
||
1303 |
XAresult CMMFBackendEngine::SetMarkerPosition(XAmillisecond mSec) |
|
1304 |
{ |
|
1305 |
iMarkerPosition = mSec; |
|
1306 |
return DoHandlePlayItfAttributesChanged(); |
|
1307 |
} |
|
1308 |
||
1309 |
XAresult CMMFBackendEngine::ClearMarkerPosition() |
|
1310 |
{ |
|
1311 |
iMarkerPosition = XA_TIME_UNKNOWN; |
|
1312 |
DoHandlePlayItfAttributesChanged(); |
|
1313 |
return XA_RESULT_SUCCESS; |
|
1314 |
} |
|
1315 |
||
1316 |
XAresult CMMFBackendEngine::SetPositionUpdatePeriod(XAmillisecond mSec) |
|
1317 |
{ |
|
1318 |
iPositionUpdatePeriod = mSec; |
|
1319 |
DoHandlePlayItfAttributesChanged(); |
|
1320 |
return XA_RESULT_SUCCESS; |
|
1321 |
} |
|
1322 |
||
1323 |
XAresult CMMFBackendEngine::DoHandlePlayItfAttributesChanged() |
|
1324 |
{ |
|
1325 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1326 |
||
1327 |
iMarkerPositionTimer->SetCallbackEventMask(iPlayItfEventFlags); |
|
1328 |
iMarkerPositionTimer->RegisterCallback(iPlayItfCBFunction); |
|
1329 |
iMarkerPositionTimer->SetMarkerPosition(iMarkerPosition); |
|
1330 |
||
1331 |
iPlayItfPositionUpdateTimer->SetCallbackEventMask(iPlayItfEventFlags); |
|
1332 |
iPlayItfPositionUpdateTimer->RegisterCallback(iPlayItfCBFunction); |
|
25 | 1333 |
iPlayItfPositionUpdateTimer->SetPositionUpdatePeriod( |
1334 |
iPositionUpdatePeriod); |
|
19 | 1335 |
|
1336 |
switch (iMediaPlayerState) |
|
1337 |
{ |
|
1338 |
case XA_PLAYSTATE_STOPPED: |
|
1339 |
case XA_PLAYSTATE_PAUSED: |
|
1340 |
break; |
|
1341 |
case XA_PLAYSTATE_PLAYING: |
|
1342 |
iMarkerPositionTimer->Start(); |
|
1343 |
iPlayItfPositionUpdateTimer->Start(); |
|
1344 |
break; |
|
1345 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1346 |
default: |
|
1347 |
break; |
|
1348 |
} |
|
1349 |
return retVal; |
|
1350 |
} |
|
1351 |
||
1352 |
void CMMFBackendEngine::DoPostEvent(XAuint32 event) |
|
1353 |
{ |
|
25 | 1354 |
if ((iPlayItfEventFlags & event) && (iPlayItfCBFunction != NULL)) |
19 | 1355 |
{ |
25 | 1356 |
XAAdaptEvent xaevent = |
1357 |
{ |
|
1358 |
XA_PLAYITFEVENTS, event, 0, 0 |
|
1359 |
}; |
|
1360 |
XAAdaptationBase_SendAdaptEvents( |
|
1361 |
(XAAdaptationBaseCtx*) iAdaptContext, &xaevent); |
|
19 | 1362 |
} |
1363 |
} |
|
1364 |
||
1365 |
XAresult CMMFBackendEngine::GetNumStreams(XAuint32* numstreams) |
|
1366 |
{ |
|
1367 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1368 |
TInt bitRate(0); |
|
1369 |
TInt numS(0); |
|
25 | 1370 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1371 |
{ |
1372 |
numS = 1; |
|
1373 |
*numstreams = numS; |
|
1374 |
} |
|
1375 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1376 |
{ |
|
1377 |
TRAPD(err, bitRate = iVideoPlayer->VideoBitRateL()); |
|
25 | 1378 |
if (!err && bitRate) |
19 | 1379 |
{ |
1380 |
numS++; |
|
1381 |
*numstreams = numS; |
|
1382 |
} |
|
25 | 1383 |
|
19 | 1384 |
bitRate = 0; |
1385 |
TRAP(err, bitRate = iVideoPlayer->AudioBitRateL()); |
|
25 | 1386 |
if (!err && bitRate) |
19 | 1387 |
{ |
1388 |
numS++; |
|
1389 |
*numstreams = numS; |
|
1390 |
} |
|
1391 |
} |
|
1392 |
return retVal; |
|
1393 |
} |
|
1394 |
||
25 | 1395 |
XAresult CMMFBackendEngine::GetStreamInfo(XAuint32 streamindex, |
1396 |
XAuint32* streamtype) |
|
19 | 1397 |
{ |
1398 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
25 | 1399 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1400 |
{ |
1401 |
*streamtype = XA_DOMAINTYPE_AUDIO; |
|
1402 |
} |
|
1403 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1404 |
{ |
|
25 | 1405 |
switch (streamindex) |
19 | 1406 |
{ |
1407 |
case 1: |
|
1408 |
*streamtype = XA_DOMAINTYPE_VIDEO; |
|
1409 |
break; |
|
1410 |
case 2: |
|
1411 |
*streamtype = XA_DOMAINTYPE_AUDIO; |
|
1412 |
break; |
|
1413 |
default: |
|
1414 |
retVal = XA_RESULT_PARAMETER_INVALID; |
|
1415 |
break; |
|
1416 |
} |
|
1417 |
} |
|
1418 |
return retVal; |
|
1419 |
} |
|
1420 |
||
25 | 1421 |
XAresult CMMFBackendEngine::GetVideoFrameSize(XAuint32* height, |
1422 |
XAuint32* width, XAuint32* frameRate) |
|
19 | 1423 |
{ |
1424 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
25 | 1425 |
if (iAPIBeingUsed == EVideoPlayerUtility) |
19 | 1426 |
{ |
25 | 1427 |
if (iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED) |
19 | 1428 |
{ |
1429 |
TSize size; |
|
1430 |
TReal32 framerate(0); |
|
1431 |
TRAPD(err, iVideoPlayer->VideoFrameSizeL(size)); |
|
25 | 1432 |
if (!err) |
19 | 1433 |
{ |
1434 |
*height = size.iHeight; |
|
1435 |
*width = size.iWidth; |
|
1436 |
} |
|
1437 |
else |
|
1438 |
{ |
|
1439 |
retVal = err; |
|
1440 |
} |
|
1441 |
||
1442 |
TRAP(err, framerate = iVideoPlayer->VideoFrameRateL()); |
|
25 | 1443 |
if (!err) |
19 | 1444 |
{ |
1445 |
*frameRate = framerate; |
|
1446 |
} |
|
1447 |
} |
|
1448 |
else |
|
1449 |
{ |
|
1450 |
retVal = XA_RESULT_PRECONDITIONS_VIOLATED; |
|
1451 |
} |
|
1452 |
} |
|
1453 |
else |
|
1454 |
{ |
|
1455 |
retVal = XA_RESULT_FEATURE_UNSUPPORTED; |
|
1456 |
} |
|
1457 |
return retVal; |
|
1458 |
} |
|
1459 |
||
25 | 1460 |
XAresult CMMFBackendEngine::SetActiveState(XAuint32 streamindex, |
1461 |
XAboolean active) |
|
19 | 1462 |
{ |
1463 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1464 |
TInt err(KErrNone); |
|
25 | 1465 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1466 |
{ |
1467 |
retVal = XA_RESULT_FEATURE_UNSUPPORTED; |
|
1468 |
} |
|
1469 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1470 |
{ |
|
25 | 1471 |
switch (streamindex) |
19 | 1472 |
{ |
1473 |
case 1: |
|
25 | 1474 |
TRAP(err, iVideoPlayer->SetVideoEnabledL(active)) |
1475 |
; |
|
19 | 1476 |
retVal = err; |
1477 |
break; |
|
1478 |
case 2: |
|
25 | 1479 |
TRAP(err, iVideoPlayer->SetAudioEnabledL(active)) |
1480 |
; |
|
19 | 1481 |
retVal = err; |
1482 |
break; |
|
1483 |
default: |
|
1484 |
retVal = XA_RESULT_PARAMETER_INVALID; |
|
1485 |
break; |
|
1486 |
} |
|
1487 |
} |
|
1488 |
return retVal; |
|
1489 |
} |
|
1490 |
||
1491 |
TInt CMMFBackendEngine::InitializeURIForMMFUtil(char *uri) |
|
1492 |
{ |
|
1493 |
/* Initializes and save uri param into iUri structure */ |
|
1494 |
TInt err(KErrNone); |
|
1495 |
TInt uriLen; |
|
25 | 1496 |
|
19 | 1497 |
if (!uri) |
1498 |
return KErrArgument; |
|
1499 |
||
1500 |
if (iUri) |
|
1501 |
{ |
|
1502 |
delete iUri; |
|
1503 |
iUri = NULL; |
|
1504 |
} |
|
25 | 1505 |
|
19 | 1506 |
uriLen = strlen(uri); |
25 | 1507 |
TPtr8 uriParam((TUint8*) uri, uriLen, uriLen); |
1508 |
||
19 | 1509 |
TRAP(err, iUri = HBufC::NewL(uriLen)); |
1510 |
if (err != KErrNone) |
|
1511 |
return err; |
|
1512 |
||
1513 |
iUriPtr.Set(iUri->Des()); |
|
1514 |
iUriPtr.Copy(uriParam); /* Copy data*/ |
|
21 | 1515 |
//iUriPtr.LowerCase(); |
19 | 1516 |
/* For file scheme convert from file:///c:/folder/file.ext |
1517 |
* format to c:\\folder\\file.ext using TUriParser. */ |
|
1518 |
_LIT(KFileScheme,"file:///"); |
|
1519 |
if (iUriPtr.Find(KFileScheme) >= 0) |
|
1520 |
{ |
|
21 | 1521 |
iUriType = ELocal; |
25 | 1522 |
TPtr tmp(const_cast<TUint16 *> (iUriPtr.Ptr()) |
1523 |
+ KFileScheme().Length(), iUriPtr.Length(), iUriPtr.Length()); |
|
19 | 1524 |
/* Convert from c:/folder/file.ext format to |
1525 |
* c:\\folder\\file.ext using TUriParser. |
|
1526 |
* TUriParser8 accepts uri in format file:///c/folder/file.ext, |
|
1527 |
* so get rid of ':' after drive letter (if any) */ |
|
1528 |
TInt pos = tmp.Find(_L(":")); |
|
1529 |
if (pos != KErrNotFound) |
|
1530 |
{ |
|
1531 |
iUriPtr.Delete(KFileScheme().Length() + pos, 1); |
|
1532 |
} |
|
1533 |
||
1534 |
TUriParser16 uriParser; |
|
1535 |
err = uriParser.Parse(iUriPtr); |
|
1536 |
if (err != KErrNone) |
|
1537 |
return err; |
|
1538 |
||
1539 |
HBufC* file = NULL; |
|
1540 |
TRAP(err, file = uriParser.GetFileNameL()); |
|
1541 |
if (err != KErrNone) |
|
1542 |
return err; |
|
1543 |
||
1544 |
iUriPtr.Copy(file->Des()); |
|
1545 |
delete file; |
|
1546 |
file = NULL; |
|
1547 |
||
1548 |
} |
|
21 | 1549 |
else |
1550 |
{ |
|
1551 |
iUriType = EStreaming; |
|
1552 |
} |
|
19 | 1553 |
return err; |
1554 |
} |
|
1555 |
||
1556 |
XAresult CMMFBackendEngine::SetVolume(XAuint32 volume) |
|
1557 |
{ |
|
1558 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1559 |
TInt err(KErrNone); |
|
25 | 1560 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1561 |
{ |
1562 |
retVal = iAudioPlayer->SetVolume(volume); |
|
1563 |
} |
|
1564 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1565 |
{ |
|
1566 |
TRAP(err, iVideoPlayer->SetVolumeL(volume)); |
|
1567 |
retVal = err; |
|
1568 |
} |
|
25 | 1569 |
else if (iAPIBeingUsed == EAudioRecorderUtility) |
19 | 1570 |
{ |
1571 |
retVal = iAudioRecorder->SetVolume(volume); |
|
1572 |
} |
|
25 | 1573 |
return retVal; |
19 | 1574 |
} |
1575 |
||
1576 |
XAresult CMMFBackendEngine::GetMaxVolume(XAuint32* maxvolume) |
|
1577 |
{ |
|
1578 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
25 | 1579 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1580 |
{ |
1581 |
*maxvolume = iAudioPlayer->MaxVolume(); |
|
1582 |
} |
|
1583 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1584 |
{ |
|
1585 |
*maxvolume = iVideoPlayer->MaxVolume(); |
|
1586 |
} |
|
25 | 1587 |
else if (iAPIBeingUsed == EAudioRecorderUtility) |
19 | 1588 |
{ |
1589 |
*maxvolume = iAudioRecorder->MaxVolume(); |
|
1590 |
} |
|
25 | 1591 |
return retVal; |
19 | 1592 |
} |
1593 |
||
1594 |
XAresult CMMFBackendEngine::GetVolume(XAuint32* volume) |
|
1595 |
{ |
|
1596 |
XAresult retVal(XA_RESULT_SUCCESS); |
|
1597 |
TInt mmfvolume(0); |
|
25 | 1598 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
19 | 1599 |
{ |
1600 |
retVal = iAudioPlayer->GetVolume(mmfvolume); |
|
25 | 1601 |
if (retVal == XA_RESULT_SUCCESS) |
19 | 1602 |
{ |
1603 |
*volume = mmfvolume; |
|
1604 |
} |
|
1605 |
} |
|
1606 |
else if (iAPIBeingUsed == EVideoPlayerUtility) |
|
1607 |
{ |
|
1608 |
*volume = iVideoPlayer->Volume(); |
|
1609 |
} |
|
25 | 1610 |
else if (iAPIBeingUsed == EAudioRecorderUtility) |
19 | 1611 |
{ |
1612 |
retVal = iAudioRecorder->GetVolume(mmfvolume); |
|
25 | 1613 |
if (retVal == XA_RESULT_SUCCESS) |
19 | 1614 |
{ |
1615 |
*volume = mmfvolume; |
|
1616 |
} |
|
1617 |
} |
|
25 | 1618 |
return retVal; |
19 | 1619 |
} |
1620 |
||
28 | 1621 |
XAresult CMMFBackendEngine::SetPlaybackRate(XAint16 rate) |
1622 |
{ |
|
1623 |
XAresult retVal(XA_RESULT_INTERNAL_ERROR); |
|
1624 |
||
1625 |
switch (iMediaPlayerState) |
|
1626 |
{ |
|
1627 |
case XA_PLAYSTATE_STOPPED: |
|
1628 |
case XA_PLAYSTATE_PAUSED: |
|
1629 |
case XA_PLAYSTATE_PLAYING: |
|
1630 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
|
1631 |
{ |
|
1632 |
retVal = XA_RESULT_FEATURE_UNSUPPORTED; |
|
1633 |
} |
|
1634 |
else |
|
1635 |
{ |
|
1636 |
TRAPD(err, iVideoPlayer->SetPlayVelocityL(rate)); |
|
1637 |
if(!err) |
|
1638 |
{ |
|
1639 |
retVal = XA_RESULT_SUCCESS; |
|
1640 |
} |
|
1641 |
} |
|
1642 |
break; |
|
1643 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1644 |
default: |
|
1645 |
break; |
|
1646 |
} |
|
1647 |
return retVal; |
|
1648 |
} |
|
1649 |
||
1650 |
XAresult CMMFBackendEngine::GetPlaybackRateCapabilities(XAboolean* forward, |
|
1651 |
XAboolean* backward) |
|
1652 |
{ |
|
1653 |
XAresult retVal(XA_RESULT_PARAMETER_INVALID); |
|
1654 |
||
1655 |
switch (iMediaPlayerState) |
|
1656 |
{ |
|
1657 |
case XA_PLAYSTATE_STOPPED: |
|
1658 |
case XA_PLAYSTATE_PAUSED: |
|
1659 |
case XA_PLAYSTATE_PLAYING: |
|
1660 |
if (iAPIBeingUsed == EAudioPlayerUtility) |
|
1661 |
{ |
|
1662 |
retVal = XA_RESULT_FEATURE_UNSUPPORTED; |
|
1663 |
} |
|
1664 |
else |
|
1665 |
{ |
|
1666 |
TVideoPlayRateCapabilities capability; |
|
1667 |
TRAPD(err, iVideoPlayer->GetPlayRateCapabilitiesL(capability)); |
|
1668 |
if(!err) |
|
1669 |
{ |
|
1670 |
*forward = capability.iPlayForward; |
|
1671 |
*backward = capability.iPlayBackward; |
|
1672 |
retVal = XA_RESULT_SUCCESS; |
|
1673 |
} |
|
1674 |
} |
|
1675 |
break; |
|
1676 |
case XA_PLAYSTATE_PLAYERUNINITIALIZED: |
|
1677 |
default: |
|
1678 |
break; |
|
1679 |
} |
|
1680 |
return retVal; |
|
1681 |
} |
|
1682 |
||
25 | 1683 |
extern "C" |
1684 |
{ |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1685 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1686 |
int mmf_backend_engine_init(void** engine) |
25 | 1687 |
{ |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1688 |
TRAPD(err, *engine = CMMFBackendEngine::NewL()); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1689 |
return err; |
25 | 1690 |
} |
19 | 1691 |
|
1692 |
void mmf_backend_engine_deinit(void* engine) |
|
25 | 1693 |
{ |
1694 |
delete ((CMMFBackendEngine*) engine); |
|
1695 |
} |
|
19 | 1696 |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1697 |
int mmf_set_recorder_uri(void* context, char* uri, XAuint32 format) |
25 | 1698 |
{ |
1699 |
return ((CMMFBackendEngine*) (context))->SetFileName(uri, format, |
|
1700 |
CMMFBackendEngine::ERecord); |
|
1701 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1702 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1703 |
int mmf_set_adapt_context(void* context, void* adaptcontext) |
25 | 1704 |
{ |
1705 |
return ((CMMFBackendEngine*) (context))->SetAdaptContext(adaptcontext); |
|
1706 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1707 |
|
19 | 1708 |
void mmf_close(void* context) |
25 | 1709 |
{ |
1710 |
((CMMFBackendEngine*) context)->Close(); |
|
1711 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1712 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1713 |
int mmf_start_recording(void* context) |
25 | 1714 |
{ |
1715 |
return ((CMMFBackendEngine*) (context))->SetRecorderState( |
|
1716 |
CMMFBackendEngine::ERecorderRecording, FALSE); |
|
1717 |
} |
|
19 | 1718 |
|
25 | 1719 |
int mmf_stop_recording(void* context, XAboolean stopCalled) |
1720 |
{ |
|
1721 |
return ((CMMFBackendEngine*) (context))->SetRecorderState( |
|
1722 |
CMMFBackendEngine::ERecorderOpen, stopCalled); |
|
1723 |
} |
|
19 | 1724 |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1725 |
int mmf_get_record_position(void* context, XAuint64* position) |
25 | 1726 |
{ |
1727 |
return ((CMMFBackendEngine*) (context))->GetRecordPosition(position); |
|
1728 |
} |
|
19 | 1729 |
|
25 | 1730 |
int mmf_set_record_position_update_period(void* context, |
1731 |
XAmillisecond msec) |
|
1732 |
{ |
|
1733 |
return ((CMMFBackendEngine*) (context))->SetPositionUpdatePerioed( |
|
1734 |
msec); |
|
1735 |
} |
|
19 | 1736 |
|
1737 |
int mmf_get_codec_id(void* context, XAuint32* encoderId) |
|
25 | 1738 |
{ |
1739 |
return ((CMMFBackendEngine*) (context))->GetCodecId(encoderId); |
|
1740 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1741 |
|
19 | 1742 |
int mmf_get_channels(void* context, XAuint32* channelsIn) |
25 | 1743 |
{ |
1744 |
return ((CMMFBackendEngine*) (context))->GetChannels(channelsIn); |
|
1745 |
} |
|
19 | 1746 |
|
1747 |
int mmf_get_samplerate(void* context, XAmilliHertz* sampleRate) |
|
25 | 1748 |
{ |
1749 |
return ((CMMFBackendEngine*) (context))->GetSampleRate(sampleRate); |
|
1750 |
} |
|
19 | 1751 |
|
1752 |
int mmf_get_bitrate(void* context, XAuint32* bitRate) |
|
25 | 1753 |
{ |
1754 |
return ((CMMFBackendEngine*) (context))->GetBitRate(bitRate); |
|
1755 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1756 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1757 |
int mmf_set_destination_channels(void* context, XAuint32* channelsIn) |
25 | 1758 |
{ |
1759 |
return ((CMMFBackendEngine*) (context))->SetDestinationChannels( |
|
1760 |
channelsIn); |
|
1761 |
} |
|
19 | 1762 |
|
25 | 1763 |
int mmf_set_destination_samplerate(void* context, |
1764 |
XAmilliHertz* sampleRate) |
|
1765 |
{ |
|
1766 |
return ((CMMFBackendEngine*) (context))->SetDestinationSampleRate( |
|
1767 |
sampleRate); |
|
1768 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1769 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1770 |
int mmf_set_destination_bitrate(void* context, XAuint32* bitRate) |
25 | 1771 |
{ |
1772 |
return ((CMMFBackendEngine*) (context))->SetDestinationBitRate( |
|
1773 |
bitRate); |
|
1774 |
} |
|
19 | 1775 |
|
1776 |
XAresult mmf_set_play_adapt_context(void * context, void * adaptcontext) |
|
25 | 1777 |
{ |
1778 |
return ((CMMFBackendEngine *) (context))->SetPlayAdaptContext( |
|
1779 |
adaptcontext); |
|
1780 |
} |
|
19 | 1781 |
|
1782 |
XAresult mmf_set_player_uri(void * context, char * uri, XAuint32 format) |
|
25 | 1783 |
{ |
1784 |
return ((CMMFBackendEngine *) (context))->SetFileName(uri, format, |
|
1785 |
CMMFBackendEngine::EPlay); |
|
1786 |
} |
|
19 | 1787 |
|
25 | 1788 |
/* |
1789 |
XAresult mmf_set_window_handle(void * context, void * display_info) |
|
1790 |
{ |
|
1791 |
return ((CMMFBackendEngine *)(context))->SetWindowHandle(display_info); |
|
1792 |
} |
|
19 | 1793 |
|
25 | 1794 |
*/ |
19 | 1795 |
XAresult mmf_setup_native_display(void * context, void * display_info) |
25 | 1796 |
{ |
1797 |
return ((CMMFBackendEngine *) (context))->SetNativeDisplayInformation( |
|
1798 |
display_info); |
|
1799 |
} |
|
19 | 1800 |
|
1801 |
XAresult mmf_playitf_resume_playback(void * context) |
|
25 | 1802 |
{ |
1803 |
return ((CMMFBackendEngine *) (context))->ResumePlayback(); |
|
1804 |
} |
|
19 | 1805 |
|
1806 |
XAresult mmf_playitf_pause_playback(void * context) |
|
25 | 1807 |
{ |
1808 |
return ((CMMFBackendEngine *) (context))->PausePlayback(); |
|
1809 |
} |
|
19 | 1810 |
|
1811 |
XAresult mmf_playitf_stop_playback(void * context) |
|
25 | 1812 |
{ |
1813 |
return ((CMMFBackendEngine *) (context))->StopPlayback(); |
|
1814 |
} |
|
19 | 1815 |
|
1816 |
XAresult mmf_playitf_get_play_state(void * context, XAuint32 * pState) |
|
25 | 1817 |
{ |
1818 |
return ((CMMFBackendEngine *) (context))->GetPlayState(pState); |
|
1819 |
} |
|
19 | 1820 |
|
1821 |
XAresult mmf_playitf_get_duration(void * context, XAmillisecond * pMsec) |
|
25 | 1822 |
{ |
1823 |
return ((CMMFBackendEngine *) (context))->GetDuration(pMsec); |
|
1824 |
} |
|
19 | 1825 |
|
1826 |
XAresult mmf_playitf_get_position(void * context, XAmillisecond * pMsec) |
|
25 | 1827 |
{ |
1828 |
return ((CMMFBackendEngine *) (context))->GetPosition(pMsec); |
|
1829 |
} |
|
19 | 1830 |
|
25 | 1831 |
XAresult mmf_playitf_register_callback(void * context, |
1832 |
xaPlayCallback callback) |
|
1833 |
{ |
|
1834 |
return ((CMMFBackendEngine *) (context))->RegisterCallback(callback); |
|
1835 |
} |
|
19 | 1836 |
|
25 | 1837 |
XAresult mmf_playitf_set_callback_events_mask(void * context, |
1838 |
XAuint32 eventflags) |
|
1839 |
{ |
|
1840 |
return ((CMMFBackendEngine *) (context))->SetCallbackEventsMask( |
|
1841 |
eventflags); |
|
1842 |
} |
|
19 | 1843 |
|
25 | 1844 |
XAresult mmf_playitf_set_marker_position(void * context, |
1845 |
XAmillisecond mSec) |
|
1846 |
{ |
|
1847 |
return ((CMMFBackendEngine *) (context))->SetMarkerPosition(mSec); |
|
1848 |
} |
|
19 | 1849 |
|
1850 |
XAresult mmf_playitf_clear_marker_position(void * context) |
|
25 | 1851 |
{ |
1852 |
return ((CMMFBackendEngine *) (context))->ClearMarkerPosition(); |
|
19 | 1853 |
|
25 | 1854 |
} |
19 | 1855 |
|
25 | 1856 |
XAresult mmf_playitf_set_position_update_period(void * context, |
1857 |
XAmillisecond mSec) |
|
1858 |
{ |
|
1859 |
return ((CMMFBackendEngine *) (context))->SetPositionUpdatePeriod( |
|
1860 |
mSec); |
|
1861 |
} |
|
19 | 1862 |
|
1863 |
XAresult mmf_seekitf_set_position(void * context, XAmillisecond pMsec) |
|
25 | 1864 |
{ |
1865 |
return ((CMMFBackendEngine *) (context))->SetPosition(pMsec); |
|
1866 |
} |
|
19 | 1867 |
|
25 | 1868 |
XAresult mmf_seekitf_set_playwindow(void * context, XAmillisecond start, |
1869 |
XAmillisecond end) |
|
1870 |
{ |
|
1871 |
return ((CMMFBackendEngine *) (context))->SetPlayWindow(start, end); |
|
1872 |
} |
|
19 | 1873 |
|
1874 |
XAresult mmf_seekitf_set_repeats(void * context, XAboolean repeat) |
|
25 | 1875 |
{ |
1876 |
return ((CMMFBackendEngine *) (context))->SetRepeats(repeat); |
|
1877 |
} |
|
19 | 1878 |
|
25 | 1879 |
XAresult mmf_streaminformationitf_get_streaminfo(void * context, |
1880 |
XAuint32 streamindex, XAuint32* streamtype) |
|
1881 |
{ |
|
1882 |
return ((CMMFBackendEngine *) (context))->GetStreamInfo(streamindex, |
|
1883 |
streamtype); |
|
1884 |
} |
|
19 | 1885 |
|
25 | 1886 |
XAresult mmf_streaminformationitf_get_numstreams(void * context, |
1887 |
XAuint32* numstreams) |
|
1888 |
{ |
|
1889 |
return ((CMMFBackendEngine *) (context))->GetNumStreams(numstreams); |
|
1890 |
} |
|
19 | 1891 |
|
25 | 1892 |
XAresult mmf_streaminformationitf_get_videoframesize(void * context, |
1893 |
XAuint32* height, XAuint32* width, XAuint32* frameRate) |
|
1894 |
{ |
|
1895 |
return ((CMMFBackendEngine *) (context))->GetVideoFrameSize(height, |
|
1896 |
width, frameRate); |
|
1897 |
} |
|
19 | 1898 |
|
25 | 1899 |
XAresult mmf_streaminformationitf_set_activestream(void * context, |
1900 |
XAuint32 streamindex, XAboolean active) |
|
1901 |
{ |
|
1902 |
return ((CMMFBackendEngine *) (context))->SetActiveState(streamindex, |
|
1903 |
active); |
|
1904 |
} |
|
1905 |
||
19 | 1906 |
XAresult mmf_volumeitf_set_volume(void * context, XAuint32 volume) |
25 | 1907 |
{ |
1908 |
return ((CMMFBackendEngine *) (context))->SetVolume(volume); |
|
1909 |
} |
|
19 | 1910 |
|
1911 |
XAresult mmf_volumeitf_get_maxvolume(void * context, XAuint32* volume) |
|
25 | 1912 |
{ |
1913 |
return ((CMMFBackendEngine *) (context))->GetMaxVolume(volume); |
|
1914 |
} |
|
1915 |
||
19 | 1916 |
XAresult mmf_volumeitf_get_volume(void * context, XAuint32* volume) |
25 | 1917 |
{ |
1918 |
return ((CMMFBackendEngine *) (context))->GetVolume(volume); |
|
1919 |
} |
|
28 | 1920 |
|
1921 |
XAresult mmf_playbackrateitf_set_playbackrate(void * context, XAint16 rate) |
|
1922 |
{ |
|
1923 |
return ((CMMFBackendEngine *) (context))->SetPlaybackRate(rate); |
|
1924 |
} |
|
1925 |
||
1926 |
XAresult mmf_playbackrateitf_get_playbackratecaps(void * context, XAboolean* forward, XAboolean* backward) |
|
1927 |
{ |
|
1928 |
return ((CMMFBackendEngine *) (context))->GetPlaybackRateCapabilities(forward,backward); |
|
1929 |
} |
|
25 | 1930 |
} |