contentmgmt/cafstreamingsupport/inc/streamagentfactory.h
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 //
       
    15 
       
    16 /**
       
    17  @file 
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef STREAMAGENTFACTORY_H
       
    23 #define STREAMAGENTFACTORY_H
       
    24 
       
    25 #include <caf/streaming/keystreamsink.h>
       
    26 #include <caf/streaming/streamagentinterface.h>
       
    27 #include <e32base.h>
       
    28 #include <ecom/ecom.h>
       
    29 #include <ecom/implementationproxy.h>
       
    30 
       
    31 class CSdpMediaField;
       
    32 class CSdpDocument;
       
    33 
       
    34 namespace StreamAccess
       
    35 	{
       
    36 
       
    37 	/**
       
    38 	 Abstract interface handed out by an ECOM agent implementation by REComSession::CreateImplementationL().
       
    39 
       
    40 	 CStreamAgentFactory defines an abstract factory that is responsible for creating instances of CKeyStreamDecoder.
       
    41 	 
       
    42 	 Derived classes will hand out concrete product implementations which are  specific for that particular agent.
       
    43 
       
    44 	 Derived classes effectively represent the ECOM session handle used by Streaming CAF classes.
       
    45 	   
       
    46 	 */
       
    47 	 class CStreamAgentFactory : public CBase
       
    48 	 	{
       
    49 	 public:
       
    50 	 	/** Destructor. */
       
    51 	 	IMPORT_C ~CStreamAgentFactory();
       
    52 	 	
       
    53 		/**
       
    54 		Factory function that creates a CAgentKeyStreamDecoder object for decoding and applying the short-term key stream.
       
    55 		 
       
    56 		@param aKeyStreamSink The reference to the necessary CKeyStreamSink object used to create the binding between
       
    57 		the short-term key stream that delivers the decryption keys for the traffic and the protocol which protects the
       
    58 		traffic itself. 
       
    59 		
       
    60 		NOTE: A copy of the key stream sink is made by the stream agent implementation during construction. This means
       
    61 		that the local copy can be destroyed once it has been used to retrieve a handle to the desired CAgentKeyStreamDecoder
       
    62 		object.
       
    63 
       
    64 		@param aSdpKeyStream Conatins the metadata for the SDP key management scheme of the stream
       
    65 		@param aSdpDoc Contains a collection of SDP fields and values describing session.
       
    66 		@return A pointer to the CAgentKeyStreamDecoder object. Ownership on the object is transferred to the client of the interface.
       
    67 		@return NULL if the agent does not support the key management scheme specified in the SDP key stream definition.
       
    68 		@leave KErrPermissionDenied if the process does not have the rights to instantiate key stream decoders.
       
    69 		@leave ...		One of the system-wide error codes.
       
    70 		*/
       
    71 		virtual CAgentKeyStreamDecoder* GetKeyStreamDecoderL(const CKeyStreamSink& aKeyStreamSink,
       
    72 													    	 const CSdpMediaField& aSdpKeyStream,
       
    73 													    	 const CSdpDocument& aSdpDoc) = 0;
       
    74 		
       
    75 		/**
       
    76 		Function to determine whether the stream agent supports the key management scheme specified in the SDP key stream definition
       
    77 		
       
    78 		@param aSdpKeyStream Conatins the metadata for the SDP key management scheme of the stream
       
    79 		@return ETrue if the stream agent recognises the SDP format and is able to decode the key stream
       
    80 		@return EFalse if the stream agent fails to recofnise the SDP format or is unable to decode the key stream
       
    81 		*/
       
    82 		virtual TBool IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) = 0;
       
    83 			
       
    84 	 protected:
       
    85 	 	/** Constructor. */
       
    86 	 	IMPORT_C CStreamAgentFactory();
       
    87 		};
       
    88 		
       
    89 	/** Hosting the Stream Agent Factory Interface UID. */	
       
    90 	const TUid KUidStreamAgentFactoryInterface = {0x10285890};
       
    91 		 
       
    92 	} // namespace StreamAccess
       
    93 #endif // STREAMAGENTFACTORY_H