00001 #ifndef FFMPEG_H 00002 #define FFMPEG_H 00003 00004 #include <ffmpeg/avcodec.h> 00005 00006 #include "asset.h" 00007 #include "guicast.h" 00008 00009 #define FFMPEG_LATENCY -9 00010 00011 class FFMPEG 00012 { 00013 public: 00014 FFMPEG(Asset *asset_in); 00015 ~FFMPEG(); 00016 int init(char *codec_string); 00017 int decode(uint8_t *data, long data_size, VFrame *frame_out); 00018 00019 static int convert_cmodel(AVPicture *picture_in, PixelFormat pix_fmt, 00020 int width_in, int height_in, 00021 VFrame *frame_out); 00022 static int convert_cmodel(VFrame *frame_in, VFrame *frame_out); 00023 00024 static int convert_cmodel_transfer(VFrame *frame_in,VFrame *frame_out); 00025 static int init_picture_from_frame(AVPicture *picture, VFrame *frame); 00026 00027 static CodecID FFMPEG::codec_id(char *codec_string); 00028 00029 private: 00030 static PixelFormat color_model_to_pix_fmt(int color_model); 00031 static int FFMPEG::pix_fmt_to_color_model(PixelFormat pix_fmt); 00032 00033 int got_picture; 00034 Asset *asset; 00035 AVCodec *codec; 00036 AVCodecContext *context; 00037 AVFrame *picture; 00038 }; 00039 00040 00041 #endif /* FFMPEG_H */
1.4.4