• 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 ASSETINFOATOMS_H_INCLUDED
19 #define ASSETINFOATOMS_H_INCLUDED
20 
21 #ifndef ATOM_H_INCLUDED
22 #include "atom.h"
23 #endif
24 #ifndef ISUCCEEDFAIL_H_INCLUDED
25 #include "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 #ifndef ATOMDEFS_H_INCLUDED
37 #include "atomdefs.h"
38 #endif
39 
40 class AssestInfoBaseParser
41 {
42     public:
43         AssestInfoBaseParser(MP4_FF_FILE *fp,
44                              uint32 size,
45                              uint32 sizeofDataFieldBeforeString = 2);
46 
~AssestInfoBaseParser()47         virtual ~AssestInfoBaseParser() {};
48 
getLangCode()49         uint16 getLangCode() const
50         {
51             return _dataPriorToString;
52         }
getInfoNotice(MP4FFParserOriginalCharEnc & charType)53         OSCL_wString& getInfoNotice(MP4FFParserOriginalCharEnc &charType)
54         {
55             charType = _charType;
56             return _infoNotice;
57         }
updateInfoNotice(OSCL_wString & aInfo)58         void updateInfoNotice(OSCL_wString& aInfo)
59         {
60             _infoNotice += aInfo;
61         }
GetMP4Success()62         bool GetMP4Success()
63         {
64             return _success;
65         }
66 
67     private:
68         bool        _success;
69         uint16      _dataPriorToString;
70         OSCL_wHeapString<OsclMemAllocator> _infoNotice;
71         MP4FFParserOriginalCharEnc _charType;
72 };
73 
74 class AssetInfoTitleAtom : public FullAtom
75 {
76 
77     public:
78         AssetInfoTitleAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
79         virtual ~AssetInfoTitleAtom();
80 
81         // Member gets
getTitleLangCode()82         uint16 getTitleLangCode() const
83         {
84             if (_pAssetInfoBaseParser != NULL)
85             {
86                 return _pAssetInfoBaseParser->getLangCode();
87             }
88             return 0;
89         }
getTitleNotice(MP4FFParserOriginalCharEnc & charType)90         OSCL_wString& getTitleNotice(MP4FFParserOriginalCharEnc &charType)
91         {
92             if (_pAssetInfoBaseParser != NULL)
93             {
94                 return _pAssetInfoBaseParser->getInfoNotice(charType);
95             }
96             return _defaultTitle;
97         }
98 
99     private:
100         OSCL_wHeapString<OsclMemAllocator> _defaultTitle;
101         AssestInfoBaseParser* _pAssetInfoBaseParser;
102 };
103 
104 typedef Oscl_Vector<AssestInfoBaseParser*, OsclMemAllocator> assestInfoBaseParserVecType;
105 
106 class AssetInfoDescAtom : public FullAtom
107 {
108 
109     public:
110         AssetInfoDescAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
111         virtual ~AssetInfoDescAtom();
112 
113         // Member gets
getDescLangCode()114         uint16 getDescLangCode() const
115         {
116             if (_pAssetInfoBaseParser != NULL)
117             {
118                 return _pAssetInfoBaseParser->getLangCode();
119             }
120             return 0;
121         }
getDescNotice(MP4FFParserOriginalCharEnc & charType)122         OSCL_wString& getDescNotice(MP4FFParserOriginalCharEnc &charType)
123         {
124             if (_pAssetInfoBaseParser != NULL)
125             {
126                 return _pAssetInfoBaseParser->getInfoNotice(charType);
127             }
128             return _defaultDesc;
129         }
130 
131     private:
132         OSCL_wHeapString<OsclMemAllocator> _defaultDesc;
133         AssestInfoBaseParser* _pAssetInfoBaseParser;
134 };
135 
136 class AssetInfoPerformerAtom : public FullAtom
137 {
138     public:
139         AssetInfoPerformerAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
140         virtual ~AssetInfoPerformerAtom();
141 
142         // Member gets
getPerfLangCode()143         uint16 getPerfLangCode() const
144         {
145             if (_pAssetInfoBaseParser != NULL)
146             {
147                 return _pAssetInfoBaseParser->getLangCode();
148             }
149             return 0;
150         }
getPerfNotice(MP4FFParserOriginalCharEnc & charType)151         OSCL_wString& getPerfNotice(MP4FFParserOriginalCharEnc &charType)
152         {
153             if (_pAssetInfoBaseParser != NULL)
154             {
155                 return _pAssetInfoBaseParser->getInfoNotice(charType);
156             }
157             return _defaultPerf;
158         }
159 
160     private:
161         OSCL_wHeapString<OsclMemAllocator> _defaultPerf;
162         AssestInfoBaseParser* _pAssetInfoBaseParser;
163 };
164 
165 class AssetInfoAuthorAtom : public FullAtom
166 {
167     public:
168         AssetInfoAuthorAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
169         virtual ~AssetInfoAuthorAtom();
170 
171         // Member gets
getAuthorLangCode()172         uint16 getAuthorLangCode() const
173         {
174             if (_pAssetInfoBaseParser != NULL)
175             {
176                 return _pAssetInfoBaseParser->getLangCode();
177             }
178             return 0;
179         }
getAuthorNotice(MP4FFParserOriginalCharEnc & charType)180         OSCL_wString& getAuthorNotice(MP4FFParserOriginalCharEnc &charType)
181         {
182             if (_pAssetInfoBaseParser != NULL)
183             {
184                 return _pAssetInfoBaseParser->getInfoNotice(charType);
185             }
186             return _defaultAuthor;
187         }
188 
189     private:
190         OSCL_wHeapString<OsclMemAllocator> _defaultAuthor;
191         AssestInfoBaseParser* _pAssetInfoBaseParser;
192 };
193 
194 class AssetInfoGenreAtom : public FullAtom
195 {
196     public:
197         AssetInfoGenreAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
198         virtual ~AssetInfoGenreAtom();
199 
200         // Member gets
getGenreLangCode()201         uint16 getGenreLangCode() const
202         {
203             if (_pAssetInfoBaseParser != NULL)
204             {
205                 return _pAssetInfoBaseParser->getLangCode();
206             }
207             return 0;
208         }
getGenreNotice(MP4FFParserOriginalCharEnc & charType)209         OSCL_wString& getGenreNotice(MP4FFParserOriginalCharEnc &charType)
210         {
211             if (_pAssetInfoBaseParser != NULL)
212             {
213                 return _pAssetInfoBaseParser->getInfoNotice(charType);
214             }
215             return _defaultGenre;
216         }
217 
218     private:
219         OSCL_wHeapString<OsclMemAllocator> _defaultGenre;
220         AssestInfoBaseParser* _pAssetInfoBaseParser;
221 };
222 
223 class AssetInfoRatingAtom : public FullAtom
224 {
225     public:
226         AssetInfoRatingAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
227         virtual ~AssetInfoRatingAtom();
228 
229         // Member gets
getRatingEntity()230         uint32      getRatingEntity() const
231         {
232             return _ratingEntity;
233         }
234 
getRatingCriteria()235         uint32      getRatingCriteria() const
236         {
237             return _ratingCriteria;
238         }
239 
getRatingLangCode()240         uint16      getRatingLangCode() const
241         {
242             if (_pAssetInfoBaseParser != NULL)
243             {
244                 return _pAssetInfoBaseParser->getLangCode();
245             }
246             return 0;
247         }
getRatingNotice(MP4FFParserOriginalCharEnc & charType)248         OSCL_wString& getRatingNotice(MP4FFParserOriginalCharEnc &charType)
249         {
250             if (_pAssetInfoBaseParser != NULL)
251             {
252                 return _pAssetInfoBaseParser->getInfoNotice(charType);
253             }
254             return _defaultRating;
255         }
256 
257     private:
258         OSCL_wHeapString<OsclMemAllocator> _defaultRating;
259         uint32                _ratingEntity;
260         uint32                _ratingCriteria;
261         AssestInfoBaseParser* _pAssetInfoBaseParser;
262 };
263 
264 class AssetInfoClassificationAtom : public FullAtom
265 {
266     public:
267         AssetInfoClassificationAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
268         virtual ~AssetInfoClassificationAtom();
269 
270         // Member gets
getClassificationEntity()271         uint32      getClassificationEntity() const
272         {
273             return _classificationEntity;
274         }
getClassificationTable()275         uint16      getClassificationTable() const
276         {
277             return _classificationTable;
278         }
getClassificationLangCode()279         uint16      getClassificationLangCode() const
280         {
281             if (_pAssetInfoBaseParser != NULL)
282             {
283                 return _pAssetInfoBaseParser->getLangCode();
284             }
285             return 0;
286         }
getClassificationNotice(MP4FFParserOriginalCharEnc & charType)287         OSCL_wString& getClassificationNotice(MP4FFParserOriginalCharEnc &charType)
288         {
289             if (_pAssetInfoBaseParser != NULL)
290             {
291                 return _pAssetInfoBaseParser->getInfoNotice(charType);
292             }
293             return _defaultClassification;
294         }
295 
296     private:
297         OSCL_wHeapString<OsclMemAllocator> _defaultClassification;
298         uint32                _classificationEntity;
299         uint16                _classificationTable;
300         AssestInfoBaseParser* _pAssetInfoBaseParser;
301 };
302 
303 class AssestInfoKeyWord
304 {
305     public:
306         AssestInfoKeyWord(MP4_FF_FILE *fp);
307         OSCL_wHeapString<OsclMemAllocator> _defaultKeyWord;
308         MP4FFParserOriginalCharEnc _charType;
309         uint32 count;
310         uint32 size;
311 
getInfoNotice(MP4FFParserOriginalCharEnc & charType)312         OSCL_wString& getInfoNotice(MP4FFParserOriginalCharEnc &charType)
313         {
314             charType = _charType;
315             return _defaultKeyWord;
316         }
317 };
318 
319 class AssetInfoKeyWordAtom : public FullAtom
320 {
321     public:
322         AssetInfoKeyWordAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
323 
324         virtual ~AssetInfoKeyWordAtom();
325 
326         // Member gets
getKeyWordLangCode()327         uint16      getKeyWordLangCode() const
328         {
329             return _langCode;
330         }
331 
getNumKeyWords()332         uint32      getNumKeyWords() const
333         {
334             return _keyWordCount;
335         }
336 
337         OSCL_wString& getKeyWordAt(int32 index);
338 
339     private:
340         uint16                        _langCode;
341         uint8                         _keyWordCount;
342         Oscl_Vector<AssestInfoKeyWord *, OsclMemAllocator> *_pAssetInfoKeyWordVec;
343         OSCL_wHeapString<OsclMemAllocator> _defaultKeyWord;
344 };
345 
346 class AssetInfoLocationAtom : public FullAtom
347 {
348     public:
349         AssetInfoLocationAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
350         virtual ~AssetInfoLocationAtom();
351 
352         // Member gets
getAssetInfoLocationStruct()353         PvmfAssetInfo3GPPLocationStruct* getAssetInfoLocationStruct()
354         {
355             return _pLocationStruct;
356         }
357 
358     private:
359         OSCL_wHeapString<OsclMemAllocator> _defaultNotice;
360         OSCL_wHeapString<OsclMemAllocator> _astronomical_body;
361         OSCL_wHeapString<OsclMemAllocator> _additional_notes;
362 
363         uint8                 _role;
364         uint32                _longitude;
365         uint32                _latitude;
366         uint32                _altitude;
367         MP4FFParserOriginalCharEnc _charType;
368         uint16 _langCode;
369         PvmfAssetInfo3GPPLocationStruct *_pLocationStruct;
370 };
371 
372 class AssetInfoAlbumAtom : public FullAtom
373 {
374     public:
375         AssetInfoAlbumAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
~AssetInfoAlbumAtom()376         virtual ~AssetInfoAlbumAtom()
377         {
378         };
379 
380         // Member gets
getAlbumLangCode()381         uint16      getAlbumLangCode() const
382         {
383             return _langCode;
384         }
getTrackNumber()385         uint8 getTrackNumber()
386         {
387             return _trackNumber;
388         }
getAlbumNotice(MP4FFParserOriginalCharEnc & charType)389         OSCL_wString& getAlbumNotice(MP4FFParserOriginalCharEnc &charType)
390         {
391             charType = _charType;
392             return _defaultNotice;
393         }
394 
395     private:
396 
397         OSCL_wHeapString<OsclMemAllocator> _defaultNotice;
398         uint8                 _trackNumber;
399         uint16                _langCode;
400         MP4FFParserOriginalCharEnc _charType;
401 };
402 
403 
404 class AssetInfoRecordingYearAtom : public FullAtom
405 {
406     public:
407         AssetInfoRecordingYearAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
~AssetInfoRecordingYearAtom()408         virtual ~AssetInfoRecordingYearAtom()
409         {
410         };
411 
412         // Member gets
getRecordingYear()413         uint16 getRecordingYear()
414         {
415             return _recordingYear;
416         }
417 
418     private:
419         uint16 _recordingYear;
420 };
421 
422 
423 
424 #endif  // ASSETINFOATOMS_H_INCLUDED
425 
426