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 COmxILPortManager; |
|
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 IMPORT_C XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, |
|
48 OMX_PTR apAppData, |
|
49 OMX_CALLBACKTYPE* apCallbacks); |
|
50 |
|
51 IMPORT_C virtual ~XOmxILCallbackManagerIfImpl(); |
|
52 |
|
53 IMPORT_C virtual void DoSetPortManager(COmxILPortManager& apPortManager); |
|
54 |
|
55 IMPORT_C virtual void DoSetFsm(COmxILFsm& apFsm); |
|
56 |
|
57 // |
|
58 // Methods for Callback Registration |
|
59 // |
|
60 IMPORT_C virtual OMX_ERRORTYPE DoRegisterComponentHandle( |
|
61 OMX_HANDLETYPE aComponentHandle); |
|
62 |
|
63 IMPORT_C virtual OMX_ERRORTYPE DoRegisterILClientCallbacks( |
|
64 const OMX_CALLBACKTYPE* apCallbacks, |
|
65 const OMX_PTR apAppData); |
|
66 |
|
67 IMPORT_C virtual OMX_ERRORTYPE DoRegisterTunnelCallback( |
|
68 OMX_U32 aLocalPortIndex, |
|
69 OMX_DIRTYPE aLocalPortDirection, |
|
70 OMX_HANDLETYPE aTunnelledComponentHandle, |
|
71 OMX_U32 aTunnelledPortIndex); |
|
72 |
|
73 IMPORT_C virtual OMX_ERRORTYPE DoRegisterBufferMarkPropagationPort( |
|
74 OMX_U32 aPortIndex, |
|
75 OMX_U32 aPropagationPortIndex); |
|
76 |
|
77 // |
|
78 // Methods for Callback Notification |
|
79 // |
|
80 |
|
81 IMPORT_C virtual OMX_ERRORTYPE DoTransitionCompleteNotification( |
|
82 OMX_STATETYPE aOmxState); |
|
83 |
|
84 IMPORT_C virtual OMX_ERRORTYPE DoCommandCompleteNotification( |
|
85 OMX_COMMANDTYPE aOmxCommand, |
|
86 OMX_U32 aOmxPortIndex); |
|
87 |
|
88 // |
|
89 // Methods for Callback Notification |
|
90 // |
|
91 |
|
92 IMPORT_C virtual OMX_ERRORTYPE DoErrorEventNotification( |
|
93 OMX_ERRORTYPE aOmxError); |
|
94 |
|
95 IMPORT_C virtual OMX_ERRORTYPE DoEventNotification( |
|
96 OMX_EVENTTYPE aEvent, |
|
97 TUint32 aData1, |
|
98 TUint32 aData2, |
|
99 OMX_STRING aExtraInfo); |
|
100 |
|
101 IMPORT_C virtual OMX_ERRORTYPE DoBufferDoneNotification( |
|
102 OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
103 OMX_U32 aLocalPortIndex, |
|
104 OMX_DIRTYPE aLocalPortDirection); |
|
105 |
|
106 IMPORT_C virtual OMX_ERRORTYPE DoPortSettingsChangeNotification( |
|
107 OMX_U32 aLocalPortIndex, |
|
108 TUint aPortSettingsIndex, |
|
109 const TDesC8& aPortSettings); |
|
110 |
|
111 IMPORT_C virtual void SignalOrPropagateBufferMarks(OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
112 OMX_U32 aLocalPortIndex); |
|
113 |
|
114 IMPORT_C virtual void HandleInsufficientResources(); |
|
115 |
|
116 protected: |
|
117 |
|
118 // Declaration of nested protected classes |
|
119 class TTunnelRegistrationInfo; |
|
120 class TBufferMarkPropagationInfo; |
|
121 class TOutputPortBufferMarkInfo; |
|
122 |
|
123 protected: |
|
124 |
|
125 // \defgroup IL Client callbacks data |
|
126 //@{ |
|
127 OMX_COMPONENTTYPE* ipHandle; // not owned |
|
128 OMX_PTR ipAppData; // not owned |
|
129 OMX_CALLBACKTYPE* ipCallbacks; // not owned |
|
130 //@} |
|
131 |
|
132 // Tunnelled ports callback data |
|
133 RArray<TTunnelRegistrationInfo> iRegisteredTunnels; |
|
134 |
|
135 // Associations between input and output ports to be used in buffer marks |
|
136 // propagation |
|
137 RArray<TBufferMarkPropagationInfo> iBufferMarkPropagationPorts; |
|
138 |
|
139 // Temporary store of buffer marks waiting to go out in the next output |
|
140 // buffer |
|
141 RArray<TOutputPortBufferMarkInfo> iBufferMarks; |
|
142 |
|
143 // Port manager |
|
144 COmxILPortManager* ipPortManager; |
|
145 |
|
146 // FSM |
|
147 COmxILFsm* ipFsm; |
|
148 |
|
149 }; |
|
150 |
|
151 /** |
|
152 Structure used to hold the tunnel information needed for callback handling |
|
153 in tunnelled communication. |
|
154 */ |
|
155 class XOmxILCallbackManagerIfImpl::TTunnelRegistrationInfo |
|
156 { |
|
157 |
|
158 public: |
|
159 |
|
160 inline TTunnelRegistrationInfo( |
|
161 OMX_U32 aLocalPortIndex, |
|
162 OMX_DIRTYPE aLocalPortDirection, |
|
163 OMX_HANDLETYPE aTunnelledComponentHandle, |
|
164 OMX_U32 aTunnelledPortIndex); |
|
165 |
|
166 public: |
|
167 |
|
168 OMX_U32 iLocalPortIndex; |
|
169 OMX_DIRTYPE iLocalPortDirection; |
|
170 OMX_HANDLETYPE iTunnelledComponentHandle; |
|
171 OMX_U32 iTunnelledPortIndex; |
|
172 |
|
173 }; |
|
174 |
|
175 |
|
176 /** |
|
177 Structure used to hold the association of marked port and propagation port. |
|
178 */ |
|
179 class XOmxILCallbackManagerIfImpl::TBufferMarkPropagationInfo |
|
180 { |
|
181 |
|
182 public: |
|
183 |
|
184 inline TBufferMarkPropagationInfo( |
|
185 OMX_U32 aPortIndex, |
|
186 OMX_U32 aPropagationPortIndex); |
|
187 |
|
188 // This constructor should only be used for array look-ups |
|
189 inline explicit TBufferMarkPropagationInfo(OMX_U32 aPortIndex); |
|
190 |
|
191 static TBool Compare(const TBufferMarkPropagationInfo& aBmpi1, |
|
192 const TBufferMarkPropagationInfo& aBmpi2); |
|
193 |
|
194 public: |
|
195 |
|
196 OMX_U32 iPortIndex; |
|
197 OMX_U32 iPropagationPortIndex; |
|
198 |
|
199 }; |
|
200 |
|
201 /** |
|
202 Structure used to hold the buffer marking info needed to propagate buffer |
|
203 marks on output ports. |
|
204 */ |
|
205 class XOmxILCallbackManagerIfImpl::TOutputPortBufferMarkInfo |
|
206 { |
|
207 |
|
208 public: |
|
209 |
|
210 inline TOutputPortBufferMarkInfo( |
|
211 OMX_U32 aPortIndex, |
|
212 OMX_HANDLETYPE apMarkTargetComponent, |
|
213 OMX_PTR apMarkData); |
|
214 |
|
215 // This constructor should only be used for array look-ups |
|
216 inline explicit TOutputPortBufferMarkInfo(OMX_U32 aPortIndex); |
|
217 |
|
218 static TBool Compare(const TOutputPortBufferMarkInfo& aOpbmi1, |
|
219 const TOutputPortBufferMarkInfo& aOpbmi2); |
|
220 |
|
221 public: |
|
222 |
|
223 OMX_U32 iPortIndex; |
|
224 OMX_HANDLETYPE ipMarkTargetComponent; |
|
225 OMX_PTR ipMarkData; |
|
226 |
|
227 }; |
|
228 |
|
229 #include "omxilcallbackmanagerifimpl.inl" |
|
230 |
|
231 #endif // OMXILCALLBACKMANAGERIFIMPL_H |
|