mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
- Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Some cable providers don't mark short channel names according to the standard, but rather go their own way and use "name>short name". VDR now splits at this character for cable channels (thanks to Gerhard Steiner for reporting this one). - Added a check for Setup.DiSEqC in cDvbDevice::ProvidesTransponder(), otherwise the EPG scan didn't work on systems that don't use DiSEqC (thanks to Michael Reinelt for reporting this one). - Made the Makefile patch friendlier (thanks to Ludwig Nussel). - Made cOsd::isOpen an integer counter to avoid problems with messages when a cOsdObject uses the raw OSD (thanks to Andreas Regel for reporting this one). - Updated the Danish OSD texts (thanks to Mogens Elneff). - The file 'summary.vdr' has been replaced with 'info.vdr' and now contains the information about a recording, in the same format as the events are stored in 'epg.data' (see man vdr(5) for details). Existing summary files can be converted to the new format by running the Perl script 'summary2info.pl', as in summary2info.pl /video (the parameter given has to be the video directory). If there is no 'info.vdr' file for a recording, an attempt is made to read a 'summary.vdr'. - The "Summary" button in the "Recordings" menu has been renamed to "Info", and the page it brings up now shows the recording's information, much like the EPG event page. Therefore it now no longer uses the skin's SetText() function, but rather the SetRecording() function. Skin plugins may need to adjust that function accordingly (see skinsttng.c, for instance). - The SVDRP command LSTR now lists the recording information in the same tagged format as the LSTE command lists the EPG data. - The audio track menu now contains track descriptions when replaying (provided such descriptions were available in the EPG data when the recording was made, and are stored in the info.vdr file). - Avoiding extra blanks at the end of names of instant recordings. - Removed converting byte order on big endian systems from cDvbOsd::Flush(), which, according to Johannes Stezenbach and Paavo Hartikainen, is wrong. - Added cPlayer::DeviceSetVideoDisplayFormat() (thanks to Marco Schlüßler). - No longer saving the setup in case of a fatal error, to keep the volume level from being set to a wrong value (thanks to Marco Schlüßler). - Fixed a possible hangup when ending a replay session while cIndexFile::CatchUp() is waiting (thanks to Marco Schlüßler). - The SVDRP command DELR no longer deletes recordings that are currently being written to by a timer (thanks to Sascha Volkenandt for pointing out this one). - Pressing the "Play" key in live viewing mode now resumes a previous replay session (thanks to Mirko Dölle). - Now dropping EPG events that have a zero start time or duration (thanks to Oliver Endriss). - No longer stopping Transfer Mode or replay immediately when the Power button is pressed (thanks to Rolf Ahrenberg). - Moved the NPTL and UTF-8 checks after the version and help output (thanks to Andreas Kool for pointing out that 'vdr --version' failed on an UTF-8 system). - Made tChannelID::operator==() inline for better performance (thanks to Georg Acher). - Introduced cListBase::count for better performance (thanks to Georg Acher). - cEvent no longer stores the channelID directly, but rather has a pointer to the schedule it is in. - Now using hash tables to speed up cSchedule::GetEvent() (partially based on a patch from Georg Acher). - Avoiding unnecessary calls to getLength() in libsi/si.c, and avoiding the '& 0xff' in CRC32::crc32() of libsi/util.c (thanks to Georg Acher). - Speeded up deleting duplicate channels. - Fixed listing recordings with empty episode names in the LSTR command (thanks to Stefan Huelswitt for pointing this out). - Added cThread::SetPriority() and using it in cSectionHandler::Action() to reduce the priority of the section handler threads (as suggested by Georg Acher).
207 lines
6.1 KiB
C++
207 lines
6.1 KiB
C++
/*
|
|
* 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.38 2005/05/28 09:34:07 kls Exp $
|
|
*/
|
|
|
|
#ifndef __RECORDING_H
|
|
#define __RECORDING_H
|
|
|
|
#include <time.h>
|
|
#include "channels.h"
|
|
#include "config.h"
|
|
#include "epg.h"
|
|
#include "thread.h"
|
|
#include "timers.h"
|
|
#include "tools.h"
|
|
|
|
void RemoveDeletedRecordings(void);
|
|
void AssertFreeDiskSpace(int Priority = 0);
|
|
///< The special Priority value -1 means that we shall get rid of any
|
|
///< deleted recordings faster than normal (because we're cutting).
|
|
|
|
class cResumeFile {
|
|
private:
|
|
char *fileName;
|
|
public:
|
|
cResumeFile(const char *FileName);
|
|
~cResumeFile();
|
|
int Read(void);
|
|
bool Save(int Index);
|
|
void Delete(void);
|
|
};
|
|
|
|
class cRecordingInfo {
|
|
friend class cRecording;
|
|
private:
|
|
tChannelID channelID;
|
|
const cEvent *event;
|
|
cEvent *ownEvent;
|
|
cRecordingInfo(const cEvent *Event = NULL);
|
|
void SetData(const char *Title, const char *ShortText, const char *Description);
|
|
public:
|
|
~cRecordingInfo();
|
|
const char *Title(void) const { return event->Title(); }
|
|
const char *ShortText(void) const { return event->ShortText(); }
|
|
const char *Description(void) const { return event->Description(); }
|
|
const cComponents *Components(void) const { return event->Components(); }
|
|
bool Read(FILE *f);
|
|
bool Write(FILE *f, const char *Prefix = "") const;
|
|
};
|
|
|
|
class cRecording : public cListObject {
|
|
private:
|
|
mutable int resume;
|
|
mutable char *titleBuffer;
|
|
mutable char *sortBuffer;
|
|
mutable char *fileName;
|
|
mutable char *name;
|
|
cRecordingInfo *info;
|
|
static char *StripEpisodeName(char *s);
|
|
char *SortName(void) const;
|
|
int GetResume(void) const;
|
|
public:
|
|
time_t start;
|
|
int priority;
|
|
int lifetime;
|
|
cRecording(cTimer *Timer, const cEvent *Event);
|
|
cRecording(const char *FileName);
|
|
~cRecording();
|
|
virtual int Compare(const cListObject &ListObject) const;
|
|
const char *Name(void) const { return name; }
|
|
const char *FileName(void) const;
|
|
const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1) const;
|
|
const cRecordingInfo *Info(void) const { return info; }
|
|
const char *PrefixFileName(char Prefix);
|
|
int HierarchyLevels(void) const;
|
|
bool IsNew(void) const { return GetResume() <= 0; }
|
|
bool IsEdited(void) const;
|
|
bool WriteInfo(void);
|
|
bool Delete(void);
|
|
// Changes the file name so that it will no longer be visible in the "Recordings" menu
|
|
// Returns false in case of error
|
|
bool Remove(void);
|
|
// Actually removes the file from the disk
|
|
// Returns false in case of error
|
|
};
|
|
|
|
class cRecordings : public cList<cRecording> {
|
|
private:
|
|
bool deleted;
|
|
time_t lastUpdate;
|
|
void ScanVideoDir(const char *DirName);
|
|
public:
|
|
cRecordings(bool Deleted = false);
|
|
bool Load(void);
|
|
void TriggerUpdate(void) { lastUpdate = 0; }
|
|
bool NeedsUpdate(void);
|
|
cRecording *GetByName(const char *FileName);
|
|
void AddByName(const char *FileName);
|
|
void DelByName(const char *FileName);
|
|
};
|
|
|
|
extern cRecordings Recordings;
|
|
|
|
class cMark : public cListObject {
|
|
public:
|
|
int position;
|
|
char *comment;
|
|
cMark(int Position = 0, const char *Comment = NULL);
|
|
~cMark();
|
|
cString ToText(void);
|
|
bool Parse(const char *s);
|
|
bool Save(FILE *f);
|
|
};
|
|
|
|
class cMarks : public cConfig<cMark> {
|
|
public:
|
|
bool Load(const char *RecordingFileName);
|
|
void Sort(void);
|
|
cMark *Add(int Position);
|
|
cMark *Get(int Position);
|
|
cMark *GetPrev(int Position);
|
|
cMark *GetNext(int Position);
|
|
};
|
|
|
|
#define RUC_BEFORERECORDING "before"
|
|
#define RUC_AFTERRECORDING "after"
|
|
#define RUC_EDITEDRECORDING "edited"
|
|
|
|
class cRecordingUserCommand {
|
|
private:
|
|
static const char *command;
|
|
public:
|
|
static void SetCommand(const char *Command) { command = Command; }
|
|
static void InvokeCommand(const char *State, const char *RecordingFileName);
|
|
};
|
|
|
|
//XXX+
|
|
#define FRAMESPERSEC 25
|
|
|
|
// The maximum size of a single frame (up to HDTV 1920x1080):
|
|
#define MAXFRAMESIZE KILOBYTE(512)
|
|
|
|
// The maximum file size is limited by the range that can be covered
|
|
// with 'int'. 4GB might be possible (if the range is considered
|
|
// 'unsigned'), 2GB should be possible (even if the range is considered
|
|
// 'signed'), so let's use 2000MB for absolute safety (the actual file size
|
|
// may be slightly higher because we stop recording only before the next
|
|
// 'I' frame, to have a complete Group Of Pictures):
|
|
#define MAXVIDEOFILESIZE 2000 // MB
|
|
#define MINVIDEOFILESIZE 100 // MB
|
|
|
|
class cIndexFile {
|
|
private:
|
|
struct tIndex { int offset; uchar type; uchar number; short reserved; };
|
|
int f;
|
|
char *fileName;
|
|
int size, last;
|
|
tIndex *index;
|
|
cResumeFile resumeFile;
|
|
cMutex mutex;
|
|
bool CatchUp(int Index = -1);
|
|
public:
|
|
cIndexFile(const char *FileName, bool Record);
|
|
~cIndexFile();
|
|
bool Ok(void) { return index != NULL; }
|
|
bool Write(uchar PictureType, uchar FileNumber, int FileOffset);
|
|
bool Get(int Index, uchar *FileNumber, int *FileOffset, uchar *PictureType = NULL, int *Length = NULL);
|
|
int GetNextIFrame(int Index, bool Forward, uchar *FileNumber = NULL, int *FileOffset = NULL, int *Length = NULL, bool StayOffEnd = false);
|
|
int Get(uchar FileNumber, int FileOffset);
|
|
int Last(void) { CatchUp(); return last; }
|
|
int GetResume(void) { return resumeFile.Read(); }
|
|
bool StoreResume(int Index) { return resumeFile.Save(Index); }
|
|
};
|
|
|
|
class cFileName {
|
|
private:
|
|
int file;
|
|
int fileNumber;
|
|
char *fileName, *pFileNumber;
|
|
bool record;
|
|
bool blocking;
|
|
public:
|
|
cFileName(const char *FileName, bool Record, bool Blocking = false);
|
|
~cFileName();
|
|
const char *Name(void) { return fileName; }
|
|
int Number(void) { return fileNumber; }
|
|
int Open(void);
|
|
void Close(void);
|
|
int SetOffset(int Number, int Offset = 0);
|
|
int NextFile(void);
|
|
};
|
|
|
|
cString IndexToHMSF(int Index, bool WithFrame = false);
|
|
// 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); //XXX+ ->player???
|
|
// Returns the number of frames corresponding to the given number of seconds.
|
|
|
|
int ReadFrame(int f, uchar *b, int Length, int Max);
|
|
|
|
#endif //__RECORDING_H
|