Visualizer.hpp

00001 /*********************************************************************** 00002 * * 00003 * ViTooKi * 00004 * * 00005 * title: Visualizer.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 #if !defined(_VISUALIZER_HPP_) 00045 #define _VISUALIZER_HPP_ 00046 00047 #if _MSC_VER > 1000 00048 #pragma once 00049 #endif // _MSC_VER > 1000 00050 00051 #include "VideoAdaptor.hpp" 00052 #include "VideoESInfo.hpp" 00053 #include "MP4Decoder.hpp" 00054 #include "io/VideoRenderer.hpp" 00055 00069 class Visualizer:public VideoAdaptor { 00070 public: 00071 typedef enum { Qt, SDL, X11 } OutputMethod; 00072 00073 00074 Visualizer(const VideoESInfo * es, OutputMethod out, UncompressedVideoFrame::ColorSpace colorSpace); 00075 00076 void initialize(); 00077 00078 list < Frame * >adapt(Frame * frm); 00079 00080 Adaptor *clone() { 00081 return new Visualizer(es, output, colorSpace); 00082 }; 00083 00084 list < Frame * >close(); 00085 00086 virtual ~ Visualizer() { dprintf_full("~Visualizer\n"); 00087 close(); 00088 }; 00089 00091 u32 getTranscodingCosts() const { 00092 return (u32)(es->getWidth()*es->getHeight()*es->getFPS()/10); 00093 } 00094 00095 private: 00096 const VideoESInfo *es; 00097 OutputMethod output; 00098 int width; 00099 int height; 00100 int video_bpp; 00101 int ySize; 00102 int uvSize; 00103 bool firstFrame; 00104 00105 VideoRenderer *renderer; 00106 UncompressedVideoFrame::ColorSpace colorSpace; 00107 }; 00108 00109 #endif // !defined(_VISUALIZER_HPP_)