00001 #ifndef QTFFPLAY_H
00002 #define QTFFPLAY_H
00003
00004 #include <QWidget>
00005 #include <QLabel>
00006 #include <QTimer>
00007 #include <QThread>
00008 #include <QImage>
00009 #include <Qt>
00010 #include "qtffthread.h"
00011
00015 struct SDL_Surface;
00016
00028 class QtFFPlay : public QWidget
00029 {
00030 Q_OBJECT
00031 public:
00037 void grabWindow();
00048 Uint32 convert_yuv_rgb(Uint8 Y, Uint8 U, Uint8 V);
00055 QtFFPlay( QWidget *parent=0 , Qt::WFlags flags=0);
00059 void togglePause();
00063 int init();
00064
00065 inline void fill_rectangle(SDL_Surface *myscreen,int x, int y, int w, int h, int color);
00066 void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect);
00067 void free_subpicture(SubPicture *sp);
00068 void video_image_display(VideoState *is);
00069 inline int compute_mod(int a, int b);
00070 void video_audio_display(VideoState *s);
00071 void video_display(VideoState *is);
00072 void schedule_refresh(VideoState *is, int delay);
00073 void stream_seek(VideoState *is, int64_t pos, int rel);
00074 void video_refresh_timer(void *opaque);
00075 void alloc_picture(void *opaque);
00076 VideoState *stream_open(QString *filename, AVInputFormat *iformat);
00077 void stream_close(VideoState *is);
00078 void stream_cycle_channel(VideoState *is, int codec_type);
00079 void toggle_full_screen(void);
00080 void toggle_pause(void);
00081 void step_to_next_frame(void);
00082 void do_exit(void);
00083 void toggle_audio_display(void);
00084 void opt_width(const char *arg);
00085 void opt_height(const char *arg);
00086 void opt_format(const char *arg);
00087 void opt_image_format(const char *arg);
00088 void opt_rtp_tcp(void);
00089 void opt_sync(const char *arg);
00090 void opt_seek(const char *arg);
00091 void opt_debug(const char *arg);
00092 void opt_vismv(const char *arg);
00093 void opt_thread_count(const char *arg);
00094 void show_help(void);
00095 void parse_arg_file(const char *filename);
00096 VideoState *is;
00100 QString input_filename;
00101 protected:
00102 void resizeEvent(QResizeEvent *);
00103 void paintEvent(QPaintEvent *);
00104
00105 public slots:
00106
00107
00108
00109
00110
00111 QImage* grabFrame();
00112 private:
00116 QLabel myLabel;
00120 Uint32 *buffer_rgb;
00124 int buffer_init;
00128 QTimer *mtimer;
00129 int flags, w, h;
00130 int alreadyInit;
00131 SDL_Surface tmpSurface;
00136 void save_pgm(unsigned char *buf,int wrap, int xsize,int ysize,char *filename);
00140 qtffthread mythread;
00141 };
00142 #endif