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 SampleEntry Class */ 21 /* ------------------------------------------------------------------- */ 22 /*********************************************************************************/ 23 /* 24 This SampleEntry Class is the base class for the HinstSampleEntry, 25 VisualSampleEntry, AudioSampleEntry. and MpegSampleEntry classes. 26 */ 27 28 29 #ifndef SAMPLEENTRY_H_INCLUDED 30 #define SAMPLEENTRY_H_INCLUDED 31 32 #ifndef OSCL_FILE_IO_H_INCLUDED 33 #include "oscl_file_io.h" 34 #endif 35 36 #ifndef ATOM_H_INCLUDED 37 #include "atom.h" 38 #endif 39 40 class ESDescriptor; 41 class DecoderSpecificInfo; 42 43 class SampleEntry : public Atom 44 { 45 46 public: 47 SampleEntry(MP4_FF_FILE *fp, uint32 size, uint32 type); 48 virtual ~SampleEntry(); 49 50 // Member gets and sets getDataReferenceIndex()51 uint16 getDataReferenceIndex() const 52 { 53 return _dataReferenceIndex; 54 } 55 getESID()56 virtual uint32 getESID() const 57 { 58 return 0; // Should get overridden 59 } getESDescriptor()60 virtual const ESDescriptor *getESDescriptor() const 61 { 62 return NULL; // Should get overridden 63 } 64 65 // Getting and setting the Mpeg4 VOL header 66 virtual DecoderSpecificInfo *getDecoderSpecificInfo() const ; 67 virtual uint8 getObjectTypeIndication() const ; 68 // Get the max size buffer needed to retrieve the media samples 69 virtual uint32 getMaxBufferSizeDB() const; 70 virtual uint32 getAverageBitrate() const; 71 virtual uint32 getMaxBitrate() const; 72 virtual uint16 getWidth() const; 73 virtual uint16 getHeight() const; 74 75 76 protected: 77 // Reserved constants 78 uint8 _reserved[6]; 79 uint16 _dataReferenceIndex; 80 }; 81 82 #endif // SAMPLEENTRY_H_INCLUDED 83 84 85