sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include "streamagentinfo.h" sl@0: #include sl@0: sl@0: using namespace StreamAccess; sl@0: sl@0: CStreamAgentInfo* CStreamAgentInfo::NewLC(const CImplementationInformation& aImplementationInfo) sl@0: { sl@0: CStreamAgentInfo* self = new(ELeave) CStreamAgentInfo(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aImplementationInfo); sl@0: return self; sl@0: } sl@0: sl@0: CStreamAgentInfo::CStreamAgentInfo() sl@0: { sl@0: } sl@0: sl@0: CStreamAgentInfo::~CStreamAgentInfo() sl@0: { sl@0: delete iName; sl@0: delete iStreamAgentFactory; sl@0: sl@0: REComSession::DestroyedImplementation(iEcomKey); sl@0: REComSession::FinalClose(); sl@0: } sl@0: sl@0: void CStreamAgentInfo::ConstructL(const CImplementationInformation& aImplementationInfo) sl@0: { sl@0: /* Retrieve the stream agent's Name and Implementation Uid from the CImplementationInformation sl@0: * object constructed by ECOM sl@0: */ sl@0: iName = aImplementationInfo.DisplayName().AllocL(); sl@0: iImplementationUid = aImplementationInfo.ImplementationUid(); sl@0: sl@0: // Instantiate an instance of the stream agents factory using the Implementation Uid sl@0: iStreamAgentFactory = static_cast(REComSession::CreateImplementationL(iImplementationUid, iEcomKey)); sl@0: } sl@0: sl@0: const TDesC& CStreamAgentInfo::Name() const sl@0: { sl@0: return *iName; sl@0: } sl@0: sl@0: TUid CStreamAgentInfo::ImplementationUid() const sl@0: { sl@0: return iImplementationUid; sl@0: } sl@0: sl@0: TBool CStreamAgentInfo::IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) const sl@0: { sl@0: /* Query the stream agent factory to determine whether the SDP key management description sl@0: * is supported sl@0: */ sl@0: return iStreamAgentFactory->IsKeyStreamSupportedL(aSdpKeyStream); sl@0: } sl@0: sl@0: CStreamAgentFactory& CStreamAgentInfo::StreamAgentFactory() const sl@0: { sl@0: return *iStreamAgentFactory; sl@0: }