#ifndef ASFREADHANDLER_H
#define ASFREADHANDLER_H

#include <default.h>
#include <except.h>
#include <string>
#include <vector>
#include <list>
#include <pthread.h>
#include <ReadHandlers.h>
#include "Iterator.h"

class Iterator;
class ASFInputStream;
class ASFStreamSeekInfo;

class ASFReadHandler : public IMediaReadHandler
{
friend class ASFReadStream;
    std::vector<ASFReadStream> m_Streams;
    std::vector<const ASFStreamSeekInfo*> m_SeekInfo;
    MainASFHeader m_Header;
protected:
    ASFInputStream* m_pInput;
public:
    ASFReadHandler(const char* pszFile) throw(FatalError);
    virtual ~ASFReadHandler();
    virtual IMediaReadStream *GetStream(fourcc_t fccType, fourcc_t lParam);
    virtual HRESULT GetHeader(void* pheader, size_t n) const;
    virtual bool GetURLs(std::vector<std::string>& urls) const;
    virtual void Interrupt();

    virtual bool IsOpened() const;
    virtual bool IsValid() const;

    virtual bool IsRedirector() const;
};

#endif
