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 OMXILPROCESSINGFUNCTION_H |
|
23 #define OMXILPROCESSINGFUNCTION_H |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 #include <openmax/il/khronos/v1_x/OMX_Core.h> |
|
28 #include <openmax/il/khronos/v1_x/OMX_Types.h> |
|
29 #include <openmax/il/khronos/v1_x/OMX_Other.h> |
|
30 |
|
31 #include "omxilfsm.h" |
|
32 |
|
33 // Forward declarations |
|
34 class MOmxILCallbackNotificationIf; |
|
35 |
|
36 /** |
|
37 Base class for component-specific implementations of the Processing Function |
|
38 abstraction. Component implementations realize within a Processing Function |
|
39 object the codec specific logic. Component implementations may choose |
|
40 whether to implement the Processing Function functionality in an additional |
|
41 independent thread or in-context with the framework. The interface is |
|
42 designed to generalize the notification of the OpenMAX IL commands, OpenMAX |
|
43 IL state changes and input/output buffer arrivals to the codec |
|
44 itself. Implementations of this interface are intended to communicate with |
|
45 the entity in charge of the egress component communication, the Callback |
|
46 Manager. |
|
47 */ |
|
48 class COmxILProcessingFunction : public CBase |
|
49 { |
|
50 |
|
51 public: |
|
52 |
|
53 IMPORT_C ~COmxILProcessingFunction(); |
|
54 |
|
55 /** |
|
56 Framework notification of a state transition in the component. |
|
57 |
|
58 @param aNewState The new state. |
|
59 |
|
60 @return OMX_ERRORTYPE |
|
61 */ |
|
62 virtual OMX_ERRORTYPE StateTransitionIndication( |
|
63 COmxILFsm::TStateIndex aNewState) = 0; |
|
64 |
|
65 /** |
|
66 Framework notification of a buffer flushing command. |
|
67 |
|
68 @param aPortIndex The port that is being flushed. |
|
69 |
|
70 @param aDirection The direction of the port that is being flushed. |
|
71 |
|
72 @return OMX_ERRORTYPE |
|
73 */ |
|
74 virtual OMX_ERRORTYPE BufferFlushingIndication( |
|
75 TUint32 aPortIndex, |
|
76 OMX_DIRTYPE aDirection) = 0; |
|
77 |
|
78 /** |
|
79 Framework notification of an OpenMAX IL Param structure change. |
|
80 |
|
81 @param aParamIndex The index of the param structure that has changed. |
|
82 |
|
83 @param apComponentParameterStructure The param structure. |
|
84 |
|
85 @return OMX_ERRORTYPE |
|
86 */ |
|
87 virtual OMX_ERRORTYPE ParamIndication( |
|
88 OMX_INDEXTYPE aParamIndex, |
|
89 const TAny* apComponentParameterStructure) = 0; |
|
90 |
|
91 /** |
|
92 Framework notification of an OpenMAX IL Config structure change. |
|
93 |
|
94 @param aConfigIndex The index of the config structure that has changed. |
|
95 |
|
96 @param apComponentConfigStructure The config structure. |
|
97 |
|
98 @return OMX_ERRORTYPE |
|
99 */ |
|
100 virtual OMX_ERRORTYPE ConfigIndication( |
|
101 OMX_INDEXTYPE aConfigIndex, |
|
102 const TAny* apComponentConfigStructure) = 0; |
|
103 |
|
104 /** |
|
105 Framework notification of a buffer arrival. |
|
106 |
|
107 @param apBufferHeader The header of the buffer to be processed. |
|
108 |
|
109 @param aDirection The direction of the port that has received the |
|
110 buffer. |
|
111 |
|
112 @return OMX_ERRORTYPE |
|
113 */ |
|
114 virtual OMX_ERRORTYPE BufferIndication( |
|
115 OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
116 OMX_DIRTYPE aDirection) = 0; |
|
117 |
|
118 /** |
|
119 Framework notification of a buffer removal. Here the Processing Function |
|
120 object is being notified that a buffer needs to be removed from its |
|
121 internal queues. At present, a synchronous implementation of this method |
|
122 is assumed. Buffer removal notifications may be originated by the |
|
123 framework in the following scenarios: |
|
124 |
|
125 -# After an OMX_FreeBuffer call has been received from the IL Client or |
|
126 from another component. |
|
127 |
|
128 -# After a port flushing command has been received from the IL Client |
|
129 AND the port is tunnelled and buffer supplier. |
|
130 |
|
131 -# After a transition OMX_StateExecuting/OMX_StatePause -> OMX_StateIdle |
|
132 has been requested by the IL Client AND the port associated to the |
|
133 buffer is tunnelled and buffer supplier. |
|
134 |
|
135 -# After a port disable command has been received from the IL Client AND |
|
136 the port associated to the buffer is tunnelled and buffer supplier. |
|
137 |
|
138 @param apBufferHeader The buffer header to be removed from internal |
|
139 queues. |
|
140 |
|
141 @param aDirection The direction of the port associated to the buffer. |
|
142 |
|
143 @return OMX_BOOL Etrue if the Processing Function has successfully |
|
144 removed the buffer header from its internal queues, EFalse otherwise. |
|
145 */ |
|
146 virtual OMX_BOOL BufferRemovalIndication( |
|
147 OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
148 OMX_DIRTYPE aDirection) = 0; |
|
149 |
|
150 IMPORT_C virtual OMX_ERRORTYPE ComponentRoleIndication( |
|
151 TUint aComponentRoleIndex); |
|
152 |
|
153 /** |
|
154 Framework notification of a buffer arrival on a OMX_PortDomainOther; |
|
155 normally the interested component would just extract the buffer and |
|
156 let the port manager returns the buffer to the buffer supplier |
|
157 component via callback immediately. |
|
158 |
|
159 @param apBufferHeader The header of the buffer to be processed. |
|
160 @param aDirection The direction of the port that has received |
|
161 the buffer. |
|
162 @return OMX_ERRORTYPE |
|
163 */ |
|
164 IMPORT_C virtual OMX_ERRORTYPE MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& ); |
|
165 |
|
166 protected: |
|
167 |
|
168 IMPORT_C COmxILProcessingFunction( |
|
169 MOmxILCallbackNotificationIf& aCallbacks); |
|
170 |
|
171 protected: |
|
172 |
|
173 MOmxILCallbackNotificationIf& iCallbacks; |
|
174 |
|
175 }; |
|
176 |
|
177 #endif // OMXILPROCESSINGFUNCTION_H |
|