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 Track Fragment Random Access Atom Class */ 21 /* ------------------------------------------------------------------- */ 22 /*********************************************************************************/ 23 /* 24 */ 25 26 #ifndef TRACKFRAGMENTRANDOMACCESSATOM_H_INCLUDED 27 #define TRACKFRAGMENTRANDOMACCESSATOM_H_INCLUDED 28 29 #ifndef FULLATOM_H_INCLUDED 30 #include "fullatom.h" 31 #endif 32 33 #ifndef ATOMUTILS_H_INCLUDED 34 #include "atomutils.h" 35 #endif 36 37 #ifndef OSCL_INT64_UTILS_H_INCLUDED 38 #include "oscl_int64_utils.h" 39 #endif 40 41 class TFRAEntries 42 { 43 public: 44 TFRAEntries(MP4_FF_FILE *fp , uint32 version, 45 uint8 length_size_of_traf_num, 46 uint8 length_size_of_trun_num, 47 uint8 length_size_of_sample_num); 48 ~TFRAEntries()49 ~TFRAEntries() {}; 50 51 uint64 _time64; 52 uint64 _moof_offset64; 53 uint32 _time32; 54 uint32 _moof_offset32; 55 //// 56 uint32 _traf_number; 57 uint32 _trun_number; 58 uint32 _sample_number; 59 uint32 _version; getTimeStamp()60 uint32 getTimeStamp() 61 { 62 if (_version == 1) 63 { 64 return Oscl_Int64_Utils::get_uint64_lower32(_time64); 65 } 66 else 67 return _time32; 68 //version check and then return 32 bit value 69 } getTimeMoofOffset()70 uint32 getTimeMoofOffset() 71 { 72 if (_version == 1) 73 { 74 return Oscl_Int64_Utils::get_uint64_lower32(_moof_offset64); 75 } 76 else 77 return _moof_offset32; 78 //version check and then return 32 bit value 79 } 80 81 private: 82 83 }; 84 85 class TrackFragmentRandomAccessAtom : public FullAtom 86 { 87 88 public: 89 TrackFragmentRandomAccessAtom(MP4_FF_FILE *fp, 90 uint32 size, 91 uint32 type); 92 93 virtual ~TrackFragmentRandomAccessAtom(); 94 getTrackID()95 uint32 getTrackID() 96 { 97 return _trackId; 98 } 99 uint32 _entry_count; getTrackFragmentRandomAccessEntries()100 Oscl_Vector<TFRAEntries*, OsclMemAllocator>* getTrackFragmentRandomAccessEntries() 101 { 102 if (_pTFRAEntriesVec != NULL) 103 return _pTFRAEntriesVec; 104 return NULL; 105 } 106 private: 107 uint32 _trackId; 108 uint32 _reserved; 109 uint8 _length_size_of_traf_num; 110 uint8 _length_size_of_trun_num; 111 uint8 _length_size_of_sample_num; 112 113 Oscl_Vector<TFRAEntries*, OsclMemAllocator> *_pTFRAEntriesVec; 114 uint32 _version; 115 116 PVLogger *iLogger, *iStateVarLogger, *iParsedDataLogger; 117 }; 118 119 #endif 120