vdr 2.7.6
vdr.c File Reference
#include <getopt.h>
#include <grp.h>
#include <langinfo.h>
#include <locale.h>
#include <malloc.h>
#include <pwd.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/capability.h>
#include <sys/prctl.h>
#include <termios.h>
#include <unistd.h>
#include "args.h"
#include "audio.h"
#include "channels.h"
#include "config.h"
#include "cutter.h"
#include "device.h"
#include "diseqc.h"
#include "dvbdevice.h"
#include "eitscan.h"
#include "epg.h"
#include "i18n.h"
#include "interface.h"
#include "keys.h"
#include "libsi/si.h"
#include "lirc.h"
#include "menu.h"
#include "osdbase.h"
#include "plugin.h"
#include "recording.h"
#include "shutdown.h"
#include "skinclassic.h"
#include "skinlcars.h"
#include "skinsttng.h"
#include "sourceparams.h"
#include "sources.h"
#include "status.h"
#include "svdrp.h"
#include "themes.h"
#include "timers.h"
#include "tools.h"
#include "transfer.h"
#include "videodir.h"

Go to the source code of this file.

Macros

#define MINCHANNELWAIT   10
#define ACTIVITYTIMEOUT   60
#define MEMCLEANUPDELTA   3600
#define SHUTDOWNWAIT   300
#define SHUTDOWNRETRY   360
#define SHUTDOWNFORCEPROMPT   5
#define SHUTDOWNCANCELPROMPT   5
#define RESTARTCANCELPROMPT   5
#define MANUALSTART   600
#define CHANNELSAVEDELTA   600
#define DEVICEREADYTIMEOUT   30
#define MENUTIMEOUT   120
#define TIMERCHECKDELTA   5
#define TIMERDEVICETIMEOUT   8
#define TIMERLOOKAHEADTIME   60
#define VPSLOOKAHEADTIME   24
#define VPSUPTODATETIME   3600
#define EXIT(v)
#define dd(a, b)
#define DEFAULTSVDRPPORT   6419
#define DEFAULTWATCHDOG   0
#define DEFAULTVIDEODIR   VIDEODIR
#define DEFAULTCONFDIR   dd(CONFDIR, VideoDirectory)
#define DEFAULTARGSDIR   dd(ARGSDIR, "/etc/vdr/conf.d")
#define DEFAULTCACHEDIR   dd(CACHEDIR, VideoDirectory)
#define DEFAULTRESDIR   dd(RESDIR, ConfigDirectory)
#define DEFAULTPLUGINDIR   PLUGINDIR
#define DEFAULTLOCDIR   LOCDIR
#define DEFAULTEPGDATAFILENAME   "epg.data"
#define DELETE_MENU   ((IsInfoMenu &= (Menu == NULL)), delete Menu, Menu = NULL)
#define DirectMainFunction(function)

Functions

static bool SetUser (const char *User, bool UserDump)
static bool DropCaps (void)
static bool SetKeepCaps (bool On)
static void SignalHandler (int signum)
static void Watchdog (int signum)
int main (int argc, char *argv[])

Variables

static int LastSignal = 0

Macro Definition Documentation

◆ ACTIVITYTIMEOUT

#define ACTIVITYTIMEOUT   60

Definition at line 77 of file vdr.c.

Referenced by main().

◆ CHANNELSAVEDELTA

#define CHANNELSAVEDELTA   600

Definition at line 85 of file vdr.c.

Referenced by main().

◆ dd

#define dd ( a,
b )
Value:
(*a ? a : b)

◆ DEFAULTARGSDIR

#define DEFAULTARGSDIR   dd(ARGSDIR, "/etc/vdr/conf.d")

Referenced by main().

◆ DEFAULTCACHEDIR

#define DEFAULTCACHEDIR   dd(CACHEDIR, VideoDirectory)

Referenced by main().

◆ DEFAULTCONFDIR

#define DEFAULTCONFDIR   dd(CONFDIR, VideoDirectory)

Referenced by main().

◆ DEFAULTEPGDATAFILENAME

#define DEFAULTEPGDATAFILENAME   "epg.data"

Referenced by main().

◆ DEFAULTLOCDIR

#define DEFAULTLOCDIR   LOCDIR

Referenced by main().

◆ DEFAULTPLUGINDIR

#define DEFAULTPLUGINDIR   PLUGINDIR

Referenced by main().

◆ DEFAULTRESDIR

#define DEFAULTRESDIR   dd(RESDIR, ConfigDirectory)

Referenced by main().

◆ DEFAULTSVDRPPORT

#define DEFAULTSVDRPPORT   6419

Referenced by main().

◆ DEFAULTVIDEODIR

#define DEFAULTVIDEODIR   VIDEODIR

Referenced by main().

◆ DEFAULTWATCHDOG

#define DEFAULTWATCHDOG   0

Referenced by main().

◆ DELETE_MENU

#define DELETE_MENU   ((IsInfoMenu &= (Menu == NULL)), delete Menu, Menu = NULL)

Referenced by main().

◆ DEVICEREADYTIMEOUT

#define DEVICEREADYTIMEOUT   30

Definition at line 86 of file vdr.c.

Referenced by main().

◆ DirectMainFunction

#define DirectMainFunction ( function)
Value:
if (Control)\
Control->Hide();\
Menu = new cMenuMain(function);\
key = kNone; }
@ kNone
Definition keys.h:55
#define DELETE_MENU

Referenced by main().

◆ EXIT

#define EXIT ( v)
Value:
{ ShutdownHandler.Exit(v); goto Exit; }
cShutdownHandler ShutdownHandler
Definition shutdown.c:27

Definition at line 94 of file vdr.c.

Referenced by main().

◆ MANUALSTART

#define MANUALSTART   600

Definition at line 84 of file vdr.c.

Referenced by main().

◆ MEMCLEANUPDELTA

#define MEMCLEANUPDELTA   3600

Definition at line 78 of file vdr.c.

Referenced by main().

◆ MENUTIMEOUT

#define MENUTIMEOUT   120

Definition at line 87 of file vdr.c.

Referenced by main().

◆ MINCHANNELWAIT

#define MINCHANNELWAIT   10

Definition at line 76 of file vdr.c.

Referenced by main().

◆ RESTARTCANCELPROMPT

#define RESTARTCANCELPROMPT   5

Definition at line 83 of file vdr.c.

Referenced by main().

◆ SHUTDOWNCANCELPROMPT

#define SHUTDOWNCANCELPROMPT   5

Definition at line 82 of file vdr.c.

Referenced by main().

◆ SHUTDOWNFORCEPROMPT

#define SHUTDOWNFORCEPROMPT   5

Definition at line 81 of file vdr.c.

Referenced by main().

◆ SHUTDOWNRETRY

#define SHUTDOWNRETRY   360

Definition at line 80 of file vdr.c.

Referenced by main().

◆ SHUTDOWNWAIT

#define SHUTDOWNWAIT   300

Definition at line 79 of file vdr.c.

Referenced by main().

◆ TIMERCHECKDELTA

#define TIMERCHECKDELTA   5

Definition at line 88 of file vdr.c.

Referenced by main().

◆ TIMERDEVICETIMEOUT

#define TIMERDEVICETIMEOUT   8

Definition at line 89 of file vdr.c.

Referenced by main().

◆ TIMERLOOKAHEADTIME

#define TIMERLOOKAHEADTIME   60

Definition at line 90 of file vdr.c.

Referenced by main().

◆ VPSLOOKAHEADTIME

#define VPSLOOKAHEADTIME   24

Definition at line 91 of file vdr.c.

Referenced by main().

◆ VPSUPTODATETIME

#define VPSUPTODATETIME   3600

Definition at line 92 of file vdr.c.

Referenced by main().

Function Documentation

◆ DropCaps()

bool DropCaps ( void )
static

Definition at line 128 of file vdr.c.

Referenced by main().

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 198 of file vdr.c.

References cRecordControls::Active(), ACTIVITYTIMEOUT, cDevice::ActualDevice(), AddDirectory(), cPluginManager::AddPlugin(), cTimers::AdjustSpawnedTimers(), cChannel::Apid(), APIVERSION, AssertFreeDiskSpace(), cControl::Attach(), Audios, cDvbDevice::BondDevices(), CamControl(), CamMenuActive(), CamResponsesLoad(), CamSlots, ChannelCamRelations, cRecordControls::ChannelDataModified(), CHANNELMOD_RETUNE, CHANNELSAVEDELTA, CiResourceHandlers, cSchedules::Cleanup(), cPlugin::CommandLineHelp(), Commands, cControl::Control(), cDisplaySubtitleTracks::Create(), cDisplayTracks::Create(), cDisplayVolume::Create(), cDevice::CurrentChannel(), cDevice::CurrentVolume(), CutRecording(), DEFAULTARGSDIR, DEFAULTCACHEDIR, DEFAULTCONFDIR, DEFAULTEPGDATAFILENAME, DEFAULTLOCDIR, DEFAULTPLUGINDIR, DEFAULTRESDIR, DEFAULTSVDRPPORT, DEFAULTVIDEODIR, DEFAULTWATCHDOG, DELETE_MENU, cTimers::DeleteExpired(), cPlugin::Description(), cVideoDirectory::Destroy(), cPositioner::DestroyPositioner(), cDevice::DeviceNumber(), DEVICEREADYTIMEOUT, DirectMainFunction, DirectoryEncoding, DirectoryNameMax, DirectoryOk(), DirectoryPathMax, Diseqcs, DoneRecordingsPattern, cChannel::Dpid(), DropCaps(), dsyslog, EITScanner, EpgHandlers, esyslog, EXIT, cList< T >::First(), Folders, tChannelID::FromString(), GenerateIndex(), cArgs::GetArgc(), cArgs::GetArgv(), cChannels::GetChannelsRead(), cDevice::GetDevice(), cDevice::GetDeviceForTransponder(), cFont::GetFontFileName(), cControl::GetInfo(), cTimers::GetMatch(), cTimers::GetMaxPriority(), cPluginManager::GetPlugin(), cRemote::GetPlugin(), cPositioner::GetPositioner(), cSchedules::GetSchedulesRead(), cTimers::GetTimersRead(), cTimers::GetTimersWrite(), cDevice::HasDecoder(), cPluginManager::HasPlugins(), cDevice::HasProgramme(), cControl::Hide(), cPluginManager::Housekeeping(), I18nInitialize(), cDvbDevice::Initialize(), cPluginManager::InitializePlugins(), InstanceId, Interface, cOsdObject::IsMenu(), ISMODELESSKEY, isnumber(), cDisplayChannel::IsOpen(), cDisplaySubtitleTracks::IsOpen(), cDisplayTracks::IsOpen(), cOsd::IsOpen(), cDevice::IsPrimaryDevice(), ISREALKEY, cDevice::IsTunedToTransponder(), isyslog, k0, k1, k9, k_Plugin, k_Repeat, kAudio, kChanDn, kChannels, kChanPrev, kChanUp, kCommands, kDown, KeyMacros, Keys, kInfo, kLeft, kMenu, kMute, kNext, kNone, kOk, kPause, kPlay, kPlayPause, kPower, kPrev, kRecord, kRecordings, kRight, kSchedule, kSetup, kSubtitles, kTimers, kUp, kUser0, kUser9, kVolDn, kVolUp, cRemote::LastActivity(), cReplayControl::LastReplayed(), LastSignal, cControl::Launch(), ListGarbageCollector, LIVEPRIORITY, cChannels::Load(), cThemes::Load(), cTimers::Load(), cPluginManager::LoadPlugins(), LOCK_CHANNELS_READ, LOCK_SCHEDULES_READ, cPlugin::MainMenuAction(), cPluginManager::MainThreadHook(), MANUALSTART, MAXDEVICES, MAXVIDEOFILESIZEDEFAULT, MAXVIDEOFILESIZETS, MEGABYTE, MEMCLEANUPDELTA, MENUTIMEOUT, MINCHANNELWAIT, MINPRIORITY, MINVIDEOFILESIZE, cChannels::ModifiedByUser(), cStatus::MsgChannelChange(), mtError, mtInfo, mtWarning, cPlugin::Name(), cOsdObject::NeedsFastResponse(), cRecordings::NeedsUpdate(), cLircRemote::NewLircRemote(), cList< T >::Next(), NORMALKEY, cChannel::Number(), cDevice::NumDevices(), osBack, osChannels, osCommands, cOsdProvider::OsdSizeChanged(), osEnd, osPause, osPlugin, osRecord, osRecordings, osReplay, osSchedule, osSetup, osStopReplay, osTimers, osUnknown, cRecordControls::PauseLiveVideo(), cMenuMain::PluginOsdObject(), cSchedule::PresentSeenWithin(), cDevice::PrimaryDevice(), cDisplaySubtitleTracks::Process(), cDisplayTracks::Process(), cDisplayVolume::Process(), cRecordControls::Process(), cOsdObject::ProcessKey(), cRemote::Put(), cRemote::PutMacro(), cArgs::ReadDirectory(), RecordingCommands, RecordingsHandler, Remotes, cStateKey::Remove(), RemoveDeletedRecordings(), ReportEpgBugFixStats(), cStateKey::Reset(), RESTARTCANCELPROMPT, cConfig< T >::Save(), Scrs, cPlugin::SetCacheDirectory(), cRecordingUserCommand::SetCommand(), cPlugin::SetConfigDirectory(), cPluginManager::SetDirectory(), cSchedules::SetEpgDataFileName(), cTimers::SetEvents(), SetKeepCaps(), cThread::SetMainThreadId(), cVideoDirectory::SetName(), cDevice::SetOccupied(), SI::SetOverrideCharacterTable(), cDevice::SetPrimaryDevice(), cPlugin::SetResourceDirectory(), SetSVDRPGrabImageDir(), SetSVDRPPorts(), cListBase::SetSyncStateKey(), cCharSetConv::SetSystemCharacterTable(), SI::SetSystemCharacterTable(), cThemes::SetThemesDirectory(), Setup, cDevice::SetUseDevice(), SetUser(), cDevice::SetVolume(), cOsdObject::Show(), cControl::Shutdown(), cDevice::Shutdown(), cOsdProvider::Shutdown(), cPluginManager::Shutdown(), cRecordControls::Shutdown(), SHUTDOWNCANCELPROMPT, SHUTDOWNFORCEPROMPT, ShutdownHandler, SHUTDOWNRETRY, SHUTDOWNWAIT, SignalHandler(), Skins, SourceParams, Sources, cTimers::SpawnPatternTimers(), cRecordControls::Start(), cThread::Start(), cPluginManager::StartPlugins(), StartSVDRPHandler(), cStateKey::StateChanged(), StateKeySVDRPRemoteTimersPoll, cPluginManager::StopPlugins(), cDevice::StopReplay(), StopSVDRPHandler(), StrToNum(), SVDRPhosts, cDevice::SwitchChannel(), cChannels::SwitchTo(), SysLogLevel, tfActive, tfVps, cThread::ThreadId(), TIMERCHECKDELTA, TIMERDEVICETIMEOUT, TIMERLOOKAHEADTIME, cDevice::ToggleMute(), tr, cRecordings::Update(), cOsdProvider::UpdateOsdSize(), cDvbDevice::useDvbDevices, VDRVERSION, cPlugin::Version(), VOLUMEDELTA, cChannel::Vpid(), VPSLOOKAHEADTIME, VPSUPTODATETIME, cDevice::WaitForAllDevicesReady(), and Watchdog().

◆ SetKeepCaps()

bool SetKeepCaps ( bool On)
static

Definition at line 161 of file vdr.c.

Referenced by main().

◆ SetUser()

bool SetUser ( const char * User,
bool UserDump )
static

Definition at line 98 of file vdr.c.

References isnumber().

Referenced by main().

◆ SignalHandler()

void SignalHandler ( int signum)
static

Definition at line 171 of file vdr.c.

References Interface, LastSignal, ShutdownHandler, and SignalHandler().

Referenced by main(), and SignalHandler().

◆ Watchdog()

void Watchdog ( int signum)
static

Definition at line 187 of file vdr.c.

References esyslog.

Referenced by main().

Variable Documentation

◆ LastSignal

int LastSignal = 0
static

Definition at line 96 of file vdr.c.

Referenced by main(), and SignalHandler().