vdr  2.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 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
 
tIndexTsindex
 
bool isPesRecording
 
cResumeFile resumeFile
 
cIndexFileGeneratorindexFileGenerator
 
cMutex mutex
 

Detailed Description

Definition at line 425 of file recording.h.

Constructor & Destructor Documentation

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

Definition at line 2534 of file recording.c.

References f, index, and indexFileGenerator.

Member Function Documentation

bool cIndexFile::CatchUp ( int  Index = -1)
private
void cIndexFile::ConvertFromPes ( tIndexTs IndexTs,
int  Count 
)
private
void cIndexFile::ConvertToPes ( tIndexTs IndexTs,
int  Count 
)
private
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 
)
int cIndexFile::Get ( uint16_t  FileNumber,
off_t  FileOffset 
)

Definition at line 2737 of file recording.c.

References CatchUp(), index, and last.

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().

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 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 
)
int cIndexFile::GetResume ( void  )
inline

Definition at line 453 of file recording.h.

References cResumeFile::Read().

Referenced by cDvbPlayer::Resume().

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

Definition at line 2751 of file recording.c.

References f.

Referenced by cDvbPlayer::Action().

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 451 of file recording.h.

Referenced by cDvbPlayer::Action(), cCuttingThread::Action(), cIndexFileGenerator::Action(), cDvbPlayer::GetIndex(), and cCuttingThread::ProcessSequence().

bool cIndexFile::Ok ( void  )
inline

Definition at line 441 of file recording.h.

Referenced by cDvbPlayer::cDvbPlayer().

bool cIndexFile::StoreResume ( int  Index)
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 
)

Member Data Documentation

int cIndexFile::f
private
cString cIndexFile::fileName
private
tIndexTs* cIndexFile::index
private

Definition at line 430 of file recording.h.

Referenced by CatchUp(), cIndexFile(), Get(), GetClosestIFrame(), GetNextIFrame(), and ~cIndexFile().

cIndexFileGenerator* cIndexFile::indexFileGenerator
private

Definition at line 433 of file recording.h.

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

bool cIndexFile::isPesRecording
private
int cIndexFile::last
private

Definition at line 429 of file recording.h.

Referenced by CatchUp(), cIndexFile(), Get(), GetClosestIFrame(), GetNextIFrame(), and Write().

cMutex cIndexFile::mutex
private

Definition at line 434 of file recording.h.

Referenced by CatchUp().

cResumeFile cIndexFile::resumeFile
private

Definition at line 432 of file recording.h.

Referenced by cIndexFile().

int cIndexFile::size
private

Definition at line 429 of file recording.h.

Referenced by CatchUp(), and cIndexFile().


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