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: @internalComponent sl@0: @released sl@0: */ sl@0: sl@0: #ifndef STREAMAGENTRESOLVER_H sl@0: #define STREAMAGENTRESOLVER_H sl@0: sl@0: #include sl@0: #include sl@0: #include "streamagentinfo.h" sl@0: sl@0: namespace StreamAccess sl@0: { sl@0: sl@0: class CStreamAgentInfo; sl@0: sl@0: /** sl@0: * Responsible for the identification of stream agent ECOM plug-in implementations and sl@0: * the selection of the most appropriate agent based on the key stream session description sl@0: * metadata and plug-in resource file information. sl@0: */ sl@0: class CStreamAgentResolver : public CBase sl@0: { sl@0: public: sl@0: sl@0: /* Constructs a new instance of CStreamAgentResolver and pushs it onto the cleanup stack sl@0: * @return Pointer to the new CStreamAgentResolver object sl@0: */ sl@0: static CStreamAgentResolver* NewLC(); sl@0: sl@0: /* Destructor sl@0: */ sl@0: ~CStreamAgentResolver(); sl@0: sl@0: /* Resolves a stream agent by the SDP (Session Description Protocol) media description sl@0: * of the key stream. sl@0: * @param aSdpKeyStream SDP media description of the key stream sl@0: * @return Reference to the CStreamAgentInfo instance for the chosen Stream Agent, capable sl@0: * of decoding the key stream. sl@0: * NOTE: The lifetime of the returned reference is limited by the lifetime of the resolver. sl@0: * The CStreamAgentInfo reference cannot be used after the CStreamAgentResolver object is sl@0: * destroyed. sl@0: * @leave KErrCANoAgent No stream agent can be found that supports the given SDP key management sl@0: * description sl@0: * @leave One of the system-wide error codes sl@0: */ sl@0: CStreamAgentInfo& ResolveSdpKeyStreamL(const CSdpMediaField& aSdpKeyStream) const; sl@0: sl@0: protected: sl@0: sl@0: /* Constructor sl@0: */ sl@0: CStreamAgentResolver(); sl@0: sl@0: /* Second phase of construction for CStreamAgentResolver sl@0: */ sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: sl@0: /* Constructs a list of information about plug-in implementations located sl@0: * by the ECOM framework that satisfy the stream agent interface. sl@0: */ sl@0: void BuildStreamAgentListL(); sl@0: sl@0: /* Adds a new instance of a stream agent to the CStreamAgentInfo array sl@0: * @param aAgentInfo Registration data regarding the stream agent interface implementation, sl@0: * retrieved from the associated resource file sl@0: */ sl@0: void AddStreamAgentL(const CImplementationInformation& aAgentInfo); sl@0: sl@0: /* Cleanup Item Operation used when constructing the stream agent list via ECOM sl@0: * @param aArray Pointer to an RImplInfoPtrArray array which is used by ECOM to store sl@0: * information about located stream agents implementations sl@0: */ sl@0: static void CleanAgentImplArray(TAny* aArray); sl@0: sl@0: private: sl@0: sl@0: /* Array of information regarding stream agent interface implementations located by ECOM sl@0: */ sl@0: RPointerArray iStreamAgentInfoArray; sl@0: sl@0: }; sl@0: } // namespace StreamAccess sl@0: #endif /*STREAMAGENTRESOLVER_H*/