ObjectDescriptorESInfo.cpp

00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: ObjectDescriptorESInfo.cpp * 00006 * * 00007 * * 00008 * * 00009 * ITEC institute of the University of Klagenfurt (Austria) * 00010 * http://www.itec.uni-klu.ac.at * 00011 * * 00012 * * 00013 * For more information visit the ViTooKi homepage: * 00014 * http://ViTooKi.sourceforge.net * 00015 * vitooki-user@lists.sourceforge.net * 00016 * vitooki-devel@lists.sourceforge.net * 00017 * * 00018 * This file is part of ViTooKi, a free video toolkit. * 00019 * ViTooKi is free software; you can redistribute it and/or * 00020 * modify it under the terms of the GNU General Public License * 00021 * as published by the Free Software Foundation; either version 2 * 00022 * of the License, or (at your option) any later version. * 00023 * * 00024 * This program is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU General Public License * 00030 * along with this program; if not, write to the Free Software * 00031 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * 00032 * MA 02111-1307, USA. * 00033 * * 00034 ***********************************************************************/ 00035 #include "ObjectDescriptorESInfo.hpp" 00036 #include "ReferenceCounter.hpp" 00037 #include "BitField.hpp" 00044 ObjectDescriptorESInfo::ObjectDescriptorESInfo(u32 streamId, u32 streamtype, 00045 ContainerInfo * vob, u32 timeIncrement, 00046 u8 * encodeddecconf, u32 objtype, u32 bufsize, 00047 u32 avgBW, u32 maxBW, u32 timeScale, 00048 u64 duration, u32 size, bool complete, 00049 CodecID codec_id, float quality):ESInfo(streamId, 00050 streamtype,vob,timeIncrement,encodeddecconf, 00051 objtype,bufsize,avgBW,maxBW, 00052 timeScale,duration,size,complete,codec_id,quality) 00053 { 00054 generateDescriptionText(); 00055 }; 00056 00057 ObjectDescriptorESInfo::~ObjectDescriptorESInfo() 00058 { 00059 00060 }; 00061 00062 u32 ObjectDescriptorESInfo::getHandlerType() const 00063 { 00064 return MP4ObjectDescriptorHandlerType; 00065 }; 00066 00067 bool ObjectDescriptorESInfo::isVisualStream() const 00068 { 00069 return false; 00070 }; 00071 bool ObjectDescriptorESInfo::isAudioStream() const 00072 { 00073 return false; 00074 }; 00075 bool ObjectDescriptorESInfo::isODStream() const 00076 { 00077 return true; 00078 }; 00079 bool ObjectDescriptorESInfo::isSceneDescriptionStream() const 00080 { 00081 return false; 00082 }; 00083 00085 ESInfo *ObjectDescriptorESInfo::clone(ContainerInfo * mp4) 00086 { 00087 dprintf_full("ESInfo::clone id %llu\n",streamId); 00088 u8 *decConf = new u8[strlen((char *) encodedDecoderConfig) + 1]; 00089 strcpy((char *) decConf, (const char *) encodedDecoderConfig); 00090 ESInfo *es = new ObjectDescriptorESInfo(streamId, streamType, mp4, vopTimeIncrement, decConf, objectType, 00091 bufferSize, avgBandwidth, maxBandwidth, 00092 mediaTimeScale, duration, mediaSize, 00093 complete, codec_id, this->quality); 00094 es->setInput(input); 00095 if(!existingClones) { 00096 existingClones=new ReferenceCounter(); 00097 existingClones->increase(); // for the orig es 00098 } 00099 existingClones->increase(); // for the first clone 00100 es->setCloneCounter(existingClones); 00101 BitField* fs=getFrameStatistic(); 00102 if(fs) { 00103 es->setFrameStatistic(fs->createWithNewSize(fs->getSize(),false)); 00104 } 00105 return es; 00106 }; 00107 00108 void ObjectDescriptorESInfo::generateDescriptionText() 00109 { 00110 snprintf(description,MAX_STR_LEN,"Unknown Streamtype"); 00111 }