vdr 2.6.3
|
#include <recorder.h>
Public Member Functions | |
cRecorder (const char *FileName, const cChannel *Channel, int Priority) | |
virtual | ~cRecorder () |
int | Errors (void) |
![]() | |
cReceiver (const cChannel *Channel=NULL, int Priority=MINPRIORITY) | |
virtual | ~cReceiver () |
int | Priority (void) |
void | SetPriority (int Priority) |
bool | AddPid (int Pid) |
bool | AddPids (const int *Pids) |
bool | AddPids (int Pid1, int Pid2, int Pid3=0, int Pid4=0, int Pid5=0, int Pid6=0, int Pid7=0, int Pid8=0, int Pid9=0) |
bool | SetPids (const cChannel *Channel) |
void | DelPid (int Pid) |
void | DelPids (const int *Pids) |
tChannelID | ChannelID (void) |
int | NumPids (void) const |
bool | IsAttached (void) |
Protected Member Functions | |
virtual void | Activate (bool On) |
virtual void | Receive (const uchar *Data, int Length) |
virtual void | Action (void) |
![]() | |
cDevice * | Device (void) |
void | Detach (void) |
virtual void | Activate (bool On) |
virtual void | Receive (const uchar *Data, int Length)=0 |
Private Member Functions | |
bool | RunningLowOnDiskSpace (void) |
bool | NextFile (void) |
void | HandleErrors (bool Force=false) |
![]() | |
cThread (const char *Description=NULL, bool LowPriority=false) | |
virtual | ~cThread () |
void | SetDescription (const char *Description,...) __attribute__((format(printf |
void bool | Start (void) |
bool | Active (void) |
void | SetPriority (int Priority) |
void | SetIOPriority (int Priority) |
void | Lock (void) |
void | Unlock (void) |
virtual void | Action (void)=0 |
bool | Running (void) |
void | Cancel (int WaitSeconds=0) |
Private Attributes | |
cTsChecker * | tsChecker |
cFrameChecker * | frameChecker |
cRingBufferLinear * | ringBuffer |
cFrameDetector * | frameDetector |
cPatPmtGenerator | patPmtGenerator |
cFileName * | fileName |
cRecordingInfo * | recordingInfo |
cIndexFile * | index |
cUnbufferedFile * | recordFile |
char * | recordingName |
bool | firstIframeSeen |
off_t | fileSize |
time_t | lastDiskSpaceCheck |
time_t | lastErrorLog |
int | oldErrors |
int | errors |
int | lastErrors |
Additional Inherited Members | |
![]() | |
static tThreadId | ThreadId (void) |
static tThreadId | IsMainThread (void) |
static void | SetMainThreadId (void) |
Definition at line 22 of file recorder.h.
cRecorder::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 FileName.
Definition at line 164 of file recorder.c.
References cChannel::Apid(), cChannel::Dpid(), errors, cRecordingInfo::Errors(), esyslog, fileName, fileSize, firstIframeSeen, frameChecker, frameDetector, cFileName::GetLastPatPmtVersions(), index, lastDiskSpaceCheck, lastErrorLog, lastErrors, max(), MIN_TS_PACKETS_FOR_FRAME_DETECTOR, oldErrors, cFileName::Open(), patPmtGenerator, cRecordingInfo::Read(), RECORDERBUFSIZE, recordFile, recordingInfo, recordingName, ringBuffer, cPatPmtGenerator::SetChannel(), cRingBuffer::SetIoThrottle(), cRingBuffer::SetTimeouts(), cPatPmtGenerator::SetVersions(), SpinUpDisk(), TS_SIZE, tsChecker, cChannel::Vpid(), and cChannel::Vtype().
|
virtual |
Definition at line 216 of file recorder.c.
References cReceiver::Detach(), fileName, frameChecker, frameDetector, index, recordingName, ringBuffer, and tsChecker.
|
protectedvirtual |
A derived cThread class must implement the code it wants to execute as a separate thread in this function.
If this is a loop, it must check Running() repeatedly to see whether it's time to stop.
Implements cThread.
Definition at line 315 of file recorder.c.
References cFrameDetector::Analyze(), cFrameChecker::CheckFrame(), DEFAULTFRAMESPERSECOND, cRingBufferLinear::Del(), DoubleEqual(), esyslog, fileName, fileSize, firstIframeSeen, frameChecker, frameDetector, cFrameDetector::FramesPerSecond(), cRecordingInfo::FramesPerSecond(), cRingBufferLinear::Get(), cPatPmtGenerator::GetPat(), cPatPmtGenerator::GetPmt(), HandleErrors(), cFrameDetector::IndependentFrame(), index, cRecordingUserCommand::InvokeCommand(), LOCK_RECORDINGS_WRITE, LOG_ERROR_STR, MAXBROKENTIMEOUT, cFileName::Name(), cFrameDetector::NewFrame(), NextFile(), cFileName::Number(), patPmtGenerator, PTSTICKS, recordFile, recordingInfo, recordingName, cFrameChecker::ReportBroken(), cShutdownHandler::RequestEmergencyExit(), ringBuffer, RUC_STARTRECORDING, cThread::Running(), cTimeMs::Set(), cFrameChecker::SetFrameDelta(), cRecordingInfo::SetFramesPerSecond(), ShutdownHandler, cFrameDetector::Synced(), cTimeMs::TimedOut(), TS_SIZE, cIndexFile::Write(), cUnbufferedFile::Write(), and cRecordingInfo::Write().
|
protectedvirtual |
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.
Reimplemented from cReceiver.
Definition at line 274 of file recorder.c.
References cThread::Cancel(), and cThread::Start().
|
inline |
Definition at line 57 of file recorder.h.
References errors, and oldErrors.
Referenced by cRecordControl::Stop().
|
private |
Definition at line 230 of file recorder.c.
References DebugChecks, ERROR_LOG_DELTA, cTsChecker::Errors(), cFrameChecker::Errors(), errors, esyslog, frameChecker, lastErrorLog, lastErrors, LOCK_RECORDINGS_WRITE, oldErrors, recordingInfo, recordingName, cRecordingInfo::SetErrors(), TimeToString(), tsChecker, and cRecordingInfo::Write().
Referenced by Action().
|
private |
Definition at line 263 of file recorder.c.
References fileName, fileSize, frameDetector, cFrameDetector::IndependentFrame(), cSetup::MaxVideoFileSize, MEGABYTE, cFileName::NextFile(), recordFile, RunningLowOnDiskSpace(), and Setup.
Referenced by Action().
|
protectedvirtual |
This function is called from the cDevice we are attached to, and delivers one TS packet from the set of PIDs the cReceiver has requested.
The data packet must be accepted immediately, and the call must return as soon as possible, without any unnecessary delay. Each TS packet will be delivered only ONCE, so the cReceiver must make sure that it will be able to buffer the data if necessary.
Implements cReceiver.
Definition at line 282 of file recorder.c.
References cTsChecker::CheckTs(), firstIframeSeen, cRingBufferLinear::Put(), cRingBuffer::ReportOverflow(), ringBuffer, cThread::Running(), TS_SIZE, and tsChecker.
|
private |
Definition at line 250 of file recorder.c.
References DISKCHECKINTERVAL, dsyslog, fileName, FreeDiskSpaceMB(), lastDiskSpaceCheck, MINFREEDISKSPACE, and cFileName::Name().
Referenced by NextFile().
|
private |
Definition at line 39 of file recorder.h.
Referenced by cRecorder(), Errors(), and HandleErrors().
|
private |
Definition at line 29 of file recorder.h.
Referenced by Action(), cRecorder(), NextFile(), RunningLowOnDiskSpace(), and ~cRecorder().
|
private |
Definition at line 35 of file recorder.h.
Referenced by Action(), cRecorder(), and NextFile().
|
private |
Definition at line 34 of file recorder.h.
Referenced by Action(), cRecorder(), and Receive().
|
private |
Definition at line 25 of file recorder.h.
Referenced by Action(), cRecorder(), HandleErrors(), and ~cRecorder().
|
private |
Definition at line 27 of file recorder.h.
Referenced by Action(), cRecorder(), NextFile(), and ~cRecorder().
|
private |
Definition at line 31 of file recorder.h.
Referenced by Action(), cRecorder(), and ~cRecorder().
|
private |
Definition at line 36 of file recorder.h.
Referenced by cRecorder(), and RunningLowOnDiskSpace().
|
private |
Definition at line 37 of file recorder.h.
Referenced by cRecorder(), and HandleErrors().
|
private |
Definition at line 40 of file recorder.h.
Referenced by cRecorder(), and HandleErrors().
|
private |
Definition at line 38 of file recorder.h.
Referenced by cRecorder(), Errors(), and HandleErrors().
|
private |
Definition at line 28 of file recorder.h.
Referenced by Action(), and cRecorder().
|
private |
Definition at line 32 of file recorder.h.
Referenced by Action(), cRecorder(), and NextFile().
|
private |
Definition at line 30 of file recorder.h.
Referenced by Action(), cRecorder(), and HandleErrors().
|
private |
Definition at line 33 of file recorder.h.
Referenced by Action(), cRecorder(), HandleErrors(), and ~cRecorder().
|
private |
Definition at line 26 of file recorder.h.
Referenced by Action(), cRecorder(), Receive(), and ~cRecorder().
|
private |
Definition at line 24 of file recorder.h.
Referenced by cRecorder(), HandleErrors(), Receive(), and ~cRecorder().