contentmgmt/cafstreamingsupport/test/streamingtestagent/source/plugin/teststreamagentfactory.cpp
branchRCL_3
changeset 43 2f10d260163b
equal deleted inserted replaced
42:eb9b28acd381 43:2f10d260163b
       
     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 // Implements the test stream agent factory plug-in.
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "teststreamagentfactory.h"
       
    19 #include "srautils.h"
       
    20 
       
    21 using namespace StreamAccess;
       
    22 
       
    23 
       
    24 static const TImplementationProxy ImplementationTable[] = 
       
    25 	{
       
    26 	IMPLEMENTATION_PROXY_ENTRY(KTestStreamAgentFactoryImpId, CTestStreamAgentFactory::CreateTestAgentL)
       
    27 	};
       
    28 	
       
    29 	
       
    30 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    31 /**
       
    32 	Standard ECOM factory
       
    33 */
       
    34 	{
       
    35 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    36 	return ImplementationTable;
       
    37 	}
       
    38 	
       
    39 //
       
    40 //CTestStreamAgentFactory
       
    41 //
       
    42 
       
    43 CTestStreamAgentFactory::CTestStreamAgentFactory()
       
    44 /**
       
    45 	Constructor.
       
    46  */
       
    47 :	CStreamAgentFactory()
       
    48  	{
       
    49  	//empty
       
    50  	}
       
    51  	
       
    52 
       
    53 CTestStreamAgentFactory::~CTestStreamAgentFactory()
       
    54 /**
       
    55 	Destructor
       
    56  */
       
    57 	{
       
    58 	//empty
       
    59 	}
       
    60 	
       
    61 
       
    62 CStreamAgentFactory* CTestStreamAgentFactory::CreateTestAgentL()
       
    63 /**
       
    64 	Factory method that instantiates a new test stream agent factory ECOM plug-in.
       
    65 
       
    66 	@return A pointer to the new test stream agent factory object.
       
    67 */
       
    68 	{
       
    69 	CTestStreamAgentFactory *self = new(ELeave) CTestStreamAgentFactory();
       
    70 	return self;
       
    71 	}
       
    72 
       
    73 CAgentKeyStreamDecoder* CTestStreamAgentFactory::GetKeyStreamDecoderL(const CKeyStreamSink& aKeyStreamSink,
       
    74 		 															  const CSdpMediaField& aSdpKeyStream,
       
    75 		 				    										  const CSdpDocument& aSdpDoc)
       
    76 /**
       
    77  	@see CStreamAgentFactory::GetKeyStreamDecoderL
       
    78  */
       
    79 	{
       
    80 	return CTestAgentKeyStreamDecoder::NewL(aKeyStreamSink, aSdpKeyStream, aSdpDoc); 
       
    81 	}
       
    82 
       
    83 TBool CTestStreamAgentFactory::IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream)
       
    84 /**
       
    85  	Function to determine whether the test stream agent supports the key management scheme 
       
    86  	specified in the SDP key stream definition
       
    87  	@param aSdpKeyStream Contains the metadata for the SDP key management scheme of the stream
       
    88  	@return ETrue if the test stream agent recognises the SDP format and is able to decode the key stream
       
    89 	@return EFalse if the test stream agent fails to recofnise the SDP format or is unable to decode the key stream
       
    90  */
       
    91 	{
       
    92 	return CheckKeyStreamSupportedL(aSdpKeyStream, KSupportedKmsIds());
       
    93 	}