vdr 2.6.4
|
#include <videodir.h>
Public Member Functions | |
cVideoDirectory (void) | |
virtual | ~cVideoDirectory () |
virtual int | FreeMB (int *UsedMB=NULL) |
virtual bool | Register (const char *FileName) |
virtual bool | Rename (const char *OldName, const char *NewName) |
virtual bool | Move (const char *FromName, const char *ToName) |
virtual bool | Remove (const char *Name) |
virtual void | Cleanup (const char *IgnoreFiles[]=NULL) |
virtual bool | Contains (const char *Name) |
Static Public Member Functions | |
static const char * | Name (void) |
static void | SetName (const char *Name) |
static void | Destroy (void) |
static cUnbufferedFile * | OpenVideoFile (const char *FileName, int Flags) |
static bool | RenameVideoFile (const char *OldName, const char *NewName) |
static bool | MoveVideoFile (const char *FromName, const char *ToName) |
static bool | RemoveVideoFile (const char *FileName) |
static bool | VideoFileSpaceAvailable (int SizeMB) |
static int | VideoDiskSpace (int *FreeMB=NULL, int *UsedMB=NULL) |
static cString | PrefixVideoFileName (const char *FileName, char Prefix) |
static void | RemoveEmptyVideoDirectories (const char *IgnoreFiles[]=NULL) |
static bool | IsOnVideoDirectoryFileSystem (const char *FileName) |
Static Private Member Functions | |
static cVideoDirectory * | Current (void) |
Static Private Attributes | |
static cMutex | mutex |
static cString | name |
static cVideoDirectory * | current = NULL |
Definition at line 16 of file videodir.h.
cVideoDirectory::cVideoDirectory | ( | void | ) |
Definition at line 26 of file videodir.c.
References current, cMutex::Lock(), mutex, and cMutex::Unlock().
Referenced by Current().
|
virtual |
Definition at line 34 of file videodir.c.
References current, cMutex::Lock(), mutex, and cMutex::Unlock().
|
virtual |
Recursively removes all empty directories under the video directory.
If IgnoreFiles is given, the file names in this (NULL terminated) array are ignored when checking whether a directory is empty. These are typically "dot files", like e.g. ".sort". The default implementation calls RemoveEmptyDirectories().
Definition at line 115 of file videodir.c.
References Name(), and RemoveEmptyDirectories().
Referenced by RemoveEmptyVideoDirectories().
|
virtual |
Checks whether the directory Name is on the same file system as the video directory.
Name is the full path name of a recording's '*.rec' directory. This function is usually called when an ongoing recording is about to run out of disk space, and an existing (old) recording needs to be deleted. It shall make sure that deleting this old recording will actually free up space in the video directory, and not on some other device that just happens to be mounted. The default implementation calls EntriesOnSameFileSystem().
Definition at line 120 of file videodir.c.
References EntriesOnSameFileSystem(), and Name().
Referenced by IsOnVideoDirectoryFileSystem().
|
staticprivate |
Definition at line 41 of file videodir.c.
References current, cVideoDirectory(), cMutex::Lock(), mutex, and cMutex::Unlock().
Referenced by IsOnVideoDirectoryFileSystem(), MoveVideoFile(), OpenVideoFile(), RemoveEmptyVideoDirectories(), RemoveVideoFile(), RenameVideoFile(), VideoDiskSpace(), and VideoFileSpaceAvailable().
|
static |
|
virtual |
Returns the total amount (in MB) of free disk space for recording.
If UsedMB is given, it returns the amount of disk space in use by existing recordings (or anything else) on that disk.
Definition at line 55 of file videodir.c.
References FreeDiskSpaceMB(), and Name().
Referenced by VideoDiskSpace(), and VideoFileSpaceAvailable().
|
static |
Definition at line 194 of file videodir.c.
References Contains(), and Current().
Referenced by cRecording::IsOnVideoDirectoryFileSystem().
|
virtual |
Moves the directory FromName to the location ToName.
FromName is the full path name of a recording's '*.rec' directory. ToName has the same '*.rec' part as FromName, but a different directory path above it. Returns true if the operation was successful. The default implementation just calls the system's rename() function.
Definition at line 91 of file videodir.c.
References cRecordingsHandler::Add(), dsyslog, EntriesOnSameFileSystem(), cRecordingUserCommand::InvokeCommand(), LOG_ERROR_STR, RecordingsHandler, RUC_MOVEDRECORDING, RUC_RENAMEDRECORDING, ruMove, and strgetbefore().
Referenced by MoveVideoFile().
|
static |
Definition at line 137 of file videodir.c.
References Current(), and Move().
Referenced by cRecording::ChangeName().
|
static |
Definition at line 60 of file videodir.c.
References name.
Referenced by cRemoveDeletedRecordingsThread::Action(), cVideoDirectoryScannerThread::Action(), AssertFreeDiskSpace(), Cleanup(), Contains(), cRecording::cRecording(), cMenuRecordings::DirectoryName(), cRecording::FileName(), FreeMB(), Register(), Remove(), SetName(), cRecording::SortName(), and cRecordings::UpdateFileName().
|
static |
Definition at line 125 of file videodir.c.
References cUnbufferedFile::Create(), Current(), and Register().
Referenced by cFileName::Open().
|
static |
Definition at line 169 of file videodir.c.
Referenced by cRecording::PrefixFileName().
|
virtual |
By default VDR assumes that the video directory consists of one large volume, on which it can store its recordings.
A derived cVideoDirectory may, for instance, use several separate disks to store recordings. The given FileName is the full path name (including the video directory) of a recording file ('*.ts') that is about to be opened for writing. If the actual file shall be put on an other disk, the derived cVideoDirectory should create a symbolic link from the given FileName to the other location. Returns true if the operation was successful. The default implementation just checks whether the incoming file name really is under the video directory.
Definition at line 70 of file videodir.c.
References esyslog, and Name().
Referenced by OpenVideoFile().
|
virtual |
Removes the directory with the given Name and everything it contains.
Name is a full path name that begins with the name of the video directory. Returns true if the operation was successful. The default implementation calls RemoveFileOrDir().
Definition at line 110 of file videodir.c.
References Name(), and RemoveFileOrDir().
Referenced by RemoveVideoFile().
|
static |
Definition at line 189 of file videodir.c.
References Cleanup(), and Current().
Referenced by cRemoveDeletedRecordingsThread::Action().
|
static |
Definition at line 142 of file videodir.c.
References Current(), and Remove().
Referenced by cRecordingsHandlerEntry::Cleanup(), cRecording::Delete(), cRecording::Remove(), and cCutter::Start().
|
virtual |
Renames the directory OldName to NewName.
OldName and NewName are full path names that begin with the name of the video directory and end with '*.rec' or '*.del'. Only the base name (the rightmost component) of the two names may be different. Returns true if the operation was successful. The default implementation just calls the system's rename() function.
Definition at line 81 of file videodir.c.
References dsyslog, and LOG_ERROR_STR.
Referenced by RenameVideoFile().
|
static |
Definition at line 132 of file videodir.c.
References Current(), and Rename().
Referenced by cRecording::ChangePriorityLifetime(), cRecording::Delete(), and cRecording::Undelete().
|
static |
|
static |
Definition at line 152 of file videodir.c.
References Current(), FreeMB(), and LOCK_DELETEDRECORDINGS_READ.
Referenced by cSVDRPServer::CmdSTAT(), cVideoDiskUsage::HasChanged(), and cRecordControls::Start().
|
static |
Definition at line 147 of file videodir.c.
References Current(), and FreeMB().
Referenced by AssertFreeDiskSpace().
|
staticprivate |
Definition at line 20 of file videodir.h.
Referenced by Current(), cVideoDirectory(), Destroy(), and ~cVideoDirectory().
|
staticprivate |
Definition at line 18 of file videodir.h.
Referenced by Current(), cVideoDirectory(), and ~cVideoDirectory().
|
staticprivate |
Definition at line 19 of file videodir.h.