sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef STREAMAGENTFACTORY_H sl@0: #define STREAMAGENTFACTORY_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class CSdpMediaField; sl@0: class CSdpDocument; sl@0: sl@0: namespace StreamAccess sl@0: { sl@0: sl@0: /** sl@0: Abstract interface handed out by an ECOM agent implementation by REComSession::CreateImplementationL(). sl@0: sl@0: CStreamAgentFactory defines an abstract factory that is responsible for creating instances of CKeyStreamDecoder. sl@0: sl@0: Derived classes will hand out concrete product implementations which are specific for that particular agent. sl@0: sl@0: Derived classes effectively represent the ECOM session handle used by Streaming CAF classes. sl@0: sl@0: */ sl@0: class CStreamAgentFactory : public CBase sl@0: { sl@0: public: sl@0: /** Destructor. */ sl@0: IMPORT_C ~CStreamAgentFactory(); sl@0: sl@0: /** sl@0: Factory function that creates a CAgentKeyStreamDecoder object for decoding and applying the short-term key stream. sl@0: sl@0: @param aKeyStreamSink The reference to the necessary CKeyStreamSink object used to create the binding between sl@0: the short-term key stream that delivers the decryption keys for the traffic and the protocol which protects the sl@0: traffic itself. sl@0: sl@0: NOTE: A copy of the key stream sink is made by the stream agent implementation during construction. This means sl@0: that the local copy can be destroyed once it has been used to retrieve a handle to the desired CAgentKeyStreamDecoder sl@0: object. sl@0: sl@0: @param aSdpKeyStream Conatins the metadata for the SDP key management scheme of the stream sl@0: @param aSdpDoc Contains a collection of SDP fields and values describing session. sl@0: @return A pointer to the CAgentKeyStreamDecoder object. Ownership on the object is transferred to the client of the interface. sl@0: @return NULL if the agent does not support the key management scheme specified in the SDP key stream definition. sl@0: @leave KErrPermissionDenied if the process does not have the rights to instantiate key stream decoders. sl@0: @leave ... One of the system-wide error codes. sl@0: */ sl@0: virtual CAgentKeyStreamDecoder* GetKeyStreamDecoderL(const CKeyStreamSink& aKeyStreamSink, sl@0: const CSdpMediaField& aSdpKeyStream, sl@0: const CSdpDocument& aSdpDoc) = 0; sl@0: sl@0: /** sl@0: Function to determine whether the stream agent supports the key management scheme specified in the SDP key stream definition sl@0: sl@0: @param aSdpKeyStream Conatins the metadata for the SDP key management scheme of the stream sl@0: @return ETrue if the stream agent recognises the SDP format and is able to decode the key stream sl@0: @return EFalse if the stream agent fails to recofnise the SDP format or is unable to decode the key stream sl@0: */ sl@0: virtual TBool IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) = 0; sl@0: sl@0: protected: sl@0: /** Constructor. */ sl@0: IMPORT_C CStreamAgentFactory(); sl@0: }; sl@0: sl@0: /** Hosting the Stream Agent Factory Interface UID. */ sl@0: const TUid KUidStreamAgentFactoryInterface = {0x10285890}; sl@0: sl@0: } // namespace StreamAccess sl@0: #endif // STREAMAGENTFACTORY_H