vdr
2.4.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 451 of file recording.h.
cIndexFile::cIndexFile | ( | const char * | FileName, |
bool | Record, | ||
bool | IsPesRecording = false , |
||
bool | PauseLive = false , |
||
bool | Update = false |
||
) |
Definition at line 2520 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 2604 of file recording.c.
References f, index, and indexFileGenerator.
|
private |
Definition at line 2642 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(), GetNextIFrame(), and Last().
|
private |
Definition at line 2617 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 2629 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 2826 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 2715 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 2807 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 2779 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 2838 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 2741 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 479 of file recording.h.
References cResumeFile::Read(), and resumeFile.
Referenced by cDvbPlayer::Resume().
|
static |
Definition at line 2612 of file recording.c.
References INDEXFILESUFFIX, and cString::sprintf().
Referenced by cIndexFile(), cRecording::FileSizeMB(), 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 477 of file recording.h.
References CatchUp(), and last.
Referenced by cCuttingThread::Action(), cDvbPlayer::Action(), cIndexFileGenerator::Action(), cDvbPlayer::GetFrameNumber(), cDvbPlayer::GetIndex(), and cCuttingThread::ProcessSequence().
|
inline |
Definition at line 467 of file recording.h.
References index.
Referenced by cDvbPlayer::cDvbPlayer().
|
inline |
Definition at line 480 of file recording.h.
References resumeFile, and cResumeFile::Save().
Referenced by cDvbPlayer::Save().
bool cIndexFile::Write | ( | bool | Independent, |
uint16_t | FileNumber, | ||
off_t | FileOffset | ||
) |
Definition at line 2698 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 453 of file recording.h.
Referenced by CatchUp(), cIndexFile(), Delete(), IsStillRecording(), Write(), and ~cIndexFile().
|
private |
Definition at line 454 of file recording.h.
Referenced by CatchUp(), cIndexFile(), Delete(), and Write().
|
private |
Definition at line 456 of file recording.h.
Referenced by CatchUp(), cIndexFile(), Get(), GetClosestIFrame(), GetNextIFrame(), Ok(), and ~cIndexFile().
|
private |
Definition at line 459 of file recording.h.
Referenced by cIndexFile(), and ~cIndexFile().
|
private |
Definition at line 457 of file recording.h.
Referenced by CatchUp(), cIndexFile(), and Write().
|
private |
Definition at line 455 of file recording.h.
Referenced by CatchUp(), cIndexFile(), Get(), GetClosestIFrame(), GetNextIFrame(), Last(), and Write().
|
private |
Definition at line 460 of file recording.h.
Referenced by CatchUp().
|
private |
Definition at line 458 of file recording.h.
Referenced by cIndexFile(), GetResume(), and StoreResume().
|
private |
Definition at line 455 of file recording.h.
Referenced by CatchUp(), and cIndexFile().