00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __OUT_VORBIS_H__
00023 #define __OUT_VORBIS_H__
00024
00025 #include <outchannels.h>
00026
00027 #include <config.h>
00028 #ifdef HAVE_VORBIS
00029
00030 extern "C" {
00031 #include <vorbis/vorbisenc.h>
00032 }
00033
00034
00035 #define INBUF OUT_CHUNK*sizeof(float)*8
00036 #define RSMPBUF INBUF*sizeof(float)*12
00037
00038 class OutVorbis : public OutChannel {
00039 private:
00040 ogg_stream_state os;
00041 ogg_page og;
00042 ogg_packet op;
00043
00044 vorbis_dsp_state vd;
00045 vorbis_block vb;
00046 vorbis_info vi;
00047 vorbis_comment vc;
00048
00049 ogg_packet header_main;
00050 ogg_packet header_comments;
00051 ogg_packet header_codebooks;
00052
00053 short int header[8192];
00054 int headersize;
00055
00056
00057
00058
00059
00060 float *pcm;
00061 float *rsmpled;
00062 float **_intbuf;
00063 int8_t *_pbyte;
00064
00065 int out_chunk_len;
00066 int prepare(float *buf, float **fbuf, int num);
00067
00068 SRC_STATE *rsmp_state;
00069 SRC_DATA rsmp_data;
00070
00071 public:
00072 OutVorbis();
00073 ~OutVorbis();
00074 int encode();
00075 bool init();
00076 void flush();
00077
00078 bool apply_profile();
00079
00080
00081 };
00082
00083 #endif
00084 #endif