summaryrefslogtreecommitdiff
path: root/PLUGINS/src/sky/sky.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <Klaus (dot) Schmidinger (at) tvdr (dot) de>2010-01-06 13:34:00 +0100
committerKlaus Schmidinger <Klaus (dot) Schmidinger (at) tvdr (dot) de>2010-01-06 13:34:00 +0100
commit939081e274d0a9868e5ba9a7951666ad508afb96 (patch)
treee79853c0ab397e609897a8f9dfc731231ce0aee4 /PLUGINS/src/sky/sky.c
parentea01358b3bca9d55402ba632c95cdd6458abfdb3 (diff)
downloadvdr-patch-lnbsharing-939081e274d0a9868e5ba9a7951666ad508afb96.tar.gz
vdr-patch-lnbsharing-939081e274d0a9868e5ba9a7951666ad508afb96.tar.bz2
Version 1.7.11vdr-1.7.11
- Fixed resetting the file size when regenerating the index file. - The new function cDevice::PatPmtParser() can be used in derived devices to access the PAT/PMT of the currently replayed material. - Updated the Italian OSD texts (thanks to Diego Pierotto). - The PCR pid in generated PMTs is now set to 0x1FFF ("no PCR pid") in cPatPmtGenerator::GeneratePmt(), because VDR doesn't record the PCR pid. - Updated the Estonian OSD texts (thanks to Arthur Konovalov). - The 'sky' plugin is no longer part of the VDR source. - Improved SPU handling on devices with limited OSD capabilities (thanks to Matthieu Castet). - Several code modifications to avoid compiler warnings (thanks to Winfried Köhler). - Added stream type 11172 AUDIO to cPatPmtParser::ParsePmt() (thanks to Johann Friedrichs). - Removed debug output of '-' from cTransfer::Receive(). - Added defines for large files to the 'newplugin' script (reported by Udo Richter). - Removed the workaround for short channel names of "Kabel Deutschland", because apparently they now have their data according to the DVB standard (thanks to Johann Friedrichs). - Some fixes to dvbspu.[hc] (thanks to Johann Friedrichs). - Fixed a busy loop when moving editing marks (thanks to Johann Friedrichs). - Updated sources.conf (thanks to Derek Kelly). - Modified cCharSetConv so that it can be used to convert from "whatever VDR uses" to a given code (thanks to Joachim Wilke). - Channel names containing commas are now handled correctly in channels.conf. If a channel's short name contains a comma, it is replaced with a '.'. - cDevice now logs the device number when a new device is created. - Fixed handling STREAMTYPE_11172_AUDIO in cPatPmtParser::ParsePmt(). - cParsePatPmt now has functions to retrieve the audio, dolby and subtitle pids. - cPatFilter::Process() now only stores CA descriptors for video and audio pids (thanks to Francesco Saverio Schiavarelli for reporting a problem with channels that have some encrypted components that VDR doesn't use). - cDevice::AddPid() now stores the stream type of the given pid (thanks to Andreas Regel). - Added cFont::FontName() and cFont::Size() (thanks to Andreas Regel). - cPatPmtParser now also stores the audio stream types. - The support for full featured DVB cards of the TT/FuSi design has been moved into the new plugin 'dvbsddevice'. On systems that use such a card as their primary device, this plugin now needs to be loaded when running VDR in order to view live or recorded video. If the plugin is not loaded, the card will be treated like a budget DVB card, and there will be no OSD or viewing capability. - Fixed handling the "CA PMT" generation (revised a change not mentioned in version 1.7.9's changes, which caused a malfunction with Conax and Viaccess CAMs). - Fixed stopping subtitle display when switching the primary device (thanks to Anssi Hannula). IMPORTANT NOTE TO PLUGIN AUTHORS: a plugin that implements a derived cDevice class that can replay video must now call the MakePrimaryDevice() function of its base class. - Fixed compiler warnings "format not a string literal and no format arguments" in some syslog calls (thanks to Rolf Ahrenberg). - The new command line options --edit and --genindex can be used to edit a recording or generate its index without actually starting the entire VDR (based on a patch from Helmut Auer). - Improved the description of the transponder parameters in vdr.5 (thanks to Winfried Köhler). - Avoiding setting the video stream type to 2 if the vpid is 0 (problem reported by Arthur Konovalov). - Implemented handling the "Content Descriptor" (based on a patch from Rolf Ahrenberg). The 'classic', 'sttng' and 'curses' skins display the textual representation of the content descriptors as "genre". The epg.data file stores the genre using the tag character 'G'. - Implemented handling the "Parental Rating Descriptor" (based on a patch from Rolf Ahrenberg). The 'classic', 'sttng' and 'curses' skins display the parental rating (if given) in their event displays. The epg.data file stores the parental rating using the tag character 'R'. IMPORTANT NOTE: if VDR doesn't display a parental rating, this does not necessarily mean that the given programme is suitable for all audiences! - Rearranged cEvent members to minimize memory waste. - After a CLRE command, no further EPG processing is now done for 10 seconds, so that data sent with subsequent PUTE commands doesn't interfere with data from the broadcasters (suggested by Helmut Auer). - Added support for DVB cards with multiple fontends. Note that this only works for DVB cards where each frontend can be used independently of all the others on the same adapter. - Fixed plugin arguments corruption with glibc 2.11 on x86_64 (thanks to Anssi Hannula).
Diffstat (limited to 'PLUGINS/src/sky/sky.c')
-rw-r--r--PLUGINS/src/sky/sky.c303
1 files changed, 0 insertions, 303 deletions
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 <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/un.h>
-#include <unistd.h>
-#include <vdr/device.h>
-#include <vdr/plugin.h>
-#include <vdr/sources.h>
-
-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<cSkyChannel> {
-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!