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