00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __THEORA11_ENCODER_H__
00021 #define __THEORA11_ENCODER_H__
00022
00023
00024 #include <config.h>
00025 #include <linklist.h>
00026 #include <video_encoder.h>
00027
00028 #ifdef WITH_OGGTHEORA
00029
00030 #include <theora/theoraenc.h>
00031 #include <vorbis/codec.h>
00032 #include <vorbis/vorbisenc.h>
00033
00034 class Context;
00035
00036 class Theora11Encoder: public Videoencoder {
00037
00038
00039 public:
00040
00041 Theora11Encoder();
00042 ~Theora11Encoder();
00043
00044
00045 bool init(Context *_env);
00046
00047 bool feed_video();
00048
00049 int encode_frame();
00050
00051 private:
00052
00053 int encode_video(int end_of_stream);
00054 int encode_audio(int end_of_stream);
00055
00056
00057
00058
00059 ogg_stream_state vo;
00060 ogg_stream_state to;
00061 ogg_stream_state so;
00062
00063 ogg_page og;
00064 ogg_packet op;
00065
00066 th_enc_ctx *td;
00067 th_info ti;
00068 th_comment tc;
00069
00070 vorbis_info vi;
00071 vorbis_comment vc;
00072
00073 vorbis_dsp_state vd;
00074 vorbis_block vb;
00075
00076 int rand_serial;
00077
00078 int frame_w;
00079 int frame_h;
00080 int pic_w;
00081 int pic_h;
00082 int pic_x;
00083 int pic_y;
00084 int video_fps_n;
00085 int video_fps_d;
00086 int video_par_n;
00087 int video_par_d;
00088
00089
00090
00091
00092
00093
00094
00095
00096 unsigned char *yuvframe[2];
00097
00098 };
00099
00100 #endif
00101
00102 #endif