vdr 2.7.6
cIndexFile Class Reference

#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 Errors=false, bool Missing=false)
bool Get (int Index, uint16_t *FileNumber, off_t *FileOffset, bool *Independent=NULL, int *Length=NULL, bool *Errors=NULL, bool *Missing=NULL)
const cErrorsGetErrors (void)
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
int lastErrorIndex
tIndexTs * index
bool isPesRecording
cResumeFile resumeFile
cErrors errors
cIndexFileGeneratorindexFileGenerator
cMutex mutex

Detailed Description

Definition at line 489 of file recording.h.

Constructor & Destructor Documentation

◆ cIndexFile()

cIndexFile::cIndexFile ( const char * FileName,
bool Record,
bool IsPesRecording = false,
bool PauseLive = false,
bool Update = false )

◆ ~cIndexFile()

cIndexFile::~cIndexFile ( )

Definition at line 2855 of file recording.c.

References f, index, and indexFileGenerator.

Member Function Documentation

◆ CatchUp()

bool cIndexFile::CatchUp ( int Index = -1)
private

◆ ConvertFromPes()

void cIndexFile::ConvertFromPes ( tIndexTs * IndexTs,
int Count )
private

Definition at line 2868 of file recording.c.

Referenced by CatchUp(), and cIndexFile().

◆ ConvertToPes()

void cIndexFile::ConvertToPes ( tIndexTs * IndexTs,
int Count )
private

Definition at line 2880 of file recording.c.

Referenced by Write().

◆ Delete()

void cIndexFile::Delete ( void )

Definition at line 3092 of file recording.c.

References dsyslog, f, and fileName.

Referenced by cIndexFileGenerator::Action().

◆ Get() [1/2]

bool cIndexFile::Get ( int Index,
uint16_t * FileNumber,
off_t * FileOffset,
bool * Independent = NULL,
int * Length = NULL,
bool * Errors = NULL,
bool * Missing = NULL )

Definition at line 2966 of file recording.c.

References CatchUp(), index, and last.

Referenced by cIndexFileGenerator::Action().

◆ Get() [2/2]

int cIndexFile::Get ( uint16_t FileNumber,
off_t FileOffset )

Definition at line 3073 of file recording.c.

References CatchUp(), index, and last.

◆ GetClosestIFrame()

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 3045 of file recording.c.

References constrain(), index, and last.

Referenced by cMarks::Align().

◆ GetErrors()

const cErrors * cIndexFile::GetErrors ( void )

Returns the frame indexes of errors in the recording (if any).

Definition at line 2996 of file recording.c.

References errors, index, last, and lastErrorIndex.

◆ GetLength()

int cIndexFile::GetLength ( const char * FileName,
bool IsPesRecording = false )
static

Calculates the recording length (number of frames) without actually reading the index file.

Returns -1 in case of error.

Definition at line 3104 of file recording.c.

References IndexFileName().

Referenced by cRecording::NumFrames(), and cRecording::NumFramesAfterEdit().

◆ GetNextIFrame()

int cIndexFile::GetNextIFrame ( int Index,
bool Forward,
uint16_t * FileNumber = NULL,
off_t * FileOffset = NULL,
int * Length = NULL )

Definition at line 3007 of file recording.c.

References CatchUp(), index, and last.

◆ GetResume()

int cIndexFile::GetResume ( void )
inline

Definition at line 521 of file recording.h.

References resumeFile.

◆ IndexFileName()

cString cIndexFile::IndexFileName ( const char * FileName,
bool IsPesRecording )
static

Definition at line 2863 of file recording.c.

References INDEXFILESUFFIX, and cString::sprintf().

Referenced by cIndexFile(), and GetLength().

◆ IsStillRecording()

bool cIndexFile::IsStillRecording ( void )

Definition at line 3087 of file recording.c.

References f.

◆ Last()

int cIndexFile::Last ( void )
inline

Returns the index of the last entry in this file, or -1 if the file is empty.

Definition at line 519 of file recording.h.

References CatchUp(), and last.

Referenced by cIndexFileGenerator::Action().

◆ Ok()

bool cIndexFile::Ok ( void )
inline

Definition at line 507 of file recording.h.

References index.

◆ StoreResume()

bool cIndexFile::StoreResume ( int Index)
inline

Definition at line 522 of file recording.h.

References resumeFile.

◆ Write()

bool cIndexFile::Write ( bool Independent,
uint16_t FileNumber,
off_t FileOffset,
bool Errors = false,
bool Missing = false )

Definition at line 2949 of file recording.c.

References ConvertToPes(), f, fileName, isPesRecording, last, LOG_ERROR_STR, and safe_write().

Referenced by cIndexFileGenerator::Action().

Member Data Documentation

◆ errors

cErrors cIndexFile::errors
private

Definition at line 498 of file recording.h.

Referenced by GetErrors().

◆ f

int cIndexFile::f
private

Definition at line 491 of file recording.h.

Referenced by CatchUp(), cIndexFile(), Delete(), IsStillRecording(), Write(), and ~cIndexFile().

◆ fileName

cString cIndexFile::fileName
private

Definition at line 492 of file recording.h.

Referenced by CatchUp(), cIndexFile(), Delete(), and Write().

◆ index

tIndexTs* cIndexFile::index
private

◆ indexFileGenerator

cIndexFileGenerator* cIndexFile::indexFileGenerator
private

Definition at line 499 of file recording.h.

Referenced by cIndexFile(), and ~cIndexFile().

◆ isPesRecording

bool cIndexFile::isPesRecording
private

Definition at line 496 of file recording.h.

Referenced by CatchUp(), cIndexFile(), and Write().

◆ last

int cIndexFile::last
private

◆ lastErrorIndex

int cIndexFile::lastErrorIndex
private

Definition at line 494 of file recording.h.

Referenced by cIndexFile(), and GetErrors().

◆ mutex

cMutex cIndexFile::mutex
private

Definition at line 500 of file recording.h.

Referenced by CatchUp().

◆ resumeFile

cResumeFile cIndexFile::resumeFile
private

Definition at line 497 of file recording.h.

Referenced by cIndexFile(), GetResume(), and StoreResume().

◆ size

int cIndexFile::size
private

Definition at line 493 of file recording.h.

Referenced by CatchUp(), and cIndexFile().


The documentation for this class was generated from the following files: