0
|
1 |
/*
|
|
2 |
* Copyright (c) 2008-2010 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 |
/**
|
|
19 |
@file
|
|
20 |
@internalComponent
|
|
21 |
*/
|
|
22 |
|
|
23 |
#include <e32std.h>
|
|
24 |
#include "omxilgraphicsinkvpb0port.h"
|
|
25 |
#include <openmax/il/khronos/v1_x/OMX_Component.h>
|
|
26 |
#include <openmax/il/shai/OMX_Symbian_ExtensionNames.h>
|
|
27 |
#include <w32std.h>
|
|
28 |
#include "log.h"
|
|
29 |
|
|
30 |
#include "omxilgraphicsinkextensionsindexes.h"
|
|
31 |
|
|
32 |
// Port definition mime type. Mime type is not relevant for uncompressed video frames
|
|
33 |
_LIT8(KMimeType, "");
|
|
34 |
|
|
35 |
// Constant numbers
|
|
36 |
static const TUint32 KRefGfxFramerate = 0; // mandatory
|
|
37 |
static const TUint32 KRefGfxMinBufferSize = 1024;
|
|
38 |
|
|
39 |
/**
|
|
40 |
Create a new VPB0 port.
|
|
41 |
|
|
42 |
@param aCommonPortData The common information of the new VPB0 port.
|
|
43 |
aSupportedVideoFormats The list of the supported video formats.
|
|
44 |
aSupportedColorFormats The list of the supported color formats.
|
|
45 |
aGraphicSinkPF The processing function for the VPB0 port.
|
|
46 |
|
|
47 |
@return A pointer of the VPB0Port to be created.
|
|
48 |
*/
|
|
49 |
COmxILGraphicSinkVPB0Port* COmxILGraphicSinkVPB0Port::NewL(
|
|
50 |
const TOmxILCommonPortData& aCommonPortData,
|
|
51 |
const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
|
|
52 |
const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
|
|
53 |
COmxILGraphicSinkProcessingFunction& aGraphicSinkPF)
|
|
54 |
{
|
|
55 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::NewL +"));
|
|
56 |
COmxILGraphicSinkVPB0Port* self = new (ELeave)COmxILGraphicSinkVPB0Port(
|
|
57 |
aGraphicSinkPF);
|
|
58 |
CleanupStack::PushL(self);
|
|
59 |
self->ConstructL(aCommonPortData, aSupportedVideoFormats, aSupportedColorFormats);
|
|
60 |
CleanupStack::Pop(self);
|
|
61 |
return self;
|
|
62 |
}
|
|
63 |
|
|
64 |
/**
|
|
65 |
Second phase construction for the class COmxILGraphicSinkVPB0Port. Initializes the param structures and config structures for GraphicSink port.
|
|
66 |
Also appends the supported color and video formats to the respective arrays.
|
|
67 |
*/
|
|
68 |
void COmxILGraphicSinkVPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData,
|
|
69 |
const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
|
|
70 |
const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats)
|
|
71 |
{
|
|
72 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::ConstructL +"));
|
|
73 |
COmxILVideoPort::ConstructL(aCommonPortData, aSupportedVideoFormats, aSupportedColorFormats);
|
|
74 |
GetParamPortDefinition().eDomain = OMX_PortDomainVideo;
|
|
75 |
|
|
76 |
iMimeTypeBuf.CreateL(KMimeType(), KMimeType().Length() + 1);
|
|
77 |
TUint8* pTUint = const_cast<TUint8*>(iMimeTypeBuf.PtrZ());
|
|
78 |
GetParamPortDefinition().format.video.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint);
|
|
79 |
GetParamPortDefinition().format.video.pNativeRender = NULL;
|
|
80 |
GetParamPortDefinition().format.video.pNativeWindow = NULL;
|
|
81 |
|
|
82 |
GetParamPortDefinition().nBufferSize = KRefGfxMinBufferSize;
|
|
83 |
|
|
84 |
GetSupportedVideoFormats().AppendL(OMX_VIDEO_CodingUnused);
|
|
85 |
GetSupportedColorFormats().AppendL(OMX_COLOR_FormatCbYCrY);
|
|
86 |
GetSupportedColorFormats().AppendL(OMX_COLOR_FormatYCrYCb);
|
|
87 |
GetSupportedColorFormats().AppendL(OMX_COLOR_Format16bitRGB565);
|
|
88 |
GetSupportedColorFormats().AppendL(OMX_COLOR_Format32bitARGB8888);
|
|
89 |
|
|
90 |
InitParamsAndConfigs();
|
|
91 |
|
|
92 |
iSharedChunkMetadataExtensionIndex = OMX_IndexComponentStartUnused;
|
|
93 |
}
|
|
94 |
|
|
95 |
/**
|
|
96 |
Constructor of the class.
|
|
97 |
|
|
98 |
@param aCommonPortData The common information of the new VPB0 port.
|
|
99 |
aSupportedVideoFormats The list of the supported video formats.
|
|
100 |
aSupportedColorFormats The list of the supported color formats.
|
|
101 |
aGraphicSinkPF The processing function for the VPB0 port.
|
|
102 |
*/
|
|
103 |
COmxILGraphicSinkVPB0Port::COmxILGraphicSinkVPB0Port(
|
|
104 |
COmxILGraphicSinkProcessingFunction& aGraphicSinkPF)
|
|
105 |
: iGraphicSinkPF(aGraphicSinkPF)
|
|
106 |
{
|
|
107 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::COmxILGraphicSinkVPB0Port +"));
|
|
108 |
}
|
|
109 |
|
|
110 |
/**
|
|
111 |
Destructor of the class.
|
|
112 |
*/
|
|
113 |
COmxILGraphicSinkVPB0Port::~COmxILGraphicSinkVPB0Port()
|
|
114 |
{
|
|
115 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::~COmxILGraphicSinkVPB0Port +"));
|
|
116 |
|
|
117 |
CleanUpPort();
|
|
118 |
iMimeTypeBuf.Close();
|
|
119 |
}
|
|
120 |
|
|
121 |
/**
|
|
122 |
Sets the format field available as part of OMX_PARAM_PORTDEFINITIONTYPE.
|
|
123 |
|
|
124 |
@param aPortDefinition structure containing the format field to be updated.
|
|
125 |
aUpdateProcessingFunction indicates whether or not processing function needs to be updated.
|
|
126 |
|
|
127 |
@return OMX_ErrorNone if successful;
|
|
128 |
OMX_ErrorBadParameter if both compression format and color format are unused at the same time, or nStride is invalid;
|
|
129 |
OMX_ErrorUnsupportedSetting if unsupported compression format and color format, or bitrate is non-zero;
|
|
130 |
*/
|
|
131 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,TBool& aUpdateProcessingFunction)
|
|
132 |
{
|
|
133 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::SetFormatInPortDefinition +"));
|
|
134 |
|
|
135 |
// Check settings in input OMX_PARAM_PORTDEFINITIONTYPE.
|
|
136 |
if (!UpdateColorFormat(GetParamPortDefinition().format.video.eColorFormat, aPortDefinition.format.video.eColorFormat, aUpdateProcessingFunction))
|
|
137 |
{
|
|
138 |
return OMX_ErrorUnsupportedSetting;
|
|
139 |
}
|
|
140 |
|
|
141 |
if (!UpdateCodingType(GetParamPortDefinition().format.video.eCompressionFormat, aPortDefinition.format.video.eCompressionFormat, aUpdateProcessingFunction))
|
|
142 |
{
|
|
143 |
return OMX_ErrorUnsupportedSetting;
|
|
144 |
}
|
|
145 |
|
|
146 |
if(GetParamPortDefinition().format.video.nStride != aPortDefinition.format.video.nStride)
|
|
147 |
{
|
|
148 |
// nStride shall not be 0x0
|
|
149 |
if(0x0 == aPortDefinition.format.video.nStride)
|
|
150 |
{
|
|
151 |
return OMX_ErrorBadParameter;
|
|
152 |
}
|
|
153 |
|
|
154 |
GetParamPortDefinition().format.video.nStride = aPortDefinition.format.video.nStride;
|
|
155 |
aUpdateProcessingFunction = ETrue;
|
|
156 |
}
|
|
157 |
|
|
158 |
if (GetParamPortDefinition().format.video.nFrameWidth != aPortDefinition.format.video.nFrameWidth ||
|
|
159 |
GetParamPortDefinition().format.video.nFrameHeight != aPortDefinition.format.video.nFrameHeight ||
|
|
160 |
GetParamPortDefinition().format.video.nBitrate != aPortDefinition.format.video.nBitrate)
|
|
161 |
{
|
|
162 |
GetParamPortDefinition().format.video.nFrameWidth = aPortDefinition.format.video.nFrameWidth;
|
|
163 |
GetParamPortDefinition().format.video.nFrameHeight = aPortDefinition.format.video.nFrameHeight;
|
|
164 |
// nSliceHeight is a RO attribute. Policy is to set it to the frame height
|
|
165 |
GetParamPortDefinition().format.video.nSliceHeight = aPortDefinition.format.video.nFrameHeight;
|
|
166 |
GetParamPortDefinition().format.video.nBitrate = aPortDefinition.format.video.nBitrate;
|
|
167 |
aUpdateProcessingFunction = ETrue;
|
|
168 |
}
|
|
169 |
return OMX_ErrorNone;
|
|
170 |
}
|
|
171 |
|
|
172 |
/**
|
|
173 |
Insert new indices belonging to the static parameter category.
|
|
174 |
|
|
175 |
@param aIndexArray The array of indices for insert.
|
|
176 |
|
|
177 |
@return OMX_ErrorNone if successful;
|
|
178 |
OMX_ErrorInsufficientResources if fail to insert indexes;
|
|
179 |
*/
|
|
180 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
|
|
181 |
{
|
|
182 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetLocalOmxParamIndexes +"));
|
|
183 |
|
|
184 |
// Always collect param indexes from parents
|
|
185 |
OMX_ERRORTYPE omxRetValue = COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray);
|
|
186 |
|
|
187 |
if(OMX_ErrorNone != omxRetValue)
|
|
188 |
{
|
|
189 |
return omxRetValue;
|
|
190 |
}
|
|
191 |
|
|
192 |
TInt err = aIndexArray.InsertInOrder(OMX_NokiaIndexParamGraphicSurfaceConfig);
|
|
193 |
|
|
194 |
// Note that index duplication is OK.
|
|
195 |
if (KErrNone != err && KErrAlreadyExists != err)
|
|
196 |
{
|
|
197 |
return OMX_ErrorInsufficientResources;
|
|
198 |
}
|
|
199 |
|
|
200 |
return OMX_ErrorNone;
|
|
201 |
}
|
|
202 |
|
|
203 |
/**
|
|
204 |
Insert new indices belonging to the dynamic configuration category.
|
|
205 |
|
|
206 |
@param aIndexArray The array of indices for insert.
|
|
207 |
|
|
208 |
@return OMX_ErrorNone if successful;
|
|
209 |
OMX_ErrorInsufficientResources if fail to insert indexes;
|
|
210 |
*/
|
|
211 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
|
|
212 |
{
|
|
213 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetLocalOmxConfigIndexes +"));
|
|
214 |
|
|
215 |
// Always collect local indexes from parent
|
|
216 |
OMX_ERRORTYPE omxRetValue = COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray);
|
|
217 |
if (omxRetValue != OMX_ErrorNone)
|
|
218 |
{
|
|
219 |
return omxRetValue;
|
|
220 |
}
|
|
221 |
|
|
222 |
TInt err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonScale);
|
|
223 |
// Note that index duplication is OK.
|
|
224 |
if (err == KErrNone || err == KErrAlreadyExists)
|
|
225 |
{
|
|
226 |
err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonOutputSize);
|
|
227 |
}
|
|
228 |
|
|
229 |
if (err == KErrNone || err == KErrAlreadyExists)
|
|
230 |
{
|
|
231 |
err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonInputCrop);
|
|
232 |
}
|
|
233 |
|
|
234 |
if (err == KErrNone || err == KErrAlreadyExists)
|
|
235 |
{
|
|
236 |
err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonOutputCrop);
|
|
237 |
}
|
|
238 |
|
|
239 |
if (err == KErrNone || err == KErrAlreadyExists)
|
|
240 |
{
|
|
241 |
err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonExclusionRect);
|
|
242 |
}
|
|
243 |
|
|
244 |
if (err == KErrNone || err == KErrAlreadyExists)
|
|
245 |
{
|
|
246 |
err = aIndexArray.InsertInOrder(OMX_SymbianIndexConfigSharedChunkMetadata);
|
|
247 |
}
|
|
248 |
|
|
249 |
if (err != KErrNone && err != KErrAlreadyExists)
|
|
250 |
{
|
|
251 |
return OMX_ErrorInsufficientResources;
|
|
252 |
}
|
|
253 |
|
|
254 |
return OMX_ErrorNone;
|
|
255 |
}
|
|
256 |
|
|
257 |
/**
|
|
258 |
This method provides the current values for the parameters present in the structure represented by the given index.
|
|
259 |
|
|
260 |
@param aParamIndex The specific param index for which the current parameter values are required.
|
|
261 |
apComponentParameterStructure The pointer to the structure which will be updated to provide the current parameter values.
|
|
262 |
|
|
263 |
@return OMX_ErrorNone if successful;
|
|
264 |
OMX_ErrorNoMore if no more formats;
|
|
265 |
OMX_ErrorUnsupportedSetting if unsupported setting is passed;
|
|
266 |
*/
|
|
267 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex,TAny* apComponentParameterStructure) const
|
|
268 |
{
|
|
269 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetParameter +"));
|
|
270 |
switch(aParamIndex)
|
|
271 |
{
|
|
272 |
case OMX_NokiaIndexParamGraphicSurfaceConfig:
|
|
273 |
{
|
|
274 |
OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION* videoSurface = static_cast<OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION*>(apComponentParameterStructure);
|
|
275 |
*videoSurface = iParamVideoSurfaceConfiguration;
|
|
276 |
break;
|
|
277 |
}
|
|
278 |
case OMX_IndexParamVideoPortFormat:
|
|
279 |
{
|
|
280 |
OMX_VIDEO_PARAM_PORTFORMATTYPE* compvideoPortFormat = static_cast<OMX_VIDEO_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
|
|
281 |
|
|
282 |
// framerate should be always zero for GFX otherwise unsupported value
|
|
283 |
if(KRefGfxFramerate != compvideoPortFormat->xFramerate)
|
|
284 |
{
|
|
285 |
return OMX_ErrorUnsupportedSetting;
|
|
286 |
}
|
|
287 |
|
|
288 |
return COmxILVideoPort::GetParameter(aParamIndex,apComponentParameterStructure);
|
|
289 |
}
|
|
290 |
default:
|
|
291 |
{
|
|
292 |
// Try the parent's indexes
|
|
293 |
return COmxILVideoPort::GetParameter(aParamIndex,apComponentParameterStructure);
|
|
294 |
}
|
|
295 |
};
|
|
296 |
|
|
297 |
return OMX_ErrorNone;
|
|
298 |
}
|
|
299 |
|
|
300 |
/**
|
|
301 |
This method sets the values of the parameters present in the structure represented by the given index.
|
|
302 |
|
|
303 |
@param aParamIndex The specific param index for which the parameter values have to be set.
|
|
304 |
apComponentParameterStructure The pointer to the structure which will provide the desired parameter values to be set.
|
|
305 |
aUpdateProcessingFunction informs whether the processing fucntion needs to be updated.
|
|
306 |
|
|
307 |
@return OMX_ErrorNone if successful;
|
|
308 |
OMX_ErrorUnsupportedSetting if non-zero framerate value;
|
|
309 |
OMX_ErrorUnsupportedIndex if request OMX_NokiaIndexParamGraphicSurfaceConfig index;
|
|
310 |
*/
|
|
311 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex,const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction)
|
|
312 |
{
|
|
313 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::SetParameter +"));
|
|
314 |
|
|
315 |
OMX_ERRORTYPE error = OMX_ErrorNone;
|
|
316 |
switch(aParamIndex)
|
|
317 |
{
|
|
318 |
case OMX_IndexParamVideoPortFormat:
|
|
319 |
{
|
|
320 |
const OMX_VIDEO_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast<const OMX_VIDEO_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
|
|
321 |
|
|
322 |
if (GetParamPortDefinition().format.video.xFramerate != componentParameterStructure->xFramerate)
|
|
323 |
{
|
|
324 |
if (0 != componentParameterStructure->xFramerate)
|
|
325 |
{
|
|
326 |
// Known Frame rate is not supported. framerate should be always zero
|
|
327 |
return OMX_ErrorUnsupportedSetting;
|
|
328 |
}
|
|
329 |
}
|
|
330 |
|
|
331 |
error = COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
|
|
332 |
if(error != OMX_ErrorNone)
|
|
333 |
{
|
|
334 |
return error;
|
|
335 |
}
|
|
336 |
|
|
337 |
if(aUpdateProcessingFunction)
|
|
338 |
{
|
|
339 |
// eColorFormat and/or eCompressionFormat and/or xFramerate is/are changed by OMX_IndexParamVideoPortFormat
|
|
340 |
// Hence change same varibles associated to index OMX_IndexParamPortDefinition.
|
|
341 |
// Update their value in OMX_PARAM_PORTDEFINITIONTYPE.
|
|
342 |
UpdateParamInPortDefinitionStruct();
|
|
343 |
return OMX_ErrorNone;
|
|
344 |
}
|
|
345 |
|
|
346 |
break;
|
|
347 |
}
|
|
348 |
case OMX_NokiaIndexParamGraphicSurfaceConfig:
|
|
349 |
{
|
|
350 |
// IL Client can only query OMX_GetParameter with this index but can not set any value on TSurfaceConfiguration
|
|
351 |
// GFX simply returns OMX_ErrorUnsupportedIndex for the attempt on OMX_GetParameter with this index.
|
|
352 |
return OMX_ErrorUnsupportedIndex;
|
|
353 |
}
|
|
354 |
default:
|
|
355 |
{
|
|
356 |
// Try the parent's indexes
|
|
357 |
return COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
|
|
358 |
}
|
|
359 |
};
|
|
360 |
return error;
|
|
361 |
}
|
|
362 |
|
|
363 |
/**
|
|
364 |
This method provides the current values for the configurations present in the structure represented by the given index.
|
|
365 |
|
|
366 |
@param aConfigIndex The specific configuration index for which the current configuration values are required.
|
|
367 |
apComponentConfigStructure The pointer to the structure which will be updated to provide the current configuration values.
|
|
368 |
|
|
369 |
@return OMX_ErrorNone if successful;
|
|
370 |
OMX_ErrorUnsupportedIndex if request non-inserted config index;
|
|
371 |
*/
|
|
372 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetConfig(OMX_INDEXTYPE aConfigIndex,TAny* apComponentParameterStructure) const
|
|
373 |
{
|
|
374 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetConfig +"));
|
|
375 |
switch(aConfigIndex)
|
|
376 |
{
|
|
377 |
case OMX_SymbianIndexConfigSharedChunkMetadata:
|
|
378 |
{
|
|
379 |
OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE*
|
|
380 |
pSharedChunkMetadata
|
|
381 |
= static_cast<
|
|
382 |
OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE*>(apComponentParameterStructure);
|
|
383 |
|
|
384 |
iGraphicSinkPF.GetSharedChunkMetadata(
|
|
385 |
pSharedChunkMetadata->nHandleId,
|
|
386 |
pSharedChunkMetadata->nOwnerThreadId);
|
|
387 |
}
|
|
388 |
break;
|
|
389 |
case OMX_IndexConfigCommonScale:
|
|
390 |
{
|
|
391 |
OMX_CONFIG_SCALEFACTORTYPE* scaleFactor = static_cast<OMX_CONFIG_SCALEFACTORTYPE*>(apComponentParameterStructure);
|
|
392 |
*scaleFactor = iConfigScaleFactor;
|
|
393 |
break;
|
|
394 |
}
|
|
395 |
case OMX_IndexConfigCommonOutputSize:
|
|
396 |
{
|
|
397 |
OMX_FRAMESIZETYPE* frameSize = static_cast<OMX_FRAMESIZETYPE*>(apComponentParameterStructure);
|
|
398 |
*frameSize = iConfigFrameSize;
|
|
399 |
break;
|
|
400 |
}
|
|
401 |
case OMX_IndexConfigCommonInputCrop:
|
|
402 |
case OMX_IndexConfigCommonOutputCrop:
|
|
403 |
case OMX_IndexConfigCommonExclusionRect:
|
|
404 |
{
|
|
405 |
OMX_CONFIG_RECTTYPE* rec = static_cast<OMX_CONFIG_RECTTYPE*>(apComponentParameterStructure);
|
|
406 |
*rec = iConfigRec;
|
|
407 |
break;
|
|
408 |
}
|
|
409 |
default:
|
|
410 |
{
|
|
411 |
// Try the parent's indexes
|
|
412 |
return COmxILVideoPort::GetConfig(aConfigIndex,apComponentParameterStructure);
|
|
413 |
}
|
|
414 |
};
|
|
415 |
|
|
416 |
return OMX_ErrorNone;
|
|
417 |
}
|
|
418 |
|
|
419 |
/**
|
|
420 |
This method sets the values of the configurations present in the structure represented by the given index.
|
|
421 |
|
|
422 |
@param aConfigIndex The specific configuration index for which the configuration values have to be set.
|
|
423 |
apComponentConfigStructure The pointer to the structure which will be provide the desired configuration values to be set.
|
|
424 |
aUpdateProcessingFunction informs whether the processing fucntion needs to be updated.
|
|
425 |
|
|
426 |
@return OMX_ErrorNone if successful;
|
|
427 |
OMX_ErrorUnsupportedIndex if request OMX_NokiaIndexParamGraphicSurfaceConfig index;
|
|
428 |
*/
|
|
429 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::SetConfig(OMX_INDEXTYPE aConfigIndex,const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction)
|
|
430 |
{
|
|
431 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::SetConfig +"));
|
|
432 |
switch(aConfigIndex)
|
|
433 |
{
|
|
434 |
case OMX_SymbianIndexConfigSharedChunkMetadata:
|
|
435 |
{
|
|
436 |
aUpdateProcessingFunction = ETrue;
|
|
437 |
break;
|
|
438 |
}
|
|
439 |
case OMX_IndexConfigCommonScale:
|
|
440 |
{
|
|
441 |
const OMX_CONFIG_SCALEFACTORTYPE* scaleFactor = static_cast<const OMX_CONFIG_SCALEFACTORTYPE*>(apComponentParameterStructure);
|
|
442 |
|
|
443 |
if(iConfigScaleFactor.xWidth != scaleFactor->xWidth)
|
|
444 |
{
|
|
445 |
iConfigScaleFactor.xWidth = scaleFactor->xWidth;
|
|
446 |
aUpdateProcessingFunction = ETrue;
|
|
447 |
}
|
|
448 |
if(iConfigScaleFactor.xHeight != scaleFactor->xHeight)
|
|
449 |
{
|
|
450 |
iConfigScaleFactor.xHeight = scaleFactor->xHeight;
|
|
451 |
aUpdateProcessingFunction = ETrue;
|
|
452 |
}
|
|
453 |
break;
|
|
454 |
}
|
|
455 |
case OMX_IndexConfigCommonOutputSize:
|
|
456 |
{
|
|
457 |
const OMX_FRAMESIZETYPE* frameSize = static_cast<const OMX_FRAMESIZETYPE*>(apComponentParameterStructure);
|
|
458 |
|
|
459 |
if(iConfigFrameSize.nWidth != frameSize->nWidth)
|
|
460 |
{
|
|
461 |
iConfigFrameSize.nWidth = frameSize->nWidth;
|
|
462 |
aUpdateProcessingFunction = ETrue;
|
|
463 |
}
|
|
464 |
if(iConfigFrameSize.nHeight != frameSize->nHeight)
|
|
465 |
{
|
|
466 |
iConfigFrameSize.nHeight = frameSize->nHeight;
|
|
467 |
aUpdateProcessingFunction = ETrue;
|
|
468 |
}
|
|
469 |
break;
|
|
470 |
}
|
|
471 |
case OMX_IndexConfigCommonInputCrop:
|
|
472 |
case OMX_IndexConfigCommonOutputCrop:
|
|
473 |
case OMX_IndexConfigCommonExclusionRect:
|
|
474 |
{
|
|
475 |
const OMX_CONFIG_RECTTYPE* rec = static_cast<const OMX_CONFIG_RECTTYPE*>(apComponentParameterStructure);
|
|
476 |
|
|
477 |
if(iConfigRec.nTop != rec->nTop)
|
|
478 |
{
|
|
479 |
iConfigRec.nTop = rec->nTop;
|
|
480 |
aUpdateProcessingFunction = ETrue;
|
|
481 |
}
|
|
482 |
if(iConfigRec.nLeft != rec->nLeft)
|
|
483 |
{
|
|
484 |
iConfigRec.nLeft = rec->nLeft;
|
|
485 |
aUpdateProcessingFunction = ETrue;
|
|
486 |
}
|
|
487 |
if(iConfigRec.nWidth != rec->nWidth)
|
|
488 |
{
|
|
489 |
iConfigRec.nWidth = rec->nWidth;
|
|
490 |
aUpdateProcessingFunction = ETrue;
|
|
491 |
}
|
|
492 |
if(iConfigRec.nHeight != rec->nHeight)
|
|
493 |
{
|
|
494 |
iConfigRec.nHeight = rec->nHeight;
|
|
495 |
aUpdateProcessingFunction = ETrue;
|
|
496 |
}
|
|
497 |
break;
|
|
498 |
}
|
|
499 |
default:
|
|
500 |
{
|
|
501 |
// Try the parent's indexes
|
|
502 |
return COmxILVideoPort::SetConfig(aConfigIndex, apComponentParameterStructure, aUpdateProcessingFunction);
|
|
503 |
}
|
|
504 |
};
|
|
505 |
|
|
506 |
return OMX_ErrorNone;
|
|
507 |
}
|
|
508 |
|
|
509 |
/**
|
|
510 |
This method provides the index type represented by the given parameter name.
|
|
511 |
|
|
512 |
@param aParameterName The name of extention parameter to be retrieved.
|
|
513 |
apIndexType The pointer which will retrieve the required index.
|
|
514 |
|
|
515 |
@return OMX_ErrorNone if successful;
|
|
516 |
OMX_ErrorUnsupportedIndex if unsupported parameter name is passed;
|
|
517 |
*/
|
|
518 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetExtensionIndex(OMX_STRING aParameterName, OMX_INDEXTYPE* apIndexType) const
|
|
519 |
{
|
|
520 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetExtensionIndex"));
|
|
521 |
|
|
522 |
TPtrC8 requestedParameterNamePtr(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(aParameterName)));
|
|
523 |
|
|
524 |
// OMX_NokiaIndexParamGraphicSurfaceConfig
|
|
525 |
TPtrC8 parameterNamePtr(reinterpret_cast<const TUint8*>(sOmxSymbianGfxSurfaceConfig));
|
|
526 |
if (requestedParameterNamePtr == parameterNamePtr)
|
|
527 |
{
|
|
528 |
*apIndexType = static_cast<OMX_INDEXTYPE>(OMX_NokiaIndexParamGraphicSurfaceConfig);
|
|
529 |
return OMX_ErrorNone;
|
|
530 |
}
|
|
531 |
|
|
532 |
// OMX_SymbianIndexConfigSharedChunkMetadata
|
|
533 |
TPtrC8 parameterNamePtr2(reinterpret_cast<const TUint8*>(OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME));
|
|
534 |
if(requestedParameterNamePtr == parameterNamePtr2)
|
|
535 |
{
|
|
536 |
*apIndexType = static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexConfigSharedChunkMetadata);
|
|
537 |
return OMX_ErrorNone;
|
|
538 |
}
|
|
539 |
|
|
540 |
*apIndexType = OMX_IndexMax;
|
|
541 |
|
|
542 |
return OMX_ErrorUnsupportedIndex;
|
|
543 |
}
|
|
544 |
|
|
545 |
/**
|
|
546 |
Check whether or not the tunnelled ports are compatible.
|
|
547 |
|
|
548 |
@param aPortDefinition The port definition parameters to be checked for compatibility.
|
|
549 |
|
|
550 |
@return EFalse if tunnelled ports' parameters are incompatible;
|
|
551 |
ETrue otherwise;
|
|
552 |
*/
|
|
553 |
TBool COmxILGraphicSinkVPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
|
|
554 |
{
|
|
555 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::IsTunnelledPortCompatible +"));
|
|
556 |
|
|
557 |
if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
|
|
558 |
{
|
|
559 |
return EFalse;
|
|
560 |
}
|
|
561 |
|
|
562 |
if(OMX_VIDEO_CodingUnused != aPortDefinition.format.video.eCompressionFormat)
|
|
563 |
{
|
|
564 |
return EFalse;
|
|
565 |
}
|
|
566 |
|
|
567 |
if (GetParamPortDefinition().format.video.eColorFormat != aPortDefinition.format.video.eColorFormat)
|
|
568 |
{
|
|
569 |
return EFalse;
|
|
570 |
}
|
|
571 |
|
|
572 |
if (GetParamPortDefinition().format.video.nFrameWidth != aPortDefinition.format.video.nFrameWidth)
|
|
573 |
{
|
|
574 |
return EFalse;
|
|
575 |
}
|
|
576 |
|
|
577 |
if (GetParamPortDefinition().format.video.nFrameHeight != aPortDefinition.format.video.nFrameHeight)
|
|
578 |
{
|
|
579 |
return EFalse;
|
|
580 |
}
|
|
581 |
|
|
582 |
if (GetParamPortDefinition().format.video.nStride != aPortDefinition.format.video.nStride)
|
|
583 |
{
|
|
584 |
return EFalse;
|
|
585 |
}
|
|
586 |
|
|
587 |
return ETrue;
|
|
588 |
}
|
|
589 |
|
|
590 |
/**
|
|
591 |
Allocates buffer, creates surface and updates the surface configuration.
|
|
592 |
|
|
593 |
@param aSizeBytes The size of buffer.
|
|
594 |
apPortSpecificBuffer The address of buffer.
|
|
595 |
apPortPrivate The pointer of COmxILMMBuffer.
|
|
596 |
apAppPrivate Not used (default = 0).
|
|
597 |
|
|
598 |
@return OMX_ErrorNone if successful;
|
|
599 |
OMX_ErrorInsufficientResources if failed to allocate buffer or update the surface configuration;
|
|
600 |
OMX_ErrorBadParameter if illegal parameters are passed;
|
|
601 |
|
|
602 |
@see COmxILGraphicSinkProcessingFunction.
|
|
603 |
*/
|
|
604 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::DoBufferAllocation(OMX_U32 /*aSizeBytes*/, OMX_U8*& apPortSpecificBuffer, OMX_PTR& apPortPrivate, OMX_PTR& /*apPlatformPrivate*/, OMX_PTR /* apAppPrivate */)
|
|
605 |
{
|
|
606 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferAllocation +"));
|
|
607 |
|
|
608 |
// Create buffers allocated to be used for other components.
|
|
609 |
TRAPD(error, iGraphicSinkPF.CreateBufferL(apPortSpecificBuffer, apPortPrivate, GetParamPortDefinition().nBufferCountActual));
|
|
610 |
switch(error)
|
|
611 |
{
|
|
612 |
case KErrNone:
|
|
613 |
break;
|
|
614 |
case KErrNoMemory:
|
|
615 |
return OMX_ErrorInsufficientResources;
|
|
616 |
default:
|
|
617 |
return OMX_ErrorBadParameter;
|
|
618 |
};
|
|
619 |
|
|
620 |
return OMX_ErrorNone;
|
|
621 |
}
|
|
622 |
|
|
623 |
/**
|
|
624 |
Utilizes buffer given from allocator component to create surface, and updates the surface configuration.
|
|
625 |
|
|
626 |
@param aSizeBytes The size of buffer.
|
|
627 |
apPortSpecificBuffer The address of buffer.
|
|
628 |
apPortPrivate The pointer of COmxILMMBuffer.
|
|
629 |
apAppPrivate Not used (default = 0).
|
|
630 |
|
|
631 |
@return OMX_ErrorNone if successful;
|
|
632 |
OMX_ErrorInsufficientResources if failed to utilize buffer or update the surface configuration;
|
|
633 |
OMX_ErrorBadParameter if illegal parameters are passed;
|
|
634 |
|
|
635 |
@see COmxILGraphicSinkProcessingFunction.
|
|
636 |
*/
|
|
637 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::DoBufferWrapping(OMX_U32 aSizeBytes, OMX_U8* apBuffer, OMX_PTR& /*apPortPrivate*/, OMX_PTR& /*apPlatformPrivate*/, OMX_PTR /*apAppPrivate*/)
|
|
638 |
{
|
|
639 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferWrapping +"));
|
|
640 |
|
|
641 |
// Init buffers given from allocator component.
|
|
642 |
TRAPD(error, iGraphicSinkPF.InitBufferL(aSizeBytes, apBuffer, GetParamPortDefinition().nBufferCountActual));
|
|
643 |
switch(error)
|
|
644 |
{
|
|
645 |
case KErrNone:
|
|
646 |
break;
|
|
647 |
case KErrNoMemory:
|
|
648 |
return OMX_ErrorInsufficientResources;
|
|
649 |
default:
|
|
650 |
return OMX_ErrorBadParameter;
|
|
651 |
};
|
|
652 |
|
|
653 |
return OMX_ErrorNone;
|
|
654 |
}
|
|
655 |
|
|
656 |
/**
|
|
657 |
Deallocate buffer and deallocates local resources in the processing function.
|
|
658 |
|
|
659 |
@param apPortSpecificBuffer Not used.
|
|
660 |
apPortPrivate Not used.
|
|
661 |
apAppPrivate Not used (default = 0).
|
|
662 |
*/
|
|
663 |
void COmxILGraphicSinkVPB0Port::DoBufferDeallocation(OMX_PTR /*apPortSpecificBuffer*/, OMX_PTR apPortPrivate, OMX_PTR /*apPlatformPrivate*/, OMX_PTR /* apAppPrivate */)
|
|
664 |
{
|
|
665 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferDeallocation"));
|
|
666 |
iGraphicSinkPF.DestroyBuffer(apPortPrivate);
|
|
667 |
}
|
|
668 |
|
|
669 |
/**
|
|
670 |
Deinitialise buffer and deallocates local resources in the processing function.
|
|
671 |
|
|
672 |
@param apPortSpecificBuffer Not used.
|
|
673 |
apPortPrivate Not used.
|
|
674 |
apAppPrivate Not used (default = 0).
|
|
675 |
*/
|
|
676 |
void COmxILGraphicSinkVPB0Port::DoBufferUnwrapping(OMX_PTR /* apPortSpecificBuffer */, OMX_PTR /* apPortPrivate */, OMX_PTR /*apPlatformPrivate*/, OMX_PTR /* apAppPrivate */)
|
|
677 |
{
|
|
678 |
DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferUnwrapping"));
|
|
679 |
iGraphicSinkPF.DeInitBuffer();
|
|
680 |
}
|
|
681 |
|
|
682 |
|
|
683 |
/**
|
|
684 |
Update ParamInPortDefinition struct.
|
|
685 |
*/
|
|
686 |
void COmxILGraphicSinkVPB0Port::UpdateParamInPortDefinitionStruct()
|
|
687 |
{
|
|
688 |
// OMX_PARAM_PORTDEFINITION structure needs to be updated with respect to the changes from other OMX_PARAM structures.
|
|
689 |
GetParamPortDefinition().format.video.eColorFormat = GetParamVideoPortFormat().eColorFormat;
|
|
690 |
GetParamPortDefinition().format.video.xFramerate = GetParamVideoPortFormat().xFramerate;
|
|
691 |
GetParamPortDefinition().format.video.eCompressionFormat = GetParamVideoPortFormat().eCompressionFormat;
|
|
692 |
}
|
|
693 |
|
|
694 |
/**
|
|
695 |
Initialise all param and config structures for GraphicSink port.
|
|
696 |
*/
|
|
697 |
void COmxILGraphicSinkVPB0Port::InitParamsAndConfigs()
|
|
698 |
{
|
|
699 |
// init OMX_SYMBIAN_VIDEO_CONFIG_SURFACECONFIGRATION here
|
|
700 |
iParamVideoSurfaceConfiguration.nSize = sizeof(OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION);
|
|
701 |
iParamVideoSurfaceConfiguration.nVersion = TOmxILSpecVersion();
|
|
702 |
iParamVideoSurfaceConfiguration.nPortIndex = GetParamPortDefinition().nPortIndex;
|
|
703 |
iParamVideoSurfaceConfiguration.pSurfaceConfig = &iGraphicSinkPF.GetSurfaceConfiguration();
|
|
704 |
|
|
705 |
// init OMX_CONFIG_SCALEFACTORTYPE
|
|
706 |
iConfigScaleFactor.nSize = sizeof(OMX_CONFIG_SCALEFACTORTYPE);
|
|
707 |
iConfigScaleFactor.nVersion = TOmxILSpecVersion();
|
|
708 |
iConfigScaleFactor.nPortIndex = GetParamPortDefinition().nPortIndex;
|
|
709 |
|
|
710 |
// init OMX_FRAMESIZETYPE
|
|
711 |
iConfigFrameSize.nSize = sizeof(OMX_FRAMESIZETYPE);
|
|
712 |
iConfigFrameSize.nVersion = TOmxILSpecVersion();
|
|
713 |
iConfigFrameSize.nPortIndex = GetParamPortDefinition().nPortIndex;
|
|
714 |
|
|
715 |
// init OMX_CONFIG_RECTTYPE
|
|
716 |
iConfigRec.nSize = sizeof(OMX_CONFIG_RECTTYPE);
|
|
717 |
iConfigRec.nVersion = TOmxILSpecVersion();
|
|
718 |
iConfigRec.nPortIndex = GetParamPortDefinition().nPortIndex;
|
|
719 |
iConfigRec.nTop = 0;
|
|
720 |
iConfigRec.nLeft = 0;
|
|
721 |
|
|
722 |
iSharedChunkBufConfig.iNumBuffers = GetParamPortDefinition().nBufferCountActual;
|
|
723 |
iSharedChunkBufConfig.iBufferSizeInBytes = GetParamPortDefinition().nBufferSize;
|
|
724 |
iGraphicSinkPF.SetSharedChunkBufConfig(iSharedChunkBufConfig);
|
|
725 |
}
|
|
726 |
|
|
727 |
TInt BytesPerPixel(OMX_COLOR_FORMATTYPE aPixelFormat)
|
|
728 |
{
|
|
729 |
switch (aPixelFormat)
|
|
730 |
{
|
|
731 |
//fall through
|
|
732 |
|
|
733 |
//case EUidPixelFormatRGB_565:
|
|
734 |
case OMX_COLOR_Format16bitRGB565:
|
|
735 |
//case EUidPixelFormatBGR_565:
|
|
736 |
case OMX_COLOR_Format16bitBGR565:
|
|
737 |
//case EUidPixelFormatARGB_1555:
|
|
738 |
case OMX_COLOR_Format16bitARGB1555:
|
|
739 |
//case EUidPixelFormatXRGB_1555:
|
|
740 |
//case EUidPixelFormatARGB_4444:
|
|
741 |
case OMX_COLOR_Format16bitARGB4444:
|
|
742 |
//case EUidPixelFormatARGB_8332:
|
|
743 |
case OMX_COLOR_Format8bitRGB332:
|
|
744 |
//case EUidPixelFormatBGRX_5551:
|
|
745 |
//case EUidPixelFormatBGRA_5551:
|
|
746 |
//case EUidPixelFormatBGRA_4444:
|
|
747 |
//case EUidPixelFormatBGRX_4444:
|
|
748 |
//case EUidPixelFormatAP_88:
|
|
749 |
//case EUidPixelFormatXRGB_4444:
|
|
750 |
//case EUidPixelFormatXBGR_4444:
|
|
751 |
//case EUidPixelFormatYUV_422Interleaved:
|
|
752 |
//case EUidPixelFormatYUV_422Planar:
|
|
753 |
case OMX_COLOR_FormatYUV422Planar:
|
|
754 |
//case EUidPixelFormatYUV_422Reversed:
|
|
755 |
case OMX_COLOR_FormatYCrYCb:
|
|
756 |
//case EUidPixelFormatYUV_422SemiPlanar:
|
|
757 |
case OMX_COLOR_FormatYUV422SemiPlanar:
|
|
758 |
//case EUidPixelFormatYUV_422InterleavedReversed:
|
|
759 |
//case EUidPixelFormatYYUV_422Interleaved:
|
|
760 |
case OMX_COLOR_FormatCbYCrY:
|
|
761 |
case OMX_COLOR_FormatYCbYCr:
|
|
762 |
case OMX_COLOR_FormatRawBayer10bit:
|
|
763 |
{
|
|
764 |
return 2;
|
|
765 |
}
|
|
766 |
|
|
767 |
//fall through
|
|
768 |
//case EUidPixelFormatXRGB_8888:
|
|
769 |
//case EUidPixelFormatBGRX_8888:
|
|
770 |
//case EUidPixelFormatXBGR_8888:
|
|
771 |
//case EUidPixelFormatBGRA_8888:
|
|
772 |
case OMX_COLOR_Format32bitBGRA8888:
|
|
773 |
//case EUidPixelFormatARGB_8888:
|
|
774 |
case OMX_COLOR_Format32bitARGB8888:
|
|
775 |
//case EUidPixelFormatABGR_8888:
|
|
776 |
//case EUidPixelFormatARGB_8888_PRE:
|
|
777 |
//case EUidPixelFormatABGR_8888_PRE:
|
|
778 |
//case EUidPixelFormatBGRA_8888_PRE:
|
|
779 |
//case EUidPixelFormatARGB_2101010:
|
|
780 |
//case EUidPixelFormatABGR_2101010:
|
|
781 |
{
|
|
782 |
return 4;
|
|
783 |
}
|
|
784 |
|
|
785 |
//fall through
|
|
786 |
//case EUidPixelFormatBGR_888:
|
|
787 |
case OMX_COLOR_Format24bitBGR888:
|
|
788 |
//case EUidPixelFormatRGB_888:
|
|
789 |
case OMX_COLOR_Format24bitRGB888:
|
|
790 |
{
|
|
791 |
return 3;
|
|
792 |
}
|
|
793 |
|
|
794 |
default:
|
|
795 |
return 0;
|
|
796 |
}
|
|
797 |
}
|
|
798 |
|
|
799 |
/**
|
|
800 |
Check the nStride value is valid.
|
|
801 |
*/
|
|
802 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::ValidateStride()
|
|
803 |
{
|
|
804 |
if (GetParamPortDefinition().format.video.nStride < GetParamPortDefinition().format.video.nFrameWidth * BytesPerPixel(GetParamPortDefinition().format.video.eColorFormat))
|
|
805 |
{
|
|
806 |
return OMX_ErrorBadParameter;
|
|
807 |
}
|
|
808 |
return OMX_ErrorNone;
|
|
809 |
}
|
|
810 |
|
|
811 |
OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::DoOmxUseBuffer(
|
|
812 |
OMX_HANDLETYPE aTunnelledComponent,
|
|
813 |
OMX_BUFFERHEADERTYPE** appBufferHdr,
|
|
814 |
OMX_U32 aTunnelledPortIndex,
|
|
815 |
OMX_PTR apPortPrivate,
|
|
816 |
OMX_PTR /* apPlatformPrivate */,
|
|
817 |
OMX_U32 aSizeBytes,
|
|
818 |
OMX_U8* apBuffer)
|
|
819 |
{
|
|
820 |
|
|
821 |
// Find out if the tunnelled port has support for the
|
|
822 |
// OMX.SYMBIAN.INDEX.CONFIG.SHAREDCHUNKMETADATA extension
|
|
823 |
if (OMX_IndexComponentStartUnused == iSharedChunkMetadataExtensionIndex)
|
|
824 |
{
|
|
825 |
if (OMX_ErrorNone == OMX_GetExtensionIndex(
|
|
826 |
aTunnelledComponent,
|
|
827 |
const_cast<char*>(OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME),
|
|
828 |
&iSharedChunkMetadataExtensionIndex))
|
|
829 |
{
|
|
830 |
// Communicate the shared chunk metadata to the tunnelled
|
|
831 |
// component
|
|
832 |
OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE configSharedChunkMetadata;
|
|
833 |
configSharedChunkMetadata.nSize = sizeof(OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE);
|
|
834 |
configSharedChunkMetadata.nVersion = TOmxILSpecVersion();
|
|
835 |
configSharedChunkMetadata.nPortIndex = GetParamPortDefinition().nPortIndex;
|
|
836 |
iGraphicSinkPF.GetSharedChunkMetadata(
|
|
837 |
configSharedChunkMetadata.nHandleId,
|
|
838 |
configSharedChunkMetadata.nOwnerThreadId);
|
|
839 |
|
|
840 |
// Ignore any error returned by the tunnelled component
|
|
841 |
(void) OMX_SetConfig(aTunnelledComponent,
|
|
842 |
iSharedChunkMetadataExtensionIndex,
|
|
843 |
&configSharedChunkMetadata);
|
|
844 |
}
|
|
845 |
else
|
|
846 |
{
|
|
847 |
// No support in the tunnelled component.
|
|
848 |
iSharedChunkMetadataExtensionIndex = OMX_IndexMax;
|
|
849 |
}
|
|
850 |
}
|
|
851 |
|
|
852 |
return OMX_UseBuffer(
|
|
853 |
aTunnelledComponent,
|
|
854 |
appBufferHdr,
|
|
855 |
aTunnelledPortIndex,
|
|
856 |
apPortPrivate,
|
|
857 |
aSizeBytes,
|
|
858 |
apBuffer);
|
|
859 |
}
|