vdr
2.2.0
|
#include <recording.h>
Public Member Functions | |
cIndexFile (const char *FileName, bool Record, bool IsPesRecording=false, bool PauseLive=false, bool Update=false) | |
~cIndexFile () | |
bool | Ok (void) |
bool | Write (bool Independent, uint16_t FileNumber, off_t FileOffset) |
bool | Get (int Index, uint16_t *FileNumber, off_t *FileOffset, bool *Independent=NULL, int *Length=NULL) |
int | GetNextIFrame (int Index, bool Forward, uint16_t *FileNumber=NULL, off_t *FileOffset=NULL, int *Length=NULL) |
int | GetClosestIFrame (int Index) |
int | Get (uint16_t FileNumber, off_t FileOffset) |
int | Last (void) |
int | GetResume (void) |
bool | StoreResume (int Index) |
bool | IsStillRecording (void) |
void | Delete (void) |
Static Public Member Functions | |
static int | GetLength (const char *FileName, bool IsPesRecording=false) |
static cString | IndexFileName (const char *FileName, bool IsPesRecording) |
Private Member Functions | |
void | ConvertFromPes (tIndexTs *IndexTs, int Count) |
void | ConvertToPes (tIndexTs *IndexTs, int Count) |
bool | CatchUp (int Index=-1) |
Private Attributes | |
int | f |
cString | fileName |
int | size |
int | last |
tIndexTs * | index |
bool | isPesRecording |
cResumeFile | resumeFile |
cIndexFileGenerator * | indexFileGenerator |
cMutex | mutex |
Definition at line 425 of file recording.h.
cIndexFile::cIndexFile | ( | const char * | FileName, |
bool | Record, | ||
bool | IsPesRecording = false , |
||
bool | PauseLive = false , |
||
bool | Update = false |
||
) |
Definition at line 2450 of file recording.c.
References ConvertFromPes(), cResumeFile::Delete(), esyslog, f, fileName, FileSize(), index, INDEXFILECHECKINTERVAL, indexFileGenerator, IndexFileName(), INDEXFILETESTINTERVAL, isPesRecording, isyslog, last, LOG_ERROR, LOG_ERROR_STR, MALLOC, MAXWAITFORINDEXFILE, MININDEXAGE, resumeFile, safe_read(), size, cCondWait::SleepMs(), and writechar().
cIndexFile::~cIndexFile | ( | ) |
Definition at line 2534 of file recording.c.
References f, index, and indexFileGenerator.
|
private |
Definition at line 2572 of file recording.c.
References ConvertFromPes(), esyslog, f, fileName, index, INDEXCATCHUPWAIT, isPesRecording, last, LOG_ERROR_STR, mutex, safe_read(), size, and cCondVar::TimedWait().
Referenced by Get(), and GetNextIFrame().
|
private |
Definition at line 2547 of file recording.c.
References tIndexTs::independent, tIndexPes::number, tIndexTs::number, tIndexPes::offset, tIndexTs::offset, and tIndexPes::type.
Referenced by CatchUp(), and cIndexFile().
|
private |
Definition at line 2559 of file recording.c.
References tIndexTs::independent, tIndexPes::number, tIndexTs::number, tIndexPes::offset, tIndexTs::offset, tIndexPes::reserved, and tIndexPes::type.
Referenced by Write().
void cIndexFile::Delete | ( | void | ) |
Definition at line 2756 of file recording.c.
References dsyslog, f, and fileName.
Referenced by cIndexFileGenerator::Action().
bool cIndexFile::Get | ( | int | Index, |
uint16_t * | FileNumber, | ||
off_t * | FileOffset, | ||
bool * | Independent = NULL , |
||
int * | Length = NULL |
||
) |
Definition at line 2645 of file recording.c.
References CatchUp(), tIndexTs::independent, index, last, tIndexTs::number, and tIndexTs::offset.
Referenced by cDvbPlayer::Action(), cIndexFileGenerator::Action(), cCuttingThread::LoadFrame(), and cDvbPlayer::Resume().
int cIndexFile::Get | ( | uint16_t | FileNumber, |
off_t | FileOffset | ||
) |
Definition at line 2737 of file recording.c.
int cIndexFile::GetClosestIFrame | ( | int | Index | ) |
Returns the index of the I-frame that is closest to the given Index (or Index itself, if it already points to an I-frame).
Index may be any value, even outside the current range of frame indexes. If there is no actual index data available, 0 is returned.
Definition at line 2709 of file recording.c.
References constrain(), index, and last.
Referenced by cMarks::Align().
|
static |
Calculates the recording length (number of frames) without actually reading the index file.
Returns -1 in case of error.
Definition at line 2768 of file recording.c.
References IndexFileName().
Referenced by cRecording::NumFrames().
int cIndexFile::GetNextIFrame | ( | int | Index, |
bool | Forward, | ||
uint16_t * | FileNumber = NULL , |
||
off_t * | FileOffset = NULL , |
||
int * | Length = NULL |
||
) |
Definition at line 2671 of file recording.c.
References CatchUp(), index, last, tIndexTs::number, and tIndexTs::offset.
Referenced by cDvbPlayer::Action(), cDvbPlayer::GetIndex(), cDvbPlayer::Goto(), cDvbPlayer::Save(), cDvbPlayer::SkipFrames(), and cDvbPlayer::SkipSeconds().
|
inline |
Definition at line 453 of file recording.h.
References cResumeFile::Read().
Referenced by cDvbPlayer::Resume().
|
static |
Definition at line 2542 of file recording.c.
References INDEXFILESUFFIX, and cString::sprintf().
Referenced by cIndexFile(), cRecording::FileSizeMB(), GenerateIndex(), GetLength(), and cRecording::NumFrames().
bool cIndexFile::IsStillRecording | ( | void | ) |
|
inline |
Returns the index of the last entry in this file, or -1 if the file is empty.
Definition at line 451 of file recording.h.
Referenced by cDvbPlayer::Action(), cCuttingThread::Action(), cIndexFileGenerator::Action(), cDvbPlayer::GetIndex(), and cCuttingThread::ProcessSequence().
|
inline |
Definition at line 441 of file recording.h.
Referenced by cDvbPlayer::cDvbPlayer().
|
inline |
Definition at line 454 of file recording.h.
References cResumeFile::Delete(), GetLength(), and cResumeFile::Save().
Referenced by cDvbPlayer::Save().
bool cIndexFile::Write | ( | bool | Independent, |
uint16_t | FileNumber, | ||
off_t | FileOffset | ||
) |
Definition at line 2628 of file recording.c.
References ConvertToPes(), f, fileName, isPesRecording, last, LOG_ERROR_STR, and safe_write().
Referenced by cRecorder::Action(), cIndexFileGenerator::Action(), and cCuttingThread::ProcessSequence().
|
private |
Definition at line 427 of file recording.h.
Referenced by CatchUp(), cIndexFile(), Delete(), GetRecordingsSortMode(), HMSFToIndex(), IndexToHMSF(), IsStillRecording(), SetRecordingsSortMode(), Write(), and ~cIndexFile().
|
private |
Definition at line 428 of file recording.h.
Referenced by CatchUp(), cFileName::cFileName(), cIndexFile(), cFileName::Close(), Delete(), cFileName::GetLastPatPmtVersions(), cFileName::Open(), cFileName::SetOffset(), Write(), and cFileName::~cFileName().
|
private |
Definition at line 430 of file recording.h.
Referenced by CatchUp(), cIndexFile(), Get(), GetClosestIFrame(), GetNextIFrame(), and ~cIndexFile().
|
private |
Definition at line 433 of file recording.h.
Referenced by cIndexFile(), and ~cIndexFile().
|
private |
Definition at line 431 of file recording.h.
Referenced by CatchUp(), cFileName::cFileName(), cIndexFile(), cFileName::GetLastPatPmtVersions(), cFileName::SetOffset(), and Write().
|
private |
Definition at line 429 of file recording.h.
Referenced by CatchUp(), cIndexFile(), Get(), GetClosestIFrame(), GetNextIFrame(), and Write().
|
private |
Definition at line 434 of file recording.h.
Referenced by CatchUp().
|
private |
Definition at line 432 of file recording.h.
Referenced by cIndexFile().
|
private |
Definition at line 429 of file recording.h.
Referenced by CatchUp(), and cIndexFile().