#include <map>
#include "viewer.h"
#include "dec.h"
#include <vdr/thread.h>
#include <vdr/rcontroller.h>

using namespace RecordingPatch;

class cRingBufferFrame;
class cSynchronizer;
class cMutex;


class cDvbSubtitlesReplay : public cThread, public iRecordingPlugin
{
public:
  cDvbSubtitlesReplay(int Priority, int DataId);
  ~cDvbSubtitlesReplay();
  virtual void Receive(unsigned char DataIdentifier, unsigned char* Data, int Length);
protected:
  virtual void Action();
private:
  bool active,subscribed;
  SubtitlesViewer viewer;
  cDecoder decoder;
  cRingBufferFrame* ringBuffer;
  uint64_t clearTime;
  cSynchronizer* syncer;
  cMutex* mutex;
  int dataId,priority;

};
