diff -r 000000000000 -r 1bce908db942 multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/CMCETestUIEngineVideoCodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/CMCETestUIEngineVideoCodec.cpp Tue Feb 02 01:04:58 2010 +0200 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + +// MCE API + + +//#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "CMCETestUIEngine.h" +#include "MCETestUIEngineConstants.h" +#include "CMCETestUIEngineVideoCodec.h" + +//#include "TMCETestUIEngineCmdBase.h" +#include "TMCETestUIEngineCmdDeleteAudioCodec.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineVideoCodec::NewL() +// ----------------------------------------------------------------------------- +// +CMCETestUIEngineVideoCodec* CMCETestUIEngineVideoCodec::NewL( + CMCETestUIEngine& aEngine, + CMceVideoCodec& aCodec ) + { + + CMCETestUIEngineVideoCodec* self = + new (ELeave) CMCETestUIEngineVideoCodec( aEngine, + aCodec ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineVideoCodec::CMCETestUIEngineVideoCodec +// ----------------------------------------------------------------------------- +// +CMCETestUIEngineVideoCodec::CMCETestUIEngineVideoCodec( + CMCETestUIEngine& aEngine, + CMceVideoCodec& aCodec ) + : iEngine( aEngine ), + iCodec( aCodec ) + { + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineVideoCodec::ConstructL() +// ----------------------------------------------------------------------------- +// +void CMCETestUIEngineVideoCodec::ConstructL() + { + return; + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineVideoCodec::~CMCETestUIEngineVideoCodec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMCETestUIEngineVideoCodec::~CMCETestUIEngineVideoCodec() + { + iCommands.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineCodec::GetCommands +// ----------------------------------------------------------------------------- +// +const RPointerArray& + CMCETestUIEngineVideoCodec::GetCommandsL() + { + iCommands.ResetAndDestroy(); + if ( iCodec.State() == CMceCodec::EDisabled ) + { + iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableVideoCodec( + iEngine, *this ) ); + iCommands.Append( new (ELeave) TMCETestUIEngineCmdStandByVideoCodec( + iEngine, *this ) ); + } + else if(iCodec.State() == CMceCodec::EEnabled) + { + iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableVideoCodec( + iEngine, *this ) ); + iCommands.Append( new (ELeave) TMCETestUIEngineCmdStandByVideoCodec( + iEngine, *this ) ); + } + else if(iCodec.State() == CMceCodec::EStandby) + { + iCommands.Append( new (ELeave) TMCETestUIEngineCmdEnableVideoCodec( + iEngine, *this ) ); + iCommands.Append( new (ELeave) TMCETestUIEngineCmdDisableVideoCodec( + iEngine, *this ) ); + } + + iCommands.Append( new (ELeave) TMCETestUIEngineCmdDeleteVideoCodec( + iEngine, *this ) ); + return iCommands; + } +// ----------------------------------------------------------------------------- +// CMCETestUIEngineVideoCodec::Codec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoCodec& CMCETestUIEngineVideoCodec::Codec() + { + return iCodec; + } +// ----------------------------------------------------------------------------- +// CMCETestUIEngineVideoSink::State +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC16& CMCETestUIEngineVideoCodec::State() const + { + if(iCodec.State() == CMceCodec::EEnabled) + { + return KCodecStateEnabled; + } + else if(iCodec.State() == CMceCodec::EDisabled) + { + return KCodecStateDisabled; + } + return KCodecStateStandBy; + } + + + +// ----------------------------------------------------------------------------- +// CMCETestUIEngineVideoSink::AudioStream +// ----------------------------------------------------------------------------- +// + +EXPORT_C TMceCodecType CMCETestUIEngineVideoCodec::Type() +{ + return iCodec.Type(); +} + +