OGGMuxDemuxIO.hpp

00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: OGGMuxDemuxIO.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 00044 #ifndef _MK_OGGMUXDEMUXIO_HPP_ 00045 #define _MK_OGGMUXDEMUXIO_HPP_ 00046 00047 #ifdef ENABLE_OGG 00048 00049 #include "MuxDemuxIO.hpp" 00050 #include "container/OGGContainerFile.hpp" 00051 #include "adaptors/TheoraDecoder.hpp" 00052 #include "adaptors/VorbisDecoder.hpp" 00053 00054 class MuxDemuxIO; 00055 00067 class OGGMuxDemuxIO:public MuxDemuxIO { 00068 00069 public: 00070 00071 /* If writeOnly is true only write access 00072 * is permitted, otherwise the file is read-only, url is deep-copied 00073 */ 00074 OGGMuxDemuxIO(ByteStream *stream); 00075 00076 virtual ~OGGMuxDemuxIO(); 00077 00078 00083 virtual Frame *getFrame(); 00084 00086 virtual int writeFrame(Frame * frm, ESInfo *out_es=NULL); 00087 00088 static void initTheora(ESInfo* esi); 00089 static void initVorbis(ESInfo* esi); 00090 00091 static theora_info* getTheoraInfo() ; 00092 static theora_state* getTheoraState(); 00093 00094 static vorbis_info* getVorbisInfo(); 00095 static vorbis_dsp_state* getVorbisDspState(); 00096 static vorbis_block* getVorbisBlock(); 00097 00098 private: 00099 // ogg_page og; 00100 static theora_info* ti; 00101 static theora_state* ts; 00102 static int theorainitialized; 00103 static int vorbisinitialized; 00104 00105 OGGHandler *osh, *osh_w; 00106 //ogg_page og;// = new ogg_page; 00107 int serialtheora, serialvorbis; 00108 //theora_state *ts; 00109 //theora_info *ti; 00110 00111 static vorbis_info *vi; 00112 static vorbis_comment *vc; 00113 static vorbis_dsp_state *vd; 00114 static vorbis_block *vb; 00115 00116 OGGStreamInfo *osi; 00117 //int theorainitialized; 00118 //int vorbisinitialized; 00119 00120 //theora_info* ti; 00121 //theora_state* ts; 00122 00123 int vorbisframesSeen; 00124 int theoraframesSeen; 00125 00126 //int numStreams; 00127 //long* theStream; 00128 //int streamp; 00129 00130 long packetsSeen; 00131 00132 protected: 00133 00134 00135 }; 00136 00137 #endif 00138 #endif