From 939081e274d0a9868e5ba9a7951666ad508afb96 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Wed, 6 Jan 2010 13:34:00 +0100 Subject: =?UTF-8?q?Version=201.7.11=20-=20Fixed=20resetting=20the=20file?= =?UTF-8?q?=20size=20when=20regenerating=20the=20index=20file.=20-=20The?= =?UTF-8?q?=20new=20function=20cDevice::PatPmtParser()=20can=20be=20used?= =?UTF-8?q?=20in=20derived=20devices=20to=20access=20=20=20the=20PAT/PMT?= =?UTF-8?q?=20of=20the=20currently=20replayed=20material.=20-=20Updated=20?= =?UTF-8?q?the=20Italian=20OSD=20texts=20(thanks=20to=20Diego=20Pierotto).?= =?UTF-8?q?=20-=20The=20PCR=20pid=20in=20generated=20PMTs=20is=20now=20set?= =?UTF-8?q?=20to=200x1FFF=20("no=20PCR=20pid")=20in=20=20=20cPatPmtGenerat?= =?UTF-8?q?or::GeneratePmt(),=20because=20VDR=20doesn't=20record=20the=20P?= =?UTF-8?q?CR=20pid.=20-=20Updated=20the=20Estonian=20OSD=20texts=20(thank?= =?UTF-8?q?s=20to=20Arthur=20Konovalov).=20-=20The=20'sky'=20plugin=20is?= =?UTF-8?q?=20no=20longer=20part=20of=20the=20VDR=20source.=20-=20Improved?= =?UTF-8?q?=20SPU=20handling=20on=20devices=20with=20limited=20OSD=20capab?= =?UTF-8?q?ilities=20(thanks=20to=20=20=20Matthieu=20Castet).=20-=20Severa?= =?UTF-8?q?l=20code=20modifications=20to=20avoid=20compiler=20warnings=20(?= =?UTF-8?q?thanks=20to=20Winfried=20K=C3=B6hler).=20-=20Added=20stream=20t?= =?UTF-8?q?ype=2011172=20AUDIO=20to=20cPatPmtParser::ParsePmt()=20(thanks?= =?UTF-8?q?=20to=20Johann=20=20=20Friedrichs).=20-=20Removed=20debug=20out?= =?UTF-8?q?put=20of=20'-'=20from=20cTransfer::Receive().=20-=20Added=20def?= =?UTF-8?q?ines=20for=20large=20files=20to=20the=20'newplugin'=20script=20?= =?UTF-8?q?(reported=20by=20Udo=20Richter).=20-=20Removed=20the=20workarou?= =?UTF-8?q?nd=20for=20short=20channel=20names=20of=20"Kabel=20Deutschland"?= =?UTF-8?q?,=20because=20=20=20apparently=20they=20now=20have=20their=20da?= =?UTF-8?q?ta=20according=20to=20the=20DVB=20standard=20(thanks=20to=20=20?= =?UTF-8?q?=20Johann=20Friedrichs).=20-=20Some=20fixes=20to=20dvbspu.[hc]?= =?UTF-8?q?=20(thanks=20to=20Johann=20Friedrichs).=20-=20Fixed=20a=20busy?= =?UTF-8?q?=20loop=20when=20moving=20editing=20marks=20(thanks=20to=20Joha?= =?UTF-8?q?nn=20Friedrichs).=20-=20Updated=20sources.conf=20(thanks=20to?= =?UTF-8?q?=20Derek=20Kelly).=20-=20Modified=20cCharSetConv=20so=20that=20?= =?UTF-8?q?it=20can=20be=20used=20to=20convert=20from=20"whatever=20VDR=20?= =?UTF-8?q?uses"=20=20=20to=20a=20given=20code=20(thanks=20to=20Joachim=20?= =?UTF-8?q?Wilke).=20-=20Channel=20names=20containing=20commas=20are=20now?= =?UTF-8?q?=20handled=20correctly=20in=20channels.conf.=20=20=20If=20a=20c?= =?UTF-8?q?hannel's=20short=20name=20contains=20a=20comma,=20it=20is=20rep?= =?UTF-8?q?laced=20with=20a=20'.'.=20-=20cDevice=20now=20logs=20the=20devi?= =?UTF-8?q?ce=20number=20when=20a=20new=20device=20is=20created.=20-=20Fix?= =?UTF-8?q?ed=20handling=20STREAMTYPE=5F11172=5FAUDIO=20in=20cPatPmtParser?= =?UTF-8?q?::ParsePmt().=20-=20cParsePatPmt=20now=20has=20functions=20to?= =?UTF-8?q?=20retrieve=20the=20audio,=20dolby=20and=20subtitle=20pids.=20-?= =?UTF-8?q?=20cPatFilter::Process()=20now=20only=20stores=20CA=20descripto?= =?UTF-8?q?rs=20for=20video=20and=20audio=20pids=20=20=20(thanks=20to=20Fr?= =?UTF-8?q?ancesco=20Saverio=20Schiavarelli=20for=20reporting=20a=20proble?= =?UTF-8?q?m=20with=20channels=20=20=20that=20have=20some=20encrypted=20co?= =?UTF-8?q?mponents=20that=20VDR=20doesn't=20use).=20-=20cDevice::AddPid()?= =?UTF-8?q?=20now=20stores=20the=20stream=20type=20of=20the=20given=20pid?= =?UTF-8?q?=20(thanks=20to=20Andreas=20=20=20Regel).=20-=20Added=20cFont::?= =?UTF-8?q?FontName()=20and=20cFont::Size()=20(thanks=20to=20Andreas=20Reg?= =?UTF-8?q?el).=20-=20cPatPmtParser=20now=20also=20stores=20the=20audio=20?= =?UTF-8?q?stream=20types.=20-=20The=20support=20for=20full=20featured=20D?= =?UTF-8?q?VB=20cards=20of=20the=20TT/FuSi=20design=20has=20been=20moved?= =?UTF-8?q?=20=20=20into=20the=20new=20plugin=20'dvbsddevice'.=20On=20syst?= =?UTF-8?q?ems=20that=20use=20such=20a=20card=20as=20their=20=20=20primary?= =?UTF-8?q?=20device,=20this=20plugin=20now=20needs=20to=20be=20loaded=20w?= =?UTF-8?q?hen=20running=20VDR=20in=20order=20=20=20to=20view=20live=20or?= =?UTF-8?q?=20recorded=20video.=20If=20the=20plugin=20is=20not=20loaded,?= =?UTF-8?q?=20the=20card=20will=20=20=20be=20treated=20like=20a=20budget?= =?UTF-8?q?=20DVB=20card,=20and=20there=20will=20be=20no=20OSD=20or=20view?= =?UTF-8?q?ing=20=20=20capability.=20-=20Fixed=20handling=20the=20"CA=20PM?= =?UTF-8?q?T"=20generation=20(revised=20a=20change=20not=20mentioned=20in?= =?UTF-8?q?=20version=20=20=201.7.9's=20changes,=20which=20caused=20a=20ma?= =?UTF-8?q?lfunction=20with=20Conax=20and=20Viaccess=20CAMs).=20-=20Fixed?= =?UTF-8?q?=20stopping=20subtitle=20display=20when=20switching=20the=20pri?= =?UTF-8?q?mary=20device=20(thanks=20to=20=20=20Anssi=20Hannula).=20=20=20?= =?UTF-8?q?IMPORTANT=20NOTE=20TO=20PLUGIN=20AUTHORS:=20a=20plugin=20that?= =?UTF-8?q?=20implements=20a=20derived=20cDevice=20=20=20class=20that=20ca?= =?UTF-8?q?n=20replay=20video=20must=20now=20call=20the=20MakePrimaryDevic?= =?UTF-8?q?e()=20function=20of=20=20=20its=20base=20class.=20-=20Fixed=20c?= =?UTF-8?q?ompiler=20warnings=20"format=20not=20a=20string=20literal=20and?= =?UTF-8?q?=20no=20format=20arguments"=20=20=20in=20some=20syslog=20calls?= =?UTF-8?q?=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20The=20new=20command?= =?UTF-8?q?=20line=20options=20--edit=20and=20--genindex=20can=20be=20used?= =?UTF-8?q?=20to=20edit=20a=20=20=20recording=20or=20generate=20its=20inde?= =?UTF-8?q?x=20without=20actually=20starting=20the=20entire=20VDR=20=20=20?= =?UTF-8?q?(based=20on=20a=20patch=20from=20Helmut=20Auer).=20-=20Improved?= =?UTF-8?q?=20the=20description=20of=20the=20transponder=20parameters=20in?= =?UTF-8?q?=20vdr.5=20(thanks=20to=20=20=20Winfried=20K=C3=B6hler).=20-=20?= =?UTF-8?q?Avoiding=20setting=20the=20video=20stream=20type=20to=202=20if?= =?UTF-8?q?=20the=20vpid=20is=200=20(problem=20reported=20=20=20by=20Arthu?= =?UTF-8?q?r=20Konovalov).=20-=20Implemented=20handling=20the=20"Content?= =?UTF-8?q?=20Descriptor"=20(based=20on=20a=20patch=20from=20Rolf=20=20=20?= =?UTF-8?q?Ahrenberg).=20The=20'classic',=20'sttng'=20and=20'curses'=20ski?= =?UTF-8?q?ns=20display=20the=20textual=20=20=20representation=20of=20the?= =?UTF-8?q?=20content=20descriptors=20as=20"genre".=20The=20epg.data=20fil?= =?UTF-8?q?e=20stores=20=20=20the=20genre=20using=20the=20tag=20character?= =?UTF-8?q?=20'G'.=20-=20Implemented=20handling=20the=20"Parental=20Rating?= =?UTF-8?q?=20Descriptor"=20(based=20on=20a=20patch=20from=20Rolf=20=20=20?= =?UTF-8?q?Ahrenberg).=20The=20'classic',=20'sttng'=20and=20'curses'=20ski?= =?UTF-8?q?ns=20display=20the=20parental=20=20=20rating=20(if=20given)=20i?= =?UTF-8?q?n=20their=20event=20displays.=20The=20epg.data=20file=20stores?= =?UTF-8?q?=20=20=20the=20parental=20rating=20using=20the=20tag=20characte?= =?UTF-8?q?r=20'R'.=20=20=20IMPORTANT=20NOTE:=20if=20VDR=20doesn't=20displ?= =?UTF-8?q?ay=20a=20parental=20rating,=20this=20does=20not=20=20=20necessa?= =?UTF-8?q?rily=20mean=20that=20the=20given=20programme=20is=20suitable=20?= =?UTF-8?q?for=20all=20audiences!=20-=20Rearranged=20cEvent=20members=20to?= =?UTF-8?q?=20minimize=20memory=20waste.=20-=20After=20a=20CLRE=20command,?= =?UTF-8?q?=20no=20further=20EPG=20processing=20is=20now=20done=20for=2010?= =?UTF-8?q?=20seconds,=20=20=20so=20that=20data=20sent=20with=20subsequent?= =?UTF-8?q?=20PUTE=20commands=20doesn't=20interfere=20with=20data=20=20=20?= =?UTF-8?q?from=20the=20broadcasters=20(suggested=20by=20Helmut=20Auer).?= =?UTF-8?q?=20-=20Added=20support=20for=20DVB=20cards=20with=20multiple=20?= =?UTF-8?q?fontends.=20Note=20that=20this=20only=20=20=20works=20for=20DVB?= =?UTF-8?q?=20cards=20where=20each=20frontend=20can=20be=20used=20independ?= =?UTF-8?q?ently=20of=20all=20=20=20the=20others=20on=20the=20same=20adapt?= =?UTF-8?q?er.=20-=20Fixed=20plugin=20arguments=20corruption=20with=20glib?= =?UTF-8?q?c=202.11=20on=20x86=5F64=20(thanks=20to=20=20=20Anssi=20Hannula?= =?UTF-8?q?).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLUGINS/src/sky/sky.c | 303 -------------------------------------------------- 1 file changed, 303 deletions(-) delete mode 100644 PLUGINS/src/sky/sky.c (limited to 'PLUGINS/src/sky/sky.c') diff --git a/PLUGINS/src/sky/sky.c b/PLUGINS/src/sky/sky.c deleted file mode 100644 index 75bd9ec..0000000 --- a/PLUGINS/src/sky/sky.c +++ /dev/null @@ -1,303 +0,0 @@ -/* - * sky.c: A plugin for the Video Disk Recorder - * - * See the README file for copyright information and how to reach the author. - * - * $Id: sky.c 2.1 2008/09/07 11:54:07 kls Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -static const char *VERSION = "0.3.8"; -static const char *DESCRIPTION = "Sky Digibox interface"; - -// --- cDigiboxDevice -------------------------------------------------------- - -#define DUMMYAPID 80 -#define DUMMYVPID 160 - -class cSkyChannel : public cListObject { -public: - tChannelID channelID; - int digiboxChannelNumber; - bool Parse(const char *s); - }; - -bool cSkyChannel::Parse(const char *s) -{ - char *id = NULL; - if (2 == sscanf(s, "%a[^:]:%d", &id, &digiboxChannelNumber)) - channelID = tChannelID::FromString(id); - free(id); - return digiboxChannelNumber && channelID.Valid(); -} - -class cSkyChannels : public cConfig { -public: - cSkyChannel *GetSkyChannel(const cChannel *Channel); - }; - -cSkyChannel *cSkyChannels::GetSkyChannel(const cChannel *Channel) -{ - tChannelID ChannelID = Channel->GetChannelID(); - for (cSkyChannel *sc = First(); sc; sc = Next(sc)) { - if (ChannelID == sc->channelID) - return sc; - } - return NULL; -} - -cSkyChannels SkyChannels; - -class cDigiboxDevice : public cDevice { -private: - int source; - int digiboxChannelNumber; - int fd_dvr; - int apid, vpid; - cTSBuffer *tsBuffer; - int fd_lirc; - void LircSend(const char *s); - void LircSend(int n); -protected: - virtual bool SetPid(cPidHandle *Handle, int Type, bool On); - virtual bool OpenDvr(void); - virtual void CloseDvr(void); - virtual bool GetTSPacket(uchar *&Data); -public: - cDigiboxDevice(void); - virtual ~cDigiboxDevice(); - virtual bool ProvidesSource(int Source) const; - virtual bool ProvidesTransponder(const cChannel *Channel) const; - virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsSetChannel = NULL) const; - virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView); - }; - -cDigiboxDevice::cDigiboxDevice(void) -{ - source = cSource::FromString("S28.2E");//XXX parameter??? - digiboxChannelNumber = 0; - fd_dvr = -1; - apid = vpid = 0; - struct sockaddr_un addr; - addr.sun_family = AF_UNIX; - strn0cpy(addr.sun_path, "/dev/lircd", sizeof(addr.sun_path));//XXX parameter??? - fd_lirc = socket(AF_UNIX, SOCK_STREAM, 0); - if (fd_lirc >= 0) { - if (connect(fd_lirc, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - LOG_ERROR; - close(fd_lirc); - } - } - else - LOG_ERROR; -} - -cDigiboxDevice::~cDigiboxDevice() -{ - if (fd_lirc >= 0) - close(fd_lirc); -} - -void cDigiboxDevice::LircSend(const char *s) -{ - char buf[100]; - snprintf(buf, sizeof(buf), "SEND_ONCE SKY %s\n", s); - dsyslog(buf);//XXX - if (write(fd_lirc, buf, strlen(buf)) < 0) - LOG_ERROR;//XXX _STR - cCondWait::SleepMs(200); -} - -void cDigiboxDevice::LircSend(int n) -{ - char buf[10]; - snprintf(buf, sizeof(buf), "%d", n); - char *p = buf; - while (*p) { - char q[10]; - sprintf(q, "%c", *p); - LircSend(q); - p++; - } -} - -bool cDigiboxDevice::SetPid(cPidHandle *Handle, int Type, bool On) -{ - //dsyslog("SetPid %d %d", Handle->pid, On); - return true; -} - -bool cDigiboxDevice::OpenDvr(void) -{ - CloseDvr(); - fd_dvr = open("/dev/video2", O_RDONLY | O_NONBLOCK);//XXX parameter??? - if (fd_dvr >= 0) - tsBuffer = new cTSBuffer(fd_dvr, MEGABYTE(2), CardIndex() + 1); - return fd_dvr >= 0; -} - -void cDigiboxDevice::CloseDvr(void) -{ - if (fd_dvr >= 0) { - close(fd_dvr); - fd_dvr = -1; - delete tsBuffer; - tsBuffer = NULL; - } -} - -bool cDigiboxDevice::GetTSPacket(uchar *&Data) -{ - if (tsBuffer) { - Data = tsBuffer->Get(); - if (Data) { - // insert the actual PIDs: - int Pid = (((uint16_t)Data[1] & TS_PID_MASK_HI) << 8) | Data[2]; - if (Pid == DUMMYAPID) - Pid = apid; - else if (Pid == DUMMYVPID) - Pid = vpid; - Data[1] = ((Pid >> 8) & 0xFF) | (Data[1] & ~TS_PID_MASK_HI); - Data[2] = Pid & 0xFF; - } - return true; - } - return false; -} - -bool cDigiboxDevice::ProvidesSource(int Source) const -{ - return source == Source; -} - -bool cDigiboxDevice::ProvidesTransponder(const cChannel *Channel) const -{ - return false; // can't provide any actual transponder -} - -bool cDigiboxDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const -{ - bool result = false; - bool hasPriority = Priority < 0 || Priority > this->Priority(); - bool needsDetachReceivers = true; - - cSkyChannel *SkyChannel = SkyChannels.GetSkyChannel(Channel); - if (SkyChannel) { - if (Receiving(true)) { - if (digiboxChannelNumber == SkyChannel->digiboxChannelNumber) { - needsDetachReceivers = false; - result = true; - } - else - result = hasPriority; - } - else - result = hasPriority; - } - if (NeedsDetachReceivers) - *NeedsDetachReceivers = needsDetachReceivers; - return result; -} - -bool cDigiboxDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) -{ - if (fd_lirc >= 0 && !Receiving(true)) { // if we are receiving the channel is already set! - cSkyChannel *SkyChannel = SkyChannels.GetSkyChannel(Channel); - if (SkyChannel) { - digiboxChannelNumber = SkyChannel->digiboxChannelNumber; - apid = Channel->Apid(0); - vpid = Channel->Vpid(); - //XXX only when recording??? -> faster channel switching! - LircSend("SKY"); // makes sure the Digibox is "on" - //XXX lircprint(fd_lirc, "BACKUP"); - //XXX lircprint(fd_lirc, "BACKUP"); - //XXX lircprint(fd_lirc, "BACKUP"); - LircSend(digiboxChannelNumber); - } - } - return true; -} - -// --- cPluginSky ------------------------------------------------------------ - -class cPluginSky : public cPlugin { -private: - // Add any member variables or functions you may need here. -public: - cPluginSky(void); - virtual ~cPluginSky(); - virtual const char *Version(void) { return VERSION; } - virtual const char *Description(void) { return DESCRIPTION; } - virtual const char *CommandLineHelp(void); - virtual bool ProcessArgs(int argc, char *argv[]); - virtual bool Initialize(void); - virtual void Housekeeping(void); - virtual cMenuSetupPage *SetupMenu(void); - virtual bool SetupParse(const char *Name, const char *Value); - }; - -cPluginSky::cPluginSky(void) -{ - // Initialize any member variables here. - // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL - // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! -} - -cPluginSky::~cPluginSky() -{ - // Clean up after yourself! -} - -const char *cPluginSky::CommandLineHelp(void) -{ - // Return a string that describes all known command line options. - return NULL; -} - -bool cPluginSky::ProcessArgs(int argc, char *argv[]) -{ - // Implement command line argument processing here if applicable. - return true; -} - -bool cPluginSky::Initialize(void) -{ - // Initialize any background activities the plugin shall perform. - const char *ConfigDir = ConfigDirectory(Name()); - if (ConfigDir) { - if (SkyChannels.Load(AddDirectory(ConfigDir, "channels.conf.sky"), true)) { - new cDigiboxDevice; - return true; - } - } - else - esyslog("ERROR: can't get config directory"); - return false; -} - -void cPluginSky::Housekeeping(void) -{ - // Perform any cleanup or other regular tasks. -} - -cMenuSetupPage *cPluginSky::SetupMenu(void) -{ - // Return a setup menu in case the plugin supports one. - return NULL; -} - -bool cPluginSky::SetupParse(const char *Name, const char *Value) -{ - // Parse your own setup parameters and store their values. - return false; -} - -VDRPLUGINCREATOR(cPluginSky); // Don't touch this! -- cgit v1.2.3