1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: Seek Itf Adaptation MMF |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 #include <glib.h> |
18 #include "unistd.h" |
19 #include "unistd.h" |
19 #include "xamediaplayeradaptctxmmf.h" |
20 #include "xamediaplayeradaptctxmmf.h" |
20 #include "xaseekitfadaptationmmf.h" |
21 #include "xaseekitfadaptationmmf.h" |
21 #include "cmmfbackendengine.h" |
22 #include "cmmfbackendengine.h" |
22 #include <glib.h> |
|
23 |
23 |
24 /* |
24 /* |
25 * XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state) |
25 * XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state) |
26 * Sets play state to GStreamer. |
26 * Sets play state to GStreamer. |
27 * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID |
27 * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID |
28 * XAuint32 state - Play state to be set |
28 * XAuint32 state - Play state to be set |
29 * @return XAresult ret - Success value |
29 * @return XAresult ret - Success value |
30 */ |
30 */ |
31 XAresult XASeekItfAdaptMMF_SetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond pos, XAuint32 seekMode) |
31 XAresult XASeekItfAdaptMMF_SetPosition(XAAdaptationBaseCtx *bCtx, |
32 { |
32 XAmillisecond pos, XAuint32 seekMode) |
|
33 { |
33 XAresult ret = XA_RESULT_SUCCESS; |
34 XAresult ret = XA_RESULT_SUCCESS; |
34 XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
35 XAMediaPlayerAdaptationMMFCtx* mCtx = |
|
36 (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
35 |
37 |
36 DEBUG_API("->XASeekItfAdaptMMF_SetPosition "); |
38 DEBUG_API("->XASeekItfAdaptMMF_SetPosition "); |
37 ret = mmf_seekitf_set_position(mCtx->mmfContext, pos); |
39 ret = mmf_seekitf_set_position(mCtx->mmfContext, pos); |
38 /* bCtx and parameter pointer validation happens in the calling function. |
40 /* bCtx and parameter pointer validation happens in the calling function. |
39 * We don't need to repeat it here*/ |
41 * We don't need to repeat it here*/ |
40 |
42 |
41 DEBUG_API("<-XASeekItfAdaptMMF_SetPosition"); |
43 DEBUG_API("<-XASeekItfAdaptMMF_SetPosition"); |
42 return ret; |
44 return ret; |
43 } |
45 } |
44 |
46 |
45 XAresult XASeekItfAdaptMMF_SetLoop(XAAdaptationBaseCtx *bCtx, XAboolean loopEnable, |
47 XAresult XASeekItfAdaptMMF_SetLoop(XAAdaptationBaseCtx *bCtx, |
46 XAmillisecond startPos, XAmillisecond endPos) |
48 XAboolean loopEnable, XAmillisecond startPos, XAmillisecond endPos) |
47 { |
49 { |
48 XAresult ret = XA_RESULT_SUCCESS; |
50 XAresult ret = XA_RESULT_SUCCESS; |
49 XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
51 XAMediaPlayerAdaptationMMFCtx* mCtx = |
|
52 (XAMediaPlayerAdaptationMMFCtx*) bCtx; |
50 |
53 |
51 DEBUG_API("->XASeekItfAdaptMMF_SetLoop "); |
54 DEBUG_API("->XASeekItfAdaptMMF_SetLoop "); |
52 |
55 |
53 /* bCtx and parameter pointer validation happens in the calling function. |
56 /* bCtx and parameter pointer validation happens in the calling function. |
54 * We don't need to repeat it here*/ |
57 * We don't need to repeat it here*/ |
55 ret = mmf_seekitf_set_repeats(mCtx->mmfContext, loopEnable); |
58 ret = mmf_seekitf_set_repeats(mCtx->mmfContext, loopEnable); |
56 |
59 |
57 ret = mmf_seekitf_set_playwindow(mCtx->mmfContext, startPos, endPos); |
60 ret = mmf_seekitf_set_playwindow(mCtx->mmfContext, startPos, endPos); |
58 |
61 |
59 |
62 DEBUG_API("<-XASeekItfAdaptMMF_SetLoop"); |
60 |
63 return ret; |
61 DEBUG_API("<-XASeekItfAdaptMMF_SetLoop"); |
|
62 return ret; |
|
63 } |
64 } |