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 MpegSampleEntry Class */ 21 /* ------------------------------------------------------------------- */ 22 /*********************************************************************************/ 23 /* 24 This MpegSampleEntry is used for hint tracks. 25 */ 26 27 28 #ifndef MPEGSAMPLEENTRY_H_INCLUDED 29 #define MPEGSAMPLEENTRY_H_INCLUDED 30 31 #ifndef OSCL_FILE_IO_H_INCLUDED 32 #include "oscl_file_io.h" 33 #endif 34 35 #ifndef SAMPLEENTRY_H_INCLUDED 36 #include "sampleentry.h" 37 #endif 38 39 #ifndef ESDATOM_H_INCLUDED 40 #include "esdatom.h" 41 #endif 42 43 class MpegSampleEntry : public SampleEntry 44 { 45 46 public: 47 MpegSampleEntry(MP4_FF_FILE *fp, uint32 size, uint32 type); 48 virtual ~MpegSampleEntry(); 49 50 uint8 getObjectTypeIndication() const 51 { 52 if (_pes != NULL) 53 { 54 return _pes->getObjectTypeIndication(); 55 } 56 else 57 { 58 return 0xFF; 59 } 60 } 61 62 // Member gets and sets 63 const ESDAtom &getESDAtom() const 64 { 65 return *_pes; 66 } 67 68 virtual uint32 getESID() const 69 { 70 if (_pes != NULL) 71 { 72 if (_pes->getESDescriptorPtr() != NULL) 73 { 74 return _pes->getESDescriptorPtr()->getESID(); 75 } 76 else 77 { 78 return 0; 79 } 80 } 81 else 82 { 83 return 0; 84 } 85 } 86 87 virtual const ESDescriptor *getESDescriptor() const 88 { 89 if (_pes != NULL) 90 { 91 return _pes->getESDescriptorPtr(); 92 } 93 else 94 { 95 return NULL; 96 } 97 } 98 99 private: 100 ESDAtom *_pes; 101 }; 102 103 104 #endif // MPEGSAMPLEENTRY_H_INCLUDED 105 106