FilteredIO.hpp

00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: FilteredIO.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 PS_MPEG4ITEC_FILTEREDIO_HPP 00045 #define PS_MPEG4ITEC_FILTEREDIO_HPP 00046 #include "IO.hpp" 00047 class BitField; 00048 class Frame; 00049 class ESInfo; 00050 00062 class FilteredIO : public IO 00063 { 00064 public: 00069 FilteredIO(IO* io, BitField* filter); 00070 00071 virtual ~FilteredIO(); 00072 00077 Frame * getFrame(); 00078 00080 int writeFrame(Frame * frm, ESInfo *out_es = NULL); 00081 00085 bool open(); 00086 00091 bool close(bool immediate=false); 00092 00096 bool destroy(); 00097 00098 State getState() const; 00099 00101 State setState(State s); 00102 00104 int getBufferFillLevel() const; 00105 00111 int flushBuffer(long from_ts = 0, long to_ts = -1); 00112 00114 const char *getURL() const; 00115 00123 bool setToFrameNumber(u32 frameNumber); 00124 00126 virtual u32 getCurrentFrameNumber() const { 00127 return io ? io->getCurrentFrameNumber() : 0; 00128 } 00129 00134 virtual bool setEndFrameNumber(u32 stopNumber) { 00135 return io ? io->setEndFrameNumber(stopNumber) : false; 00136 } 00137 00139 virtual u32 getEndFrameNumber() const { 00140 return io ? io->getEndFrameNumber() : 0; 00141 } 00142 00145 void setResendFrameHeader(bool set); 00146 00147 void run(); 00148 00149 void setESInfo(ESInfo * es); 00150 00151 ESInfo* getESInfo(); 00152 00160 long setToClosestIFrame(u32 frameNumber, bool backwards); 00161 00165 bool setBitField(BitField* b); 00166 00169 virtual u32 getFramesSeen() const { return framesSeen;}; 00170 00172 void setRtxInfo(const rtx_info* rtx); 00173 00174 State play(double prefetchTime=0.0); 00175 00176 State pause(); 00177 00178 State mute(); 00179 00180 protected: 00181 IO* io; 00182 BitField* filter; 00183 }; 00184 #endif 00185