vdr
1.7.27
|
#include "recording.h"
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "channels.h"
#include "i18n.h"
#include "interface.h"
#include "remux.h"
#include "ringbuffer.h"
#include "skins.h"
#include "tools.h"
#include "videodir.h"
Go to the source code of this file.
Classes | |
class | cRemoveDeletedRecordingsThread |
struct | tCharExchange |
class | cIndexFileGenerator |
struct | tIndexPes |
struct | tIndexTs |
Defines | |
#define | __STDC_FORMAT_MACROS |
#define | SUMMARYFALLBACK |
#define | RECEXT ".rec" |
#define | DELEXT ".del" |
#define | DATAFORMATPES "%4d-%02d-%02d.%02d%*c%02d.%02d.%02d" RECEXT |
#define | NAMEFORMATPES "%s/%s/" "%4d-%02d-%02d.%02d.%02d.%02d.%02d" RECEXT |
#define | DATAFORMATTS "%4d-%02d-%02d.%02d.%02d.%d-%d" RECEXT |
#define | NAMEFORMATTS "%s/%s/" DATAFORMATTS |
#define | RESUMEFILESUFFIX "/resume%s%s" |
#define | SUMMARYFILESUFFIX "/summary.vdr" |
#define | INFOFILESUFFIX "/info" |
#define | MARKSFILESUFFIX "/marks" |
#define | MINDISKSPACE 1024 |
#define | REMOVECHECKDELTA 60 |
#define | DELETEDLIFETIME 300 |
#define | DISKCHECKDELTA 100 |
#define | REMOVELATENCY 10 |
#define | MARKSUPDATEDELTA 10 |
#define | MININDEXAGE 3600 |
#define | MAX_SUBTITLE_LENGTH 40 |
#define | MAX_LINK_LEVEL 6 |
#define | RESUME_NOT_INITIALIZED (-2) |
#define | IFG_BUFFER_SIZE KILOBYTE(100) |
#define | INDEXFILESUFFIX "/index" |
#define | MAXINDEXCATCHUP 8 |
#define | MAXWAITFORINDEXFILE 10 |
#define | INDEXFILECHECKINTERVAL 500 |
#define | INDEXFILETESTINTERVAL 10 |
#define | MAXFILESPERRECORDINGPES 255 |
#define | RECORDFILESUFFIXPES "/%03d.vdr" |
#define | MAXFILESPERRECORDINGTS 65535 |
#define | RECORDFILESUFFIXTS "/%05d.ts" |
#define | RECORDFILESUFFIXLEN 20 |
Functions | |
cRecordings | DeletedRecordings (true) |
void | RemoveDeletedRecordings (void) |
void | AssertFreeDiskSpace (int Priority, bool Force) |
char * | ExchangeChars (char *s, bool ToFileSystem) |
bool | GenerateIndex (const char *FileName) |
cString | IndexToHMSF (int Index, bool WithFrame, double FramesPerSecond) |
int | HMSFToIndex (const char *HMSF, double FramesPerSecond) |
int | SecondsToFrames (int Seconds, double FramesPerSecond) |
int | ReadFrame (cUnbufferedFile *f, uchar *b, int Length, int Max) |
Variables | |
bool | VfatFileSystem = false |
int | InstanceId = 0 |
static cRemoveDeletedRecordingsThread | RemoveDeletedRecordingsThread |
tCharExchange | CharExchange [] |
cRecordings | Recordings |
double | MarkFramesPerSecond = DEFAULTFRAMESPERSECOND |
cMutex | MutexMarkFramesPerSecond |
#define __STDC_FORMAT_MACROS |
Definition at line 15 of file recording.c.
#define DATAFORMATPES "%4d-%02d-%02d.%02d%*c%02d.%02d.%02d" RECEXT |
Definition at line 44 of file recording.c.
Referenced by cRecording::cRecording().
#define DATAFORMATTS "%4d-%02d-%02d.%02d.%02d.%d-%d" RECEXT |
Definition at line 46 of file recording.c.
Referenced by cRecording::cRecording().
#define DELETEDLIFETIME 300 |
Definition at line 59 of file recording.c.
Referenced by cRemoveDeletedRecordingsThread::Action(), and RemoveDeletedRecordings().
#define DELEXT ".del" |
Definition at line 34 of file recording.c.
Referenced by cRecordings::DelByName(), cRecording::Delete(), cRecording::Remove(), cRecordings::ScanVideoDir(), and cRecording::Undelete().
#define DISKCHECKDELTA 100 |
Definition at line 60 of file recording.c.
Referenced by AssertFreeDiskSpace().
#define IFG_BUFFER_SIZE KILOBYTE(100) |
Definition at line 1446 of file recording.c.
Referenced by cIndexFileGenerator::Action().
#define INDEXFILECHECKINTERVAL 500 |
Definition at line 1594 of file recording.c.
Referenced by cIndexFile::cIndexFile(), and GenerateIndex().
#define INDEXFILESUFFIX "/index" |
Definition at line 1567 of file recording.c.
Referenced by GenerateIndex(), and cIndexFile::IndexFileName().
#define INDEXFILETESTINTERVAL 10 |
Definition at line 1595 of file recording.c.
Referenced by cIndexFile::cIndexFile().
#define INFOFILESUFFIX "/info" |
Definition at line 53 of file recording.c.
Referenced by cRecording::cRecording(), cRecordingInfo::cRecordingInfo(), and cRecording::WriteInfo().
#define MARKSFILESUFFIX "/marks" |
Definition at line 54 of file recording.c.
Referenced by cMarks::Load().
#define MARKSUPDATEDELTA 10 |
Definition at line 62 of file recording.c.
#define MAX_LINK_LEVEL 6 |
Definition at line 67 of file recording.c.
Referenced by cRecordings::ScanVideoDir().
#define MAX_SUBTITLE_LENGTH 40 |
Definition at line 65 of file recording.c.
Referenced by cRecording::cRecording().
#define MAXFILESPERRECORDINGPES 255 |
Definition at line 1921 of file recording.c.
Referenced by cFileName::SetOffset().
#define MAXFILESPERRECORDINGTS 65535 |
Definition at line 1923 of file recording.c.
Referenced by cFileName::GetLastPatPmtVersions(), and cFileName::SetOffset().
#define MAXINDEXCATCHUP 8 |
Definition at line 1570 of file recording.c.
#define MAXWAITFORINDEXFILE 10 |
Definition at line 1593 of file recording.c.
Referenced by cIndexFile::cIndexFile().
#define MINDISKSPACE 1024 |
Definition at line 56 of file recording.c.
Referenced by AssertFreeDiskSpace().
#define MININDEXAGE 3600 |
Definition at line 63 of file recording.c.
Referenced by cIndexFile::CatchUp(), cRecording::FileSizeMB(), and cRecording::NumFrames().
#define NAMEFORMATPES "%s/%s/" "%4d-%02d-%02d.%02d.%02d.%02d.%02d" RECEXT |
Definition at line 45 of file recording.c.
Referenced by cRecording::FileName().
#define NAMEFORMATTS "%s/%s/" DATAFORMATTS |
Definition at line 47 of file recording.c.
Referenced by cRecording::FileName().
#define RECEXT ".rec" |
Definition at line 33 of file recording.c.
Referenced by cRecording::Delete(), cRecordings::ScanVideoDir(), and cRecording::Undelete().
#define RECORDFILESUFFIXLEN 20 |
Definition at line 1925 of file recording.c.
Referenced by cFileName::cFileName().
#define RECORDFILESUFFIXPES "/%03d.vdr" |
Definition at line 1922 of file recording.c.
Referenced by cFileName::SetOffset().
#define RECORDFILESUFFIXTS "/%05d.ts" |
Definition at line 1924 of file recording.c.
Referenced by cFileName::GetLastPatPmtVersions(), and cFileName::SetOffset().
#define REMOVECHECKDELTA 60 |
Definition at line 58 of file recording.c.
Referenced by RemoveDeletedRecordings().
#define REMOVELATENCY 10 |
Definition at line 61 of file recording.c.
Referenced by AssertFreeDiskSpace().
#define RESUME_NOT_INITIALIZED (-2) |
Definition at line 525 of file recording.c.
Referenced by cRecording::cRecording(), cRecording::GetResume(), and cRecording::ResetResume().
#define RESUMEFILESUFFIX "/resume%s%s" |
Definition at line 49 of file recording.c.
Referenced by cResumeFile::cResumeFile().
#define SUMMARYFALLBACK |
Definition at line 31 of file recording.c.
#define SUMMARYFILESUFFIX "/summary.vdr" |
Definition at line 51 of file recording.c.
Referenced by cRecording::cRecording().
void AssertFreeDiskSpace | ( | int | Priority = 0 , |
bool | Force = false |
||
) |
The special Priority value -1 means that we shall get rid of any deleted recordings faster than normal (because we're cutting).
If Force is true, the check will be done even if the timeout hasn't expired yet.
Definition at line 134 of file recording.c.
References cListBase::Count(), cListBase::Del(), cRecording::Delete(), DeletedRecordings, DISKCHECKDELTA, cRecording::FileName(), cList< T >::First(), cRecording::IsEdited(), IsOnVideoDirectoryFileSystem(), isyslog, cRecording::Lifetime(), cLockFile::Lock(), MAXLIFETIME, MINDISKSPACE, mtWarning, cList< T >::Next(), cRecording::Priority(), cSkins::QueueMessage(), Recordings, cRecording::Remove(), REMOVELATENCY, SECSINDAY, Skins, cRecording::Start(), tr, cRecordings::Update(), VideoDirectory, and VideoFileSpaceAvailable().
Referenced by cCuttingThread::Action(), cRecordControl::Process(), and cRecordControls::Start().
cRecordings DeletedRecordings | ( | true | ) |
char* ExchangeChars | ( | char * | s, |
bool | ToFileSystem | ||
) |
Definition at line 539 of file recording.c.
References tCharExchange::a, esyslog, FOLDERDELIMCHAR, and VfatFileSystem.
Referenced by cRecording::cRecording(), cRecording::FileName(), and NewVideoFileName().
bool GenerateIndex | ( | const char * | FileName | ) |
Definition at line 1892 of file recording.c.
References cThread::Active(), AddDirectory(), DirectoryOk(), INDEXFILECHECKINTERVAL, INDEXFILESUFFIX, cRecording::IsPesRecording(), cRecording::Name(), and cCondWait::SleepMs().
Referenced by main().
int HMSFToIndex | ( | const char * | HMSF, |
double | FramesPerSecond | ||
) |
Definition at line 2114 of file recording.c.
Referenced by cSVDRP::CmdPLAY(), and cMark::Parse().
cString IndexToHMSF | ( | int | Index, |
bool | WithFrame, | ||
double | FramesPerSecond | ||
) |
Definition at line 2098 of file recording.c.
References cString::sprintf().
Referenced by cDvbPlayer::Action(), cReplayControl::ShowProgress(), and cMark::ToText().
int ReadFrame | ( | cUnbufferedFile * | f, |
uchar * | b, | ||
int | Length, | ||
int | Max | ||
) |
Definition at line 2132 of file recording.c.
References esyslog, LOG_ERROR, and cUnbufferedFile::Read().
Referenced by cCuttingThread::Action(), and cDvbPlayer::Goto().
void RemoveDeletedRecordings | ( | void | ) |
Definition at line 117 of file recording.c.
References cThread::Active(), DELETEDLIFETIME, DeletedRecordings, cList< T >::First(), cList< T >::Next(), REMOVECHECKDELTA, and cThread::Start().
Referenced by main().
int SecondsToFrames | ( | int | Seconds, |
double | FramesPerSecond | ||
) |
Definition at line 2125 of file recording.c.
Referenced by cReplayControl::EditTest(), cReplayControl::MarkJump(), cDvbPlayer::SkipSeconds(), and cReplayControl::TimeSearchProcess().
{ { FOLDERDELIMCHAR, '/' }, { '/', FOLDERDELIMCHAR }, { ' ', '_' }, { '\'', '\'' }, { '\'', '\x01' }, { '/', '\x02' }, { 0, 0 } }
Definition at line 528 of file recording.c.
int InstanceId = 0 |
Definition at line 70 of file recording.c.
Referenced by cRecording::cRecording(), and main().
Definition at line 1302 of file recording.c.
Referenced by cMark::Parse(), and cMarks::Update().
Definition at line 1303 of file recording.c.
Definition at line 1089 of file recording.c.
Referenced by cCuttingThread::Action(), cRecorder::Action(), cCopyingThread::Action(), AssertFreeDiskSpace(), cMenuRecordings::cMenuRecordings(), cMenuTimers::Commands(), cRecordControl::cRecordControl(), cResumeFile::Delete(), cMenuRecordings::Delete(), cReplayControl::GetInfo(), cMenuRecordings::GetRecording(), cFreeDiskSpace::HasChanged(), main(), cMenuRecordings::ProcessKey(), cResumeFile::Save(), cMenuRecordings::Set(), SetTrackDescriptions(), cCutter::Start(), cFileTransfer::Stop(), cCutter::Stop(), cReplayControl::Stop(), and cMenuSetupReplay::Store().
Definition at line 113 of file recording.c.
bool VfatFileSystem = false |
Definition at line 69 of file recording.c.
Referenced by cTimer::cTimer(), ExchangeChars(), main(), and cTimer::Parse().