19
|
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: Record Itf GST adaptation
|
|
15 |
*
|
|
16 |
*/
|
19
|
17 |
|
|
18 |
#include <pthread.h>
|
20
|
19 |
#include <gst/gst.h>
|
19
|
20 |
#include "xamediarecorderadaptctx.h"
|
|
21 |
#include "xarecorditfadaptation.h"
|
|
22 |
#include "xaadaptationgst.h"
|
|
23 |
#include "xacameraadaptctx.h"
|
|
24 |
|
|
25 |
/*forward declaration of position updater callback*/
|
|
26 |
gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx);
|
|
27 |
|
|
28 |
extern XAboolean cameraRealized;
|
|
29 |
extern XACameraAdaptationCtx_* cameraCtx;
|
|
30 |
|
|
31 |
/*
|
|
32 |
* XAresult XARecordItfAdapt_SetRecordState(XAAdaptationGstCtx *ctx, XAuint32 state)
|
|
33 |
* Sets record state to GStreamer.
|
|
34 |
* @param XAAdaptationGstCtx *ctx - Adaptation context
|
|
35 |
* XAuint32 state - Record state to be set
|
|
36 |
* @return XAresult ret - Success value
|
|
37 |
*/
|
25
|
38 |
XAresult XARecordItfAdapt_SetRecordState(XAAdaptationGstCtx *bCtx,
|
|
39 |
XAuint32 state)
|
|
40 |
{
|
19
|
41 |
XAresult ret = XA_RESULT_SUCCESS;
|
|
42 |
XAboolean closeSink = XA_BOOLEAN_FALSE;
|
|
43 |
XAboolean requestStateChange = XA_BOOLEAN_FALSE;
|
|
44 |
GstStateChangeReturn gstRet = GST_STATE_CHANGE_SUCCESS;
|
|
45 |
XAMediaRecorderAdaptationCtx* mCtx = NULL;
|
|
46 |
XAboolean recording = XA_BOOLEAN_FALSE;
|
|
47 |
DEBUG_API_A1("->XARecordItfAdapt_SetRecordState %s",RECORDSTATENAME(state));
|
25
|
48 |
if (!bCtx || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
|
|
49 |
{
|
19
|
50 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
|
|
51 |
DEBUG_API("<-XARecordItfAdapt_SetRecordState");
|
|
52 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
53 |
}
|
19
|
54 |
|
|
55 |
mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
|
|
56 |
|
|
57 |
mCtx->isRecord = XA_BOOLEAN_TRUE;
|
|
58 |
|
25
|
59 |
switch (state)
|
|
60 |
{
|
19
|
61 |
case XA_RECORDSTATE_STOPPED:
|
25
|
62 |
{
|
|
63 |
// Audio sourse should be stopped
|
|
64 |
if (mCtx->audiosource)
|
19
|
65 |
{
|
25
|
66 |
if (gst_element_send_event(mCtx->audiosource,
|
|
67 |
gst_event_new_eos()) == TRUE)
|
|
68 |
{
|
|
69 |
DEBUG_INFO ("posted eos");
|
|
70 |
}
|
|
71 |
else
|
|
72 |
{
|
|
73 |
DEBUG_ERR("FAIL : post eos");
|
|
74 |
}
|
19
|
75 |
}
|
25
|
76 |
|
|
77 |
if (cameraCtx && cameraRealized && mCtx->isobjvsrc
|
|
78 |
&& mCtx->videosource)
|
|
79 |
{
|
|
80 |
cameraCtx->recording = XA_BOOLEAN_FALSE;
|
19
|
81 |
|
25
|
82 |
if (!cameraCtx->playing && !cameraCtx->snapshotting)
|
|
83 |
{
|
|
84 |
/* Neither view finder or recorder is running -> pause camera */
|
|
85 |
if (GST_STATE( GST_ELEMENT(mCtx->videosource))
|
|
86 |
== GST_STATE_PLAYING)
|
|
87 |
{
|
|
88 |
GstStateChangeReturn gret;
|
|
89 |
DEBUG_INFO("Stop camera source");
|
|
90 |
gret = gst_element_set_state(
|
|
91 |
GST_ELEMENT(mCtx->videosource),
|
|
92 |
GST_STATE_PAUSED);
|
|
93 |
if (gret == GST_STATE_CHANGE_SUCCESS)
|
|
94 |
gret = gst_element_get_state(
|
|
95 |
GST_ELEMENT(mCtx->videosource), NULL,
|
|
96 |
NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
|
|
97 |
}
|
|
98 |
}
|
|
99 |
}
|
19
|
100 |
|
|
101 |
bCtx->binWantedState = GST_STATE_PAUSED;
|
|
102 |
closeSink = XA_BOOLEAN_TRUE;
|
25
|
103 |
if (mCtx->runpositiontimer > 0)
|
|
104 |
{
|
19
|
105 |
g_source_remove(mCtx->runpositiontimer);
|
25
|
106 |
mCtx->runpositiontimer = 0;
|
|
107 |
}
|
19
|
108 |
|
25
|
109 |
if (mCtx->recThrCtx.bufInsufficientSem)
|
|
110 |
{
|
19
|
111 |
DEBUG_INFO("No buffer-insufficient received, posting record thr semaphore.");
|
25
|
112 |
if (XAImpl_PostSemaphore(mCtx->recThrCtx.bufInsufficientSem)
|
|
113 |
!= XA_RESULT_SUCCESS)
|
|
114 |
{
|
19
|
115 |
DEBUG_ERR("Posting buffer-insufficient semaphore FAILED!");
|
25
|
116 |
}
|
19
|
117 |
}
|
|
118 |
|
|
119 |
break;
|
25
|
120 |
}
|
19
|
121 |
case XA_RECORDSTATE_PAUSED:
|
|
122 |
{
|
25
|
123 |
if (cameraCtx && cameraRealized && mCtx->isobjvsrc
|
|
124 |
&& mCtx->videosource)
|
|
125 |
{
|
|
126 |
cameraCtx->recording = XA_BOOLEAN_FALSE;
|
|
127 |
if (!cameraCtx->playing && !cameraCtx->snapshotting)
|
|
128 |
{
|
|
129 |
/* Neither view finder or recorder is running -> pause camera */
|
|
130 |
if (GST_STATE( GST_ELEMENT(mCtx->videosource))
|
|
131 |
== GST_STATE_PLAYING)
|
|
132 |
{
|
|
133 |
GstStateChangeReturn gret;
|
|
134 |
DEBUG_INFO("Stop camera source");
|
|
135 |
gret = gst_element_set_state(
|
|
136 |
GST_ELEMENT(mCtx->videosource),
|
|
137 |
GST_STATE_PAUSED);
|
|
138 |
if (gret == GST_STATE_CHANGE_SUCCESS)
|
|
139 |
gret = gst_element_get_state(
|
|
140 |
GST_ELEMENT(mCtx->videosource), NULL,
|
|
141 |
NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
|
|
142 |
}
|
|
143 |
}
|
|
144 |
}
|
|
145 |
|
|
146 |
if (mCtx->xaRecordState == XA_RECORDSTATE_STOPPED
|
|
147 |
&& mCtx->encodingchanged)
|
|
148 |
{
|
|
149 |
XAMediaRecorderAdapt_ChangeEncoders(mCtx);
|
|
150 |
mCtx->encodingchanged = XA_BOOLEAN_FALSE;
|
|
151 |
}
|
|
152 |
bCtx->binWantedState = GST_STATE_PAUSED;
|
|
153 |
if (mCtx->runpositiontimer > 0)
|
|
154 |
{
|
19
|
155 |
g_source_remove(mCtx->runpositiontimer);
|
25
|
156 |
mCtx->runpositiontimer = 0;
|
|
157 |
}
|
|
158 |
break;
|
19
|
159 |
}
|
|
160 |
case XA_RECORDSTATE_RECORDING:
|
|
161 |
{
|
25
|
162 |
if (cameraCtx && mCtx->isobjvsrc)
|
|
163 |
{
|
|
164 |
cameraCtx->recording = XA_BOOLEAN_TRUE;
|
|
165 |
}
|
|
166 |
|
|
167 |
if (mCtx->xaRecordState == XA_RECORDSTATE_STOPPED
|
|
168 |
&& (mCtx->encodingchanged))
|
|
169 |
{
|
|
170 |
XAMediaRecorderAdapt_ChangeEncoders(mCtx);
|
19
|
171 |
mCtx->encodingchanged = XA_BOOLEAN_FALSE;
|
25
|
172 |
}
|
19
|
173 |
|
25
|
174 |
if (mCtx->recThrCtx.bufInsufficientSem)
|
|
175 |
{
|
19
|
176 |
/* Recording to address and recording thread semaphora is created */
|
25
|
177 |
if (!XAImpl_StartThread(&(mCtx->recordingEventThr), NULL,
|
|
178 |
&XAMediaRecorderAdapt_RecordEventThr, (void*) mCtx))
|
19
|
179 |
{
|
25
|
180 |
DEBUG_ERR("Start thread Failed");
|
|
181 |
return XA_RESULT_INTERNAL_ERROR;
|
19
|
182 |
}
|
25
|
183 |
}
|
19
|
184 |
|
|
185 |
bCtx->binWantedState = GST_STATE_PLAYING;
|
|
186 |
recording = XA_BOOLEAN_TRUE;
|
|
187 |
break;
|
25
|
188 |
}
|
19
|
189 |
default:
|
25
|
190 |
DEBUG_ERR("Unhandled state")
|
|
191 |
;
|
19
|
192 |
ret = XA_RESULT_PARAMETER_INVALID;
|
|
193 |
break;
|
25
|
194 |
}
|
19
|
195 |
|
25
|
196 |
if (ret == XA_RESULT_SUCCESS)
|
|
197 |
{
|
19
|
198 |
mCtx->xaRecordState = state;
|
25
|
199 |
}
|
19
|
200 |
|
|
201 |
/* launch Gstreamer state change only if necessary */
|
25
|
202 |
if (GST_STATE_TARGET(bCtx->bin) == bCtx->binWantedState)
|
|
203 |
{
|
19
|
204 |
DEBUG_INFO("Gst already transitioning to wanted state!!");
|
|
205 |
requestStateChange = XA_BOOLEAN_FALSE;
|
25
|
206 |
}
|
19
|
207 |
else
|
|
208 |
{
|
25
|
209 |
if ((GST_STATE(bCtx->bin) == bCtx->binWantedState)
|
|
210 |
&& (GST_STATE_PENDING(bCtx->bin) == GST_STATE_VOID_PENDING))
|
|
211 |
{
|
19
|
212 |
DEBUG_ERR_A3("WARNING : gststate %d == wanted %d != gsttarget %d and no statechange pending",
|
25
|
213 |
GST_STATE(bCtx->bin), bCtx->binWantedState, GST_STATE_TARGET(bCtx->bin));
|
|
214 |
}
|
19
|
215 |
requestStateChange = XA_BOOLEAN_TRUE;
|
25
|
216 |
}
|
19
|
217 |
|
25
|
218 |
if (requestStateChange)
|
|
219 |
{
|
19
|
220 |
XAAdaptationGst_PrepareAsyncWait(bCtx);
|
|
221 |
DEBUG_INFO_A1("Sending change state request to state %d", bCtx->binWantedState);
|
25
|
222 |
gstRet = gst_element_set_state(GST_ELEMENT(bCtx->bin),
|
|
223 |
bCtx->binWantedState);
|
|
224 |
switch (gstRet)
|
|
225 |
{
|
19
|
226 |
case GST_STATE_CHANGE_FAILURE:
|
25
|
227 |
DEBUG_ERR_A1("FAILED to change state (target %d)",bCtx->binWantedState)
|
|
228 |
;
|
19
|
229 |
bCtx->binWantedState = GST_STATE(bCtx->bin);
|
|
230 |
ret = XA_RESULT_INTERNAL_ERROR;
|
|
231 |
break;
|
|
232 |
case GST_STATE_CHANGE_ASYNC:
|
|
233 |
DEBUG_INFO_A1("Change state will happen asyncronously (target %d)",bCtx->binWantedState);
|
|
234 |
XAAdaptationGst_StartAsyncWait(bCtx);
|
|
235 |
ret = XA_RESULT_SUCCESS;
|
|
236 |
break;
|
|
237 |
case GST_STATE_CHANGE_NO_PREROLL:
|
25
|
238 |
DEBUG_INFO("GST_STATE_CHANGE_NO_PREROLL")
|
|
239 |
;
|
19
|
240 |
/* deliberate fall-through */
|
|
241 |
case GST_STATE_CHANGE_SUCCESS:
|
25
|
242 |
DEBUG_INFO_A1("Successfully changed state (target %d)",bCtx->binWantedState)
|
|
243 |
;
|
19
|
244 |
ret = XA_RESULT_SUCCESS;
|
|
245 |
break;
|
|
246 |
default:
|
25
|
247 |
DEBUG_ERR_A1("Unhandled error (%d)",gstRet)
|
|
248 |
;
|
19
|
249 |
ret = XA_RESULT_UNKNOWN_ERROR;
|
|
250 |
break;
|
25
|
251 |
}
|
19
|
252 |
bCtx->waitingasyncop = XA_BOOLEAN_FALSE;
|
25
|
253 |
}
|
|
254 |
if ((GST_STATE(bCtx->bin) > GST_STATE_READY) && closeSink)
|
|
255 |
{ /* close the sink*/
|
|
256 |
gst_element_send_event(bCtx->bin, gst_event_new_flush_start());
|
|
257 |
gst_element_send_event(bCtx->bin, gst_event_new_flush_stop());
|
|
258 |
}
|
19
|
259 |
|
25
|
260 |
if (recording && mCtx->isobjvsrc && mCtx->videosource)
|
|
261 |
{
|
|
262 |
GstPad *pad = gst_element_get_static_pad(
|
|
263 |
GST_ELEMENT(mCtx->videosource), "MRObjSrc");
|
|
264 |
if (pad && gst_pad_is_linked(pad))
|
|
265 |
{
|
|
266 |
DEBUG_INFO_A2("unblock element:%s pad:%s",
|
|
267 |
gst_element_get_name(mCtx->videosource),
|
|
268 |
gst_pad_get_name(pad));
|
|
269 |
gst_pad_set_blocked_async(pad, FALSE, XAAdaptationGst_PadBlockCb,
|
|
270 |
NULL);
|
|
271 |
}
|
19
|
272 |
|
25
|
273 |
if (GST_STATE( GST_ELEMENT(mCtx->videosource)) != GST_STATE_PLAYING)
|
|
274 |
{
|
|
275 |
GstStateChangeReturn gret = GST_STATE_CHANGE_SUCCESS;
|
|
276 |
DEBUG_INFO("Start camera source");
|
|
277 |
gret = gst_element_set_state(GST_ELEMENT(mCtx->videosource),
|
|
278 |
GST_STATE_PLAYING);
|
|
279 |
if (gret == GST_STATE_CHANGE_SUCCESS)
|
|
280 |
gret = gst_element_get_state(GST_ELEMENT(mCtx->videosource),
|
|
281 |
NULL, NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC);
|
|
282 |
}
|
|
283 |
}DEBUG_API("<-XARecordItfAdapt_SetRecordState");
|
|
284 |
return ret;
|
19
|
285 |
}
|
|
286 |
|
|
287 |
/*
|
|
288 |
* XAresult XARecordItfAdapt_GetRecordState(XAAdaptationGstCtx *bCtx, XAuint32 *state)
|
|
289 |
* Description: Return record state
|
|
290 |
*/
|
25
|
291 |
XAresult XARecordItfAdapt_GetRecordState(XAAdaptationGstCtx *bCtx,
|
|
292 |
XAuint32 *state)
|
|
293 |
{
|
19
|
294 |
XAMediaRecorderAdaptationCtx* mCtx = NULL;
|
|
295 |
DEBUG_API("->XARecordItfAdapt_GetRecordState");
|
|
296 |
|
25
|
297 |
if (!bCtx || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
|
|
298 |
{
|
19
|
299 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
|
|
300 |
DEBUG_API("<-XARecordItfAdapt_GetRecordState");
|
|
301 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
302 |
}
|
19
|
303 |
|
|
304 |
mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
|
|
305 |
|
|
306 |
*state = mCtx->xaRecordState;
|
|
307 |
|
|
308 |
DEBUG_API("<-XARecordItfAdapt_GetRecordState");
|
|
309 |
return XA_RESULT_SUCCESS;
|
25
|
310 |
}
|
19
|
311 |
|
|
312 |
/*
|
|
313 |
* XAresult XARecordItfAdapt_GetPosition(XAAdaptationGstCtx *ctx, AdaptationContextIDS ctxIDs, XAmillisecond *pMsec)
|
|
314 |
* @param XAAdaptationGstCtx *ctx - Adaptation context, this will be casted to correct type regarding to contextID value given as 2nd parameter
|
|
315 |
* XAmillisecond *pMsec - Pointer where to store current position in stream.
|
|
316 |
* @return XAresult ret - Success value
|
|
317 |
*/
|
25
|
318 |
XAresult XARecordItfAdapt_GetPosition(XAAdaptationGstCtx *bCtx,
|
|
319 |
XAmillisecond *pMsec)
|
|
320 |
{
|
19
|
321 |
XAresult ret = XA_RESULT_SUCCESS;
|
25
|
322 |
|
|
323 |
gint64 position = 0;
|
19
|
324 |
GstFormat format = GST_FORMAT_TIME;
|
|
325 |
DEBUG_API("->XARecordItfAdapt_GetPosition");
|
|
326 |
|
25
|
327 |
if (!bCtx || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
|
|
328 |
{
|
19
|
329 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
|
|
330 |
DEBUG_API("<-XARecordItfAdapt_GetPosition");
|
|
331 |
/* invalid parameter */
|
|
332 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
333 |
}
|
|
334 |
if (gst_element_query_position(GST_ELEMENT(bCtx->bin), &format, &position))
|
|
335 |
{
|
19
|
336 |
ret = XA_RESULT_SUCCESS;
|
|
337 |
*pMsec = GST_TIME_AS_MSECONDS(position); /*Warning ok due to used API specification*/
|
|
338 |
DEBUG_INFO_A1("Gst: Position in microseconds : %u", *pMsec );
|
25
|
339 |
}
|
19
|
340 |
else
|
25
|
341 |
{
|
19
|
342 |
DEBUG_ERR("WARNING: Gst: could not get position");
|
|
343 |
/* probably not fully prerolled - safe assumption for position = 0 */
|
|
344 |
*pMsec = 0;
|
|
345 |
ret = XA_RESULT_SUCCESS;
|
25
|
346 |
}
|
19
|
347 |
|
|
348 |
DEBUG_API("<-XARecordItfAdapt_GetPosition");
|
|
349 |
return ret;
|
25
|
350 |
}
|
19
|
351 |
|
|
352 |
/*
|
|
353 |
* gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx)
|
|
354 |
* callback.
|
|
355 |
* If position tracking enabled, periodic timer calls this method every XA_ADAPT_PU_INTERVAL msecs
|
|
356 |
* @return false to stop periodic calls
|
|
357 |
*/
|
|
358 |
gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx)
|
25
|
359 |
{
|
19
|
360 |
XAAdaptationGstCtx *bCtx = (XAAdaptationGstCtx*) ctx;
|
|
361 |
XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) ctx;
|
|
362 |
DEBUG_API("->XARecordItfAdapt_PositionUpdate");
|
|
363 |
|
25
|
364 |
if (mCtx && mCtx->trackpositionenabled)
|
|
365 |
{
|
19
|
366 |
GstFormat format = GST_FORMAT_TIME;
|
|
367 |
gint64 position = 0;
|
25
|
368 |
if (gst_element_query_position(GST_ELEMENT(bCtx->bin), &format,
|
|
369 |
&position))
|
|
370 |
{
|
|
371 |
XAuint32 posMsec = GST_TIME_AS_MSECONDS(position);
|
|
372 |
/*Warning ok due to used API specification*/
|
|
373 |
XAAdaptEvent event =
|
|
374 |
{
|
|
375 |
XA_RECORDITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL
|
|
376 |
};
|
19
|
377 |
event.data = &posMsec;
|
|
378 |
DEBUG_API_A1("XARecordItfAdapt_PositionUpdate: pos %lu ms", posMsec);
|
|
379 |
/* send needed events */
|
25
|
380 |
XAAdaptationBase_SendAdaptEvents(&bCtx->baseObj, &event);
|
|
381 |
}
|
19
|
382 |
else
|
25
|
383 |
{
|
19
|
384 |
DEBUG_ERR("Gst: Failed to get position");
|
25
|
385 |
}
|
|
386 |
DEBUG_API_A1("<-XARecordItfAdapt_PositionUpdate: %d", mCtx->runpositiontimer);
|
|
387 |
/* return false to stop timer */
|
|
388 |
return (mCtx->runpositiontimer);
|
19
|
389 |
}
|
25
|
390 |
return FALSE;
|
19
|
391 |
}
|
|
392 |
|
|
393 |
/*
|
|
394 |
* XAresult XARecordItfAdapt_EnablePositionTracking
|
|
395 |
* Enable/disable periodic position tracking callbacks
|
|
396 |
*/
|
25
|
397 |
XAresult XARecordItfAdapt_EnablePositionTracking(XAAdaptationGstCtx *bCtx,
|
|
398 |
XAboolean enable)
|
|
399 |
{
|
19
|
400 |
XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
|
|
401 |
DEBUG_API_A1("->XARecordItfAdapt_EnablePositionTracking (enable: %lu)", enable);
|
|
402 |
|
25
|
403 |
if (!bCtx || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
|
|
404 |
{
|
19
|
405 |
DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
|
|
406 |
DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
|
|
407 |
/* invalid parameter */
|
|
408 |
return XA_RESULT_PARAMETER_INVALID;
|
25
|
409 |
}
|
19
|
410 |
|
|
411 |
/* create a timer to track position of playback */
|
25
|
412 |
if (enable && !(mCtx->trackpositionenabled))
|
|
413 |
{
|
19
|
414 |
mCtx->trackpositionenabled = XA_BOOLEAN_TRUE;
|
|
415 |
mCtx->positionCb = &XARecordItfAdapt_PositionUpdate;
|
|
416 |
/* if recording is already on, create a timer to track position of recording */
|
25
|
417 |
if (GST_STATE(bCtx->bin) == GST_STATE_PLAYING)
|
|
418 |
{
|
|
419 |
mCtx->runpositiontimer = g_timeout_add(XA_ADAPT_PU_INTERVAL,
|
|
420 |
mCtx->positionCb, mCtx);
|
|
421 |
}
|
19
|
422 |
}
|
|
423 |
else if (!enable && (mCtx->trackpositionenabled))
|
25
|
424 |
{
|
19
|
425 |
mCtx->trackpositionenabled = XA_BOOLEAN_FALSE;
|
25
|
426 |
if (mCtx->runpositiontimer > 0)
|
|
427 |
{
|
19
|
428 |
g_source_remove(mCtx->runpositiontimer);
|
25
|
429 |
mCtx->runpositiontimer = 0;
|
|
430 |
}
|
19
|
431 |
}
|
|
432 |
|
|
433 |
DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
|
|
434 |
return XA_RESULT_SUCCESS;
|
25
|
435 |
}
|
19
|
436 |
|