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 PV_ENGINE_TYPES_H_INCLUDED 19 #define PV_ENGINE_TYPES_H_INCLUDED 20 21 #ifndef OSCL_BASE_H_INCLUDED 22 #include "oscl_base.h" 23 #endif 24 #ifndef OSCL_STRING_H_INCLUDED 25 #include "oscl_string.h" 26 #endif 27 #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED 28 #include "oscl_string_containers.h" 29 #endif 30 #ifndef OSCL_MEM_H_INCLUDED 31 #include "oscl_mem.h" 32 #endif 33 #ifndef PVMF_FORMAT_TYPE_H_INCLUDED 34 #include "pvmf_format_type.h" 35 #endif 36 #ifndef PV_UUID_H_INCLUDED 37 #include "pv_uuid.h" 38 #endif 39 #ifndef PV_INTERFACE_H_INCLUDED 40 #include "pv_interface.h" 41 #endif 42 #ifndef OSCL_VECTOR_H_INCLUDED 43 #include "oscl_vector.h" 44 #endif 45 46 // DATA TYPES 47 typedef int32 PVCommandId; 48 typedef int32 PVEventType; 49 typedef OsclAny* PVExclusivePtr; 50 typedef int32 PVResponseType; 51 typedef int32 PVLogLevelInfo; 52 typedef Oscl_Vector<OSCL_HeapString<OsclMemAllocator>, OsclMemAllocator> PVPMetadataList; 53 /* Temporary definitions */ 54 typedef int32 PVSDKModuleInfo; 55 /* END of temp defs */ 56 57 struct PVSDKInfo 58 { PVSDKInfoPVSDKInfo59 PVSDKInfo() 60 { 61 iDate = 0x00000000; 62 } 63 64 PVSDKInfo& operator=(const PVSDKInfo& aSDKInfo) 65 { 66 iLabel = aSDKInfo.iLabel; 67 iDate = aSDKInfo.iDate; 68 return *this; 69 } 70 71 OSCL_StackString<80> iLabel; 72 uint32 iDate; // 0xyyyymmdd 73 }; 74 75 76 /** 77 * PVEngineCommand Class 78 * 79 * PVEngineCommand class is a data class to hold issued commands. The class is meant to be used inside the engine 80 * and not exposed to the interface layer or above. 81 **/ 82 class PVEngineCommand 83 { 84 public: 85 /** 86 * The constructor for PVEngineCommand which allows the data values to be set. 87 * 88 * @param aCmdType The command type value for this command. The value is an engine-specific 32-bit value. 89 * @param aCmdId The command ID assigned by the engine for this command. 90 * @param aContextData The pointer to the passed-in context data for this command. 91 * 92 * @returns None 93 **/ 94 PVEngineCommand(int32 aCmdType, PVCommandId aCmdId, OsclAny* aContextData = NULL, OsclAny* aParam1 = NULL, OsclAny* aParam2 = NULL, OsclAny* aParam3 = NULL) : iCmdType(aCmdType)95 iCmdType(aCmdType), iCmdId(aCmdId), iContextData(aContextData), iParam1(aParam1), iParam2(aParam2), iParam3(aParam3) {} 96 97 /** 98 * The copy constructor for PVEngineCommand. Used mainly for Oscl_Vector. 99 * 100 * @param aCmd The reference to the source PVEngineCommand to copy the data values from. 101 * 102 * @returns None 103 **/ PVEngineCommand(const PVEngineCommand & aCmd)104 PVEngineCommand(const PVEngineCommand& aCmd) 105 { 106 iCmdType = aCmd.iCmdType; 107 iCmdId = aCmd.iCmdId; 108 iContextData = aCmd.iContextData; 109 iParam1 = aCmd.iParam1; 110 iParam2 = aCmd.iParam2; 111 iParam3 = aCmd.iParam3; 112 iMimeType = aCmd.iMimeType; 113 iUuid = aCmd.iUuid; 114 } 115 116 /** 117 * This function returns the stored command type value. 118 * 119 * @returns The signed 32-bit command type value for this command. 120 **/ GetCmdType()121 int32 GetCmdType()const 122 { 123 return iCmdType; 124 } 125 126 /** 127 * This function returns the stored command ID value. 128 * 129 * @returns The PVCommandId value for this command. 130 **/ GetCmdId()131 PVCommandId GetCmdId()const 132 { 133 return iCmdId; 134 } 135 136 /** 137 * This function returns the stored context data pointer. 138 * 139 * @returns The pointer to the context data for this command 140 **/ GetContext()141 OsclAny* GetContext()const 142 { 143 return iContextData; 144 } 145 146 /** 147 * This function returns the first stored parameter pointer. 148 * 149 * @returns The pointer to the first stored parameter for this command 150 **/ GetParam1()151 OsclAny* GetParam1()const 152 { 153 return iParam1; 154 } 155 156 /** 157 * This function returns the second stored parameter pointer. 158 * 159 * @returns The pointer to the second stored parameter for this command 160 **/ GetParam2()161 OsclAny* GetParam2()const 162 { 163 return iParam2; 164 } 165 166 /** 167 * This function returns the third stored parameter pointer. 168 * 169 * @returns The pointer to the third stored parameter for this command 170 **/ GetParam3()171 OsclAny* GetParam3()const 172 { 173 return iParam3; 174 } 175 176 /** 177 * This function returns Mime type parameter for this command 178 * 179 * @returns The Mime type parameter for this command 180 */ GetMimeType()181 const PvmfMimeString& GetMimeType()const 182 { 183 return iMimeType; 184 } 185 186 /** 187 * This function returns Uuid parameter for this command 188 * 189 * @returns The Uuid parameter for this command 190 */ GetUuid()191 PVUuid GetUuid()const 192 { 193 return iUuid; 194 } 195 196 /** 197 * This function stores Mime type parameter of this command 198 */ SetMimeType(const PvmfMimeString & aMimeType)199 void SetMimeType(const PvmfMimeString& aMimeType) 200 { 201 iMimeType = aMimeType; 202 } 203 204 /** 205 * This function stores the Uuid parameter of this command 206 */ SetUuid(const PVUuid & aUuid)207 void SetUuid(const PVUuid& aUuid) 208 { 209 iUuid = aUuid; 210 } 211 212 int32 iCmdType; 213 PVCommandId iCmdId; 214 OsclAny* iContextData; 215 OsclAny* iParam1; 216 OsclAny* iParam2; 217 OsclAny* iParam3; 218 OSCL_HeapString<OsclMemAllocator> iMimeType; 219 PVUuid iUuid; 220 }; 221 222 223 /** 224 * PVEngineAsyncEvent Class 225 * 226 * PVEngineAsyncEvent class is a data class to hold asynchronous events generated by the engine. The class is meant to be used inside the engine 227 * and not exposed to the interface layer or above. 228 **/ 229 class PVEngineAsyncEvent 230 { 231 public: 232 /** 233 * The constructor for PVEngineCommand which allows the data values to be set. 234 * 235 * @param aCmdType The command type value for this command. The value is an engine-specific 32-bit value. 236 * @param aCmdId The command ID assigned by the engine for this command. 237 * @param aContextData The pointer to the passed-in context data for this command. 238 * 239 * @returns None 240 **/ PVEngineAsyncEvent(int32 aAsyncEventType)241 PVEngineAsyncEvent(int32 aAsyncEventType) : 242 iAsyncEventType(aAsyncEventType) {} 243 244 /** 245 * The copy constructor for PVEngineAsyncEvent. Used mainly for Oscl_Vector. 246 * 247 * @param aAsyncEvent The reference to the source PVEngineAsyncEvent to copy the data values from. 248 * 249 * @returns None 250 **/ PVEngineAsyncEvent(const PVEngineAsyncEvent & aAsyncEvent)251 PVEngineAsyncEvent(const PVEngineAsyncEvent& aAsyncEvent) 252 { 253 iAsyncEventType = aAsyncEvent.iAsyncEventType; 254 } 255 256 /** 257 * This function returns the stored asynchronous event type value. 258 * 259 * @returns The signed 32-bit event type value. 260 **/ GetAsyncEventType()261 int32 GetAsyncEventType()const 262 { 263 return iAsyncEventType; 264 } 265 266 int32 iAsyncEventType; 267 }; 268 269 #endif 270 271