#ifndef CFRAMEDLIVESOURCE_H
#define CFRAMEDLIVESOURCE_H

#include "ImageHandler.h"
#include "FramedSource.hh"
#include <iostream>

class CFramedLiveSource : public FramedSource
{
public:
    static CFramedLiveSource* createNew(UsageEnvironment& env,CImageIO *piImgIO);

protected:
    CFramedLiveSource(UsageEnvironment& env,CImageIO *piImgIO); // called only by createNew()
    ~CFramedLiveSource();

private:
    virtual void doGetNextFrame();

protected:
    uint8_t * m_pTempBuffer;
    int    m_nLeftBufferLen;
    int    m_nBufferLen;

    unsigned fMaxPayloadSize;
    unsigned char* fOutputBuffer;

    uint  m_nFrameRate;
    CImageHandler *m_piImageHandler;
    CImageIO *m_piCVMatIO;
};

#endif // CFRAMEDLIVESOURCE_H
