#pragma once

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

class KbTssDecoder : public KbKpiUnknownImpl<IKpiDecoder>
{
private:
    KPI_MEDIAINFO  m_MediaInfo;
    IKpiFile      *m_pFile;
    const BYTE    *m_pBuffer;
    DWORD          m_dwSize;
    static KbTssDecoder *s_pActive;//マルチプルインスタンスでない場合に使う
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);
    static void __fastcall Uninitialize(void);
    KbTssDecoder(IKpiConfig *pConfig);
    ~KbTssDecoder(void);
};
