#ifndef f_AVIREADHANDLER_H #define f_AVIREADHANDLER_H #include #include #include "AVIIndex.h" #include "Cache.h" class IvAVIReadStream { public: virtual ~IvAVIReadStream(); virtual HRESULT BeginStreaming(long lStart, long lEnd, long lRate)=0; //starts cacheable mode //lRate not used virtual HRESULT EndStreaming()=0; virtual HRESULT Header(AVIStreamHeader* pheader)=0; // virtual HRESULT ChunkTable(AVIIndex** ppIndex)=0; virtual HRESULT Info(AVISTREAMINFO *pasi, long lSize)=0; //very Microsoft'ish //copy some data from two structures to third virtual bool IsKeyFrame(long lFrame) const =0; virtual HRESULT Read(long lStart, long lSamples, void *lpBuffer, long cbBuffer, long *plBytes, long *plSamples)=0; virtual long Start()=0; //start position virtual long End()=0; //end position virtual long PrevKeyFrame(long lFrame)=0; virtual long NextKeyFrame(long lFrame)=0; virtual long NearestKeyFrame(long lFrame)=0; virtual long Length() const =0; virtual HRESULT FormatSize(long lFrame, long *plSize)=0; virtual HRESULT ReadFormat(long lFrame, void *pFormat, long *plSize)=0; virtual bool isStreaming()=0; virtual void ClearCache()=0; }; class IvAVIReadHandler { public: virtual ~IvAVIReadHandler(); virtual void AddRef()=0; virtual void Release()=0; virtual IvAVIReadStream *GetStream(DWORD fccType, LONG lParam)=0; //vids/auds, 0-... virtual void EnableFastIO(bool)=0; //not needed virtual bool isOptimizedForRealtime()=0; //not needed virtual bool isStreaming()=0; virtual bool isIndexFabricated()=0; //hmmm virtual bool AppendFile(const char *pszFile)=0; virtual bool getSegmentHint(const char **ppszPath)=0; //not needed? virtual HRESULT Header(MainAVIHeader* pheader)=0; }; IvAVIReadHandler *CreateAVIReadHandler(const char *pszFile); #endif