Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

recording.c File Reference

#include "recording.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "channels.h"
#include "i18n.h"
#include "interface.h"
#include "remux.h"
#include "tools.h"
#include "videodir.h"

Include dependency graph for recording.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  tCharExchange

Defines

#define RECEXT   ".rec"
#define DELEXT   ".del"
#define DATAFORMAT   "%4d-%02d-%02d.%02d%*c%02d.%02d.%02d" RECEXT
#define nameFORMAT   "%4d-%02d-%02d.%02d:%02d.%02d.%02d" RECEXT
#define NAMEFORMAT   "%s/%s/" nameFORMAT
#define RESUMEFILESUFFIX   "/resume.vdr"
#define SUMMARYFILESUFFIX   "/summary.vdr"
#define MARKSFILESUFFIX   "/marks.vdr"
#define FINDCMD   "find %s -follow -type d -name '%s' 2> /dev/null"
#define MINDISKSPACE   1024
#define DELETEDLIFETIME   1
#define REMOVECHECKDELTA   3600
#define DISKCHECKDELTA   100
#define REMOVELATENCY   10
#define TIMERMACRO_TITLE   "TITLE"
#define TIMERMACRO_EPISODE   "EPISODE"
#define RESUME_NOT_INITIALIZED   (-2)
#define INDEXFILESUFFIX   "/index.vdr"
#define MAXINDEXCATCHUP   2
#define MININDEXAGE   10
#define MAXFILESPERRECORDING   255
#define RECORDFILESUFFIX   "/%03d.vdr"
#define RECORDFILESUFFIXLEN   20

Functions

void RemoveDeletedRecordings (void)
void AssertFreeDiskSpace (int Priority)
char * ExchangeChars (char *s, bool ToFileSystem)
const char * IndexToHMSF (int Index, bool WithFrame)
 Converts the given index to a string, optionally containing the frame number.

int HMSFToIndex (const char *HMSF)
 Converts the given string (format: "hh:mm:ss.ff") to an index.

int SecondsToFrames (int Seconds)
int ReadFrame (int f, uchar *b, int Length, int Max)

Variables

tCharExchange CharExchange []


Define Documentation

#define DATAFORMAT   "%4d-%02d-%02d.%02d%*c%02d.%02d.%02d" RECEXT
 

start of implementation for brain dead systems

Definition at line 38 of file recording.c.

#define DELETEDLIFETIME   1
 

hours after which a deleted recording will be actually removed

Definition at line 61 of file recording.c.

Referenced by RemoveDeletedRecordings().

#define DELEXT   ".del"
 

Definition at line 25 of file recording.c.

#define DISKCHECKDELTA   100
 

Definition at line 67 of file recording.c.

Referenced by AssertFreeDiskSpace().

#define FINDCMD   "find %s -follow -type d -name '%s' 2> /dev/null"
 

Definition at line 51 of file recording.c.

#define INDEXFILESUFFIX   "/index.vdr"
 

Definition at line 773 of file recording.c.

#define MARKSFILESUFFIX   "/marks.vdr"
 

Definition at line 49 of file recording.c.

#define MAXFILESPERRECORDING   255
 

Definition at line 1006 of file recording.c.

Referenced by cFileName::SetOffset().

#define MAXINDEXCATCHUP   2
 

Definition at line 776 of file recording.c.

#define MINDISKSPACE   1024
 

MB

Definition at line 56 of file recording.c.

#define MININDEXAGE   10
 

Definition at line 779 of file recording.c.

Referenced by cIndexFile::CatchUp().

#define NAMEFORMAT   "%s/%s/" nameFORMAT
 

Definition at line 44 of file recording.c.

#define nameFORMAT   "%4d-%02d-%02d.%02d:%02d.%02d.%02d" RECEXT
 

Definition at line 42 of file recording.c.

#define RECEXT   ".rec"
 

recording.c: Recording file handling

See the main source file 'vdr.c' for copyright information and how to reach the author.

Id
recording.c 1.70 2002/10/20 11:54:29 kls Exp

Definition at line 24 of file recording.c.

#define RECORDFILESUFFIX   "/%03d.vdr"
 

Definition at line 1007 of file recording.c.

#define RECORDFILESUFFIXLEN   20
 

Definition at line 1008 of file recording.c.

#define REMOVECHECKDELTA   3600
 

seconds between checks for removing deleted files

Definition at line 66 of file recording.c.

Referenced by RemoveDeletedRecordings().

#define REMOVELATENCY   10
 

Definition at line 68 of file recording.c.

Referenced by AssertFreeDiskSpace(), and RemoveDeletedRecordings().

#define RESUME_NOT_INITIALIZED   (-2)
 

--- cRecording ------------------------------------------------------------

Definition at line 226 of file recording.c.

Referenced by cRecording::cRecording(), and cRecording::GetResume().

#define RESUMEFILESUFFIX   "/resume.vdr"
 

Definition at line 47 of file recording.c.

#define SUMMARYFILESUFFIX   "/summary.vdr"
 

Definition at line 48 of file recording.c.

#define TIMERMACRO_EPISODE   "EPISODE"
 

Definition at line 71 of file recording.c.

Referenced by cRecording::cRecording().

#define TIMERMACRO_TITLE   "TITLE"
 

Definition at line 70 of file recording.c.

Referenced by cRecording::cRecording().


Function Documentation

void AssertFreeDiskSpace int    Priority
 

With every call to this function we try to actually remove a file, or mark a file for removal ("delete" it), so that it will get removed during the next call.

Definition at line 102 of file recording.c.

References cRecording::Delete(), DISKCHECKDELTA, cList< cRecording >::First(), isyslog, cRecording::lifetime, cRecordings::Load(), cLockFile::Lock(), MAXLIFETIME, cList< cRecording >::Next(), cRecording::priority, cRecording::Remove(), REMOVELATENCY, SECSINDAY, cRecording::start, tr, and VideoFileSpaceAvailable().

Referenced by cCuttingThread::Action(), and cRecordControl::Process().

char* ExchangeChars char *    s,
bool    ToFileSystem
[static]
 

Definition at line 237 of file recording.c.

References tCharExchange::a, tCharExchange::b, and CharExchange.

Referenced by cRecording::cRecording(), and cRecording::FileName().

int HMSFToIndex const char *    HMSF
 

Converts the given string (format: "hh:mm:ss.ff") to an index.

Definition at line 1113 of file recording.c.

References FRAMESPERSEC.

Referenced by cMark::Parse().

const char* IndexToHMSF int    Index,
bool    WithFrame
 

Converts the given index to a string, optionally containing the frame number.

Definition at line 1101 of file recording.c.

References FRAMESPERSEC.

Referenced by cDvbPlayer::Action(), cReplayControl::ShowProgress(), and cMark::ToText().

int ReadFrame int    f,
uchar   b,
int    Length,
int    Max
 

Definition at line 1128 of file recording.c.

References esyslog, LOG_ERROR, and safe_read().

Referenced by cCuttingThread::Action(), cDvbPlayer::Action(), and cDvbPlayer::Goto().

void RemoveDeletedRecordings void   
 

recording.h: Recording file handling

See the main source file 'vdr.c' for copyright information and how to reach the author.

Id
recording.h 1.25 2002/10/19 15:48:52 kls Exp

Definition at line 73 of file recording.c.

References DELETEDLIFETIME, cList< cRecording >::First(), cRecordings::Load(), cLockFile::Lock(), cList< cRecording >::Next(), cRecording::Remove(), REMOVECHECKDELTA, RemoveEmptyVideoDirectories(), REMOVELATENCY, and cRecording::start.

Referenced by main().

int SecondsToFrames int    Seconds
 

Returns the number of frames corresponding to the given number of seconds. XXX+ ->player???

Definition at line 1121 of file recording.c.

References FRAMESPERSEC.


Variable Documentation

tCharExchange CharExchange[]
 

Initial value:

 {
  { '~',  '/'    },
  { ' ',  '_'    },
  { '\'', \x01 },
  { '/',  \x02 },
  { 0, 0 }
  }

Definition at line 229 of file recording.c.

Referenced by ExchangeChars().


Generated on Wed Feb 5 23:30:42 2003 for VDR by doxygen1.3-rc2