00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __TLSOURCEVIDEOFILE_H__
00018 #define __TLSOURCEVIDEOFILE_H__
00019
00020
00021
00022 #include "tlVision.h"
00023 #include "tlSource.h"
00024
00025
00026 #ifndef __TLDIRECTXH__
00027 #define __TLDIRECTXH__
00028 #include <atlbase.h>
00029 #include <qedit.h>
00030 #include <streams.h>
00031 #include <dshow.h>
00032
00033 #endif
00034
00035
00036
00037
00038 class tlSourceVideoFile : tlSource
00039 {
00040 private:
00041 char *filename;
00042
00043 IGraphBuilder *pGraph;
00044 IMediaControl *pControl;
00045 IMediaEvent *pEvent;
00046 ISampleGrabber *pGrabber;
00047 IMediaSeeking *pSeek;
00048 char *buffer;
00049 long evCode;
00050 long size;
00051 LONGLONG length;
00052 LONGLONG current;
00053
00054
00055 public:
00056 tlSourceVideoFile (char *filename);
00057
00058 int getLength () { return (int)length; };
00059 int getIndex () { return (int)current; };
00060
00061 int open (char *filename);
00062 int close ();
00063 int setFrame (int frame);
00064
00065 virtual int grab (tlImage *image);
00066 virtual int grab (tlImage *image, tlRect *rect);
00067 virtual int grabQueued (tlImage *image);
00068 virtual int grabQueued (tlImage *image, tlRect *rect);
00069 };
00070
00071 #endif
00072