author | hgs |
Fri, 25 Jun 2010 17:36:03 -0500 | |
changeset 28 | ebf79c79991a |
parent 25 | 6f7ceef7b1d1 |
child 33 | 5e8b14bae8c3 |
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: Play Itf Adapt MMF |
|
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 "unistd.h" |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include "xamediaplayeradaptctxmmf.h" |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include "xaplayitfadaptationmmf.h" |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include "xaadaptationmmf.h" |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include "cmmfbackendengine.h" |
21 | 23 |
#include "cmmfradiobackendengine.h" |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <glib.h> |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
extern XAboolean cameraRealized; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
/*forward declaration of position updater callback*/ |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
gboolean XAPlayItfAdapt_PositionUpdate(gpointer ctx); |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
/* |
19 | 32 |
* XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
* Sets play state to GStreamer. |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
* @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
* XAuint32 state - Play state to be set |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
* @return XAresult ret - Success value |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
*/ |
25 | 38 |
XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseCtx *bCtx, |
39 |
XAuint32 state) |
|
40 |
{ |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 42 |
XAMediaPlayerAdaptationMMFCtx* mCtx; |
43 |
if (!bCtx) |
|
44 |
{ |
|
45 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
46 |
return ret; |
|
47 |
} |
|
48 |
||
49 |
mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
50 |
||
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
|
19 | 52 |
DEBUG_API_A1("->XAPlayItfAdaptMMF_SetPlayState %s",PLAYSTATENAME(state)); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
19 | 54 |
/* bCtx and parameter pointer validation happens in the calling function. |
55 |
* We don't need to repeat it here*/ |
|
25 | 56 |
switch (state) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
{ |
25 | 58 |
case XA_PLAYSTATE_STOPPED: |
59 |
{ |
|
60 |
if (bCtx->ctxId == XARadioAdaptation) |
|
61 |
{ |
|
62 |
mmf_set_player_adapt_context(cmmfradiobackendengine_init(), |
|
63 |
bCtx); |
|
64 |
stop_radio(cmmfradiobackendengine_init()); |
|
65 |
} |
|
66 |
else |
|
67 |
{ |
|
68 |
ret = mmf_playitf_stop_playback(mCtx->mmfContext); |
|
69 |
} |
|
70 |
break; |
|
71 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
case XA_PLAYSTATE_PAUSED: |
19 | 73 |
ret = mmf_playitf_pause_playback(mCtx->mmfContext); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
break; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
case XA_PLAYSTATE_PLAYING: |
25 | 76 |
{ |
77 |
if (bCtx->ctxId == XARadioAdaptation) |
|
78 |
{ |
|
79 |
mmf_set_player_adapt_context(cmmfradiobackendengine_init(), |
|
80 |
bCtx); |
|
81 |
play_radio(cmmfradiobackendengine_init()); |
|
82 |
} |
|
83 |
else |
|
84 |
{ |
|
85 |
ret = mmf_playitf_resume_playback(mCtx->mmfContext); |
|
86 |
} |
|
87 |
break; |
|
88 |
} |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
default: |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
ret = XA_RESULT_PARAMETER_INVALID; |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
break; |
25 | 92 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
|
19 | 94 |
DEBUG_API("<-XAPlayItfAdaptMMF_SetPlayState"); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
return ret; |
25 | 96 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
/* |
19 | 99 |
* XAresult XAPlayItfAdaptMMF_GetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 *pState) |
100 |
* @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID |
|
101 |
* XAuint32 *state - XAmillisecond *pMsec - Pointer where to store play state |
|
102 |
* @return XAresult ret - Success value |
|
103 |
*/ |
|
25 | 104 |
XAresult XAPlayItfAdaptMMF_GetPlayState(XAAdaptationBaseCtx *bCtx, |
105 |
XAuint32 *pState) |
|
19 | 106 |
{ |
107 |
XAresult ret = XA_RESULT_SUCCESS; |
|
25 | 108 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
109 |
if (!bCtx || !pState) |
|
110 |
{ |
|
111 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
112 |
return ret; |
|
113 |
} |
|
114 |
||
115 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
19 | 116 |
|
117 |
DEBUG_API("->XAPlayItfAdaptMMF_GetPlayState"); |
|
118 |
||
119 |
/* If playhead reaches eof, state will transition to paused. |
|
120 |
* This object does not have visibility to callback*/ |
|
25 | 121 |
ret = mmf_playitf_get_play_state(pSelf->mmfContext, pState); |
19 | 122 |
|
123 |
DEBUG_API("<-XAPlayItfAdaptMMF_GetPlayState"); |
|
124 |
return ret; |
|
125 |
||
126 |
} |
|
127 |
||
128 |
/* |
|
129 |
* XAresult XAPlayItfAdaptMMF_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec) |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
* @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
* XAmillisecond *pMsec - Pointer where to store duration of stream. |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
* @return XAresult ret - Success value |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
*/ |
25 | 134 |
XAresult XAPlayItfAdaptMMF_GetDuration(XAAdaptationBaseCtx *bCtx, |
135 |
XAmillisecond *pMsec) |
|
136 |
{ |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 138 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
139 |
if (!bCtx || !pMsec) |
|
140 |
{ |
|
141 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
142 |
return ret; |
|
143 |
} |
|
144 |
||
145 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
|
19 | 147 |
DEBUG_API("->XAPlayItfAdaptMMF_GetDuration"); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
|
25 | 149 |
ret = mmf_playitf_get_duration(pSelf->mmfContext, pMsec); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
|
19 | 151 |
DEBUG_API("<-XAPlayItfAdaptMMF_GetDuration"); |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
return ret; |
25 | 153 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
/* |
19 | 156 |
* XAresult XAPlayItfAdaptMMF_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec) |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
* @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID value |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
* XAmillisecond *pMsec - Pointer where to store current position in stream. |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
* @return XAresult ret - Success value |
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
*/ |
25 | 161 |
XAresult XAPlayItfAdaptMMF_GetPosition(XAAdaptationBaseCtx *bCtx, |
162 |
XAmillisecond *pMsec) |
|
163 |
{ |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 165 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
166 |
if (!bCtx || !pMsec) |
|
167 |
{ |
|
168 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
169 |
return ret; |
|
170 |
} |
|
171 |
||
172 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
19 | 173 |
|
174 |
DEBUG_API("->XAPlayItfAdaptMMF_GetPosition"); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
|
25 | 176 |
ret = mmf_playitf_get_position(pSelf->mmfContext, pMsec); |
19 | 177 |
|
178 |
DEBUG_API("<-XAPlayItfAdaptMMF_GetPosition"); |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
return ret; |
25 | 180 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
|
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
/* |
19 | 183 |
* XAresult XAPlayItfAdaptMMF_RegisterCallback(XAAdaptationBaseCtx *bCtx, xaPlayCallback callback) |
184 |
* Description: Sets the playback callback function. |
|
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
*/ |
25 | 186 |
XAresult XAPlayItfAdaptMMF_RegisterCallback(XAAdaptationBaseCtx *bCtx, |
187 |
xaPlayCallback callback) |
|
188 |
{ |
|
19 | 189 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 190 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
191 |
if (!bCtx) |
|
192 |
{ |
|
193 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
194 |
return ret; |
|
195 |
} |
|
196 |
||
197 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
19 | 198 |
|
199 |
DEBUG_API("->XAPlayItfAdaptMMF_RegisterCallback"); |
|
200 |
||
25 | 201 |
ret = mmf_playitf_register_callback(pSelf->mmfContext, callback); |
19 | 202 |
|
203 |
DEBUG_API("<-XAPlayItfAdaptMMF_RegisterCallback"); |
|
204 |
return ret; |
|
25 | 205 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
|
19 | 207 |
/** |
208 |
* XAresult XAPlayItfAdaptMMF_SetCallbackEventsMask(XAAdaptationBaseCtx *bCtx, XAuint32 eventFlags) |
|
209 |
* Description: Enables/disables notification of playback events. |
|
210 |
**/ |
|
25 | 211 |
XAresult XAPlayItfAdaptMMF_SetCallbackEventsMask(XAAdaptationBaseCtx *bCtx, |
212 |
XAuint32 eventFlags) |
|
213 |
{ |
|
19 | 214 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 215 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
216 |
if (!bCtx) |
|
217 |
{ |
|
218 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
219 |
return ret; |
|
220 |
} |
|
221 |
||
222 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
19 | 223 |
|
224 |
DEBUG_API("->XAPlayItfAdaptMMF_SetCallbackEventsMask"); |
|
225 |
||
25 | 226 |
ret = mmf_playitf_set_callback_events_mask(pSelf->mmfContext, eventFlags); |
19 | 227 |
|
228 |
DEBUG_API("<-XAPlayItfAdaptMMF_SetCallbackEventsMask"); |
|
229 |
return ret; |
|
25 | 230 |
} |
12
5a06f39ad45b
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
|
19 | 232 |
/** |
233 |
* XAresult XAPlayItfAdaptMMF_SetMarkerPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec) |
|
234 |
* Description: Sets marker position. |
|
235 |
**/ |
|
25 | 236 |
XAresult XAPlayItfAdaptMMF_SetMarkerPosition(XAAdaptationBaseCtx *bCtx, |
237 |
XAmillisecond mSec) |
|
238 |
{ |
|
19 | 239 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 240 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
241 |
if (!bCtx) |
|
242 |
{ |
|
243 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
244 |
return ret; |
|
245 |
} |
|
246 |
||
247 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
19 | 248 |
|
249 |
DEBUG_API("->XAPlayItfAdaptMMF_SetMarkerPosition"); |
|
250 |
||
25 | 251 |
ret = mmf_playitf_set_marker_position(pSelf->mmfContext, mSec); |
19 | 252 |
|
253 |
DEBUG_API("<-XAPlayItfAdaptMMF_SetMarkerPosition"); |
|
254 |
return ret; |
|
25 | 255 |
} |
19 | 256 |
|
257 |
/** |
|
258 |
* XAresult XAPlayItfAdaptMMF_SetCallbackEventsMask(XAAdaptationBaseCtx *bCtx, XAuint32 eventFlags) |
|
259 |
* Description: Clears marker position. |
|
260 |
**/ |
|
261 |
XAresult XAPlayItfAdaptMMF_ClearMarkerPosition(XAAdaptationBaseCtx *bCtx) |
|
25 | 262 |
{ |
19 | 263 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 264 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
265 |
if (!bCtx) |
|
266 |
{ |
|
267 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
268 |
return ret; |
|
269 |
} |
|
270 |
||
271 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
19 | 272 |
|
273 |
DEBUG_API("->XAPlayItfAdaptMMF_ClearMarkerPosition"); |
|
274 |
||
25 | 275 |
ret = mmf_playitf_clear_marker_position(pSelf->mmfContext); |
19 | 276 |
|
277 |
DEBUG_API("<-XAPlayItfAdaptMMF_ClearMarkerPosition"); |
|
278 |
return ret; |
|
25 | 279 |
} |
19 | 280 |
|
281 |
/** |
|
282 |
* XAPlayItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec) |
|
283 |
* Description: Sets position update period. |
|
284 |
**/ |
|
25 | 285 |
XAresult XAPlayItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseCtx *bCtx, |
286 |
XAmillisecond mSec) |
|
287 |
{ |
|
19 | 288 |
XAresult ret = XA_RESULT_SUCCESS; |
25 | 289 |
XAMediaPlayerAdaptationMMFCtx* pSelf; |
290 |
if (!bCtx) |
|
291 |
{ |
|
292 |
ret = XA_RESULT_PARAMETER_INVALID; |
|
293 |
return ret; |
|
294 |
} |
|
295 |
||
296 |
pSelf = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
|
19 | 297 |
|
298 |
DEBUG_API("->XAPlayItfAdaptMMF_SetPositionUpdatePeriod"); |
|
299 |
||
25 | 300 |
ret = mmf_playitf_set_position_update_period(pSelf->mmfContext, mSec); |
19 | 301 |
|
302 |
DEBUG_API("<-XAPlayItfAdaptMMF_SetPositionUpdatePeriod"); |
|
303 |
return ret; |
|
25 | 304 |
} |
21 | 305 |
/* |
306 |
* XAresult XAPlayItfAdapt_StateChange |
|
307 |
* Handle callback from Radio utility |
|
308 |
*/ |
|
25 | 309 |
void XAPlayItfAdaptMMF_StateChange(XAAdaptationBaseCtx *bCtx, |
310 |
XAboolean playing) |
|
311 |
{ |
|
312 |
if (playing) |
|
313 |
{ |
|
314 |
XAAdaptEvent event = |
|
315 |
{ |
|
316 |
XA_PLAYITFEVENTS, XA_PLAYEVENT_HEADMOVING, 1, 0 |
|
317 |
}; |
|
318 |
XAAdaptationBase_SendAdaptEvents(bCtx, &event); |
|
319 |
} |
|
320 |
else |
|
321 |
{ |
|
322 |
XAAdaptEvent event = |
|
323 |
{ |
|
324 |
XA_PLAYITFEVENTS, XA_PLAYEVENT_HEADSTALLED, 1, 0 |
|
325 |
}; |
|
326 |
XAAdaptationBase_SendAdaptEvents(bCtx, &event); |
|
327 |
} |
|
21 | 328 |
|
25 | 329 |
} |