VITContainerFile.hpp

00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: VITContainerFile.hpp * 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 00036 /*********************************************************************** 00037 * * 00038 * REVISION HISTORY: * 00039 * * 00040 * * 00041 * * 00042 ***********************************************************************/ 00043 #ifndef VITOOKI_VITCONTAINERFILE_HPP_ 00044 #define VITOOKI_VITCONTAINERFILE_HPP_ 00045 00059 #include "global.hpp" 00060 #include "VideoESInfo.hpp" 00061 #include "AudioESInfo.hpp" 00062 #include "io/ByteStream.hpp" 00063 00064 class ContainerInfo; 00065 class Url; 00066 00067 //The VIT Header format for the TrackList 00068 typedef enum VITStreamType { VIT_VIDEO, VIT_AUDIO, VIT_SUBTITLE } VITStreamType; 00069 00070 //one track is coded in this struct, union'd for video and audio information 00071 typedef struct VITTrackInfo { 00072 u32 streamID; 00073 u32 streamType; //chose from enumeration above 00074 u32 codecID; //maps to ffmpeg codec ids 00075 u32 kbps; //avgBandwidth in kilobit/sec 00076 u32 vopinc; //VOPTimeIncrement, for Video, it is 90000/fps, but for MP3 it's special (eg. 2348) 00077 union { 00078 struct videoInfo { 00079 u32 fps; 00080 u32 width; 00081 u32 height; 00082 float aspectRatio; 00083 } vi; 00084 struct audioInfo { 00085 u32 sampleRate; 00086 u32 channels; 00087 char language[2]; //use clear-text acronyms like en,de,fr,it 00088 } ai; 00089 u32 padding[12]; 00090 } esi; 00091 } VITTrackInfo; 00092 00093 //header used for each frame 00094 typedef struct VITFrameInfo { 00095 u32 streamID; //for mapping to corresponding ESInfo streams 00096 u32 cts; //presentation timestamp of this frame 00097 u32 size; //bytes following in the payload 00098 } VITFrameInfo; 00099 00100 00101 00102 00103 class VITContainerFile { 00104 00105 public: 00106 00110 static ContainerInfo *loadContainerInfo(const Url* uri=NULL, ByteStream *stream = NULL); 00111 00115 static bool saveToContainerFile(const char *fileName, ContainerInfo *ci) { 00116 return false; 00117 }; 00118 00119 00120 };//VITContainerFile 00121 00122 #endif 00123 00124 00125 00126 00127