1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/cafstreamingsupport/inc/streamagentfactory.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,93 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @publishedPartner
1.22 + @released
1.23 +*/
1.24 +
1.25 +#ifndef STREAMAGENTFACTORY_H
1.26 +#define STREAMAGENTFACTORY_H
1.27 +
1.28 +#include <caf/streaming/keystreamsink.h>
1.29 +#include <caf/streaming/streamagentinterface.h>
1.30 +#include <e32base.h>
1.31 +#include <ecom/ecom.h>
1.32 +#include <ecom/implementationproxy.h>
1.33 +
1.34 +class CSdpMediaField;
1.35 +class CSdpDocument;
1.36 +
1.37 +namespace StreamAccess
1.38 + {
1.39 +
1.40 + /**
1.41 + Abstract interface handed out by an ECOM agent implementation by REComSession::CreateImplementationL().
1.42 +
1.43 + CStreamAgentFactory defines an abstract factory that is responsible for creating instances of CKeyStreamDecoder.
1.44 +
1.45 + Derived classes will hand out concrete product implementations which are specific for that particular agent.
1.46 +
1.47 + Derived classes effectively represent the ECOM session handle used by Streaming CAF classes.
1.48 +
1.49 + */
1.50 + class CStreamAgentFactory : public CBase
1.51 + {
1.52 + public:
1.53 + /** Destructor. */
1.54 + IMPORT_C ~CStreamAgentFactory();
1.55 +
1.56 + /**
1.57 + Factory function that creates a CAgentKeyStreamDecoder object for decoding and applying the short-term key stream.
1.58 +
1.59 + @param aKeyStreamSink The reference to the necessary CKeyStreamSink object used to create the binding between
1.60 + the short-term key stream that delivers the decryption keys for the traffic and the protocol which protects the
1.61 + traffic itself.
1.62 +
1.63 + NOTE: A copy of the key stream sink is made by the stream agent implementation during construction. This means
1.64 + that the local copy can be destroyed once it has been used to retrieve a handle to the desired CAgentKeyStreamDecoder
1.65 + object.
1.66 +
1.67 + @param aSdpKeyStream Conatins the metadata for the SDP key management scheme of the stream
1.68 + @param aSdpDoc Contains a collection of SDP fields and values describing session.
1.69 + @return A pointer to the CAgentKeyStreamDecoder object. Ownership on the object is transferred to the client of the interface.
1.70 + @return NULL if the agent does not support the key management scheme specified in the SDP key stream definition.
1.71 + @leave KErrPermissionDenied if the process does not have the rights to instantiate key stream decoders.
1.72 + @leave ... One of the system-wide error codes.
1.73 + */
1.74 + virtual CAgentKeyStreamDecoder* GetKeyStreamDecoderL(const CKeyStreamSink& aKeyStreamSink,
1.75 + const CSdpMediaField& aSdpKeyStream,
1.76 + const CSdpDocument& aSdpDoc) = 0;
1.77 +
1.78 + /**
1.79 + Function to determine whether the stream agent supports the key management scheme specified in the SDP key stream definition
1.80 +
1.81 + @param aSdpKeyStream Conatins the metadata for the SDP key management scheme of the stream
1.82 + @return ETrue if the stream agent recognises the SDP format and is able to decode the key stream
1.83 + @return EFalse if the stream agent fails to recofnise the SDP format or is unable to decode the key stream
1.84 + */
1.85 + virtual TBool IsKeyStreamSupportedL(const CSdpMediaField& aSdpKeyStream) = 0;
1.86 +
1.87 + protected:
1.88 + /** Constructor. */
1.89 + IMPORT_C CStreamAgentFactory();
1.90 + };
1.91 +
1.92 + /** Hosting the Stream Agent Factory Interface UID. */
1.93 + const TUid KUidStreamAgentFactoryInterface = {0x10285890};
1.94 +
1.95 + } // namespace StreamAccess
1.96 +#endif // STREAMAGENTFACTORY_H