r499: This commit was manufactured by cvs2svn to create tag 'r1_2_1-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / ffmpeg.h
blob3cb97baa884b3faf7fadd67fa9514288e32dc13b
1 #ifndef FFMPEG_H
2 #define FFMPEG_H
4 #include <ffmpeg/avcodec.h>
6 #include "asset.h"
7 #include "guicast.h"
9 #define FFMPEG_LATENCY -9
11 class FFMPEG
13 public:
14 FFMPEG(Asset *asset_in);
15 ~FFMPEG();
16 int init(char *codec_string);
17 int decode(uint8_t *data, long data_size, VFrame *frame_out);
19 static int convert_cmodel(AVPicture *picture_in, PixelFormat pix_fmt,
20 int width_in, int height_in,
21 VFrame *frame_out);
22 static int convert_cmodel(VFrame *frame_in, VFrame *frame_out);
24 static int convert_cmodel_transfer(VFrame *frame_in,VFrame *frame_out);
25 static int init_picture_from_frame(AVPicture *picture, VFrame *frame);
27 static CodecID FFMPEG::codec_id(char *codec_string);
29 private:
30 static PixelFormat color_model_to_pix_fmt(int color_model);
31 static int FFMPEG::pix_fmt_to_color_model(PixelFormat pix_fmt);
33 int got_picture;
34 Asset *asset;
35 AVCodec *codec;
36 AVCodecContext *context;
37 AVFrame *picture;
41 #endif /* FFMPEG_H */