omxilvideocomps/omxilvideoscheduler/src/comxilvideoscheduleroutputport.cpp
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 /**
       
    20 @file
       
    21 @internalComponent
       
    22 */
       
    23 
       
    24 #include "comxilvideoscheduleroutputport.h"
       
    25 
       
    26 
       
    27 COmxILVideoSchedulerOutputPort* COmxILVideoSchedulerOutputPort::NewL(const TOmxILCommonPortData& aCommonPortData)
       
    28 	{
       
    29 	// TODO these arrays must left empty, to be removed from the video port constructor
       
    30 	RArray<OMX_VIDEO_CODINGTYPE> supportedCodings;
       
    31 	RArray<OMX_COLOR_FORMATTYPE> supportedColorFormats;
       
    32 	CleanupClosePushL(supportedCodings);
       
    33 	CleanupClosePushL(supportedColorFormats);
       
    34 
       
    35 	COmxILVideoSchedulerOutputPort* self = new(ELeave) COmxILVideoSchedulerOutputPort();
       
    36 	CleanupStack::PushL(self);
       
    37 	self->ConstructL(aCommonPortData, supportedCodings, supportedColorFormats);
       
    38 	CleanupStack::Pop(self);
       
    39 	
       
    40 	CleanupStack::PopAndDestroy(2, &supportedCodings);
       
    41 	
       
    42 	return self;
       
    43 	}
       
    44 
       
    45 COmxILVideoSchedulerOutputPort::COmxILVideoSchedulerOutputPort()
       
    46 	{
       
    47 	}
       
    48 
       
    49 COmxILVideoSchedulerOutputPort::~COmxILVideoSchedulerOutputPort()
       
    50 	{
       
    51 	iMimeTypeBuf.Close();
       
    52 	}
       
    53 
       
    54 void COmxILVideoSchedulerOutputPort::ConstructL(const TOmxILCommonPortData& aCommonPortData,
       
    55                                             const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
       
    56                                             const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats)
       
    57 	{
       
    58 	COmxILVideoPort::ConstructL(aCommonPortData, aSupportedCodings, aSupportedColourFormats);
       
    59 	// Port definition mime type. Mime type is not relevant for uncompressed video frames
       
    60  	iMimeTypeBuf.CreateL(KNullDesC8(), KNullDesC8().Length() + 1);
       
    61  	TUint8* pTUint = const_cast<TUint8*>(iMimeTypeBuf.PtrZ());
       
    62  	GetParamPortDefinition().format.video.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint);
       
    63 
       
    64 	GetSupportedVideoFormats().AppendL(OMX_VIDEO_CodingUnused);
       
    65 	GetSupportedColorFormats().AppendL(OMX_COLOR_FormatUnused);
       
    66 	}
       
    67 
       
    68 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
       
    69 	{
       
    70 	return COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray);
       
    71 	}
       
    72 
       
    73 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
       
    74 	{
       
    75 	return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray);
       
    76 	}
       
    77 
       
    78 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetParameter(OMX_INDEXTYPE aParamIndex,
       
    79                                                TAny* apComponentParameterStructure) const
       
    80 	{				
       
    81 	return COmxILVideoPort::GetParameter(aParamIndex, apComponentParameterStructure);
       
    82 	}
       
    83 
       
    84 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::SetParameter(OMX_INDEXTYPE aParamIndex,
       
    85 		                                       const TAny* apComponentParameterStructure,
       
    86 		                                       TBool& aUpdateProcessingFunction)
       
    87 	{		
       
    88 	return COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
       
    89 	}
       
    90 
       
    91 OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
       
    92 													TBool& /*aUpdateProcessingFunction*/)
       
    93 	{
       
    94 	GetParamPortDefinition().format.video = aPortDefinition.format.video;
       
    95  	TUint8* pTUint = const_cast<TUint8*>(iMimeTypeBuf.PtrZ());
       
    96  	GetParamPortDefinition().format.video.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint);
       
    97  	GetParamPortDefinition().format.video.nSliceHeight = GetParamPortDefinition().format.video.nFrameHeight;
       
    98  	GetParamPortDefinition().nBufferSize = GetParamPortDefinition().format.video.nStride * GetParamPortDefinition().format.video.nSliceHeight;
       
    99 	return OMX_ErrorNone;
       
   100 	}
       
   101 
       
   102 TBool COmxILVideoSchedulerOutputPort::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const
       
   103 	{
       
   104 	return ETrue;	
       
   105 	}
       
   106 
       
   107 /** Returns the number of buffers configured on this port. */
       
   108 TUint32 COmxILVideoSchedulerOutputPort::BufferCount() const
       
   109 	{
       
   110 	return GetParamPortDefinition().nBufferCountActual;
       
   111 	}