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 ASSETINFOATOMS_H_INCLUDED 19 #define ASSETINFOATOMS_H_INCLUDED 20 21 #ifndef ATOM_H_INCLUDED 22 #include "atom.h" 23 #endif 24 #ifndef A_ISUCCEEDFAIL_H_INCLUDED 25 #include "a_isucceedfail.h" 26 #endif 27 #ifndef FULLATOM_H_INCLUDED 28 #include "fullatom.h" 29 #endif 30 #ifndef ATOMUTILS_H_INCLUDED 31 #include "atomutils.h" 32 #endif 33 #ifndef OSCL_VECTOR_H_INCLUDED 34 #include "oscl_vector.h" 35 #endif 36 37 #define BYTE_ORDER_MASK 0xFEFF 38 39 class PVA_FF_AssetInfoTitleAtom : public PVA_FF_FullAtom 40 { 41 public: 42 PVA_FF_AssetInfoTitleAtom(); ~PVA_FF_AssetInfoTitleAtom()43 virtual ~PVA_FF_AssetInfoTitleAtom() {}; 44 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 45 46 // Member gets setTitleLangCode(const uint16 aLangCode)47 void setTitleLangCode(const uint16 aLangCode) 48 { 49 _langCode = aLangCode; 50 } setTitleNotice(const PVA_FF_UNICODE_HEAP_STRING aTitle)51 void setTitleNotice(const PVA_FF_UNICODE_HEAP_STRING aTitle) 52 { 53 _title = aTitle; 54 recomputeSize(); 55 } 56 virtual void recomputeSize(); 57 private: 58 uint16 _langCode; 59 uint16 _byteOrderMask; 60 PVA_FF_UNICODE_HEAP_STRING _title; 61 }; 62 63 class PVA_FF_AssetInfoDescAtom : public PVA_FF_FullAtom 64 { 65 public: 66 PVA_FF_AssetInfoDescAtom(); ~PVA_FF_AssetInfoDescAtom()67 virtual ~PVA_FF_AssetInfoDescAtom() {}; 68 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 69 70 // Member gets setDescLangCode(uint16 aLangCode)71 void setDescLangCode(uint16 aLangCode) 72 { 73 _langCode = aLangCode; 74 } setDescNotice(PVA_FF_UNICODE_HEAP_STRING aDescription)75 void setDescNotice(PVA_FF_UNICODE_HEAP_STRING aDescription) 76 { 77 _description = aDescription; 78 recomputeSize(); 79 } 80 virtual void recomputeSize(); 81 private: 82 uint16 _langCode; 83 uint16 _byteOrderMask; 84 PVA_FF_UNICODE_HEAP_STRING _description; 85 }; 86 87 class PVA_FF_AssetInfoCopyRightAtom : public PVA_FF_FullAtom 88 { 89 public: 90 PVA_FF_AssetInfoCopyRightAtom(); ~PVA_FF_AssetInfoCopyRightAtom()91 virtual ~PVA_FF_AssetInfoCopyRightAtom() {}; 92 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 93 94 // Member gets setCopyRightLangCode(const uint16 aLangCode)95 void setCopyRightLangCode(const uint16 aLangCode) 96 { 97 _langCode = aLangCode; 98 } setCopyRightString(const PVA_FF_UNICODE_HEAP_STRING aCprt)99 void setCopyRightString(const PVA_FF_UNICODE_HEAP_STRING aCprt) 100 { 101 _cprt = aCprt; 102 recomputeSize(); 103 } 104 virtual void recomputeSize(); 105 private: 106 uint16 _langCode; 107 uint16 _byteOrderMask; 108 PVA_FF_UNICODE_HEAP_STRING _cprt; 109 }; 110 111 class PVA_FF_AssetInfoPerformerAtom : public PVA_FF_FullAtom 112 { 113 public: 114 PVA_FF_AssetInfoPerformerAtom(); ~PVA_FF_AssetInfoPerformerAtom()115 virtual ~PVA_FF_AssetInfoPerformerAtom() {}; 116 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 117 // Member gets setPerfLangCode(uint16 aLangCode)118 void setPerfLangCode(uint16 aLangCode) 119 { 120 _langCode = aLangCode; 121 } setPerfNotice(PVA_FF_UNICODE_HEAP_STRING aPerformer)122 void setPerfNotice(PVA_FF_UNICODE_HEAP_STRING aPerformer) 123 { 124 _performer = aPerformer; 125 recomputeSize(); 126 } 127 virtual void recomputeSize(); 128 private: 129 uint16 _langCode; 130 uint16 _byteOrderMask; 131 PVA_FF_UNICODE_HEAP_STRING _performer; 132 }; 133 134 class PVA_FF_AssetInfoAuthorAtom : public PVA_FF_FullAtom 135 { 136 public: 137 PVA_FF_AssetInfoAuthorAtom(); ~PVA_FF_AssetInfoAuthorAtom()138 virtual ~PVA_FF_AssetInfoAuthorAtom() {}; 139 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 140 // Member gets setAuthorLangCode(uint16 aLangCode)141 void setAuthorLangCode(uint16 aLangCode) 142 { 143 _langCode = aLangCode; 144 } setAuthorNotice(PVA_FF_UNICODE_HEAP_STRING aAuthor)145 void setAuthorNotice(PVA_FF_UNICODE_HEAP_STRING aAuthor) 146 { 147 _author = aAuthor; 148 recomputeSize(); 149 } 150 virtual void recomputeSize(); 151 private: 152 uint16 _langCode; 153 uint16 _byteOrderMask; 154 PVA_FF_UNICODE_HEAP_STRING _author; 155 }; 156 157 class PVA_FF_AssetInfoGenreAtom : public PVA_FF_FullAtom 158 { 159 public: 160 PVA_FF_AssetInfoGenreAtom(); ~PVA_FF_AssetInfoGenreAtom()161 virtual ~PVA_FF_AssetInfoGenreAtom() {}; 162 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 163 // Member gets setGenreLangCode(uint16 aLangCode)164 void setGenreLangCode(uint16 aLangCode) 165 { 166 _langCode = aLangCode; 167 } setGenreNotice(PVA_FF_UNICODE_HEAP_STRING aGenre)168 void setGenreNotice(PVA_FF_UNICODE_HEAP_STRING aGenre) 169 { 170 _genre = aGenre; 171 recomputeSize(); 172 } 173 virtual void recomputeSize(); 174 private: 175 uint16 _langCode; 176 uint16 _byteOrderMask; 177 PVA_FF_UNICODE_HEAP_STRING _genre; 178 179 }; 180 181 class PVA_FF_AssetInfoRatingAtom : public PVA_FF_FullAtom 182 { 183 public: 184 PVA_FF_AssetInfoRatingAtom(); ~PVA_FF_AssetInfoRatingAtom()185 virtual ~PVA_FF_AssetInfoRatingAtom() {}; 186 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 187 // Member gets setRatingLangCode(uint16 aLangCode)188 void setRatingLangCode(uint16 aLangCode) 189 { 190 _langCode = aLangCode; 191 } 192 setRatingEntity(uint32 aRatingEntity)193 void setRatingEntity(uint32 aRatingEntity) 194 { 195 _ratingEntity = aRatingEntity; 196 } 197 setRatingCriteria(uint32 aRatingCriteria)198 void setRatingCriteria(uint32 aRatingCriteria) 199 { 200 _ratingCriteria = aRatingCriteria; 201 } 202 setRatingInfoNotice(PVA_FF_UNICODE_HEAP_STRING aRatingInfo)203 void setRatingInfoNotice(PVA_FF_UNICODE_HEAP_STRING aRatingInfo) 204 { 205 _ratingInfo = aRatingInfo; 206 recomputeSize(); 207 } 208 virtual void recomputeSize(); 209 private: 210 uint16 _langCode; 211 uint16 _byteOrderMask; 212 uint32 _ratingEntity; 213 uint32 _ratingCriteria; 214 PVA_FF_UNICODE_HEAP_STRING _ratingInfo; 215 }; 216 217 class PVA_FF_AssetInfoClassificationAtom : public PVA_FF_FullAtom 218 { 219 public: 220 PVA_FF_AssetInfoClassificationAtom(); ~PVA_FF_AssetInfoClassificationAtom()221 virtual ~PVA_FF_AssetInfoClassificationAtom() {}; 222 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 223 // Member gets setClassificationLangCode(uint16 aLangCode)224 void setClassificationLangCode(uint16 aLangCode) 225 { 226 _langCode = aLangCode; 227 } 228 setClassificationEntity(uint32 aClassificationEntity)229 void setClassificationEntity(uint32 aClassificationEntity) 230 { 231 _classificationEntity = aClassificationEntity; 232 } 233 234 setClassificationTable(uint32 aClassificationTable)235 void setClassificationTable(uint32 aClassificationTable) 236 { 237 _classificationTable = aClassificationTable; 238 } 239 setClassificationInfoNotice(PVA_FF_UNICODE_HEAP_STRING aClassificationInfo)240 void setClassificationInfoNotice(PVA_FF_UNICODE_HEAP_STRING aClassificationInfo) 241 { 242 _classificationInfo = aClassificationInfo; 243 recomputeSize(); 244 } 245 246 virtual void recomputeSize(); 247 private: 248 uint16 _langCode; 249 uint16 _byteOrderMask; 250 uint16 _classificationTable; 251 uint32 _classificationEntity; 252 253 PVA_FF_UNICODE_HEAP_STRING _classificationInfo; 254 255 }; 256 257 class PVA_FF_AssetInfoKeyWordStruct 258 { 259 260 public: PVA_FF_AssetInfoKeyWordStruct()261 PVA_FF_AssetInfoKeyWordStruct() {}; 262 PVA_FF_AssetInfoKeyWordStruct(uint8 , PVA_FF_UNICODE_HEAP_STRING); ~PVA_FF_AssetInfoKeyWordStruct()263 virtual ~PVA_FF_AssetInfoKeyWordStruct() {}; 264 uint32 getSizeofStruct(); 265 bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 266 267 private: 268 uint8 _keyWordSize; 269 PVA_FF_UNICODE_HEAP_STRING _keyWordInfo; 270 uint16 _byteOrderMask; 271 272 }; 273 274 class PVA_FF_AssetInfoKeyWordsAtom : public PVA_FF_FullAtom 275 { 276 public: 277 PVA_FF_AssetInfoKeyWordsAtom(); 278 virtual ~PVA_FF_AssetInfoKeyWordsAtom();//{}; 279 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 280 // Member gets 281 setKeyWordsLangCode(uint16 aLangCode)282 void setKeyWordsLangCode(uint16 aLangCode) 283 { 284 _langCode = aLangCode; 285 } 286 287 void setKeyWord(uint32 aKeyWordBinarySize, 288 PVA_FF_UNICODE_HEAP_STRING aKeyWord); 289 virtual void recomputeSize(); 290 private: 291 uint16 _langCode; 292 uint8 _keyWordCnt; 293 PVA_FF_AssetInfoKeyWordStruct PVA_FF_KeyWordStruct; 294 Oscl_Vector<PVA_FF_AssetInfoKeyWordStruct*, OsclMemAllocator> *_pKeyWordVect; 295 296 }; 297 298 class PVA_FF_AssetInfoLocationInfoAtom : public PVA_FF_FullAtom 299 { 300 public: 301 PVA_FF_AssetInfoLocationInfoAtom(); ~PVA_FF_AssetInfoLocationInfoAtom()302 virtual ~PVA_FF_AssetInfoLocationInfoAtom() {}; 303 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 304 // Member gets setLocationInfoLangCode(uint16 aLangCode)305 void setLocationInfoLangCode(uint16 aLangCode) 306 { 307 _langCode = aLangCode; 308 } 309 setLocationInfoRole(uint8 aLocationInfoRole)310 void setLocationInfoRole(uint8 aLocationInfoRole) 311 { 312 _locationInfoRole = aLocationInfoRole; 313 } 314 setLocationInfoLongitude(uint32 _aLocationInfoLongitude)315 void setLocationInfoLongitude(uint32 _aLocationInfoLongitude) 316 { 317 _locationInfoLongitude = _aLocationInfoLongitude; 318 } 319 setLocationInfoLatitude(uint32 _aLocationInfoLatitude)320 void setLocationInfoLatitude(uint32 _aLocationInfoLatitude) 321 { 322 _locationInfoLatitude = _aLocationInfoLatitude; 323 } 324 setLocationInfoAltitude(uint32 _aLocationInfoAltitude)325 void setLocationInfoAltitude(uint32 _aLocationInfoAltitude) 326 { 327 _locationInfoAltitude = _aLocationInfoAltitude; 328 } 329 setLocationInfoName(PVA_FF_UNICODE_HEAP_STRING aLocationInfoName)330 void setLocationInfoName(PVA_FF_UNICODE_HEAP_STRING aLocationInfoName) 331 { 332 _locationInfoName = aLocationInfoName; 333 recomputeSize(); 334 } 335 setLocationInfoAstrBody(PVA_FF_UNICODE_HEAP_STRING aLocationInfoAstrBody)336 void setLocationInfoAstrBody(PVA_FF_UNICODE_HEAP_STRING aLocationInfoAstrBody) 337 { 338 _locationInfoAstrBody = aLocationInfoAstrBody; 339 recomputeSize(); 340 } 341 setLocationInfoAddNotes(PVA_FF_UNICODE_HEAP_STRING aLocationInfoAddNotes)342 void setLocationInfoAddNotes(PVA_FF_UNICODE_HEAP_STRING aLocationInfoAddNotes) 343 { 344 _locationInfoAddNotes = aLocationInfoAddNotes; 345 recomputeSize(); 346 } 347 virtual void recomputeSize(); 348 private: 349 uint16 _langCode; 350 uint8 _locationInfoRole; 351 352 uint32 _locationInfoLongitude; 353 uint32 _locationInfoLatitude; 354 uint32 _locationInfoAltitude; 355 356 PVA_FF_UNICODE_HEAP_STRING _locationInfoName; 357 PVA_FF_UNICODE_HEAP_STRING _locationInfoAstrBody; 358 PVA_FF_UNICODE_HEAP_STRING _locationInfoAddNotes; 359 uint16 _byteOrderMask; 360 361 }; 362 363 class PVA_FF_AssetInfoAlbumAtom : public PVA_FF_FullAtom 364 { 365 public: 366 PVA_FF_AssetInfoAlbumAtom(); ~PVA_FF_AssetInfoAlbumAtom()367 virtual ~PVA_FF_AssetInfoAlbumAtom() {}; 368 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 369 370 // Member gets setAlbumLangCode(uint16 aLangCode)371 void setAlbumLangCode(uint16 aLangCode) 372 { 373 _langCode = aLangCode; 374 } setAlbumInfo(PVA_FF_UNICODE_HEAP_STRING aAlbumTitle)375 void setAlbumInfo(PVA_FF_UNICODE_HEAP_STRING aAlbumTitle) 376 { 377 _albumTitle = aAlbumTitle; 378 recomputeSize(); 379 } setAlbumTrackNumber(uint8 trackNumber)380 void setAlbumTrackNumber(uint8 trackNumber) 381 { 382 _trackNumber = trackNumber; 383 } 384 virtual void recomputeSize(); 385 private: 386 uint16 _langCode; 387 uint16 _byteOrderMask; 388 uint8 _trackNumber; 389 PVA_FF_UNICODE_HEAP_STRING _albumTitle; 390 }; 391 392 class PVA_FF_AssetInfoRecordingYearAtom : public PVA_FF_FullAtom 393 { 394 public: 395 PVA_FF_AssetInfoRecordingYearAtom(); ~PVA_FF_AssetInfoRecordingYearAtom()396 virtual ~PVA_FF_AssetInfoRecordingYearAtom() {}; 397 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 398 399 // Member gets setRecordingYear(uint16 aRecordingYear)400 void setRecordingYear(uint16 aRecordingYear) 401 { 402 _recordingYear = aRecordingYear; 403 recomputeSize(); 404 } 405 virtual void recomputeSize(); 406 private: 407 uint16 _recordingYear; 408 }; 409 410 #endif // ASSETINFOATOMS_H_INCLUDED 411