vdr 2.6.1
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)
 
 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)
 
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)
 
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 456 of file include/vdr/recording.h.

Constructor & Destructor Documentation

◆ cIndexFile() [1/2]

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

◆ ~cIndexFile() [1/2]

cIndexFile::~cIndexFile ( )

Definition at line 2648 of file recording.c.

References f, index, and indexFileGenerator.

◆ cIndexFile() [2/2]

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

◆ ~cIndexFile() [2/2]

cIndexFile::~cIndexFile ( )

Member Function Documentation

◆ CatchUp() [1/2]

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

◆ CatchUp() [2/2]

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

◆ ConvertFromPes() [1/2]

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

Definition at line 2661 of file recording.c.

Referenced by CatchUp(), and cIndexFile().

◆ ConvertFromPes() [2/2]

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

◆ ConvertToPes() [1/2]

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

Definition at line 2673 of file recording.c.

Referenced by Write().

◆ ConvertToPes() [2/2]

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

◆ Delete() [1/2]

void cIndexFile::Delete ( void  )

Definition at line 2870 of file recording.c.

References dsyslog, f, and fileName.

Referenced by cIndexFileGenerator::Action().

◆ Delete() [2/2]

void cIndexFile::Delete ( void  )

◆ Get() [1/4]

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

◆ Get() [2/4]

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

◆ Get() [3/4]

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

Definition at line 2851 of file recording.c.

References CatchUp(), index, and last.

◆ Get() [4/4]

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

◆ GetClosestIFrame() [1/2]

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

References constrain(), index, and last.

Referenced by cMarks::Align().

◆ GetClosestIFrame() [2/2]

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.

◆ GetLength() [1/2]

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

References IndexFileName().

Referenced by cRecording::NumFrames().

◆ GetLength() [2/2]

static 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.

◆ GetNextIFrame() [1/2]

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

◆ GetNextIFrame() [2/2]

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

◆ GetResume() [1/2]

int cIndexFile::GetResume ( void  )
inline

Definition at line 484 of file include/vdr/recording.h.

References cResumeFile::Read(), and resumeFile.

Referenced by cDvbPlayer::Resume().

◆ GetResume() [2/2]

int cIndexFile::GetResume ( void  )
inline

Definition at line 484 of file recording.h.

References cResumeFile::Read(), and resumeFile.

◆ IndexFileName() [1/2]

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

◆ IndexFileName() [2/2]

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

◆ IsStillRecording() [1/2]

bool cIndexFile::IsStillRecording ( void  )

Definition at line 2865 of file recording.c.

References f.

Referenced by cDvbPlayer::Action().

◆ IsStillRecording() [2/2]

bool cIndexFile::IsStillRecording ( void  )

◆ Last() [1/2]

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 482 of file include/vdr/recording.h.

References CatchUp(), and last.

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

◆ Last() [2/2]

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

References CatchUp(), and last.

◆ Ok() [1/2]

bool cIndexFile::Ok ( void  )
inline

Definition at line 472 of file include/vdr/recording.h.

References index.

Referenced by cDvbPlayer::cDvbPlayer().

◆ Ok() [2/2]

bool cIndexFile::Ok ( void  )
inline

Definition at line 472 of file recording.h.

References index.

◆ StoreResume() [1/2]

bool cIndexFile::StoreResume ( int  Index)
inline

Definition at line 485 of file include/vdr/recording.h.

References resumeFile, and cResumeFile::Save().

Referenced by cDvbPlayer::Save().

◆ StoreResume() [2/2]

bool cIndexFile::StoreResume ( int  Index)
inline

Definition at line 485 of file recording.h.

References resumeFile, and cResumeFile::Save().

◆ Write() [1/2]

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

◆ Write() [2/2]

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

Member Data Documentation

◆ f

int cIndexFile::f
private

◆ fileName

cString cIndexFile::fileName
private

Definition at line 459 of file include/vdr/recording.h.

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

◆ index

tIndexTs * cIndexFile::index
private

◆ indexFileGenerator

cIndexFileGenerator * cIndexFile::indexFileGenerator
private

Definition at line 464 of file include/vdr/recording.h.

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

◆ isPesRecording

bool cIndexFile::isPesRecording
private

Definition at line 462 of file include/vdr/recording.h.

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

◆ last

int cIndexFile::last
private

◆ mutex

cMutex cIndexFile::mutex
private

Definition at line 465 of file include/vdr/recording.h.

Referenced by CatchUp().

◆ resumeFile

cResumeFile cIndexFile::resumeFile
private

Definition at line 463 of file include/vdr/recording.h.

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

◆ size

int cIndexFile::size
private

Definition at line 460 of file include/vdr/recording.h.

Referenced by CatchUp(), and cIndexFile().


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