#pragma once

#include "kpi_impl.h"
#include "kpi_decoder.h"
#include "libasap/asap/asap.h"

class KbSapDecoder : public KbKpiDecoderImpl
{
private:
    ASAP         *m_pAsap;
    IKpiFile     *m_pFile;
    IKpiFolder   *m_pFolder;
    const BYTE   *m_pBuffer;
    DWORD         m_dwSize;
    KPI_MEDIAINFO m_MediaInfo;
public:
    DWORD  __fastcall Open(const KPI_MEDIAINFO *cpRequest,
                           IKpiFile   *pFile,
                           IKpiFolder *pFolder);
    DWORD  WINAPI Select(DWORD dwNumber,
                         const KPI_MEDIAINFO **ppMediaInfo,
                         IKpiTagInfo *pTagInfo,
                         DWORD dwTagGetFlags);
    DWORD  WINAPI Render(BYTE *pBuffer, DWORD dwSizeSample);
    UINT64 WINAPI Seek(UINT64 qwPosSample, DWORD dwFlag);
    DWORD  WINAPI UpdateConfig(void *pvReserved){return 0;}
    void __fastcall GetTagInfo(IKpiTagInfo *pTagInfo, DWORD dwTagGetFlags);
    KbSapDecoder(void);
    ~KbSapDecoder(void);
};
