|
1 /* |
|
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 */ |
|
17 |
|
18 #ifndef XAPLAYITF_H |
|
19 #define XAPLAYITF_H |
|
20 |
|
21 #include "openmaxalwrapper.h" |
|
22 #include "xaglobals.h" |
|
23 #ifdef _GSTREAMER_BACKEND_ |
|
24 #include "XAAdaptationContextBase.h" |
|
25 #endif |
|
26 #include "xaadaptationcontextbasemmf.h" |
|
27 #include "xamediaplayer.h" |
|
28 |
|
29 |
|
30 /** MACROS **/ |
|
31 #define NO_POSITION XA_TIME_UNKNOWN |
|
32 #define PLAYITF_DEFAULT_UPDATE_PERIOD 1000 |
|
33 #define START_POSITION 0 |
|
34 |
|
35 /** TYPES **/ |
|
36 |
|
37 /** ENUMERATIONS **/ |
|
38 |
|
39 /** STRUCTURES **/ |
|
40 /* Definition of XAPlayItf implementation */ |
|
41 typedef struct XAPlayItfImpl_ |
|
42 { |
|
43 /* parent interface */ |
|
44 struct XAPlayItf_ itf; |
|
45 /* pointer to self */ |
|
46 struct XAPlayItfImpl_* self; |
|
47 |
|
48 /* variables */ |
|
49 XAPlayItf cbPtrToSelf; |
|
50 XAuint32 playbackState; |
|
51 xaPlayCallback callback; |
|
52 void *cbcontext; |
|
53 XAuint32 eventFlags; |
|
54 XAmillisecond markerPosition; |
|
55 XAmillisecond positionUpdatePeriod; |
|
56 XAboolean positionupdateOn; |
|
57 XAmillisecond lastPosition; |
|
58 XAboolean isMarkerPosCbSend; |
|
59 |
|
60 #ifdef _GSTREAMER_BACKEND_ |
|
61 /*Adaptation variables*/ |
|
62 XAAdaptationBaseCtx *adapCtx; |
|
63 #endif |
|
64 XAAdaptationBaseMMFCtx *adaptCtxMMF; |
|
65 XAboolean isMMFPlayback; |
|
66 |
|
67 } XAPlayItfImpl; |
|
68 |
|
69 /** METHODS **/ |
|
70 |
|
71 /* Base interface XAPlayItf implementation */ |
|
72 XAresult XAPlayItfImpl_SetPlayState(XAPlayItf self, XAuint32 state); |
|
73 |
|
74 XAresult XAPlayItfImpl_GetPlayState(XAPlayItf self, XAuint32 *pState); |
|
75 |
|
76 XAresult XAPlayItfImpl_GetDuration(XAPlayItf self, XAmillisecond *pMsec); |
|
77 |
|
78 XAresult XAPlayItfImpl_GetPosition(XAPlayItf self, XAmillisecond *pMsec); |
|
79 |
|
80 XAresult XAPlayItfImpl_RegisterCallback(XAPlayItf self, xaPlayCallback callback, |
|
81 void *pContext); |
|
82 |
|
83 XAresult XAPlayItfImpl_SetCallbackEventsMask(XAPlayItf self, XAuint32 eventFlags); |
|
84 |
|
85 XAresult XAPlayItfImpl_GetCallbackEventsMask(XAPlayItf self, XAuint32 *pEventFlags); |
|
86 |
|
87 XAresult XAPlayItfImpl_SetMarkerPosition(XAPlayItf self, XAmillisecond mSec); |
|
88 |
|
89 XAresult XAPlayItfImpl_ClearMarkerPosition(XAPlayItf self); |
|
90 |
|
91 XAresult XAPlayItfImpl_GetMarkerPosition(XAPlayItf self, XAmillisecond *pMsec); |
|
92 |
|
93 XAresult XAPlayItfImpl_SetPositionUpdatePeriod(XAPlayItf self, XAmillisecond mSec); |
|
94 |
|
95 XAresult XAPlayItfImpl_GetPositionUpdatePeriod(XAPlayItf self, XAmillisecond *pMsec); |
|
96 |
|
97 |
|
98 /* |
|
99 * implementation-specific methods |
|
100 */ |
|
101 XAPlayItfImpl* XAPlayItfImpl_Create( |
|
102 #ifdef _GSTREAMER_BACKEND_ |
|
103 XAAdaptationBaseCtx *adapCtx, |
|
104 #endif |
|
105 XAAdaptationBaseMMFCtx *adaptationCtxMMF ); |
|
106 #ifdef _GSTREAMER_BACKEND_ |
|
107 void XAPlayItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event ); |
|
108 #endif |
|
109 XAresult XAPlayItfImpl_DeterminePlaybackEngine(XAPlayItf self, XADataLocator_URI *uri); |
|
110 void XAPlayItfImpl_Free(XAPlayItfImpl* self); |
|
111 |
|
112 |
|
113 #endif /* XAPLAYITF_H */ |