|
1 /* |
|
2 * Copyright (c) 2008-2009 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 #ifndef OMXILGRAPHICSINKVPB0PORT_H |
|
24 #define OMXILGRAPHICSINKVPB0PORT_H |
|
25 |
|
26 #include "omxilvideoport.h" |
|
27 #include "omxilgraphicsinkprocessingfunction.h" |
|
28 #include <openmax/il/extensions/omxilsymbianvideographicsinkextensions.h> |
|
29 #include <platform/openmax/il/shai/OMX_Symbian_ComponentExt.h> |
|
30 #include "mmfbuffershared.h" |
|
31 |
|
32 /** |
|
33 Class COmxILGraphicSinkVPB0Port represents the input port 0 for the OpenMAX IL based graphics sink component. |
|
34 */ |
|
35 class COmxILGraphicSinkVPB0Port : public COmxILVideoPort |
|
36 { |
|
37 public: |
|
38 |
|
39 static COmxILGraphicSinkVPB0Port* NewL( |
|
40 const TOmxILCommonPortData& aCommonPortData, |
|
41 const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats, |
|
42 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats, |
|
43 COmxILGraphicSinkProcessingFunction& aGraphicSinkPF); |
|
44 |
|
45 ~COmxILGraphicSinkVPB0Port(); |
|
46 |
|
47 OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const; |
|
48 OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const; |
|
49 |
|
50 OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const; |
|
51 OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction); |
|
52 |
|
53 OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex, TAny* apComponentConfigStructure) const; |
|
54 OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure, TBool& aUpdateProcessingFunction); |
|
55 |
|
56 OMX_ERRORTYPE GetExtensionIndex(OMX_STRING aParameterName, OMX_INDEXTYPE* apIndexType) const; |
|
57 OMX_ERRORTYPE ValidateStride(); |
|
58 |
|
59 private: |
|
60 |
|
61 COmxILGraphicSinkVPB0Port( |
|
62 const TOmxILCommonPortData& aCommonPortData, |
|
63 const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats, |
|
64 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats, |
|
65 COmxILGraphicSinkProcessingFunction& aGraphicSinkPF); |
|
66 |
|
67 void ConstructL(); |
|
68 |
|
69 OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, TBool& aUpdateProcessingFunction); |
|
70 |
|
71 TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; |
|
72 |
|
73 OMX_ERRORTYPE DoBufferAllocation(OMX_U32 aSizeBytes, OMX_U8*& apPortSpecificBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0); |
|
74 void DoBufferDeallocation(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0); |
|
75 OMX_ERRORTYPE DoBufferWrapping(OMX_U32 aSizeBytes, OMX_U8* apBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0); |
|
76 void DoBufferUnwrapping(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0); |
|
77 OMX_ERRORTYPE DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent, OMX_BUFFERHEADERTYPE** appBufferHdr, OMX_U32 aTunnelledPortIndex, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_U32 aSizeBytes, OMX_U8* apBuffer); |
|
78 |
|
79 void InitParamsAndConfigs(); |
|
80 void UpdateParamInPortDefinitionStruct(); |
|
81 |
|
82 private: |
|
83 /** The reference of GraphicSink ProcessingFunction. */ |
|
84 COmxILGraphicSinkProcessingFunction& iGraphicSinkPF; |
|
85 /** The type of Mime. */ |
|
86 RBuf8 iMimeTypeBuf; |
|
87 |
|
88 // The scaling size of video or image data. |
|
89 OMX_CONFIG_SCALEFACTORTYPE iConfigScaleFactor; |
|
90 // The size of frame. |
|
91 OMX_FRAMESIZETYPE iConfigFrameSize; |
|
92 // The size of rectangle. |
|
93 OMX_CONFIG_RECTTYPE iConfigRec; |
|
94 |
|
95 // Extension to provide a structure for Surface Configuration. |
|
96 OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION iParamVideoSurfaceConfiguration; |
|
97 |
|
98 TMMSharedChunkBufConfig iSharedChunkBufConfig; |
|
99 OMX_INDEXTYPE iSharedChunkMetadataExtensionIndex; |
|
100 }; |
|
101 |
|
102 #endif // OMXILGRAPHICSINKVPB0PORT_H |