1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/cafstreamingsupport/source/streamagentinfo.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,76 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <ecom/ecom.h>
1.20 +#include "streamagentinfo.h"
1.21 +#include <caf/streaming/streamagentfactory.h>
1.22 +
1.23 +using namespace StreamAccess;
1.24 +
1.25 +CStreamAgentInfo* CStreamAgentInfo::NewLC(const CImplementationInformation& aImplementationInfo)
1.26 + {
1.27 + CStreamAgentInfo* self = new(ELeave) CStreamAgentInfo();
1.28 + CleanupStack::PushL(self);
1.29 + self->ConstructL(aImplementationInfo);
1.30 + return self;
1.31 + }
1.32 +
1.33 +CStreamAgentInfo::CStreamAgentInfo()
1.34 + {
1.35 + }
1.36 +
1.37 +CStreamAgentInfo::~CStreamAgentInfo()
1.38 + {
1.39 + delete iName;
1.40 + delete iStreamAgentFactory;
1.41 +
1.42 + REComSession::DestroyedImplementation(iEcomKey);
1.43 + REComSession::FinalClose();
1.44 + }
1.45 +
1.46 +void CStreamAgentInfo::ConstructL(const CImplementationInformation& aImplementationInfo)
1.47 + {
1.48 + /* Retrieve the stream agent's Name and Implementation Uid from the CImplementationInformation
1.49 + * object constructed by ECOM
1.50 + */
1.51 + iName = aImplementationInfo.DisplayName().AllocL();
1.52 + iImplementationUid = aImplementationInfo.ImplementationUid();
1.53 +
1.54 + // Instantiate an instance of the stream agents factory using the Implementation Uid
1.55 + iStreamAgentFactory = static_cast<CStreamAgentFactory *>(REComSession::CreateImplementationL(iImplementationUid, iEcomKey));
1.56 + }
1.57 +
1.58 +const TDesC& CStreamAgentInfo::Name() const
1.59 + {
1.60 + return *iName;
1.61 + }
1.62 +
1.63 +TUid CStreamAgentInfo::ImplementationUid() const
1.64 + {
1.65 + return iImplementationUid;
1.66 + }
1.67 +
1.68 +TBool CStreamAgentInfo::IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) const
1.69 + {
1.70 + /* Query the stream agent factory to determine whether the SDP key management description
1.71 + * is supported
1.72 + */
1.73 + return iStreamAgentFactory->IsKeyStreamSupportedL(aSdpKeyStream);
1.74 + }
1.75 +
1.76 +CStreamAgentFactory& CStreamAgentInfo::StreamAgentFactory() const
1.77 + {
1.78 + return *iStreamAgentFactory;
1.79 + }