omxil/generic/omxilfilesink/src/omxilimagefilesinkopb0port.cpp
branchOpenMAX-IL_SHAI
changeset 16 eedf2dcd43c6
equal deleted inserted replaced
15:c1e808730d6c 16:eedf2dcd43c6
       
     1 // Copyright (c) 2010 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 /**
       
    19  * @file
       
    20  * @internalTechnology
       
    21  */
       
    22 
       
    23 #include "omxilimagefilesinkopb0port.h"
       
    24 #include "omxilfilesinkprocessingfunction.h"
       
    25 #include <uri8.h>
       
    26 
       
    27 COmxILImageFileSinkOPB0Port* COmxILImageFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData,
       
    28                                                              const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
       
    29                                                              const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
       
    30                                                              const COmxILFileSinkProcessingFunction& aFileSinkPF)
       
    31 	{
       
    32 	COmxILImageFileSinkOPB0Port* self = new (ELeave) COmxILImageFileSinkOPB0Port(aCommonPortData,
       
    33                                                                                 aSupportedImageFormats,
       
    34                                                                                 aSupportedColorFormats,
       
    35                                                                                 aFileSinkPF);
       
    36 	CleanupStack::PushL(self);
       
    37 	self->ConstructL();
       
    38 	CleanupStack::Pop(self);
       
    39 	return self;
       
    40 	}
       
    41 
       
    42 void COmxILImageFileSinkOPB0Port::ConstructL()
       
    43 	{
       
    44 	iParamPortDefinition.eDomain = OMX_PortDomainImage;
       
    45 	}
       
    46 
       
    47 COmxILImageFileSinkOPB0Port::COmxILImageFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData,
       
    48                                                         const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
       
    49                                                         const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
       
    50                                                         const COmxILFileSinkProcessingFunction& aFileSinkPF)
       
    51 	: COmxILImagePort(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats),
       
    52 	iFileSinkPF(aFileSinkPF)
       
    53 	{
       
    54 	}
       
    55 
       
    56 COmxILImageFileSinkOPB0Port::~COmxILImageFileSinkOPB0Port()
       
    57 	{
       
    58 	CleanUpPort();
       
    59 	}
       
    60 	
       
    61 OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
       
    62 	{
       
    63 	return COmxILImagePort::GetLocalOmxParamIndexes(aIndexArray);
       
    64 	}
       
    65 
       
    66 OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
       
    67 	{
       
    68 	return COmxILImagePort::GetLocalOmxConfigIndexes(aIndexArray);
       
    69 	}
       
    70 
       
    71 OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, 
       
    72 														TAny* apComponentParameterStructure) const
       
    73 	{
       
    74 	return COmxILImagePort::GetParameter(aParamIndex, apComponentParameterStructure);
       
    75 	}
       
    76 
       
    77 OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, 
       
    78 														const TAny* apComponentParameterStructure, 
       
    79 														TBool& aUpdateProcessingFunction)
       
    80 	{
       
    81 	return COmxILImagePort::SetParameter(aParamIndex, 
       
    82 										 apComponentParameterStructure, 
       
    83 										 aUpdateProcessingFunction);
       
    84 	}
       
    85 
       
    86 OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
       
    87 																TBool& /*aUpdateProcessingFunction*/)
       
    88 	{
       
    89 	iParamPortDefinition.format.image = aPortDefinition.format.image;
       
    90 	return OMX_ErrorNone;
       
    91 	}
       
    92 
       
    93 TBool COmxILImageFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
       
    94 	{
       
    95 	if(aPortDefinition.eDomain != iParamPortDefinition.eDomain)
       
    96 	    {
       
    97 	    return EFalse;
       
    98 	    }
       
    99 
       
   100 	if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingMax)
       
   101         {
       
   102         return EFalse;
       
   103         }	
       
   104 	return ETrue;	
       
   105 	}