00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef VideoReaderControler_h
00010 #define VideoReaderControler_h
00011
00012 #include <windows.h>
00013 #include <streams.h>
00014 #include <dvdmedia.h>
00015 #include <fstream.h>
00016
00017 #include "IVideoReaderControler.h"
00018
00019 class VideoReaderControler : public CUnknown, IVideoReaderControler
00020 {
00021 public:
00022 static CUnknown* WINAPI CreateInstance(LPUNKNOWN unk, HRESULT *hr);
00023 ~VideoReaderControler();
00024
00025 virtual STDMETHODIMP SetFrameCapacity(int num);
00026 virtual STDMETHODIMP GetFrameCapacity(int *num);
00027
00028 virtual STDMETHODIMP GetLength(int *num);
00029 virtual STDMETHODIMP GetFrameWidth(int *width);
00030 virtual STDMETHODIMP GetFrameHeight(int *height);
00031 virtual STDMETHODIMP GetFrame(int num, BYTE **sample);
00032
00033 virtual STDMETHODIMP SetFilterGraph(IFilterGraph* iGraph);
00034
00035 virtual STDMETHODIMP NextData(BYTE *sample);
00036 virtual STDMETHODIMP SetDataSizes(int width, int height);
00037
00038 DECLARE_IUNKNOWN;
00039
00040
00041 private:
00042 VideoReaderControler(LPUNKNOWN unk, HRESULT *hr);
00043
00044
00045 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
00046
00047 void readFrames(int first);
00048
00049 BYTE** _data;
00050 int _dataSize;
00051 int _dataOffset;
00052 int _dataFree;
00053
00054
00055
00056
00057
00058 int _width;
00059 int _height;
00060 int _length;
00061 int _empty;
00062
00063
00064 int _testingEnd;
00065
00066 IMediaControl* _imCtrl;
00067 IMediaSeeking* _imSeek;
00068 IMediaEvent* _imEvent;
00069
00070 CCritSec* _ofsSec;
00071 ofstream _ofs;
00072 int _ofs_open;
00073 };
00074
00075 #endif