#pragma once

#include "kpi_decoder.h"
#include "kpi_impl.h"

class KbOfrDecoder : public KbKpiUnknownImpl<IKpiDecoder>
{
private:
    KPI_MEDIAINFO m_MediaInfo;
    void         *m_pInstance;
    ReadInterface m_ReadInterface;
    void  __fastcall Close(void);
    void __fastcall GetTagInfo(IKpiTagInfo *pTagInfo, DWORD dwTagGetFlags);
public:
    KbOfrDecoder(void);
    ~KbOfrDecoder(void);
    DWORD __fastcall Open(const KPI_MEDIAINFO *cpRequest,
                          IKpiFile *pFile,
                          IKpiFolder *pFolder);
    DWORD  WINAPI Select(DWORD dwNumber,
                         const KPI_MEDIAINFO **ppMediaInfo,
                         IKpiTagInfo *pTagInfo,
                         DWORD dwTagGetFlags);
    UINT64 WINAPI Seek(UINT64 qwPosSample, DWORD dwFlag);
    DWORD  WINAPI Render(BYTE *pBuffer, DWORD dwSizeSample);
    DWORD  WINAPI UpdateConfig(void *pvReserved){return 0;}
};
