vdr
1.7.27
|
#include <recorder.h>
Public Member Functions | |
cRecorder (const char *FileName, const cChannel *Channel, int Priority) | |
virtual | ~cRecorder () |
cRecorder (const char *FileName, const cChannel *Channel, int Priority) | |
virtual | ~cRecorder () |
Protected Member Functions | |
virtual void | Activate (bool On) |
virtual void | Receive (uchar *Data, int Length) |
virtual void | Action (void) |
virtual void | Activate (bool On) |
virtual void | Receive (uchar *Data, int Length) |
virtual void | Action (void) |
Private Member Functions | |
bool | RunningLowOnDiskSpace (void) |
bool | NextFile (void) |
bool | RunningLowOnDiskSpace (void) |
bool | NextFile (void) |
Private Attributes | |
cRingBufferLinear * | ringBuffer |
cFrameDetector * | frameDetector |
cPatPmtGenerator | patPmtGenerator |
cFileName * | fileName |
cIndexFile * | index |
cUnbufferedFile * | recordFile |
char * | recordingName |
off_t | fileSize |
time_t | lastDiskSpaceCheck |
Definition at line 19 of file include/vdr/recorder.h.
cRecorder::cRecorder | ( | const char * | FileName, |
const cChannel * | Channel, | ||
int | Priority | ||
) |
Definition at line 24 of file recorder.c.
References cChannel::Apid(), cChannel::Dpid(), esyslog, fileName, fileSize, frameDetector, cFileName::GetLastPatPmtVersions(), index, lastDiskSpaceCheck, MIN_TS_PACKETS_FOR_FRAME_DETECTOR, cFileName::Open(), patPmtGenerator, RECORDERBUFSIZE, recordFile, recordingName, ringBuffer, cPatPmtGenerator::SetChannel(), cRingBuffer::SetTimeouts(), cPatPmtGenerator::SetVersions(), SpinUpDisk(), TS_SIZE, cChannel::Vpid(), and cChannel::Vtype().
cRecorder::~cRecorder | ( | ) | [virtual] |
Definition at line 66 of file recorder.c.
References cReceiver::Detach(), fileName, frameDetector, index, recordingName, and ringBuffer.
cRecorder::cRecorder | ( | const char * | FileName, |
const cChannel * | Channel, | ||
int | Priority | ||
) |
virtual cRecorder::~cRecorder | ( | ) | [virtual] |
void cRecorder::Action | ( | void | ) | [protected, virtual] |
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 117 of file recorder.c.
References cFrameDetector::Analyze(), DEFAULTFRAMESPERSECOND, cRingBufferLinear::Del(), DoubleEqual(), esyslog, fileName, fileSize, frameDetector, cRecordingInfo::FramesPerSecond(), cFrameDetector::FramesPerSecond(), cRingBufferLinear::Get(), cPatPmtGenerator::GetPat(), cPatPmtGenerator::GetPmt(), cFrameDetector::IndependentFrame(), index, LOG_ERROR_STR, MAXBROKENTIMEOUT, cFileName::Name(), cFrameDetector::NewFrame(), NextFile(), cFileName::Number(), patPmtGenerator, cRecordingInfo::Read(), recordFile, recordingName, Recordings, cShutdownHandler::RequestEmergencyExit(), ringBuffer, cThread::Running(), cRecordingInfo::SetFramesPerSecond(), ShutdownHandler, cFrameDetector::Synced(), TS_SIZE, cRecordings::UpdateByName(), cRecordingInfo::Write(), cIndexFile::Write(), and cUnbufferedFile::Write().
virtual void cRecorder::Action | ( | void | ) | [protected, virtual] |
virtual void cRecorder::Activate | ( | bool | On | ) | [protected, virtual] |
void cRecorder::Activate | ( | bool | On | ) | [protected, virtual] |
This function is called just before the cReceiver gets attached to (On == true) or detached from (On == false) a cDevice.
It can be used to do things like starting/stopping a thread. It is guaranteed that Receive() will not be called before Activate(true).
Reimplemented from cReceiver.
Definition at line 100 of file recorder.c.
References cThread::Cancel(), and cThread::Start().
bool cRecorder::NextFile | ( | void | ) | [private] |
bool cRecorder::NextFile | ( | void | ) | [private] |
Definition at line 89 of file recorder.c.
References fileName, fileSize, frameDetector, cFrameDetector::IndependentFrame(), cFileName::MaxFileSize(), cFileName::NextFile(), recordFile, and RunningLowOnDiskSpace().
Referenced by Action().
virtual void cRecorder::Receive | ( | uchar * | Data, |
int | Length | ||
) | [protected, virtual] |
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.
void cRecorder::Receive | ( | uchar * | Data, |
int | Length | ||
) | [protected, virtual] |
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 108 of file recorder.c.
References cRingBufferLinear::Put(), cRingBuffer::ReportOverflow(), ringBuffer, and cThread::Running().
bool cRecorder::RunningLowOnDiskSpace | ( | void | ) | [private] |
bool cRecorder::RunningLowOnDiskSpace | ( | void | ) | [private] |
Definition at line 76 of file recorder.c.
References DISKCHECKINTERVAL, dsyslog, fileName, FreeDiskSpaceMB(), lastDiskSpaceCheck, MINFREEDISKSPACE, and cFileName::Name().
Referenced by NextFile().
cFileName * cRecorder::fileName [private] |
Definition at line 24 of file include/vdr/recorder.h.
Referenced by Action(), cRecorder(), NextFile(), RunningLowOnDiskSpace(), and ~cRecorder().
off_t cRecorder::fileSize [private] |
Definition at line 28 of file include/vdr/recorder.h.
Referenced by Action(), cRecorder(), and NextFile().
cFrameDetector * cRecorder::frameDetector [private] |
Definition at line 22 of file include/vdr/recorder.h.
Referenced by Action(), cRecorder(), NextFile(), and ~cRecorder().
cIndexFile * cRecorder::index [private] |
Definition at line 25 of file include/vdr/recorder.h.
Referenced by Action(), cRecorder(), and ~cRecorder().
time_t cRecorder::lastDiskSpaceCheck [private] |
Definition at line 29 of file include/vdr/recorder.h.
Referenced by cRecorder(), and RunningLowOnDiskSpace().
cPatPmtGenerator cRecorder::patPmtGenerator [private] |
Definition at line 23 of file include/vdr/recorder.h.
Referenced by Action(), and cRecorder().
cUnbufferedFile * cRecorder::recordFile [private] |
Definition at line 26 of file include/vdr/recorder.h.
Referenced by Action(), cRecorder(), and NextFile().
char * cRecorder::recordingName [private] |
Definition at line 27 of file include/vdr/recorder.h.
Referenced by Action(), cRecorder(), and ~cRecorder().
cRingBufferLinear * cRecorder::ringBuffer [private] |
Definition at line 21 of file include/vdr/recorder.h.
Referenced by Action(), cRecorder(), Receive(), and ~cRecorder().