00001 #ifndef AVFECODER_H_
00002 #define AVFECODER_H_
00003
00004 #include "decoder.h"
00005
00006 extern "C" {
00007 #include <mythtv/ffmpeg/avformat.h>
00008 #include <mythtv/ffmpeg/avcodec.h>
00009 }
00010
00011 class Metadata;
00012
00013 class avfDecoder : public Decoder
00014 {
00015 public:
00016 avfDecoder(const QString &file, DecoderFactory *, QIODevice *, AudioOutput *);
00017 virtual ~avfDecoder(void);
00018
00019 bool initialize();
00020 double lengthInSeconds();
00021 void seek(double);
00022 void stop();
00023
00024 MetaIO *doCreateTagger(void);
00025
00026 private:
00027 void run();
00028
00029 void flush(bool = FALSE);
00030 void deinit();
00031
00032 bool inited, user_stop;
00033 int stat;
00034 char *output_buf;
00035 ulong output_bytes, output_at;
00036
00037 unsigned int bks;
00038 bool done, finish;
00039 long len, freq, bitrate;
00040 int chan;
00041 unsigned long output_size;
00042 double totalTime, seekTime;
00043
00044 QString devicename;
00045
00046 long int start;
00047 long int end;
00048
00049 AVOutputFormat *fmt;
00050 AVInputFormat *ifmt;
00051 AVFormatParameters params;
00052 AVFormatParameters *ap;
00053 AVFormatContext *oc, *ic;
00054 AVStream *enc_st, *dec_st;
00055 AVCodec *codec, *enc_codec;
00056 AVCodecContext *audio_enc, *audio_dec;
00057 AVPacket pkt1;
00058 AVPacket *pkt;
00059
00060 int errcode;
00061
00062 unsigned char *ptr;
00063 int dec_len, data_size;
00064 short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
00065
00066 };
00067
00068 #endif
00069