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 __MovieExtendsAtom_H__ 19 #define __MovieExtendsAtom_H__ 20 21 #include "atom.h" 22 #include "a_atomdefs.h" 23 #include "atomutils.h" 24 25 #include "movieextendsheaderatom.h" 26 #include "trackextendsatom.h" 27 28 29 class PVA_FF_MovieExtendsAtom : public PVA_FF_Atom 30 { 31 32 public: 33 34 PVA_FF_MovieExtendsAtom(); // Constructor 35 virtual ~PVA_FF_MovieExtendsAtom(); // destructor 36 37 38 // Member gets and sets 39 40 // add and retrieve Trex atom for track ID 41 PVA_FF_TrackExtendsAtom* getTrexAtom(uint32 trackId); 42 void addTrexAtom(PVA_FF_TrackExtendsAtom *pTrexAtom); 43 44 //get movie extend header (to update fragment duration) 45 PVA_FF_MovieExtendsHeaderAtom* getMehdAtom(); 46 void setMovieFragmentDuration(uint32 duration); 47 void updateMovieFragmentDuration(uint32 ts); 48 void writeMovieFragmentDuration(MP4_AUTHOR_FF_FILE_IO_WRAP* fp); 49 uint32 getDuration(); 50 51 // Rendering the PVA_FF_MovieExtendsAtom in proper format (bitlengths, etc.) to an ostream 52 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP* fp); 53 54 private: 55 56 // child atoms 57 PVA_FF_MovieExtendsHeaderAtom* _pMehdAtom; 58 Oscl_Vector <PVA_FF_TrackExtendsAtom*, OsclMemAllocator>* _pTrexAtomVec; 59 60 // functions needed by composer to update and write atoms into file 61 virtual void recomputeSize(); 62 }; 63 64 #endif 65 66