2002-06-16 12:57:31 +02:00
|
|
|
/*
|
|
|
|
* recorder.h: The actual DVB recorder
|
|
|
|
*
|
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
|
|
* how to reach the author.
|
|
|
|
*
|
2021-05-19 11:22:20 +02:00
|
|
|
* $Id: recorder.h 5.1 2021/05/19 11:22:20 kls Exp $
|
2002-06-16 12:57:31 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __RECORDER_H
|
|
|
|
#define __RECORDER_H
|
|
|
|
|
|
|
|
#include "receiver.h"
|
|
|
|
#include "recording.h"
|
|
|
|
#include "remux.h"
|
|
|
|
#include "ringbuffer.h"
|
|
|
|
#include "thread.h"
|
|
|
|
|
2021-05-19 11:22:20 +02:00
|
|
|
class cTsChecker;
|
|
|
|
class cFrameChecker;
|
|
|
|
|
2002-06-16 12:57:31 +02:00
|
|
|
class cRecorder : public cReceiver, cThread {
|
|
|
|
private:
|
2021-05-19 11:22:20 +02:00
|
|
|
cTsChecker *tsChecker;
|
|
|
|
cFrameChecker *frameChecker;
|
2002-06-16 12:57:31 +02:00
|
|
|
cRingBufferLinear *ringBuffer;
|
2009-01-06 14:41:11 +01:00
|
|
|
cFrameDetector *frameDetector;
|
|
|
|
cPatPmtGenerator patPmtGenerator;
|
|
|
|
cFileName *fileName;
|
2021-05-19 11:22:20 +02:00
|
|
|
cRecordingInfo *recordingInfo;
|
2009-01-06 14:41:11 +01:00
|
|
|
cIndexFile *index;
|
|
|
|
cUnbufferedFile *recordFile;
|
2010-12-27 12:25:19 +01:00
|
|
|
char *recordingName;
|
2021-05-19 11:22:20 +02:00
|
|
|
bool firstIframeSeen;
|
2009-01-06 14:41:11 +01:00
|
|
|
off_t fileSize;
|
|
|
|
time_t lastDiskSpaceCheck;
|
2021-05-19 11:22:20 +02:00
|
|
|
time_t lastErrorLog;
|
|
|
|
int oldErrors;
|
|
|
|
int errors;
|
|
|
|
int lastErrors;
|
2009-01-06 14:41:11 +01:00
|
|
|
bool RunningLowOnDiskSpace(void);
|
|
|
|
bool NextFile(void);
|
2021-05-19 11:22:20 +02:00
|
|
|
void HandleErrors(bool Force = false);
|
2002-06-16 12:57:31 +02:00
|
|
|
protected:
|
|
|
|
virtual void Activate(bool On);
|
2015-01-15 14:29:18 +01:00
|
|
|
///< If you override Activate() you need to call Detach() (which is a
|
|
|
|
///< member of the cReceiver class) from your own destructor in order
|
|
|
|
///< to properly get a call to Activate(false) when your object is
|
|
|
|
///< destroyed.
|
2015-09-05 11:49:56 +02:00
|
|
|
virtual void Receive(const uchar *Data, int Length);
|
2002-06-16 12:57:31 +02:00
|
|
|
virtual void Action(void);
|
|
|
|
public:
|
2010-01-30 11:10:25 +01:00
|
|
|
cRecorder(const char *FileName, const cChannel *Channel, int Priority);
|
2015-01-15 14:29:18 +01:00
|
|
|
///< Creates a new recorder for the given Channel and
|
|
|
|
///< the given Priority that will record into the file FileName.
|
2002-06-16 12:57:31 +02:00
|
|
|
virtual ~cRecorder();
|
2021-05-19 11:22:20 +02:00
|
|
|
int Errors(void) { return oldErrors + errors; };
|
|
|
|
///< Returns the number of errors that were detected during recording.
|
2002-06-16 12:57:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__RECORDER_H
|