sl@0
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include <omxprocessingunit.h>
|
sl@0
|
17 |
#include <omxinputport.h>
|
sl@0
|
18 |
#include <mdf/mdfpuconfig.h>
|
sl@0
|
19 |
#include "omxcomponentbody.h"
|
sl@0
|
20 |
#include "omxinputportbody.h"
|
sl@0
|
21 |
|
sl@0
|
22 |
_LIT(KOmxInputPort, "OmxInputPort");
|
sl@0
|
23 |
|
sl@0
|
24 |
/**
|
sl@0
|
25 |
Constructor.
|
sl@0
|
26 |
*/
|
sl@0
|
27 |
EXPORT_C COmxInputPort::COmxInputPort()
|
sl@0
|
28 |
{
|
sl@0
|
29 |
}
|
sl@0
|
30 |
|
sl@0
|
31 |
/**
|
sl@0
|
32 |
Destructor.
|
sl@0
|
33 |
*/
|
sl@0
|
34 |
EXPORT_C COmxInputPort::~COmxInputPort()
|
sl@0
|
35 |
{
|
sl@0
|
36 |
delete iBody;
|
sl@0
|
37 |
}
|
sl@0
|
38 |
|
sl@0
|
39 |
/**
|
sl@0
|
40 |
Class constructor.
|
sl@0
|
41 |
*/
|
sl@0
|
42 |
EXPORT_C void COmxInputPort::ConstructL(TInt aIndex, COmxProcessingUnit* aComponent)
|
sl@0
|
43 |
{
|
sl@0
|
44 |
__ASSERT_ALWAYS(!iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
45 |
iBody = CBody::NewL(aIndex, aComponent, this);
|
sl@0
|
46 |
}
|
sl@0
|
47 |
|
sl@0
|
48 |
|
sl@0
|
49 |
/**
|
sl@0
|
50 |
Synchronous function used to configure the OpenMAX Input Port.
|
sl@0
|
51 |
@param aConfiguration
|
sl@0
|
52 |
Holds the configuration parameters for the OpenMAX Input Port.
|
sl@0
|
53 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
54 |
nother of the system-wide error codes.
|
sl@0
|
55 |
*/
|
sl@0
|
56 |
EXPORT_C TInt COmxInputPort::MipConfigure(const TPuConfig& aConfig)
|
sl@0
|
57 |
{
|
sl@0
|
58 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
59 |
return iBody->MipConfigure(aConfig);
|
sl@0
|
60 |
}
|
sl@0
|
61 |
|
sl@0
|
62 |
|
sl@0
|
63 |
/**
|
sl@0
|
64 |
Synchronous method which gets a configuration structure for the OpenMAX Input Port
|
sl@0
|
65 |
@param aConfig
|
sl@0
|
66 |
The reference to the structure that is to contain the configuration information.
|
sl@0
|
67 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
68 |
another of the system-wide error codes.
|
sl@0
|
69 |
*/
|
sl@0
|
70 |
EXPORT_C TInt COmxInputPort::MipGetConfig(TPuConfig& aConfig)
|
sl@0
|
71 |
{
|
sl@0
|
72 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
73 |
return iBody->MipGetConfig(aConfig);
|
sl@0
|
74 |
}
|
sl@0
|
75 |
|
sl@0
|
76 |
|
sl@0
|
77 |
/**
|
sl@0
|
78 |
Synchronous function used to initialise the OpenMAX Input Port.
|
sl@0
|
79 |
*/
|
sl@0
|
80 |
EXPORT_C void COmxInputPort::MipInitialize()
|
sl@0
|
81 |
{
|
sl@0
|
82 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
83 |
iBody->MipInitialize();
|
sl@0
|
84 |
}
|
sl@0
|
85 |
|
sl@0
|
86 |
|
sl@0
|
87 |
/**
|
sl@0
|
88 |
Synchronous function used to instruct the OpenMAX Input Port to create a buffer.
|
sl@0
|
89 |
@param aBufferSize
|
sl@0
|
90 |
The size of the buffer to be created.
|
sl@0
|
91 |
@return A pointer to the new created buffer.
|
sl@0
|
92 |
*/
|
sl@0
|
93 |
EXPORT_C CMMFBuffer* COmxInputPort::MipCreateBuffer(TInt aBufferSize)
|
sl@0
|
94 |
{
|
sl@0
|
95 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
96 |
return iBody->MipCreateBuffer(aBufferSize);
|
sl@0
|
97 |
}
|
sl@0
|
98 |
|
sl@0
|
99 |
|
sl@0
|
100 |
/**
|
sl@0
|
101 |
Synchronous function used to instruct the OpenMAX Input Port to use the buffer
|
sl@0
|
102 |
passed in the function's argument.
|
sl@0
|
103 |
@param aBuffer
|
sl@0
|
104 |
The buffer to be used by the Input Port.
|
sl@0
|
105 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
106 |
another of the system-wide error codes.
|
sl@0
|
107 |
*/
|
sl@0
|
108 |
EXPORT_C TInt COmxInputPort::MipUseBuffer(CMMFBuffer& aBuffer)
|
sl@0
|
109 |
{
|
sl@0
|
110 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
111 |
return iBody->MipUseBuffer(aBuffer);
|
sl@0
|
112 |
}
|
sl@0
|
113 |
|
sl@0
|
114 |
|
sl@0
|
115 |
/**
|
sl@0
|
116 |
Synchronous function used to instruct the OpenMAX Input Port to free the buffer given
|
sl@0
|
117 |
passed in the function's argument.
|
sl@0
|
118 |
@param aBuffer
|
sl@0
|
119 |
The buffer to be freed
|
sl@0
|
120 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
121 |
another of the system-wide error codes.
|
sl@0
|
122 |
*/
|
sl@0
|
123 |
EXPORT_C TInt COmxInputPort::MipFreeBuffer(CMMFBuffer* aBuffer)
|
sl@0
|
124 |
{
|
sl@0
|
125 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
126 |
return iBody->MipFreeBuffer(aBuffer);
|
sl@0
|
127 |
}
|
sl@0
|
128 |
|
sl@0
|
129 |
|
sl@0
|
130 |
/**
|
sl@0
|
131 |
Synchronous function used to request the set up of a tunnel between this OpenMAX Input Port
|
sl@0
|
132 |
and an OpenMAX Output Port.
|
sl@0
|
133 |
@param aOutputPortToBeConnectedTo
|
sl@0
|
134 |
Reference to the Output Port to be connected to.
|
sl@0
|
135 |
@param aTunnelFlags
|
sl@0
|
136 |
Control flags for tunneling
|
sl@0
|
137 |
@param aSupplierType
|
sl@0
|
138 |
Specifies the supplier of the buffers for the tunnel.
|
sl@0
|
139 |
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
|
sl@0
|
140 |
another of the system-wide error codes.
|
sl@0
|
141 |
*/
|
sl@0
|
142 |
EXPORT_C TInt COmxInputPort::MipTunnelRequest(const MMdfOutputPort& aOutputPortToBeConnectedTo,
|
sl@0
|
143 |
TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType)
|
sl@0
|
144 |
{
|
sl@0
|
145 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
146 |
return iBody->MipTunnelRequest(aOutputPortToBeConnectedTo, aTunnelFlags, aSupplierType);
|
sl@0
|
147 |
}
|
sl@0
|
148 |
|
sl@0
|
149 |
|
sl@0
|
150 |
/**
|
sl@0
|
151 |
Asynchronous function used to write data to the OpenMAX Input Port.
|
sl@0
|
152 |
@param aBuffer
|
sl@0
|
153 |
Reference to the buffer containing data.
|
sl@0
|
154 |
*/
|
sl@0
|
155 |
EXPORT_C void COmxInputPort::MipWriteData(CMMFBuffer& aInputBuffer)
|
sl@0
|
156 |
{
|
sl@0
|
157 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
158 |
iBody->MipWriteData(aInputBuffer);
|
sl@0
|
159 |
}
|
sl@0
|
160 |
|
sl@0
|
161 |
|
sl@0
|
162 |
/**
|
sl@0
|
163 |
Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
|
sl@0
|
164 |
*/
|
sl@0
|
165 |
EXPORT_C void COmxInputPort::MipDisconnectTunnel()
|
sl@0
|
166 |
{
|
sl@0
|
167 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
168 |
iBody->MipDisconnectTunnel();
|
sl@0
|
169 |
}
|
sl@0
|
170 |
|
sl@0
|
171 |
/**
|
sl@0
|
172 |
Asynchronous function used to restart the data processing of a tunnelled port.
|
sl@0
|
173 |
*/
|
sl@0
|
174 |
EXPORT_C void COmxInputPort::MipRestartTunnel()
|
sl@0
|
175 |
{
|
sl@0
|
176 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
177 |
iBody->MipRestartTunnel();
|
sl@0
|
178 |
}
|
sl@0
|
179 |
|
sl@0
|
180 |
|
sl@0
|
181 |
/**
|
sl@0
|
182 |
Synchronous function used to find out if an OpenMAX Input Port is tunnelled or not.
|
sl@0
|
183 |
@return ETrue if the Input Port is tunnelled, EFalse otherwise.
|
sl@0
|
184 |
*/
|
sl@0
|
185 |
EXPORT_C TBool COmxInputPort::MipIsTunnelled() const
|
sl@0
|
186 |
{
|
sl@0
|
187 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
188 |
return iBody->MipIsTunnelled();
|
sl@0
|
189 |
}
|
sl@0
|
190 |
|
sl@0
|
191 |
|
sl@0
|
192 |
/**
|
sl@0
|
193 |
Synchronous function used to get the OpenMAX Input Port index
|
sl@0
|
194 |
@return The OpenMAX Input Port index.
|
sl@0
|
195 |
*/
|
sl@0
|
196 |
EXPORT_C TInt COmxInputPort::MipIndex() const
|
sl@0
|
197 |
{
|
sl@0
|
198 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
199 |
return iBody->MipIndex();
|
sl@0
|
200 |
}
|
sl@0
|
201 |
|
sl@0
|
202 |
|
sl@0
|
203 |
/**
|
sl@0
|
204 |
Synchronous function used to get the size of the buffer(s) used by the OpenMAX Input Port.
|
sl@0
|
205 |
@param The OpenMAX Input Port's buffer size.
|
sl@0
|
206 |
*/
|
sl@0
|
207 |
EXPORT_C TUint32 COmxInputPort::MipBufferSize() const
|
sl@0
|
208 |
{
|
sl@0
|
209 |
return iBody->MipBufferSize();
|
sl@0
|
210 |
}
|
sl@0
|
211 |
|
sl@0
|
212 |
|
sl@0
|
213 |
/**
|
sl@0
|
214 |
Synchronous function used to set the observer for the OpenMAX Input Port.
|
sl@0
|
215 |
@param aOutputPortObserver
|
sl@0
|
216 |
The observer of the OpenMAX Input Port.
|
sl@0
|
217 |
*/
|
sl@0
|
218 |
EXPORT_C void COmxInputPort::MipSetObserver(const MMdfInputPortObserver& aOutputPortObserver)
|
sl@0
|
219 |
{
|
sl@0
|
220 |
iBody->MipSetObserver(aOutputPortObserver);
|
sl@0
|
221 |
}
|
sl@0
|
222 |
|
sl@0
|
223 |
/**
|
sl@0
|
224 |
Request extension feature. This is intended to provide additional features.
|
sl@0
|
225 |
@param aUid
|
sl@0
|
226 |
Used to indicate which interface is required.
|
sl@0
|
227 |
@return Standard error code. KErrNotSupported is used to indicate that the particular
|
sl@0
|
228 |
plugin is not used.
|
sl@0
|
229 |
*/
|
sl@0
|
230 |
EXPORT_C TInt COmxInputPort::MipCreateCustomInterface(TUid aUid)
|
sl@0
|
231 |
{
|
sl@0
|
232 |
return iBody->MipCreateCustomInterface(aUid);
|
sl@0
|
233 |
}
|
sl@0
|
234 |
|
sl@0
|
235 |
/**
|
sl@0
|
236 |
Return previously created extension.
|
sl@0
|
237 |
This returns a custom interface. This should only be used if CreateCustomInterface() has already
|
sl@0
|
238 |
been called for the same UID value. This means that any construction for that interface
|
sl@0
|
239 |
has already been called, and thus this call cannot fail.
|
sl@0
|
240 |
@param aUid
|
sl@0
|
241 |
Used to indicate which interface is required.
|
sl@0
|
242 |
@return The requested interface, or NULL if not known.
|
sl@0
|
243 |
@see MipCreateCustomInterface()
|
sl@0
|
244 |
*/
|
sl@0
|
245 |
EXPORT_C TAny* COmxInputPort::MipCustomInterface(TUid aUid)
|
sl@0
|
246 |
{
|
sl@0
|
247 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
248 |
return MipCustomInterface(aUid);
|
sl@0
|
249 |
}
|
sl@0
|
250 |
|
sl@0
|
251 |
/**
|
sl@0
|
252 |
Synchronous function used to return the observer for the OpenMAx Input Port.
|
sl@0
|
253 |
@return Pointer to this class obsever
|
sl@0
|
254 |
*/
|
sl@0
|
255 |
EXPORT_C MMdfInputPortObserver* COmxInputPort::Observer() const
|
sl@0
|
256 |
{
|
sl@0
|
257 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
258 |
return iBody->Observer();
|
sl@0
|
259 |
}
|
sl@0
|
260 |
|
sl@0
|
261 |
/**
|
sl@0
|
262 |
Synchronous function used to return the OpenMAX Processing Unit this Input Port
|
sl@0
|
263 |
belongs to.
|
sl@0
|
264 |
@return Pointer to the OpenMAX Processing Unit this Input Port belongs to.
|
sl@0
|
265 |
*/
|
sl@0
|
266 |
EXPORT_C COmxProcessingUnit* COmxInputPort::Component() const
|
sl@0
|
267 |
{
|
sl@0
|
268 |
__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
|
sl@0
|
269 |
return iBody->Component();
|
sl@0
|
270 |
}
|