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 /* ------------------------------------------------------------------- */
20 /* MPEG-4 UserDataAtom Class */
21 /* ------------------------------------------------------------------- */
22 /*********************************************************************************/
23 /*
24 This UserDataAtom Class is a container atom for informative user-data.
25 */
26
27
28 #define __IMPLEMENT_UserDataAtom__
29
30 #include "userdataatom.h"
31 #include "atomdefs.h"
32
33
getAtomOfType(uint32 type)34 Atom *UserDataAtom::getAtomOfType(uint32 type)
35 {
36 if (type == PVUSER_DATA_ATOM)
37 return _pPVUserDataAtom;
38
39
40 else if (type == META_DATA_ATOM)
41 return _pMetaDataAtom;
42
43 else if (type == PV_CONTENT_TYPE_ATOM)
44 return _pPVContentTypeAtom;
45 else
46 return NULL;
47 }
48
49 typedef Oscl_Vector<AssetInfoTitleAtom*, OsclMemAllocator> assetInfoTitleAtomVecType;
50 typedef Oscl_Vector<AssetInfoDescAtom*, OsclMemAllocator> assetInfoDescAtomVecType;
51 typedef Oscl_Vector<CopyRightAtom*, OsclMemAllocator> copyRightAtomVecType;
52 typedef Oscl_Vector<AssetInfoPerformerAtom*, OsclMemAllocator> assetInfoPerformerAtomVecType;
53 typedef Oscl_Vector<AssetInfoAuthorAtom*, OsclMemAllocator> assetInfoAuthorAtomVecType;
54 typedef Oscl_Vector<AssetInfoGenreAtom*, OsclMemAllocator> assetInfoGenreAtomVecType;
55 typedef Oscl_Vector<AssetInfoRatingAtom*, OsclMemAllocator> assetInfoRatingAtomVecType;
56 typedef Oscl_Vector<AssetInfoClassificationAtom*, OsclMemAllocator> assetInfoClassificationAtomVecType;
57 typedef Oscl_Vector<AssetInfoKeyWordAtom*, OsclMemAllocator> assetInfoKeyWordAtomVecType;
58 typedef Oscl_Vector<AssetInfoLocationAtom*, OsclMemAllocator> assetInfoLocationAtomVecType;
59 typedef Oscl_Vector<AssetInfoAlbumAtom*, OsclMemAllocator> assetInfoAlbumAtomVecType;
60 typedef Oscl_Vector<AssetInfoRecordingYearAtom*, OsclMemAllocator> assetInfoRecordingYearAtomVecType;
61
62
63 // Stream-in Constructor
UserDataAtom(MP4_FF_FILE * fp,uint32 size,uint32 type)64 UserDataAtom::UserDataAtom(MP4_FF_FILE *fp, uint32 size, uint32 type)
65 : Atom(fp, size, type)
66 {
67 _pPVUserDataAtom = NULL;
68
69 _pMetaDataAtom = NULL;
70
71 _pPVContentTypeAtom = NULL;
72
73
74 PV_MP4_FF_NEW(fp->auditCB, assetInfoTitleAtomVecType, (), _pAssetInfoTitleAtomArray);
75 PV_MP4_FF_NEW(fp->auditCB, assetInfoDescAtomVecType, (), _pAssetInfoDescAtomArray);
76 PV_MP4_FF_NEW(fp->auditCB, copyRightAtomVecType, (), _pCopyRightAtomArray);
77 PV_MP4_FF_NEW(fp->auditCB, assetInfoPerformerAtomVecType, (), _pAssetInfoPerformerAtomArray);
78 PV_MP4_FF_NEW(fp->auditCB, assetInfoAuthorAtomVecType, (), _pAssetInfoAuthorAtomArray);
79 PV_MP4_FF_NEW(fp->auditCB, assetInfoGenreAtomVecType, (), _pAssetInfoGenreAtomArray);
80 PV_MP4_FF_NEW(fp->auditCB, assetInfoRatingAtomVecType, (), _pAssetInfoRatingAtomArray);
81 PV_MP4_FF_NEW(fp->auditCB, assetInfoClassificationAtomVecType, (), _pAssetInfoClassificationAtomArray);
82 PV_MP4_FF_NEW(fp->auditCB, assetInfoKeyWordAtomVecType, (), _pAssetInfoKeyWordAtomArray);
83 PV_MP4_FF_NEW(fp->auditCB, assetInfoLocationAtomVecType, (), _pAssetInfoLocationAtomArray);
84 PV_MP4_FF_NEW(fp->auditCB, assetInfoAlbumAtomVecType, (), _pAssetInfoAlbumAtomArray);
85 PV_MP4_FF_NEW(fp->auditCB, assetInfoRecordingYearAtomVecType, (), _pAssetInfoRecordingYearArray);
86
87 uint32 count = _size - DEFAULT_ATOM_SIZE;
88
89 if (_success)
90 {
91 while (count > 0)
92 {
93 uint32 atomType = UNKNOWN_ATOM;
94 uint32 atomSize = 0;
95 uint32 currPtr = 0;
96
97 currPtr = AtomUtils::getCurrentFilePosition(fp);
98 AtomUtils::getNextAtomType(fp, atomSize, atomType);
99
100 if (atomSize > count)
101 {
102 AtomUtils::seekFromStart(fp, currPtr);
103 AtomUtils::seekFromCurrPos(fp, count);
104 count = 0;
105 return;
106 }
107
108 if (atomType == COPYRIGHT_ATOM)
109 {
110 CopyRightAtom *pCopyRightAtom = NULL;
111 PV_MP4_FF_NEW(fp->auditCB, CopyRightAtom, (fp, atomSize, atomType), pCopyRightAtom);
112 if (!pCopyRightAtom->MP4Success())
113 {
114 AtomUtils::seekFromStart(fp, currPtr);
115 AtomUtils::seekFromCurrPos(fp, atomSize);
116 PV_MP4_FF_DELETE(NULL, CopyRightAtom, pCopyRightAtom);
117 pCopyRightAtom = NULL;
118 count -= atomSize;
119 }
120 else
121 {
122 (*_pCopyRightAtomArray).push_back(pCopyRightAtom);
123 pCopyRightAtom->setParent(this);
124 count -= pCopyRightAtom->getSize();
125 }
126 }
127 else if (atomType == PVUSER_DATA_ATOM)
128 {
129 PV_MP4_FF_NEW(fp->auditCB, PVUserDataAtom, (fp, atomSize, atomType), _pPVUserDataAtom);
130 if (!_pPVUserDataAtom->MP4Success())
131 {
132 AtomUtils::seekFromStart(fp, currPtr);
133 AtomUtils::seekFromCurrPos(fp, atomSize);
134 PV_MP4_FF_DELETE(NULL, PVUserDataAtom, _pPVUserDataAtom);
135 _pPVUserDataAtom = NULL;
136 count -= atomSize;
137 }
138 else
139 count -= _pPVUserDataAtom->getSize();
140 }
141 else if (atomType == PV_CONTENT_TYPE_ATOM)
142 {
143 PV_MP4_FF_NEW(fp->auditCB, PVContentTypeAtom, (fp, atomSize, atomType), _pPVContentTypeAtom);
144 if (!_pPVContentTypeAtom->MP4Success())
145 {
146 AtomUtils::seekFromStart(fp, currPtr);
147 AtomUtils::seekFromCurrPos(fp, atomSize);
148 PV_MP4_FF_DELETE(NULL, PVContentTypeAtom, _pPVContentTypeAtom);
149 _pPVContentTypeAtom = NULL;
150 count -= atomSize;
151 }
152 else
153 count -= _pPVContentTypeAtom->getSize();
154 }
155 else if (atomType == ASSET_INFO_TITLE_ATOM)
156 {
157 AssetInfoTitleAtom *pAssetInfoTitleAtom = NULL;
158 PV_MP4_FF_NEW(fp->auditCB, AssetInfoTitleAtom, (fp, atomSize, atomType), pAssetInfoTitleAtom);
159
160 if (!pAssetInfoTitleAtom->MP4Success())
161 {
162 AtomUtils::seekFromStart(fp, currPtr);
163 AtomUtils::seekFromCurrPos(fp, atomSize);
164 PV_MP4_FF_DELETE(NULL, AssetInfoTitleAtom, pAssetInfoTitleAtom);
165 pAssetInfoTitleAtom = NULL;
166 count -= atomSize;
167 }
168 else
169 {
170 (*_pAssetInfoTitleAtomArray).push_back(pAssetInfoTitleAtom);
171 pAssetInfoTitleAtom->setParent(this);
172 count -= pAssetInfoTitleAtom->getSize();
173 }
174 }
175 else if (atomType == ASSET_INFO_DESCP_ATOM)
176 {
177 AssetInfoDescAtom *pAssetInfoDescAtom = NULL;
178 PV_MP4_FF_NEW(fp->auditCB, AssetInfoDescAtom, (fp, atomSize, atomType), pAssetInfoDescAtom);
179
180 if (!pAssetInfoDescAtom->MP4Success())
181 {
182 AtomUtils::seekFromStart(fp, currPtr);
183 AtomUtils::seekFromCurrPos(fp, atomSize);
184 PV_MP4_FF_DELETE(NULL, AssetInfoDescAtom, pAssetInfoDescAtom);
185 pAssetInfoDescAtom = NULL;
186 count -= atomSize;
187 }
188 else
189 {
190 (*_pAssetInfoDescAtomArray).push_back(pAssetInfoDescAtom);
191 pAssetInfoDescAtom->setParent(this);
192 count -= pAssetInfoDescAtom->getSize();
193 }
194
195 }
196 else if (atomType == ASSET_INFO_PERF_ATOM)
197 {
198 AssetInfoPerformerAtom * pAssetInfoPerformerAtom = NULL;
199 PV_MP4_FF_NEW(fp->auditCB, AssetInfoPerformerAtom, (fp, atomSize, atomType), pAssetInfoPerformerAtom);
200
201 if (!pAssetInfoPerformerAtom->MP4Success())
202 {
203 AtomUtils::seekFromStart(fp, currPtr);
204 AtomUtils::seekFromCurrPos(fp, atomSize);
205 PV_MP4_FF_DELETE(NULL, AssetInfoPerformerAtom, pAssetInfoPerformerAtom);
206 pAssetInfoPerformerAtom = NULL;
207 count -= atomSize;
208 }
209 else
210 {
211 (*_pAssetInfoPerformerAtomArray).push_back(pAssetInfoPerformerAtom);
212 pAssetInfoPerformerAtom->setParent(this);
213 count -= pAssetInfoPerformerAtom->getSize();
214 }
215 }
216 else if (atomType == ASSET_INFO_AUTHOR_ATOM)
217 {
218 AssetInfoAuthorAtom * pAssetInfoAuthorAtom = NULL;
219 PV_MP4_FF_NEW(fp->auditCB, AssetInfoAuthorAtom, (fp, atomSize, atomType), pAssetInfoAuthorAtom);
220 if (!pAssetInfoAuthorAtom->MP4Success())
221 {
222 AtomUtils::seekFromStart(fp, currPtr);
223 AtomUtils::seekFromCurrPos(fp, atomSize);
224 PV_MP4_FF_DELETE(NULL, AssetInfoAuthorAtom, pAssetInfoAuthorAtom);
225 pAssetInfoAuthorAtom = NULL;
226 count -= atomSize;
227 }
228 else
229 {
230 (*_pAssetInfoAuthorAtomArray).push_back(pAssetInfoAuthorAtom);
231 pAssetInfoAuthorAtom->setParent(this);
232 count -= pAssetInfoAuthorAtom->getSize();
233 }
234 }
235 else if (atomType == ASSET_INFO_GENRE_ATOM)
236 {
237 AssetInfoGenreAtom * pAssetInfoGenreAtom = NULL;
238 PV_MP4_FF_NEW(fp->auditCB, AssetInfoGenreAtom, (fp, atomSize, atomType), pAssetInfoGenreAtom);
239
240 if (!pAssetInfoGenreAtom->MP4Success())
241 {
242 AtomUtils::seekFromStart(fp, currPtr);
243 AtomUtils::seekFromCurrPos(fp, atomSize);
244 PV_MP4_FF_DELETE(NULL, AssetInfoGenreAtom, pAssetInfoGenreAtom);
245 pAssetInfoGenreAtom = NULL;
246 count -= atomSize;
247 }
248 else
249 {
250 (*_pAssetInfoGenreAtomArray).push_back(pAssetInfoGenreAtom);
251 pAssetInfoGenreAtom->setParent(this);
252 count -= pAssetInfoGenreAtom->getSize();
253 }
254 }
255 else if (atomType == ASSET_INFO_RATING_ATOM)
256 {
257 AssetInfoRatingAtom * pAssetInfoRatingAtom = NULL;
258 PV_MP4_FF_NEW(fp->auditCB, AssetInfoRatingAtom, (fp, atomSize, atomType), pAssetInfoRatingAtom);
259
260 if (!pAssetInfoRatingAtom->MP4Success())
261 {
262 AtomUtils::seekFromStart(fp, currPtr);
263 AtomUtils::seekFromCurrPos(fp, atomSize);
264 PV_MP4_FF_DELETE(NULL, AssetInfoRatingAtom, pAssetInfoRatingAtom);
265 pAssetInfoRatingAtom = NULL;
266 count -= atomSize;
267 }
268 else
269 {
270 (*_pAssetInfoRatingAtomArray).push_back(pAssetInfoRatingAtom);
271 pAssetInfoRatingAtom->setParent(this);
272 count -= pAssetInfoRatingAtom->getSize();
273 }
274 }
275 else if (atomType == ASSET_INFO_CLSF_ATOM)
276 {
277 AssetInfoClassificationAtom * pAssetInfoClassificationAtom = NULL;
278 PV_MP4_FF_NEW(fp->auditCB, AssetInfoClassificationAtom, (fp, atomSize, atomType), pAssetInfoClassificationAtom);
279
280 if (!pAssetInfoClassificationAtom->MP4Success())
281 {
282 AtomUtils::seekFromStart(fp, currPtr);
283 AtomUtils::seekFromCurrPos(fp, atomSize);
284 PV_MP4_FF_DELETE(NULL, AssetInfoClassificationAtom, pAssetInfoClassificationAtom);
285 pAssetInfoClassificationAtom = NULL;
286 count -= atomSize;
287 }
288 else
289 {
290 (*_pAssetInfoClassificationAtomArray).push_back(pAssetInfoClassificationAtom);
291 pAssetInfoClassificationAtom->setParent(this);
292 count -= pAssetInfoClassificationAtom->getSize();
293 }
294 }
295 else if (atomType == ASSET_INFO_KEYWORD_ATOM)
296 {
297 AssetInfoKeyWordAtom * pAssetInfoKeyWordAtom = NULL;
298 PV_MP4_FF_NEW(fp->auditCB, AssetInfoKeyWordAtom, (fp, atomSize, atomType), pAssetInfoKeyWordAtom);
299
300 if (!pAssetInfoKeyWordAtom->MP4Success())
301 {
302 AtomUtils::seekFromStart(fp, currPtr);
303 AtomUtils::seekFromCurrPos(fp, atomSize);
304 PV_MP4_FF_DELETE(NULL, AssetInfoKeyWordAtom, pAssetInfoKeyWordAtom);
305 pAssetInfoKeyWordAtom = NULL;
306 count -= atomSize;
307 }
308 else
309 {
310 (*_pAssetInfoKeyWordAtomArray).push_back(pAssetInfoKeyWordAtom);
311 pAssetInfoKeyWordAtom->setParent(this);
312 count -= pAssetInfoKeyWordAtom->getSize();
313 }
314 }
315
316 else if (atomType == ASSET_INFO_LOCATION_ATOM)
317 {
318 AssetInfoLocationAtom * pAssetInfoLocationAtom = NULL;
319 PV_MP4_FF_NEW(fp->auditCB, AssetInfoLocationAtom, (fp, atomSize, atomType), pAssetInfoLocationAtom);
320
321 if (!pAssetInfoLocationAtom->MP4Success())
322 {
323 AtomUtils::seekFromStart(fp, currPtr);
324 AtomUtils::seekFromCurrPos(fp, atomSize);
325 PV_MP4_FF_DELETE(NULL, AssetInfoLocationAtom, pAssetInfoLocationAtom);
326 pAssetInfoLocationAtom = NULL;
327 count -= atomSize;
328 }
329 else
330 {
331 (*_pAssetInfoLocationAtomArray).push_back(pAssetInfoLocationAtom);
332 pAssetInfoLocationAtom->setParent(this);
333 count -= pAssetInfoLocationAtom->getSize();
334 }
335 }
336 else if (atomType == ASSET_INFO_ALBUM_ATOM)
337 {
338 AssetInfoAlbumAtom * pAssetInfoAlbumAtom = NULL;
339 PV_MP4_FF_NEW(fp->auditCB, AssetInfoAlbumAtom, (fp, atomSize, atomType), pAssetInfoAlbumAtom);
340
341 if (!pAssetInfoAlbumAtom->MP4Success())
342 {
343 AtomUtils::seekFromStart(fp, currPtr);
344 AtomUtils::seekFromCurrPos(fp, atomSize);
345 PV_MP4_FF_DELETE(NULL, AssetInfoAlbumAtom, pAssetInfoAlbumAtom);
346 pAssetInfoAlbumAtom = NULL;
347 count -= atomSize;
348 }
349 else
350 {
351 (*_pAssetInfoAlbumAtomArray).push_back(pAssetInfoAlbumAtom);
352 pAssetInfoAlbumAtom->setParent(this);
353 count -= pAssetInfoAlbumAtom->getSize();
354 }
355 }
356 else if (atomType == ASSET_INFO_YRRC_ATOM)
357 {
358 AssetInfoRecordingYearAtom * pAssetInfoRecordingYearAtom = NULL;
359 PV_MP4_FF_NEW(fp->auditCB, AssetInfoRecordingYearAtom, (fp, atomSize, atomType), pAssetInfoRecordingYearAtom);
360
361 if (!pAssetInfoRecordingYearAtom->MP4Success())
362 {
363 AtomUtils::seekFromStart(fp, currPtr);
364 AtomUtils::seekFromCurrPos(fp, atomSize);
365 PV_MP4_FF_DELETE(NULL, AssetInfoRecordingYearAtom, pAssetInfoRecordingYearAtom);
366 pAssetInfoRecordingYearAtom = NULL;
367 count -= atomSize;
368 }
369 else
370 {
371 (*_pAssetInfoRecordingYearArray).push_back(pAssetInfoRecordingYearAtom);
372 pAssetInfoRecordingYearAtom->setParent(this);
373 count -= pAssetInfoRecordingYearAtom->getSize();
374 }
375 }
376
377 else if (atomType == META_DATA_ATOM)
378 {
379 if (_pMetaDataAtom == NULL)
380 {
381 PV_MP4_FF_NEW(fp->auditCB, MetaDataAtom, (fp, atomSize, atomType), _pMetaDataAtom);
382
383 if (!_pMetaDataAtom->MP4Success())
384 {
385 AtomUtils::seekFromStart(fp, currPtr);
386 AtomUtils::seekFromCurrPos(fp, atomSize);
387 PV_MP4_FF_DELETE(NULL, MetaDataAtom, _pMetaDataAtom);
388 _pMetaDataAtom = NULL;
389 count -= atomSize;
390 }
391 else
392 count -= _pMetaDataAtom->getSize();
393 }
394 else
395 {
396 count -= atomSize;
397 atomSize -= DEFAULT_ATOM_SIZE;
398 AtomUtils::seekFromCurrPos(fp, atomSize);
399 }
400 }
401
402 else
403 {
404 // skip unknown atom
405 if (atomSize < DEFAULT_ATOM_SIZE)
406 {
407 //lost sync
408 AtomUtils::seekFromStart(fp, currPtr);
409 AtomUtils::seekFromCurrPos(fp, count);
410 count = 0;
411 return;
412 }
413 count -= atomSize;
414 atomSize -= DEFAULT_ATOM_SIZE;
415 AtomUtils::seekFromCurrPos(fp, atomSize);
416 }
417 }
418 }
419 else
420 {
421 _mp4ErrorCode = READ_USER_DATA_ATOM_FAILED;
422 }
423
424 }
425
426
427 // Destructor
~UserDataAtom()428 UserDataAtom::~UserDataAtom()
429 {
430 if (_pPVUserDataAtom != NULL)
431 {
432 PV_MP4_FF_DELETE(NULL, PVUserDataAtom, _pPVUserDataAtom);
433 }
434
435 if (_pPVContentTypeAtom != NULL)
436 {
437 PV_MP4_FF_DELETE(NULL, PVContentTypeAtom, _pPVContentTypeAtom);
438 }
439
440
441 if (_pMetaDataAtom != NULL)
442 {
443 PV_MP4_FF_DELETE(NULL, MetaDataAtom, _pMetaDataAtom);
444 }
445
446
447 if (_pCopyRightAtomArray != NULL)
448 {
449 // CLEAN UP VECTOR!!
450 for (uint32 i = 0; i < _pCopyRightAtomArray->size(); i++)
451 {
452 PV_MP4_FF_DELETE(NULL, CopyRightAtom, (*_pCopyRightAtomArray)[i]);
453 }
454 PV_MP4_FF_TEMPLATED_DELETE(NULL, copyRightAtomVecType, Oscl_Vector, _pCopyRightAtomArray);
455 }
456 if (_pAssetInfoTitleAtomArray != NULL)
457 {
458 // CLEAN UP VECTOR!!
459 for (uint32 i = 0; i < _pAssetInfoTitleAtomArray->size(); i++)
460 {
461 PV_MP4_FF_DELETE(NULL, AssetInfoTitleAtom, (*_pAssetInfoTitleAtomArray)[i]);
462 }
463 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoTitleAtomVecType, Oscl_Vector, _pAssetInfoTitleAtomArray);
464 }
465 if (_pAssetInfoDescAtomArray != NULL)
466 {
467 // CLEAN UP VECTOR!!
468 for (uint32 i = 0; i < _pAssetInfoDescAtomArray->size(); i++)
469 {
470 PV_MP4_FF_DELETE(NULL, AssetInfoDescAtom, (*_pAssetInfoDescAtomArray)[i]);
471 }
472 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoDescAtomVecType, Oscl_Vector, _pAssetInfoDescAtomArray);
473 }
474 if (_pAssetInfoPerformerAtomArray != NULL)
475 {
476 // CLEAN UP VECTOR!!
477 for (uint32 i = 0; i < _pAssetInfoPerformerAtomArray->size(); i++)
478 {
479 PV_MP4_FF_DELETE(NULL, AssetInfoPerformerAtom, (*_pAssetInfoPerformerAtomArray)[i]);
480 }
481 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoPerformerAtomVecType, Oscl_Vector, _pAssetInfoPerformerAtomArray);
482 }
483 if (_pAssetInfoAuthorAtomArray != NULL)
484 {
485 // CLEAN UP VECTOR!!
486 for (uint32 i = 0; i < _pAssetInfoAuthorAtomArray->size(); i++)
487 {
488 PV_MP4_FF_DELETE(NULL, AssetInfoAuthorAtom, (*_pAssetInfoAuthorAtomArray)[i]);
489 }
490 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoAuthorAtomVecType, Oscl_Vector, _pAssetInfoAuthorAtomArray);
491 }
492 if (_pAssetInfoGenreAtomArray != NULL)
493 {
494 // CLEAN UP VECTOR!!
495 for (uint32 i = 0; i < _pAssetInfoGenreAtomArray->size(); i++)
496 {
497 PV_MP4_FF_DELETE(NULL, AssetInfoGenreAtom, (*_pAssetInfoGenreAtomArray)[i]);
498 }
499 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoGenreAtomVecType, Oscl_Vector, _pAssetInfoGenreAtomArray);
500 }
501 if (_pAssetInfoRatingAtomArray != NULL)
502 {
503 // CLEAN UP VECTOR!!
504 for (uint32 i = 0; i < _pAssetInfoRatingAtomArray->size(); i++)
505 {
506 PV_MP4_FF_DELETE(NULL, AssetInfoRatingAtom, (*_pAssetInfoRatingAtomArray)[i]);
507 }
508 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoRatingAtomVecType, Oscl_Vector, _pAssetInfoRatingAtomArray);
509 }
510 if (_pAssetInfoClassificationAtomArray != NULL)
511 {
512 // CLEAN UP VECTOR!!
513 for (uint32 i = 0; i < _pAssetInfoClassificationAtomArray->size(); i++)
514 {
515 PV_MP4_FF_DELETE(NULL, AssetInfoClassificationAtom, (*_pAssetInfoClassificationAtomArray)[i]);
516 }
517 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoClassificationAtomVecType, Oscl_Vector, _pAssetInfoClassificationAtomArray);
518 }
519 if (_pAssetInfoKeyWordAtomArray != NULL)
520 {
521 // CLEAN UP VECTOR!!
522 for (uint32 i = 0; i < _pAssetInfoKeyWordAtomArray->size(); i++)
523 {
524 PV_MP4_FF_DELETE(NULL, AssetInfoKeyWordAtom, (*_pAssetInfoKeyWordAtomArray)[i]);
525 }
526 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoKeyWordAtomVecType, Oscl_Vector, _pAssetInfoKeyWordAtomArray);
527 }
528 if (_pAssetInfoLocationAtomArray != NULL)
529 {
530 // CLEAN UP VECTOR!!
531 for (uint32 i = 0; i < _pAssetInfoLocationAtomArray->size(); i++)
532 {
533 PV_MP4_FF_DELETE(NULL, AssetInfoLocationAtom, (*_pAssetInfoLocationAtomArray)[i]);
534 }
535 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoLocationAtomVecType, Oscl_Vector, _pAssetInfoLocationAtomArray);
536 }
537
538 if (_pAssetInfoAlbumAtomArray != NULL)
539 {
540 // CLEAN UP VECTOR!!
541 for (uint32 i = 0; i < _pAssetInfoAlbumAtomArray->size(); i++)
542 {
543 PV_MP4_FF_DELETE(NULL, AssetInfoAlbumAtom, (*_pAssetInfoAlbumAtomArray)[i]);
544 }
545 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoAlbumAtomVecType, Oscl_Vector, _pAssetInfoAlbumAtomArray);
546 }
547
548 if (_pAssetInfoRecordingYearArray != NULL)
549 {
550 // CLEAN UP VECTOR!!
551 for (uint32 i = 0; i < _pAssetInfoRecordingYearArray->size(); i++)
552 {
553 PV_MP4_FF_DELETE(NULL, AssetInfoRecordingYearAtom, (*_pAssetInfoRecordingYearArray)[i]);
554 }
555 PV_MP4_FF_TEMPLATED_DELETE(NULL, assetInfoRecordingYearAtomVecType, Oscl_Vector, _pAssetInfoRecordingYearArray);
556 }
557
558
559
560 }
561
562
563 CopyRightAtom *
getCopyRightAtomAt(int32 index)564 UserDataAtom::getCopyRightAtomAt(int32 index)
565 {
566 if ((_pCopyRightAtomArray->size() == 0) ||
567 ((uint32)index >= (_pCopyRightAtomArray->size())))
568 {
569 return NULL;
570 }
571 else
572 {
573 return (*_pCopyRightAtomArray)[index];
574 }
575 }
576
577 AssetInfoTitleAtom *
getAssetInfoTitleAtomAt(int32 index)578 UserDataAtom::getAssetInfoTitleAtomAt(int32 index)
579 {
580 if ((_pAssetInfoTitleAtomArray->size() == 0) ||
581 ((uint32)index >= (_pAssetInfoTitleAtomArray->size())))
582 {
583 return NULL;
584 }
585 else
586 {
587 return (*_pAssetInfoTitleAtomArray)[index];
588 }
589 }
590
591 AssetInfoDescAtom *
getAssetInfoDescAtomAt(int32 index)592 UserDataAtom::getAssetInfoDescAtomAt(int32 index)
593 {
594 if ((_pAssetInfoDescAtomArray->size() == 0) ||
595 ((uint32)index >= (_pAssetInfoDescAtomArray->size())))
596 {
597 return NULL;
598 }
599 else
600 {
601 return (*_pAssetInfoDescAtomArray)[index];
602 }
603 }
604
605 AssetInfoPerformerAtom *
getAssetInfoPerformerAtomAt(int32 index)606 UserDataAtom::getAssetInfoPerformerAtomAt(int32 index)
607 {
608 if ((_pAssetInfoPerformerAtomArray->size() == 0) ||
609 ((uint32)index >= (_pAssetInfoPerformerAtomArray->size())))
610 {
611 return NULL;
612 }
613 else
614 {
615 return (*_pAssetInfoPerformerAtomArray)[index];
616 }
617 }
618
619 AssetInfoAuthorAtom *
getAssetInfoAuthorAtomAt(int32 index)620 UserDataAtom::getAssetInfoAuthorAtomAt(int32 index)
621 {
622 if ((_pAssetInfoAuthorAtomArray->size() == 0) ||
623 ((uint32)index >= (_pAssetInfoAuthorAtomArray->size())))
624 {
625 return NULL;
626 }
627 else
628 {
629 return (*_pAssetInfoAuthorAtomArray)[index];
630 }
631 }
632
633 AssetInfoGenreAtom *
getAssetInfoGenreAtomAt(int32 index)634 UserDataAtom::getAssetInfoGenreAtomAt(int32 index)
635 {
636 if ((_pAssetInfoGenreAtomArray->size() == 0) ||
637 ((uint32)index >= (_pAssetInfoGenreAtomArray->size())))
638 {
639 return NULL;
640 }
641 else
642 {
643 return (*_pAssetInfoGenreAtomArray)[index];
644 }
645 }
646
647 AssetInfoRatingAtom *
getAssetInfoRatingAtomAt(int32 index)648 UserDataAtom::getAssetInfoRatingAtomAt(int32 index)
649 {
650 if ((_pAssetInfoRatingAtomArray->size() == 0) ||
651 ((uint32)index >= (_pAssetInfoRatingAtomArray->size())))
652 {
653 return NULL;
654 }
655 else
656 {
657 return (*_pAssetInfoRatingAtomArray)[index];
658 }
659 }
660
661 AssetInfoClassificationAtom *
getAssetInfoClassificationAtomAt(int32 index)662 UserDataAtom::getAssetInfoClassificationAtomAt(int32 index)
663 {
664 if ((_pAssetInfoClassificationAtomArray->size() == 0) ||
665 ((uint32)index >= (_pAssetInfoClassificationAtomArray->size())))
666 {
667 return NULL;
668 }
669 else
670 {
671 return (*_pAssetInfoClassificationAtomArray)[index];
672 }
673 }
674
675 AssetInfoKeyWordAtom *
getAssetInfoKeyWordAtomAt(int32 index)676 UserDataAtom::getAssetInfoKeyWordAtomAt(int32 index)
677 {
678 if ((_pAssetInfoKeyWordAtomArray->size() == 0) ||
679 ((uint32)index >= (_pAssetInfoKeyWordAtomArray->size())))
680 {
681 return NULL;
682 }
683 else
684 {
685 return (*_pAssetInfoKeyWordAtomArray)[index];
686 }
687 }
688
689 AssetInfoLocationAtom *
getAssetInfoLocationAtomAt(int32 index)690 UserDataAtom::getAssetInfoLocationAtomAt(int32 index)
691 {
692 if ((_pAssetInfoLocationAtomArray->size() == 0) ||
693 ((uint32)index >= (_pAssetInfoLocationAtomArray->size())))
694 {
695 return NULL;
696 }
697 else
698 {
699 return (*_pAssetInfoLocationAtomArray)[index];
700 }
701 }
702
703 AssetInfoAlbumAtom *
getAssetInfoAlbumAtomAt(int32 index)704 UserDataAtom::getAssetInfoAlbumAtomAt(int32 index)
705 {
706 if ((_pAssetInfoAlbumAtomArray->size() == 0) ||
707 ((uint32)index >= (_pAssetInfoAlbumAtomArray->size())))
708 {
709 return NULL;
710 }
711 else
712 {
713 return (*_pAssetInfoAlbumAtomArray)[index];
714 }
715 }
716
717 AssetInfoRecordingYearAtom *
getAssetInfoRecordingYearAtomAt(int32 index)718 UserDataAtom::getAssetInfoRecordingYearAtomAt(int32 index)
719 {
720 if ((_pAssetInfoRecordingYearArray->size() == 0) ||
721 ((uint32)index >= (_pAssetInfoRecordingYearArray->size())))
722 {
723 return NULL;
724 }
725 else
726 {
727 return (*_pAssetInfoRecordingYearArray)[index];
728 }
729 }
730
731