00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVI_SOURCE_H
00023 #define AVI_SOURCE_H
00024
00025 #include "Image.h"
00026 #include "ImageSource.h"
00027 #include <avcodec.h>
00028 #include <avformat.h>
00029
00030 class AVISource : public ImageSource
00040 {
00041 protected:
00042
00043 AVFormatContext *pFormatCtx;
00044 int i;
00045 int videoStream;
00046 AVCodecContext *pCodecCtx;
00047 AVCodec *pCodec;
00048 AVFrame *pFrame;
00049 AVFrame *pFrameRGB;
00050 int numBytes;
00051 uint8_t *buffer;
00052
00053
00054
00055
00056 unsigned char** buff;
00057
00058 unsigned int width;
00059 unsigned int height;
00060 long frames;
00061 float framerate;
00062 public:
00063
00064
00066 AVISource(char* path);
00067
00068 ~AVISource();
00069
00070
00071
00072 virtual ImageSource& operator >> (ImageRGB&);
00073 virtual ImageSource& operator >> (ImageGrey&);
00074 virtual ImageSource& operator >> (Image&);
00075
00077 void get_size(unsigned int&, unsigned int&);
00078
00080 int get_no_frames() ;
00081
00083 int set_frame(long frame_no) ;
00085 void get_framerate(float&);
00086
00088 bool eof(void) const;
00089 };
00090
00091 #endif // AVI_SOURCE_H