os/security/contentmgmt/cafstreamingsupport/source/streamagentinfo.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include <ecom/ecom.h>
    17 #include "streamagentinfo.h"
    18 #include <caf/streaming/streamagentfactory.h> 
    19 
    20 using namespace StreamAccess;
    21 
    22 CStreamAgentInfo* CStreamAgentInfo::NewLC(const CImplementationInformation& aImplementationInfo)
    23 	{
    24 	CStreamAgentInfo* self = new(ELeave) CStreamAgentInfo();
    25 	CleanupStack::PushL(self);
    26 	self->ConstructL(aImplementationInfo);
    27 	return self;
    28 	}
    29 
    30 CStreamAgentInfo::CStreamAgentInfo()
    31 	{
    32 	}
    33 
    34 CStreamAgentInfo::~CStreamAgentInfo()
    35 	{
    36 	delete iName;
    37 	delete iStreamAgentFactory;
    38 	
    39 	REComSession::DestroyedImplementation(iEcomKey);
    40 	REComSession::FinalClose();	
    41 	}
    42 
    43 void CStreamAgentInfo::ConstructL(const CImplementationInformation& aImplementationInfo)
    44 	{
    45 	/* Retrieve the stream agent's Name and Implementation Uid from the CImplementationInformation
    46 	 * object constructed by ECOM
    47 	 */
    48 	iName = aImplementationInfo.DisplayName().AllocL();
    49 	iImplementationUid = aImplementationInfo.ImplementationUid();
    50 	
    51 	// Instantiate an instance of the stream agents factory using the Implementation Uid
    52 	iStreamAgentFactory = static_cast<CStreamAgentFactory *>(REComSession::CreateImplementationL(iImplementationUid, iEcomKey));
    53 	}
    54 
    55 const TDesC& CStreamAgentInfo::Name() const
    56 	{
    57 	return *iName;
    58 	}
    59 
    60 TUid CStreamAgentInfo::ImplementationUid() const
    61 	{
    62 	return iImplementationUid;
    63 	}
    64 
    65 TBool CStreamAgentInfo::IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) const
    66 	{
    67 	/* Query the stream agent factory to determine whether the SDP key management description 
    68 	 * is supported
    69 	 */
    70 	return iStreamAgentFactory->IsKeyStreamSupportedL(aSdpKeyStream);
    71 	}
    72 
    73 CStreamAgentFactory& CStreamAgentInfo::StreamAgentFactory() const
    74 	{
    75 	return *iStreamAgentFactory;
    76 	}