Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

AVISource.h

Go to the documentation of this file.
00001 /*************************************************************************
00008  *
00009  * Source code for Real Time Image Library (libRTImage) 
00010  *
00011  * Leeds Vision Group give permission for this code to be copied, modified 
00012  * and distributed within the University of Leeds subject to the following
00013  * conditions:-
00014  *
00015  * - The code is not to be used for commercial gain.
00016  * - The code and use thereof will be attributed to the authors where
00017  *   appropriate (including demonstrations which rely on it's use).
00018  * - All modified, distributions of the source files will retain this header.
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 /* Protected Members */
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 //NOTE: typedef unsigned char  uint8_t;
00054 
00055 
00056         unsigned char** buff;           
00057 
00058         unsigned int    width;          
00059         unsigned int    height;         
00060         long            frames;         
00061         float           framerate;      
00062 public:
00063 /* Public Methods */
00064 
00066         AVISource(char* path);
00067 
00068         ~AVISource();
00069 
00070         /* Extraction operators */
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

Generated at Fri Aug 13 17:29:20 2004 for libRTImage by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001