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 This AudioSampleEntry Class is used for visual streams. 20 */ 21 22 23 #ifndef AMRSAMPLEENTRY_H_INCLUDED 24 #define AMRSAMPLEENTRY_H_INCLUDED 25 26 #ifndef ATOM_H_INCLUDED 27 #include "atom.h" 28 #endif 29 #ifndef ATOMUTILS_H_INCLUDED 30 #include "atomutils.h" 31 #endif 32 #ifndef OSCL_FILE_IO_H_INCLUDED 33 #include "oscl_file_io.h" 34 #endif 35 #ifndef GPP_AMRDECODERSPECIFICINFO_H_INCLUDED 36 #include "3gpp_amrdecoderspecificinfo.h" 37 #endif 38 #include "oscl_vector.h" 39 class AMRSampleEntry : public Atom 40 { 41 42 public: 43 AMRSampleEntry(MP4_FF_FILE *fp, uint32 size, uint32 type); // Stream-in ctor 44 virtual ~AMRSampleEntry(); 45 getTimeScale()46 uint16 getTimeScale() 47 { 48 return _timeScale; 49 } 50 getDecoderSpecificInfo()51 virtual AMRSpecificAtom *getDecoderSpecificInfo() const 52 { 53 return _pAMRSpecificAtom; 54 } 55 56 DecoderSpecificInfo *getDecoderSpecificInfo(uint32 index); 57 getBitRate()58 int32 getBitRate() 59 { 60 if (_pAMRSpecificAtom != NULL) 61 { 62 return (_pAMRSpecificAtom->getBitRate()); 63 } 64 else 65 { 66 return 0; 67 } 68 } 69 70 private: 71 // Reserved constants 72 uint8 _reserved[6]; 73 uint16 _dataReferenceIndex; 74 uint32 _reserved1[2]; 75 uint16 _reserved2; 76 uint16 _reserved3; 77 uint32 _reserved4; 78 uint16 _reserved5; 79 uint16 _timeScale; 80 81 AMRSpecificAtom *_pAMRSpecificAtom; 82 83 Oscl_Vector<DecoderSpecificInfo *, OsclMemAllocator> *_pAMRDecSpecInfoArray; 84 }; 85 86 87 #endif // AMRSAMPLEENTRY_H_INCLUDED 88