First public contribution.
1 // Copyright (c) 2007-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include <ecom/ecom.h>
17 #include "streamagentinfo.h"
18 #include <caf/streaming/streamagentfactory.h>
20 using namespace StreamAccess;
22 CStreamAgentInfo* CStreamAgentInfo::NewLC(const CImplementationInformation& aImplementationInfo)
24 CStreamAgentInfo* self = new(ELeave) CStreamAgentInfo();
25 CleanupStack::PushL(self);
26 self->ConstructL(aImplementationInfo);
30 CStreamAgentInfo::CStreamAgentInfo()
34 CStreamAgentInfo::~CStreamAgentInfo()
37 delete iStreamAgentFactory;
39 REComSession::DestroyedImplementation(iEcomKey);
40 REComSession::FinalClose();
43 void CStreamAgentInfo::ConstructL(const CImplementationInformation& aImplementationInfo)
45 /* Retrieve the stream agent's Name and Implementation Uid from the CImplementationInformation
46 * object constructed by ECOM
48 iName = aImplementationInfo.DisplayName().AllocL();
49 iImplementationUid = aImplementationInfo.ImplementationUid();
51 // Instantiate an instance of the stream agents factory using the Implementation Uid
52 iStreamAgentFactory = static_cast<CStreamAgentFactory *>(REComSession::CreateImplementationL(iImplementationUid, iEcomKey));
55 const TDesC& CStreamAgentInfo::Name() const
60 TUid CStreamAgentInfo::ImplementationUid() const
62 return iImplementationUid;
65 TBool CStreamAgentInfo::IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) const
67 /* Query the stream agent factory to determine whether the SDP key management description
70 return iStreamAgentFactory->IsKeyStreamSupportedL(aSdpKeyStream);
73 CStreamAgentFactory& CStreamAgentInfo::StreamAgentFactory() const
75 return *iStreamAgentFactory;