omxilcomp/omxilgeneric/filesink/src/omxilotherfilesinkopb0port.cpp
changeset 0 58be5850fb6c
equal deleted inserted replaced
-1:000000000000 0:58be5850fb6c
       
     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(aFileSinkPF);
       
    32 	CleanupStack::PushL(self);
       
    33 	self->ConstructL(aCommonPortData, aSupportedOtherFormats);
       
    34 	CleanupStack::Pop(self);
       
    35 	return self;
       
    36 	}
       
    37 
       
    38 void COmxILOtherFileSinkOPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats)
       
    39 	{
       
    40     // base
       
    41     COmxILOtherPort::ConstructL(aCommonPortData, aSupportedOtherFormats);    
       
    42 	GetParamPortDefinition().eDomain = OMX_PortDomainOther;
       
    43 	GetParamPortDefinition().format.other.eFormat = OMX_OTHER_FormatBinary;
       
    44 	}
       
    45 
       
    46 COmxILOtherFileSinkOPB0Port::COmxILOtherFileSinkOPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF)
       
    47 	: iFileSinkPF(aFileSinkPF)
       
    48 	{
       
    49 	}
       
    50 
       
    51 COmxILOtherFileSinkOPB0Port::~COmxILOtherFileSinkOPB0Port()
       
    52 	{
       
    53 	CleanUpPort();
       
    54 	}
       
    55 	
       
    56 OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
       
    57 	{
       
    58 	return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray);
       
    59 	}
       
    60 
       
    61 OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
       
    62 	{
       
    63 	return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray);
       
    64 	}
       
    65 
       
    66 OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, 
       
    67 												   TAny* apComponentParameterStructure) const
       
    68 	{
       
    69 	return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure);
       
    70 	}
       
    71 
       
    72 OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, 
       
    73 		           								   const TAny* apComponentParameterStructure, 
       
    74 		           								   TBool& aUpdateProcessingFunction)
       
    75 	{
       
    76 	return COmxILOtherPort::SetParameter(aParamIndex, 
       
    77 										 apComponentParameterStructure, 
       
    78 										 aUpdateProcessingFunction);
       
    79 	}
       
    80 
       
    81 OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
       
    82 																TBool& /*aUpdateProcessingFunction*/)
       
    83 	{
       
    84 	OMX_ERRORTYPE OMXErr = OMX_ErrorNone;
       
    85 	if(aPortDefinition.format.other.eFormat == OMX_OTHER_FormatBinary)
       
    86 	    {
       
    87         GetParamPortDefinition().format.other = aPortDefinition.format.other;
       
    88 	    }
       
    89 	else
       
    90 	    {
       
    91 	    OMXErr=OMX_ErrorUnsupportedSetting;
       
    92 	    }
       
    93 	return OMXErr;
       
    94 	}
       
    95 
       
    96 TBool COmxILOtherFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
       
    97 	{
       
    98 	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
       
    99 	    {
       
   100 	    return EFalse;
       
   101 	    }
       
   102 
       
   103 	if (aPortDefinition.format.other.eFormat == OMX_OTHER_FormatMax)
       
   104         {
       
   105         return EFalse;
       
   106         }	
       
   107 	
       
   108 	return ETrue;	
       
   109 	}