Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

vorbisfile.hh

00001 /*
00002  * PIAVE - PIAVE Is A Video Editor
00003  *
00004  * Copyright (C) 2002 Rolf Dubitzky, rolf@dubitzky.de
00005  *
00006  */
00007 
00008 /*
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software Foundation,
00021  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00022  */
00023 
00024 
00034 #if ! defined( VORBISFILE_HH )
00035 #define VORBISFILE_HH
00036 
00037 // stdc
00038 #include <signal.h>
00039 #include <stdio.h>
00040 #include <unistd.h>
00041 #include <fcntl.h>
00042 #include <sys/stat.h>
00043 
00044 // stdc++
00045 #include <string>
00046 
00047 // vorbis
00048 #include "vorbis/codec.h"
00049 #include "vorbis/vorbisfile.h"
00050 
00051 // PIAVE
00052 #include "libpiave/piave_base.hh"
00053 #include "libpiave/avstream.hh"
00054 #include "libpiave/exception.hh"
00055 #include "libpiave/ringbuffer.hh"
00056 
00057 
00058 namespace PIAVE {
00059 
00060     class Frame;
00061 
00062     class VorbisfilePlugin : public Plugin
00063     {
00064       public:
00065         VorbisfilePlugin();
00066         virtual PluginBase * newElement( const PropertyNode * p = 0 );
00067     };
00068 
00069 
00073     class InVorbisfile : public InAVFStream
00074     {
00075       public:
00076         InVorbisfile( const std::string& fileName ) throw(exception);
00077 
00078         ~InVorbisfile();
00079         virtual Frame getFrame( Time t );
00080 
00081         virtual PropertyNode * getProperties( PropertyNode * p ) const;
00082 
00083         virtual void decodeMetaData( Frame & f );
00084         virtual void decodeVideo( Frame & f, uint8_t * dest = 0 );
00085         virtual void decodeAudio( Frame & f, uint8_t * dest = 0 );
00086 
00087       private:
00088         void refillBuffer();
00089 
00090       private:
00091         FILE           * _file; 
00092         OggVorbis_File   _vf;
00093         vorbis_info    * _vi;
00094         vorbis_comment * _vc;
00095         int              _current_section;
00096         int              _nChannels;
00097         int              _frequency;
00098 
00103         ValRingBuffer<int16_t> * _readBuffer;
00104         double                   _minSec;
00105         double                   _maxSec;
00106 
00107     };
00108 
00109 };
00110 
00111 #endif

Generated on Tue Oct 14 20:45:37 2003 for piave by doxygen1.2.18