|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 /** |
|
18 @file |
|
19 @internalComponent |
|
20 */ |
|
21 |
|
22 #ifndef OMXILCALLBACKMANAGERIFIMPL_H |
|
23 #define OMXILCALLBACKMANAGERIFIMPL_H |
|
24 |
|
25 #include <openmax/il/khronos/v1_x/OMX_Component.h> |
|
26 |
|
27 /** |
|
28 Call Back ManagerIf Impl Panic category |
|
29 */ |
|
30 _LIT(KOmxILCallbackManagerIfImplPanicCategory, "OmxILCallbackManagerIfImpl"); |
|
31 |
|
32 // Forward declarations |
|
33 class MOmxILPortManagerIf; |
|
34 class COmxILFsm; |
|
35 |
|
36 /** |
|
37 This is a generic implementation of the Callback Manager functionality. |
|
38 |
|
39 This implementation is meant to be reused totally or partially by specilized |
|
40 implementations of a Callback Manager object. |
|
41 */ |
|
42 class XOmxILCallbackManagerIfImpl |
|
43 { |
|
44 |
|
45 protected: |
|
46 |
|
47 XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, |
|
48 OMX_PTR apAppData, |
|
49 OMX_CALLBACKTYPE* apCallbacks); |
|
50 |
|
51 virtual ~XOmxILCallbackManagerIfImpl(); |
|
52 |
|
53 virtual void DoSetPortManager(MOmxILPortManagerIf& apPortManager); |
|
54 |
|
55 virtual void DoSetFsm(COmxILFsm& apFsm); |
|
56 |
|
57 // |
|
58 // Methods for Callback Registration |
|
59 // |
|
60 virtual OMX_ERRORTYPE DoRegisterComponentHandle( |
|
61 OMX_HANDLETYPE aComponentHandle); |
|
62 |
|
63 virtual OMX_ERRORTYPE DoRegisterILClientCallbacks( |
|
64 const OMX_CALLBACKTYPE* apCallbacks, |
|
65 const OMX_PTR apAppData); |
|
66 |
|
67 virtual OMX_ERRORTYPE DoRegisterTunnelCallback( |
|
68 OMX_U32 aLocalPortIndex, |
|
69 OMX_DIRTYPE aLocalPortDirection, |
|
70 OMX_HANDLETYPE aTunnelledComponentHandle, |
|
71 OMX_U32 aTunnelledPortIndex); |
|
72 |
|
73 virtual OMX_ERRORTYPE DoRegisterBufferMarkPropagationPort( |
|
74 OMX_U32 aPortIndex, |
|
75 OMX_U32 aPropagationPortIndex); |
|
76 |
|
77 // |
|
78 // Methods for Callback Notification |
|
79 // |
|
80 |
|
81 virtual OMX_ERRORTYPE DoTransitionCompleteNotification( |
|
82 OMX_STATETYPE aOmxState); |
|
83 |
|
84 virtual OMX_ERRORTYPE DoCommandCompleteNotification( |
|
85 OMX_COMMANDTYPE aOmxCommand, |
|
86 OMX_U32 aOmxPortIndex); |
|
87 |
|
88 // |
|
89 // Methods for Callback Notification |
|
90 // |
|
91 |
|
92 virtual OMX_ERRORTYPE DoErrorEventNotification( |
|
93 OMX_ERRORTYPE aOmxError); |
|
94 |
|
95 virtual OMX_ERRORTYPE DoEventNotification( |
|
96 OMX_EVENTTYPE aEvent, |
|
97 TUint32 aData1, |
|
98 TUint32 aData2, |
|
99 OMX_STRING aExtraInfo); |
|
100 |
|
101 virtual OMX_ERRORTYPE DoBufferDoneNotification( |
|
102 OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
103 OMX_U32 aLocalPortIndex, |
|
104 OMX_DIRTYPE aLocalPortDirection); |
|
105 |
|
106 virtual OMX_ERRORTYPE DoPortSettingsChangeNotification( |
|
107 OMX_U32 aLocalPortIndex, |
|
108 TUint aPortSettingsIndex, |
|
109 const TDesC8& aPortSettings); |
|
110 |
|
111 #ifdef _OMXIL_COMMON_IL516C_ON |
|
112 virtual OMX_ERRORTYPE DoEjectBuffersRequest( |
|
113 OMX_U32 aLocalPortIndex); |
|
114 #endif |
|
115 |
|
116 virtual void SignalOrPropagateBufferMarks(OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
117 OMX_U32 aLocalPortIndex); |
|
118 |
|
119 virtual void HandleInsufficientResources(); |
|
120 |
|
121 protected: |
|
122 |
|
123 // Declaration of nested protected classes |
|
124 class TTunnelRegistrationInfo; |
|
125 class TBufferMarkPropagationInfo; |
|
126 class TOutputPortBufferMarkInfo; |
|
127 |
|
128 protected: |
|
129 |
|
130 // \defgroup IL Client callbacks data |
|
131 //@{ |
|
132 OMX_COMPONENTTYPE* ipHandle; // not owned |
|
133 OMX_PTR ipAppData; // not owned |
|
134 OMX_CALLBACKTYPE* ipCallbacks; // not owned |
|
135 //@} |
|
136 |
|
137 // Tunnelled ports callback data |
|
138 RArray<TTunnelRegistrationInfo> iRegisteredTunnels; |
|
139 |
|
140 // Associations between input and output ports to be used in buffer marks |
|
141 // propagation |
|
142 RArray<TBufferMarkPropagationInfo> iBufferMarkPropagationPorts; |
|
143 |
|
144 // Temporary store of buffer marks waiting to go out in the next output |
|
145 // buffer |
|
146 RArray<TOutputPortBufferMarkInfo> iBufferMarks; |
|
147 |
|
148 // Port manager |
|
149 MOmxILPortManagerIf* ipPortManager; |
|
150 |
|
151 // FSM |
|
152 COmxILFsm* ipFsm; |
|
153 |
|
154 }; |
|
155 |
|
156 /** |
|
157 Structure used to hold the tunnel information needed for callback handling |
|
158 in tunnelled communication. |
|
159 */ |
|
160 class XOmxILCallbackManagerIfImpl::TTunnelRegistrationInfo |
|
161 { |
|
162 |
|
163 public: |
|
164 |
|
165 inline TTunnelRegistrationInfo( |
|
166 OMX_U32 aLocalPortIndex, |
|
167 OMX_DIRTYPE aLocalPortDirection, |
|
168 OMX_HANDLETYPE aTunnelledComponentHandle, |
|
169 OMX_U32 aTunnelledPortIndex); |
|
170 |
|
171 public: |
|
172 |
|
173 OMX_U32 iLocalPortIndex; |
|
174 OMX_DIRTYPE iLocalPortDirection; |
|
175 OMX_HANDLETYPE iTunnelledComponentHandle; |
|
176 OMX_U32 iTunnelledPortIndex; |
|
177 |
|
178 }; |
|
179 |
|
180 |
|
181 /** |
|
182 Structure used to hold the association of marked port and propagation port. |
|
183 */ |
|
184 class XOmxILCallbackManagerIfImpl::TBufferMarkPropagationInfo |
|
185 { |
|
186 |
|
187 public: |
|
188 |
|
189 inline TBufferMarkPropagationInfo( |
|
190 OMX_U32 aPortIndex, |
|
191 OMX_U32 aPropagationPortIndex); |
|
192 |
|
193 // This constructor should only be used for array look-ups |
|
194 inline explicit TBufferMarkPropagationInfo(OMX_U32 aPortIndex); |
|
195 |
|
196 static TBool Compare(const TBufferMarkPropagationInfo& aBmpi1, |
|
197 const TBufferMarkPropagationInfo& aBmpi2); |
|
198 |
|
199 public: |
|
200 |
|
201 OMX_U32 iPortIndex; |
|
202 OMX_U32 iPropagationPortIndex; |
|
203 |
|
204 }; |
|
205 |
|
206 /** |
|
207 Structure used to hold the buffer marking info needed to propagate buffer |
|
208 marks on output ports. |
|
209 */ |
|
210 class XOmxILCallbackManagerIfImpl::TOutputPortBufferMarkInfo |
|
211 { |
|
212 |
|
213 public: |
|
214 |
|
215 inline TOutputPortBufferMarkInfo( |
|
216 OMX_U32 aPortIndex, |
|
217 OMX_HANDLETYPE apMarkTargetComponent, |
|
218 OMX_PTR apMarkData); |
|
219 |
|
220 // This constructor should only be used for array look-ups |
|
221 inline explicit TOutputPortBufferMarkInfo(OMX_U32 aPortIndex); |
|
222 |
|
223 static TBool Compare(const TOutputPortBufferMarkInfo& aOpbmi1, |
|
224 const TOutputPortBufferMarkInfo& aOpbmi2); |
|
225 |
|
226 public: |
|
227 |
|
228 OMX_U32 iPortIndex; |
|
229 OMX_HANDLETYPE ipMarkTargetComponent; |
|
230 OMX_PTR ipMarkData; |
|
231 |
|
232 }; |
|
233 |
|
234 #include "omxilcallbackmanagerifimpl.inl" |
|
235 |
|
236 #endif // OMXILCALLBACKMANAGERIFIMPL_H |