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 #ifndef __PVA_FF_AVCSampleEntry_H__ 20 #define __PVA_FF_AVCSampleEntry_H__ 21 22 #include "atom.h" 23 #include "oscl_file_io.h" 24 #include "avcconfigurationatom.h" 25 #include "decoderspecificinfo.h" 26 #include "sampleentry.h" 27 #include "mpeg4bitrateatom.h" 28 29 class PVA_FF_AVCSampleEntry : public PVA_FF_SampleEntry 30 { 31 32 public: 33 PVA_FF_AVCSampleEntry(uint8 profile = 1, uint8 profileComp = 0xFF, uint8 level = 0xFF); 34 virtual ~PVA_FF_AVCSampleEntry(); 35 void setVideoParam(int16 width, int16 height); 36 void setBitrate(uint32 BufferSizeDB, uint32 MaxBitRate, uint32 AvgBitRate); setSample(void * sample,uint32 size)37 void setSample(void* sample, uint32 size) 38 { 39 40 _pAVCConfigurationAtom->setSample(sample, size); 41 } 42 virtual void recomputeSize(); 43 virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp); 44 void addDecoderSpecificInfo(PVA_FF_DecoderSpecificInfo *pinfo); checkPS()45 bool checkPS() 46 { 47 if (_pAVCConfigurationAtom->checkIfPSWritten()) 48 { 49 return true; 50 } 51 else 52 { 53 return false; 54 } 55 } 56 private: 57 void init(uint8 profile, uint8 profileComp, uint8 level); 58 59 60 61 // Reserved constants 62 uint8 _reserved[6]; 63 uint16 _dataReferenceIndex; 64 int16 _preDefined1; 65 int16 _reserved1; 66 int32 _predefined2[3]; 67 int16 _width; 68 int16 _height; 69 int32 _horizResolution; 70 int32 _vertResolution; 71 int32 _reserved2; 72 int16 _preDefined2; 73 uint8 _compressorName[32]; 74 int16 _depth; 75 int16 _predefined3; 76 int16 _predefined4; 77 78 PVA_FF_AVCConfigurationAtom *_pAVCConfigurationAtom; 79 PVA_FF_Mpeg4Bitrate *_pMpeg4BitrateAtom; 80 }; 81 82 83 #endif 84