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 Movie Fragment Random Access Atom Class */ 21 /* ------------------------------------------------------------------- */ 22 /*********************************************************************************/ 23 /* 24 */ 25 26 #ifndef MOVIEFRAGMENTRANDOMACCESSATOM_H_INCLUDED 27 #define MOVIEFRAGMENTRANDOMACCESSATOM_H_INCLUDED 28 29 #ifndef FULLATOM_H_INCLUDED 30 #include "atom.h" 31 #endif 32 33 #ifndef ATOMUTILS_H_INCLUDED 34 #include "atomutils.h" 35 #endif 36 37 #ifndef MFRAOFFSETATOM_H_INCLUDED 38 #include "mfraoffsetatom.h" 39 #endif 40 41 #ifndef CKFRAGMENTRANDOMACCESS_H_INCLUDED 42 #include "trackfragmentrandomaccess.h" 43 #endif 44 45 class MovieFragmentRandomAccessAtom : public Atom 46 { 47 48 public: 49 MovieFragmentRandomAccessAtom(MP4_FF_FILE *fp, 50 uint32 size, 51 uint32 type); 52 53 virtual ~MovieFragmentRandomAccessAtom(); 54 int32 getSyncSampleInfoClosestToTime(uint32 trackID, uint32 &time, uint32 &moof_offset, 55 uint32 &traf_number, uint32 &trun_number, 56 uint32 &sample_num); 57 int32 queryRepositionTime(uint32 trackID, int32 time, bool oDependsOn, bool bBeforeRequestedTime); 58 int32 getTimestampForRandomAccessPointsBeforeAfter(uint32 id, uint32 ts, uint32 *tsBuf, uint32* numBuf, 59 uint32& numsamplestoget, 60 uint32 howManyKeySamples); 61 int32 getTimestampForRandomAccessPoints(uint32 id, uint32 *num, uint32 *tsBuf, uint32* numBuf, uint32* offsetBuff = NULL, uint32 samplesFromMovie = 0); 62 63 /* 64 * This function will check if TFRA is present for all tracks and the entry count in TFRA for all 65 * tracks are equal. 66 */ 67 bool IsTFRAPresentForTrack(uint32 trackID, bool oVideoAudioTextTrack); 68 #if (DISABLE_REPOS_ON_CLIPS_HAVING_UNEQUAL_TFRA_ENTRY_COUNT) 69 int32 oVideoAudioTextTrackTfraCount; 70 #endif // DISABLE_REPOS_ON_CLIPS_HAVING_UNEQUAL_TFRA_ENTRY_COUNT 71 72 private: 73 Oscl_Vector<TrackFragmentRandomAccessAtom*, OsclMemAllocator> *_pTrackFragmentRandomAccessAtomVec; 74 MfraOffsetAtom *_pMfraOffsetAtom; 75 PVLogger *iLogger, *iStateVarLogger, *iParsedDataLogger; 76 }; 77 78 #endif 79