omxilvideocomps/omxilgraphicsink/src/omxilgraphicsinkvpb0port.h
changeset 0 5d29cba61097
equal deleted inserted replaced
-1:000000000000 0:5d29cba61097
       
     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 <openmax/il/common/omxilvideoport.h>
       
    27 #include "omxilgraphicsinkprocessingfunction.h"
       
    28 #include <openmax/il/extensions/omxilsymbianvideographicsinkextensions.h>
       
    29 #include <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 		COmxILGraphicSinkProcessingFunction& aGraphicSinkPF);
       
    63 	
       
    64 	void ConstructL(const TOmxILCommonPortData& aCommonPortData,
       
    65 	        const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
       
    66 	        const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats);
       
    67 	
       
    68 	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, TBool& aUpdateProcessingFunction);
       
    69 
       
    70 	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
       
    71 
       
    72 	OMX_ERRORTYPE DoBufferAllocation(OMX_U32 aSizeBytes, OMX_U8*& apPortSpecificBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0);
       
    73 	void DoBufferDeallocation(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0);
       
    74 	OMX_ERRORTYPE DoBufferWrapping(OMX_U32 aSizeBytes, OMX_U8* apBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0);
       
    75 	void DoBufferUnwrapping(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0);
       
    76 	OMX_ERRORTYPE DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent, OMX_BUFFERHEADERTYPE** appBufferHdr, OMX_U32 aTunnelledPortIndex, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_U32 aSizeBytes, OMX_U8* apBuffer);
       
    77 
       
    78 	void InitParamsAndConfigs();
       
    79 	void UpdateParamInPortDefinitionStruct();
       
    80 	
       
    81 private:
       
    82 	/** The reference of GraphicSink ProcessingFunction. */
       
    83 	COmxILGraphicSinkProcessingFunction& iGraphicSinkPF;
       
    84 	/** The type of Mime. */
       
    85 	RBuf8 iMimeTypeBuf;
       
    86 	
       
    87 	// The scaling size of video or image data.
       
    88 	OMX_CONFIG_SCALEFACTORTYPE iConfigScaleFactor;
       
    89 	// The size of frame.
       
    90 	OMX_FRAMESIZETYPE iConfigFrameSize;
       
    91 	// The size of rectangle.
       
    92 	OMX_CONFIG_RECTTYPE iConfigRec;
       
    93 
       
    94 	// Extension to provide a structure for Surface Configuration.
       
    95 	OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION iParamVideoSurfaceConfiguration;
       
    96 
       
    97     TMMSharedChunkBufConfig iSharedChunkBufConfig;
       
    98     OMX_INDEXTYPE iSharedChunkMetadataExtensionIndex;
       
    99 	};
       
   100 
       
   101 #endif // OMXILGRAPHICSINKVPB0PORT_H