|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef STREAMAGENTRESOLVER_H |
|
23 #define STREAMAGENTRESOLVER_H |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <ecom/ecom.h> |
|
27 #include "streamagentinfo.h" |
|
28 |
|
29 namespace StreamAccess |
|
30 { |
|
31 |
|
32 class CStreamAgentInfo; |
|
33 |
|
34 /** |
|
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. |
|
38 */ |
|
39 class CStreamAgentResolver : public CBase |
|
40 { |
|
41 public: |
|
42 |
|
43 /* Constructs a new instance of CStreamAgentResolver and pushs it onto the cleanup stack |
|
44 * @return Pointer to the new CStreamAgentResolver object |
|
45 */ |
|
46 static CStreamAgentResolver* NewLC(); |
|
47 |
|
48 /* Destructor |
|
49 */ |
|
50 ~CStreamAgentResolver(); |
|
51 |
|
52 /* Resolves a stream agent by the SDP (Session Description Protocol) media description |
|
53 * of the key stream. |
|
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 |
|
59 * destroyed. |
|
60 * @leave KErrCANoAgent No stream agent can be found that supports the given SDP key management |
|
61 * description |
|
62 * @leave One of the system-wide error codes |
|
63 */ |
|
64 CStreamAgentInfo& ResolveSdpKeyStreamL(const CSdpMediaField& aSdpKeyStream) const; |
|
65 |
|
66 protected: |
|
67 |
|
68 /* Constructor |
|
69 */ |
|
70 CStreamAgentResolver(); |
|
71 |
|
72 /* Second phase of construction for CStreamAgentResolver |
|
73 */ |
|
74 void ConstructL(); |
|
75 |
|
76 private: |
|
77 |
|
78 /* Constructs a list of information about plug-in implementations located |
|
79 * by the ECOM framework that satisfy the stream agent interface. |
|
80 */ |
|
81 void BuildStreamAgentListL(); |
|
82 |
|
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 |
|
86 */ |
|
87 void AddStreamAgentL(const CImplementationInformation& aAgentInfo); |
|
88 |
|
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 |
|
92 */ |
|
93 static void CleanAgentImplArray(TAny* aArray); |
|
94 |
|
95 private: |
|
96 |
|
97 /* Array of information regarding stream agent interface implementations located by ECOM |
|
98 */ |
|
99 RPointerArray<CStreamAgentInfo> iStreamAgentInfoArray; |
|
100 |
|
101 }; |
|
102 } // namespace StreamAccess |
|
103 #endif /*STREAMAGENTRESOLVER_H*/ |