vdr  2.7.6
recorder.h
Go to the documentation of this file.
1 /*
2  * recorder.h: The actual DVB recorder
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: recorder.h 5.4 2025/03/02 11:03:35 kls Exp $
8  */
9 
10 #ifndef __RECORDER_H
11 #define __RECORDER_H
12 
13 #include "receiver.h"
14 #include "recording.h"
15 #include "remux.h"
16 #include "ringbuffer.h"
17 #include "thread.h"
18 
19 class cRecorder : public cReceiver, cThread {
20 private:
30  off_t fileSize;
32  time_t lastErrorLog;
33  int oldErrors;
34  int errors;
36  bool RunningLowOnDiskSpace(void);
37  bool NextFile(void);
38  void HandleErrors(bool Force = false);
39 protected:
40  virtual void Activate(bool On) override;
45  virtual void Receive(const uchar *Data, int Length) override;
46  virtual void Action(void) override;
47 public:
48  cRecorder(const char *FileName, const cChannel *Channel, int Priority);
51  virtual ~cRecorder() override;
52  int Errors(void) { return oldErrors + errors; };
57  };
58 
59 #endif //__RECORDER_H
int Priority(void)
Definition: receiver.h:57
cRecorder(const char *FileName, const cChannel *Channel, int Priority)
Creates a new recorder for the given Channel and the given Priority that will record into the file Fi...
Definition: recorder.c:24
bool NextFile(void)
Definition: recorder.c:116
cFileName * fileName
Definition: recorder.h:24
cIndexFile * index
Definition: recorder.h:26
virtual void Receive(const uchar *Data, int Length) override
This function is called from the cDevice we are attached to, and delivers one TS packet from the set ...
Definition: recorder.c:135
int Errors(void)
Definition: recorder.h:52
time_t lastErrorLog
Definition: recorder.h:32
virtual void Activate(bool On) override
If you override Activate() you need to call Detach() (which is a member of the cReceiver class) from ...
Definition: recorder.c:127
void HandleErrors(bool Force=false)
Definition: recorder.c:86
off_t fileSize
Definition: recorder.h:30
cRecordingInfo * recordingInfo
Definition: recorder.h:25
cFrameDetector * frameDetector
Definition: recorder.h:22
time_t lastDiskSpaceCheck
Definition: recorder.h:31
cUnbufferedFile * recordFile
Definition: recorder.h:27
virtual void Action(void) override
A derived cThread class must implement the code it wants to execute as a separate thread in this func...
Definition: recorder.c:166
bool firstIframeSeen
Definition: recorder.h:29
cRingBufferLinear * ringBuffer
Definition: recorder.h:21
char * recordingName
Definition: recorder.h:28
int oldErrors
Definition: recorder.h:33
bool RunningLowOnDiskSpace(void)
Definition: recorder.c:103
int errors
Definition: recorder.h:34
virtual ~cRecorder() override
Definition: recorder.c:74
cPatPmtGenerator patPmtGenerator
Definition: recorder.h:23
int lastErrors
Definition: recorder.h:35
Definition: thread.h:79
cUnbufferedFile is used for large files that are mainly written or read in a streaming manner,...
Definition: tools.h:494
unsigned char uchar
Definition: tools.h:31