summaryrefslogtreecommitdiff
path: root/dvbdevice.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-01-10 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-01-10 18:00:00 +0100
commit3e1d34f392792bbcf1bda4884c58ca9cec445d1d (patch)
treee2c9910b5a7d429784eeda4404ea7429e757a8f3 /dvbdevice.c
parent48fd2b04e9010bb67e19f33e8c7506a976b70e90 (diff)
downloadvdr-patch-lnbsharing-3e1d34f392792bbcf1bda4884c58ca9cec445d1d.tar.gz
vdr-patch-lnbsharing-3e1d34f392792bbcf1bda4884c58ca9cec445d1d.tar.bz2
Version 1.1.21vdr-1.1.21
- Fixed the 'channels.conf' entries for "Studio Universal" and "Disney Channel". - Fixed handling channels in the "Channels" menu in case there are ':@nnn' group separators without names (thanks to Guy Roussin for reporting this one). - The SVDRP command CHAN now also accepts channel IDs. - Increased the timeout until an index file is considerd no longer to be written (sometimes in time shift with heavy system load the index file was closed too early by the replay thread). - Implemented "Link Layer" based CAM support, which hopefully will solve the problems with CAMs we had in the past. To use this you need the driver version 2002-01-08 or higher (with the new firmware supporting the "Link Layer" protocol). - Added an EPG bugfix that moves the Subtitle data to the Extended Description in case the latter is empty and the Subtitle exceeds some useful length. - Since several channels put very long strings into the Subtitle part of their EPG data, that string is now limited in length when used in a recording's file name.
Diffstat (limited to 'dvbdevice.c')
-rw-r--r--dvbdevice.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/dvbdevice.c b/dvbdevice.c
index adc900b..2e12f26 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.c 1.40 2002/12/14 10:52:13 kls Exp $
+ * $Id: dvbdevice.c 1.41 2003/01/06 14:44:27 kls Exp $
*/
#include "dvbdevice.h"
@@ -43,6 +43,7 @@ extern "C" {
#define DEV_DVB_DEMUX "demux"
#define DEV_DVB_VIDEO "video"
#define DEV_DVB_AUDIO "audio"
+#define DEV_DVB_CA "ca"
static const char *DvbName(const char *Name, int n)
{
@@ -68,30 +69,34 @@ private:
int fd_frontend;
int cardIndex;
fe_type_t frontendType;
+ cCiHandler *ciHandler;
cChannel channel;
const char *diseqcCommands;
bool active;
eTunerStatus tunerStatus;
+ bool caSet;
cMutex mutex;
cCondVar newSet;
bool SetFrontend(void);
virtual void Action(void);
public:
- cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType);
+ cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCiHandler *CiHandler);
virtual ~cDvbTuner();
bool IsTunedTo(const cChannel *Channel) const;
- void Set(const cChannel *Channel);
+ void Set(const cChannel *Channel, bool Tune);
bool Locked(void) { return tunerStatus == tsLocked; }
};
-cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType)
+cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCiHandler *CiHandler)
{
fd_frontend = Fd_Frontend;
cardIndex = CardIndex;
frontendType = FrontendType;
+ ciHandler = CiHandler;
diseqcCommands = NULL;
active = false;
tunerStatus = tsIdle;
+ caSet = false;
Start();
}
@@ -108,11 +113,13 @@ bool cDvbTuner::IsTunedTo(const cChannel *Channel) const
return tunerStatus != tsIdle && channel.Source() == Channel->Source() && channel.Frequency() == Channel->Frequency();
}
-void cDvbTuner::Set(const cChannel *Channel)
+void cDvbTuner::Set(const cChannel *Channel, bool Tune)
{
cMutexLock MutexLock(&mutex);
channel = *Channel;
- tunerStatus = tsSet;
+ if (Tune)
+ tunerStatus = tsSet;
+ caSet = false;
newSet.Broadcast();
}
@@ -251,6 +258,30 @@ void cDvbTuner::Action(void)
continue;
}
}
+ if (ciHandler && !caSet) {//XXX TODO update in case the CA descriptors have changed
+ uchar buffer[2048];
+ int length = cSIProcessor::GetCaDescriptors(channel.Source(), channel.Frequency(), channel.Sid(), sizeof(buffer), buffer);
+ if (length > 0) {
+ cCiCaPmt CaPmt(channel.Sid());
+ if (channel.Vpid()) {
+ CaPmt.AddPid(channel.Vpid());
+ CaPmt.AddCaDescriptor(length, buffer);
+ }
+ if (channel.Apid1()) {
+ CaPmt.AddPid(channel.Apid1());
+ CaPmt.AddCaDescriptor(length, buffer);
+ }
+ if (channel.Apid2()) {
+ CaPmt.AddPid(channel.Apid2());
+ CaPmt.AddCaDescriptor(length, buffer);
+ }
+ if (channel.Dpid1()) {
+ CaPmt.AddPid(channel.Dpid1());
+ CaPmt.AddCaDescriptor(length, buffer);
+ }
+ caSet = ciHandler->SetCaPmt(CaPmt);
+ }
+ }
newSet.TimedWait(mutex, 1000);
}
dsyslog("tuner thread ended on device %d (pid=%d)", cardIndex + 1, getpid());
@@ -291,7 +322,8 @@ cDvbDevice::cDvbDevice(int n)
siProcessor = new cSIProcessor(DvbName(DEV_DVB_DEMUX, n));
if (ioctl(fd_frontend, FE_GET_INFO, &feinfo) >= 0) {
frontendType = feinfo.type;
- dvbTuner = new cDvbTuner(fd_frontend, CardIndex(), frontendType);
+ ciHandler = cCiHandler::CreateCiHandler(DvbName(DEV_DVB_CA, n));
+ dvbTuner = new cDvbTuner(fd_frontend, CardIndex(), frontendType, ciHandler);
}
else
LOG_ERROR;
@@ -616,8 +648,8 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
DelPid(pidHandles[ptDolby].pid);
}
+ dvbTuner->Set(Channel, DoTune);
if (DoTune) {
- dvbTuner->Set(Channel);
/*XXX do we still need this???
if (!(status & FE_HAS_LOCK)) {
esyslog("ERROR: channel %d not locked on DVB card %d!", Channel->Number(), CardIndex() + 1);