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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #ifndef STREAMAGENTFACTORY_H
23 #define STREAMAGENTFACTORY_H
25 #include <caf/streaming/keystreamsink.h>
26 #include <caf/streaming/streamagentinterface.h>
28 #include <ecom/ecom.h>
29 #include <ecom/implementationproxy.h>
34 namespace StreamAccess
38 Abstract interface handed out by an ECOM agent implementation by REComSession::CreateImplementationL().
40 CStreamAgentFactory defines an abstract factory that is responsible for creating instances of CKeyStreamDecoder.
42 Derived classes will hand out concrete product implementations which are specific for that particular agent.
44 Derived classes effectively represent the ECOM session handle used by Streaming CAF classes.
47 class CStreamAgentFactory : public CBase
51 IMPORT_C ~CStreamAgentFactory();
54 Factory function that creates a CAgentKeyStreamDecoder object for decoding and applying the short-term key stream.
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
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
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.
71 virtual CAgentKeyStreamDecoder* GetKeyStreamDecoderL(const CKeyStreamSink& aKeyStreamSink,
72 const CSdpMediaField& aSdpKeyStream,
73 const CSdpDocument& aSdpDoc) = 0;
76 Function to determine whether the stream agent supports the key management scheme specified in the SDP key stream definition
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
82 virtual TBool IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) = 0;
86 IMPORT_C CStreamAgentFactory();
89 /** Hosting the Stream Agent Factory Interface UID. */
90 const TUid KUidStreamAgentFactoryInterface = {0x10285890};
92 } // namespace StreamAccess
93 #endif // STREAMAGENTFACTORY_H