• 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 #ifndef PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_INTERFACE_H_INCLUDED
19 #define PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_INTERFACE_H_INCLUDED
20 
21 #ifndef PVMF_FORMAT_TYPE_H_INCLUDED
22 #include "pvmf_format_type.h"
23 #endif
24 
25 #ifndef PV_UUID_H_INCLUDED
26 #include "pv_uuid.h"
27 #endif
28 
29 
30 class PVMFProtocolEngineNode;
31 class ProtocolContainer;
32 
33 // CLASS DECLARATION
34 /**
35  * PVMFProtocolEngineContainerInfo is a class which will maintain feature specific plugin info
36  **/
37 
38 class PVMFProtocolEngineContainerInfo
39 {
40     public:
41         /**
42          * Object Constructor function
43          **/
PVMFProtocolEngineContainerInfo()44         PVMFProtocolEngineContainerInfo()
45         {
46             clear();
47         }
48 
49         /**
50          * Copy Constructor function
51          **/
PVMFProtocolEngineContainerInfo(const PVMFProtocolEngineContainerInfo & aInfo)52         PVMFProtocolEngineContainerInfo(const PVMFProtocolEngineContainerInfo& aInfo)
53         {
54             iSourceType = aInfo.iSourceType;
55             iSourceExtraInfo = aInfo.iSourceExtraInfo;
56             iProtocolEngineContainerUUID = aInfo.iProtocolEngineContainerUUID;
57             iProtocolEngineContainerCreateFunc = aInfo.iProtocolEngineContainerCreateFunc;
58             iProtocolEngineContainerReleaseFunc = aInfo.iProtocolEngineContainerReleaseFunc;
59         }
60 
clear()61         void clear()
62         {
63             iSourceExtraInfo = 0;
64             iProtocolEngineContainerCreateFunc  = NULL;
65             iProtocolEngineContainerReleaseFunc = NULL;
66 
67         }
68 
69         /**
70          * Object destructor function
71          **/
~PVMFProtocolEngineContainerInfo()72         ~PVMFProtocolEngineContainerInfo()
73         {
74         }
75 
76     public:
77         PVMFFormatType iSourceType;
78         uint32 iSourceExtraInfo; // bit0=1, progressive streaming type
79         PVUuid iProtocolEngineContainerUUID;
80         ProtocolContainer*(*iProtocolEngineContainerCreateFunc)(PVMFProtocolEngineNode *);
81         bool (*iProtocolEngineContainerReleaseFunc)(ProtocolContainer *);
82 };
83 
84 
85 // CLASS DECLARATION
86 /**
87  * PVMFProtocolEngineNodeRegistry maintains a list of protocol constainers available which is queryable.
88  * The utility also allows the node specified by PVUuid to be created and returned
89  **/
90 
91 class PVMFProtocolEngineNodeRegistryInterface
92 {
93     public:
94         /**
95          * The CheckPluginAvailability for PVMFProtocolEngineNodeRegistry. Used for releasing a protocol-specific protocol container.
96          *
97          * @param aSourceFormat source format type passed in from upper layer up to the app.
98          *
99          * @param aSourceData source opaque data
100          *
101          * @returns True or False
102          **/
103         virtual bool CheckPluginAvailability(PVMFFormatType& aSourceFormat, OsclAny* aSourceData = NULL) = 0;
104 
105         /**
106          * The CreateProtocolEngineContainer for PVMFProtocolEngineNodeRegistry. Used mainly for creating a protocol-specific protocol container.
107          *
108          * @param aRecreateInfo opaque info for creating ProtocolEngineContainer
109          * @param aNode an PVMFProtocolEngineNode instance
110          *
111          * @returns a pointer to protocol container
112          **/
113         virtual ProtocolContainer* CreateProtocolEngineContainer(OsclAny* &aPluginInfo, PVMFProtocolEngineNode* aNode) = 0;
114 
115         /**
116          * The ReleaseProtocolEngineContainer for PVMFProtocolEngineNodeRegistry. Used for releasing a protocol-specific protocol container.
117          *
118          * @param aUuid UUID recorded at the time of creation of the node.
119          *
120          * @param Pointer to the protocol-based protocol container to be released
121          *
122          * @returns True or False
123          **/
124         virtual bool ReleaseProtocolEngineContainer(ProtocolContainer *aContainer) = 0;
125 
126         virtual void RegisterProtocolEngineContainer(PVMFProtocolEngineContainerInfo *aInfo) = 0;
127 
128         /**
129          * Object destructor function
130          **/
~PVMFProtocolEngineNodeRegistryInterface()131         virtual ~PVMFProtocolEngineNodeRegistryInterface()
132         {
133             ;
134         }
135 };
136 
137 
138 #endif // PVMF_PROTOCOL_ENGINE_NODE_REGISTRY_INTERFACE_H_INCLUDED
139 
140 
141