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