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