vdr 2.7.9
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.6 2025/12/26 16:04:59 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
19class cRecorder : public cReceiver, cThread {
20private:
30 bool working;
32 off_t fileSize;
37 int errors;
39 void GetLastPts(const char *RecordingName);
40 bool RunningLowOnDiskSpace(void);
41 bool NextFile(void);
42 void HandleErrors(bool Force = false);
43protected:
44 virtual void Activate(bool On) override;
49 virtual void Receive(const uchar *Data, int Length) override;
50 virtual void Action(void) override;
51public:
52 cRecorder(const char *FileName, const cChannel *Channel, int Priority);
55 virtual ~cRecorder() override;
56 void Stop(void);
59 int Errors(void) { return oldErrors + errors + tmpErrors; };
64 };
65
66#endif //__RECORDER_H
int Priority(void)
Definition receiver.h:57
cReceiver(const cChannel *Channel=NULL, int Priority=MINPRIORITY)
Creates a new receiver for the given Channel with the given Priority.
Definition receiver.c:14
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:25
bool NextFile(void)
Definition recorder.c:141
cFileName * fileName
Definition recorder.h:25
cIndexFile * index
Definition recorder.h:27
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:160
int Errors(void)
Definition recorder.h:59
time_t lastErrorLog
Definition recorder.h:34
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:152
void HandleErrors(bool Force=false)
Definition recorder.c:110
void GetLastPts(const char *RecordingName)
Definition recorder.c:193
bool working
Definition recorder.h:30
void Stop(void)
Stops the recorder.
Definition recorder.c:103
off_t fileSize
Definition recorder.h:32
cRecordingInfo * recordingInfo
Definition recorder.h:26
cFrameDetector * frameDetector
Definition recorder.h:22
time_t lastDiskSpaceCheck
Definition recorder.h:33
cUnbufferedFile * recordFile
Definition recorder.h:28
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:245
bool firstIframeSeen
Definition recorder.h:31
cRingBufferLinear * ringBuffer
Definition recorder.h:21
int tmpErrors
Definition recorder.h:36
char * recordingName
Definition recorder.h:29
int oldErrors
Definition recorder.h:35
bool RunningLowOnDiskSpace(void)
Definition recorder.c:128
int errors
Definition recorder.h:37
virtual ~cRecorder() override
Definition recorder.c:86
cNaluStreamProcessor * naluStreamProcessor
Definition recorder.h:24
cPatPmtGenerator patPmtGenerator
Definition recorder.h:23
int lastErrors
Definition recorder.h:38
cThread(const char *Description=NULL, bool LowPriority=false)
Creates a new thread.
Definition thread.c:239
cUnbufferedFile is used for large files that are mainly written or read in a streaming manner,...
Definition tools.h:507
unsigned char uchar
Definition tools.h:31