vdr 2.6.9
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
 
tIndexTs * index
 
bool isPesRecording
 
cResumeFile resumeFile
 
cIndexFileGeneratorindexFileGenerator
 
cMutex mutex
 

Detailed Description

Definition at line 484 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 2806 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 2819 of file recording.c.

Referenced by CatchUp(), and cIndexFile().

◆ ConvertToPes()

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

Definition at line 2831 of file recording.c.

Referenced by Write().

◆ Delete()

void cIndexFile::Delete ( void )

Definition at line 3028 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 )

◆ Get() [2/2]

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

Definition at line 3009 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 2981 of file recording.c.

References constrain(), index, and last.

Referenced by cMarks::Align().

◆ 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 3040 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 )

◆ GetResume()

int cIndexFile::GetResume ( void )
inline

Definition at line 512 of file recording.h.

References cResumeFile::Read(), and resumeFile.

Referenced by cDvbPlayer::Resume().

◆ IndexFileName()

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

Definition at line 2814 of file recording.c.

References INDEXFILESUFFIX, and cString::sprintf().

Referenced by cIndexFile(), and GetLength().

◆ IsStillRecording()

bool cIndexFile::IsStillRecording ( void )

Definition at line 3023 of file recording.c.

References f.

Referenced by cDvbPlayer::Action().

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

References CatchUp(), and last.

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

◆ Ok()

bool cIndexFile::Ok ( void )
inline

Definition at line 500 of file recording.h.

References index.

Referenced by cDvbPlayer::cDvbPlayer().

◆ StoreResume()

bool cIndexFile::StoreResume ( int Index)
inline

Definition at line 513 of file recording.h.

References resumeFile, and cResumeFile::Save().

Referenced by cDvbPlayer::Save().

◆ Write()

bool cIndexFile::Write ( bool Independent,
uint16_t FileNumber,
off_t FileOffset )

Member Data Documentation

◆ f

int cIndexFile::f
private

Definition at line 486 of file recording.h.

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

◆ fileName

cString cIndexFile::fileName
private

Definition at line 487 of file recording.h.

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

◆ index

tIndexTs* cIndexFile::index
private

Definition at line 489 of file recording.h.

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

◆ indexFileGenerator

cIndexFileGenerator* cIndexFile::indexFileGenerator
private

Definition at line 492 of file recording.h.

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

◆ isPesRecording

bool cIndexFile::isPesRecording
private

Definition at line 490 of file recording.h.

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

◆ last

int cIndexFile::last
private

Definition at line 488 of file recording.h.

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

◆ mutex

cMutex cIndexFile::mutex
private

Definition at line 493 of file recording.h.

Referenced by CatchUp().

◆ resumeFile

cResumeFile cIndexFile::resumeFile
private

Definition at line 491 of file recording.h.

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

◆ size

int cIndexFile::size
private

Definition at line 488 of file recording.h.

Referenced by CatchUp(), and cIndexFile().


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