• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 /**
19  *  @file pvmf_protocol_engine_node_registry.h
20  *  @brief PVMFProtocolEngineNodeRegistry maintains a list of protocol constainers available which is queryable. The utility
21  *   also allows the node specified by PVUuid to be created and returned *
22  */
23 
24 
25 #ifndef PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_H_INCLUDED
26 #define PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_H_INCLUDED
27 
28 #ifndef OSCL_VECTOR_H_INCLUDED
29 #include "oscl_vector.h"
30 #endif
31 
32 #ifndef OSCL_VECTOR_H_INCLUDED
33 #include "oscl_mem.h"
34 #endif
35 
36 #ifndef PV_UUID_H_INCLUDED
37 #include "pv_uuid.h"
38 #endif
39 
40 #ifndef PVMF_FORMAT_TYPE_H_INCLUDED
41 #include "pvmf_format_type.h"
42 #endif
43 
44 #ifndef PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_INTERFACE_H_INCLUDED
45 #include "pvmf_protocol_engine_node_registry_interface.h"
46 #endif
47 
48 #ifndef PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_POPULATOR_H_INCLUDED
49 #include "pvmf_protocol_engine_node_registry_populator_interface.h"
50 #endif
51 
52 
53 // CLASS DECLARATION
54 /**
55  * PVMFProtocolEngineNodeRegistry maintains a list of protocol constainers available which is queryable.
56  * The utility also allows the node specified by PVUuid to be created and returned
57  **/
58 
59 class ProtocolContainer;
60 class OsclSharedLibrary;
61 class PVLogger;
62 class PVMFProtocolEngineNodeRegistry : public PVMFProtocolEngineNodeRegistryInterface
63 {
64     public:
65         /**
66          * Object Constructor function
67          **/
68         PVMFProtocolEngineNodeRegistry();
69 
70         /**
71          * The CheckPluginAvailability for PVMFProtocolEngineNodeRegistry. Used for releasing a protocol-specific protocol container.
72          *
73          * @param aSourceFormat source format type passed in from upper layer up to the app.
74          *
75          * @param aSourceData source opaque data
76          *
77          * @returns True or False
78          **/
79         bool CheckPluginAvailability(PVMFFormatType& aSourceFormat, OsclAny* aSourceData = NULL);
80 
81         /**
82          * The CreateProtocolEngineContainer for PVMFProtocolEngineNodeRegistry. Used mainly for creating a protocol-specific protocol container.
83          *
84          * @param aRecreateInfo opaque info for creating ProtocolEngineContainer
85          * @param aNode an PVMFProtocolEngineNode instance
86          *
87          * @returns a pointer to protocol container
88          **/
89         ProtocolContainer* CreateProtocolEngineContainer(OsclAny* &aPluginInfo, PVMFProtocolEngineNode* aNode);
90 
91         /**
92          * The ReleaseProtocolEngineContainer for PVMFProtocolEngineNodeRegistry. Used for releasing a protocol-specific protocol container.
93          *
94          * @param aUuid UUID recorded at the time of creation of the node.
95          *
96          * @param Pointer to the protocol-based protocol container to be released
97          *
98          * @returns True or False
99          **/
100         bool ReleaseProtocolEngineContainer(ProtocolContainer *aContainer);
101 
102         void RegisterProtocolEngineContainer(PVMFProtocolEngineContainerInfo *aInfo);
103 
104         /**
105          * Object destructor function
106          **/
107         ~PVMFProtocolEngineNodeRegistry();
108 
109     private:
110         bool RecheckPlugin(OsclAny* aNewPluginInfo);
111 
112         void AddLoadableModules();
113         void RemoveLoadableModules();
114 
115     private:
116         Oscl_Vector<PVMFProtocolEngineContainerInfo, OsclMemAllocator> iTypeVec;
117         uint32 iTypeVecIndex;
118 
119         struct PVProtocolEngineNodeSharedLibInfo
120         {
121             OsclSharedLibrary* iLib;
122             PVMFProtocolEngineNodeRegistryPopulatorInterface* iNodeLibIfacePtr;
123             OsclAny* iContext;
124         };
125         Oscl_Vector<struct PVProtocolEngineNodeSharedLibInfo*, OsclMemAllocator> iNodeLibInfoList;
126         PVLogger* iLogger;
127 };
128 
129 
130 #endif // PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_H_INCLUDED
131 
132 
133