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 STREAMAGENTRESOLVER_H
23 #define STREAMAGENTRESOLVER_H
26 #include <ecom/ecom.h>
27 #include "streamagentinfo.h"
29 namespace StreamAccess
32 class CStreamAgentInfo;
35 * Responsible for the identification of stream agent ECOM plug-in implementations and
36 * the selection of the most appropriate agent based on the key stream session description
37 * metadata and plug-in resource file information.
39 class CStreamAgentResolver : public CBase
43 /* Constructs a new instance of CStreamAgentResolver and pushs it onto the cleanup stack
44 * @return Pointer to the new CStreamAgentResolver object
46 static CStreamAgentResolver* NewLC();
50 ~CStreamAgentResolver();
52 /* Resolves a stream agent by the SDP (Session Description Protocol) media description
54 * @param aSdpKeyStream SDP media description of the key stream
55 * @return Reference to the CStreamAgentInfo instance for the chosen Stream Agent, capable
56 * of decoding the key stream.
57 * NOTE: The lifetime of the returned reference is limited by the lifetime of the resolver.
58 * The CStreamAgentInfo reference cannot be used after the CStreamAgentResolver object is
60 * @leave KErrCANoAgent No stream agent can be found that supports the given SDP key management
62 * @leave One of the system-wide error codes
64 CStreamAgentInfo& ResolveSdpKeyStreamL(const CSdpMediaField& aSdpKeyStream) const;
70 CStreamAgentResolver();
72 /* Second phase of construction for CStreamAgentResolver
78 /* Constructs a list of information about plug-in implementations located
79 * by the ECOM framework that satisfy the stream agent interface.
81 void BuildStreamAgentListL();
83 /* Adds a new instance of a stream agent to the CStreamAgentInfo array
84 * @param aAgentInfo Registration data regarding the stream agent interface implementation,
85 * retrieved from the associated resource file
87 void AddStreamAgentL(const CImplementationInformation& aAgentInfo);
89 /* Cleanup Item Operation used when constructing the stream agent list via ECOM
90 * @param aArray Pointer to an RImplInfoPtrArray array which is used by ECOM to store
91 * information about located stream agents implementations
93 static void CleanAgentImplArray(TAny* aArray);
97 /* Array of information regarding stream agent interface implementations located by ECOM
99 RPointerArray<CStreamAgentInfo> iStreamAgentInfoArray;
102 } // namespace StreamAccess
103 #endif /*STREAMAGENTRESOLVER_H*/