vdr: -dynamite-subdevice.patch to 1.7.25

This commit is contained in:
Stefan Saraev 2012-03-04 16:00:10 +02:00
parent a441cb56d1
commit 94d72f09e8

View File

@ -1,5 +1,11 @@
commit 0e0b199ea828148d82b08e0702eb3dc1b49fc5f4
Author: Stefan Saraev <stefan@saraev.ca>
Date: Sun Mar 4 15:55:17 2012 +0200
vdr-dynamite: adjust to 1.7.25
diff --git a/ci.c b/ci.c
index 59d62ef..6c5face 100644
index 0135d07..cf21952 100644
--- a/ci.c
+++ b/ci.c
@@ -1571,6 +1571,8 @@ cCamSlot::cCamSlot(cCiAdapter *CiAdapter)
@ -12,7 +18,7 @@ index 59d62ef..6c5face 100644
DeleteAllConnections();
}
diff --git a/ci.h b/ci.h
index 71bbdf9..70303d1 100644
index 74e0270..d38e2dd 100644
--- a/ci.h
+++ b/ci.h
@@ -115,6 +115,8 @@ public:
@ -25,10 +31,10 @@ index 71bbdf9..70303d1 100644
class cTPDU;
diff --git a/device.c b/device.c
index 0bab66c..60382dd 100644
index 663f91a..c0810fa 100644
--- a/device.c
+++ b/device.c
@@ -72,12 +72,22 @@ cDevice *cDevice::device[MAXDEVICES] = { NULL };
@@ -70,12 +70,22 @@ cDevice *cDevice::device[MAXDEVICES] = { NULL };
cDevice *cDevice::primaryDevice = NULL;
cDevice *cDevice::avoidDevice = NULL;
cList<cDeviceHook> cDevice::deviceHooks;
@ -56,7 +62,7 @@ index 0bab66c..60382dd 100644
SetDescription("receiver on device %d", CardIndex() + 1);
@@ -110,10 +120,14 @@ cDevice::cDevice(void)
@@ -106,10 +116,14 @@ cDevice::cDevice(void)
for (int i = 0; i < MAXRECEIVERS; i++)
receiver[i] = NULL;
@ -74,7 +80,7 @@ index 0bab66c..60382dd 100644
}
cDevice::~cDevice()
@@ -122,6 +136,29 @@ cDevice::~cDevice()
@@ -118,6 +132,29 @@ cDevice::~cDevice()
DetachAllReceivers();
delete liveSubtitle;
delete dvbSubtitleConverter;
@ -104,7 +110,7 @@ index 0bab66c..60382dd 100644
}
bool cDevice::WaitForAllDevicesReady(int Timeout)
@@ -160,6 +197,8 @@ int cDevice::NextCardIndex(int n)
@@ -156,6 +193,8 @@ int cDevice::NextCardIndex(int n)
int cDevice::DeviceNumber(void) const
{
@ -113,7 +119,7 @@ index 0bab66c..60382dd 100644
for (int i = 0; i < numDevices; i++) {
if (device[i] == this)
return i;
@@ -330,6 +369,8 @@ bool cDevice::HasCi(void)
@@ -326,6 +365,8 @@ bool cDevice::HasCi(void)
void cDevice::SetCamSlot(cCamSlot *CamSlot)
{
@ -122,7 +128,7 @@ index 0bab66c..60382dd 100644
camSlot = CamSlot;
}
@@ -533,6 +574,10 @@ bool cDevice::SetPid(cPidHandle *Handle, int Type, bool On)
@@ -538,6 +579,10 @@ void cDevice::DelLivePids(void)
void cDevice::StartSectionHandler(void)
{
@ -133,7 +139,7 @@ index 0bab66c..60382dd 100644
if (!sectionHandler) {
sectionHandler = new cSectionHandler(this);
AttachFilter(eitFilter = new cEitFilter);
@@ -544,6 +589,10 @@ void cDevice::StartSectionHandler(void)
@@ -549,6 +594,10 @@ void cDevice::StartSectionHandler(void)
void cDevice::StopSectionHandler(void)
{
@ -144,7 +150,7 @@ index 0bab66c..60382dd 100644
if (sectionHandler) {
delete nitFilter;
delete sdtFilter;
@@ -570,12 +619,17 @@ void cDevice::CloseFilter(int Handle)
@@ -575,12 +624,17 @@ void cDevice::CloseFilter(int Handle)
void cDevice::AttachFilter(cFilter *Filter)
{
@ -162,7 +168,7 @@ index 0bab66c..60382dd 100644
if (sectionHandler)
sectionHandler->Detach(Filter);
}
@@ -737,6 +791,7 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
@@ -742,6 +796,7 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
sectionHandler->SetStatus(false);
sectionHandler->SetChannel(NULL);
}
@ -170,7 +176,7 @@ index 0bab66c..60382dd 100644
// Tell the camSlot about the channel switch and add all PIDs of this
// channel to it, for possible later decryption:
if (camSlot)
@@ -783,19 +838,27 @@ void cDevice::ForceTransferMode(void)
@@ -788,19 +843,27 @@ void cDevice::ForceTransferMode(void)
{
if (!cTransferControl::ReceiverDevice()) {
cChannel *Channel = Channels.GetByNumber(CurrentChannel());
@ -199,7 +205,7 @@ index 0bab66c..60382dd 100644
if (Seconds >= 0)
occupiedTimeout = time(NULL) + min(Seconds, MAXOCCUPIEDTIMEOUT);
}
@@ -1167,7 +1230,10 @@ bool cDevice::Transferring(void) const
@@ -1173,7 +1236,10 @@ bool cDevice::Transferring(void) const
bool cDevice::AttachPlayer(cPlayer *Player)
{
@ -210,7 +216,7 @@ index 0bab66c..60382dd 100644
if (player)
Detach(player);
DELETENULL(liveSubtitle);
@@ -1186,6 +1252,8 @@ bool cDevice::AttachPlayer(cPlayer *Player)
@@ -1192,6 +1258,8 @@ bool cDevice::AttachPlayer(cPlayer *Player)
void cDevice::Detach(cPlayer *Player)
{
@ -219,7 +225,7 @@ index 0bab66c..60382dd 100644
if (Player && player == Player) {
cPlayer *p = player;
player = NULL; // avoids recursive calls to Detach()
@@ -1205,6 +1273,8 @@ void cDevice::Detach(cPlayer *Player)
@@ -1211,6 +1279,8 @@ void cDevice::Detach(cPlayer *Player)
void cDevice::StopReplay(void)
{
@ -228,25 +234,25 @@ index 0bab66c..60382dd 100644
if (player) {
Detach(player);
if (IsPrimaryDevice())
@@ -1487,6 +1557,8 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly)
@@ -1493,6 +1563,8 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly)
int cDevice::Priority(void) const
{
+ if (parentDevice)
+ return parentDevice->Priority();
int priority = IsPrimaryDevice() ? Setup.PrimaryLimit - 1 : DEFAULTPRIORITY;
cMutexLock MutexLock(&mutexReceiver);
for (int i = 0; i < MAXRECEIVERS; i++) {
@@ -1503,6 +1575,8 @@ bool cDevice::Ready(void)
int priority = IDLEPRIORITY;
if (IsPrimaryDevice() && !Replaying() && ActualDevice() == PrimaryDevice())
priority = TRANSFERPRIORITY; // we use the same value here, no matter whether it's actual Transfer Mode or real live viewing
@@ -1511,6 +1583,8 @@ bool cDevice::Ready(void)
bool cDevice::Receiving(bool CheckAny) const
bool cDevice::Receiving(bool Dummy) const
{
+ if (parentDevice)
+ return parentDevice->Receiving(CheckAny);
+ return parentDevice->Receiving(Dummy);
cMutexLock MutexLock(&mutexReceiver);
for (int i = 0; i < MAXRECEIVERS; i++) {
if (receiver[i] && (CheckAny || receiver[i]->priority >= 0)) // cReceiver with priority < 0 doesn't count
@@ -1583,10 +1657,13 @@ bool cDevice::GetTSPacket(uchar *&Data)
if (receiver[i])
@@ -1591,10 +1665,13 @@ bool cDevice::GetTSPacket(uchar *&Data)
bool cDevice::AttachReceiver(cReceiver *Receiver)
{
@ -260,7 +266,7 @@ index 0bab66c..60382dd 100644
// activate the following line if you need it - actually the driver should be fixed!
//#define WAIT_FOR_TUNER_LOCK
#ifdef WAIT_FOR_TUNER_LOCK
@@ -1625,6 +1702,8 @@ bool cDevice::AttachReceiver(cReceiver *Receiver)
@@ -1633,6 +1710,8 @@ bool cDevice::AttachReceiver(cReceiver *Receiver)
void cDevice::Detach(cReceiver *Receiver)
{
@ -269,7 +275,7 @@ index 0bab66c..60382dd 100644
if (!Receiver || Receiver->device != this)
return;
bool receiversLeft = false;
@@ -1650,6 +1729,8 @@ void cDevice::Detach(cReceiver *Receiver)
@@ -1658,6 +1737,8 @@ void cDevice::Detach(cReceiver *Receiver)
void cDevice::DetachAll(int Pid)
{
@ -278,7 +284,7 @@ index 0bab66c..60382dd 100644
if (Pid) {
cMutexLock MutexLock(&mutexReceiver);
for (int i = 0; i < MAXRECEIVERS; i++) {
@@ -1662,6 +1743,8 @@ void cDevice::DetachAll(int Pid)
@@ -1670,6 +1751,8 @@ void cDevice::DetachAll(int Pid)
void cDevice::DetachAllReceivers(void)
{
@ -287,7 +293,7 @@ index 0bab66c..60382dd 100644
cMutexLock MutexLock(&mutexReceiver);
for (int i = 0; i < MAXRECEIVERS; i++)
Detach(receiver[i]);
@@ -1733,3 +1816,25 @@ uchar *cTSBuffer::Get(void)
@@ -1741,3 +1824,25 @@ uchar *cTSBuffer::Get(void)
}
return NULL;
}
@ -314,10 +320,10 @@ index 0bab66c..60382dd 100644
+ DynamicDeviceProbes.Del(this, false);
+}
diff --git a/device.h b/device.h
index e2ff812..1db0d9d 100644
index 23aea97..d4968cc 100644
--- a/device.h
+++ b/device.h
@@ -164,7 +164,6 @@ private:
@@ -168,7 +168,6 @@ private:
static int nextCardIndex;
int cardIndex;
protected:
@ -325,7 +331,7 @@ index e2ff812..1db0d9d 100644
virtual ~cDevice();
virtual bool Ready(void);
///< Returns true if this device is ready. Devices with conditional
@@ -191,9 +190,6 @@ protected:
@@ -195,9 +194,6 @@ protected:
///< A derived class must call the MakePrimaryDevice() function of its
///< base class.
public:
@ -335,7 +341,7 @@ index e2ff812..1db0d9d 100644
int DeviceNumber(void) const;
///< Returns the number of this device (0 ... numDevices).
virtual bool HasDecoder(void) const;
@@ -397,9 +393,6 @@ public:
@@ -403,9 +399,6 @@ public:
///< Returns true if this device has a Common Interface.
void SetCamSlot(cCamSlot *CamSlot);
///< Sets the given CamSlot to be used with this device.
@ -345,7 +351,7 @@ index e2ff812..1db0d9d 100644
// Image Grab facilities
@@ -555,9 +548,6 @@ private:
@@ -561,9 +554,6 @@ private:
cTsToPes tsToPesSubtitle;
bool isPlayingVideo;
protected:
@ -355,7 +361,7 @@ index e2ff812..1db0d9d 100644
virtual bool CanReplay(void) const;
///< Returns true if this device can currently start a replay session.
virtual bool SetPlayMode(ePlayMode PlayMode);
@@ -743,6 +733,38 @@ public:
@@ -748,6 +738,38 @@ public:
///< Detaches all receivers from this device for this pid.
virtual void DetachAllReceivers(void);
///< Detaches all receivers from this device.
@ -394,7 +400,7 @@ index e2ff812..1db0d9d 100644
};
/// Derived cDevice classes that can receive channels will have to provide
@@ -766,4 +788,47 @@ public:
@@ -771,4 +793,47 @@ public:
uchar *Get(void);
};
@ -584,7 +590,7 @@ index adbe40d..6d117b2 100644
#endif //__DVBCI_H
diff --git a/dvbdevice.c b/dvbdevice.c
index 163fce3..fd3f212 100644
index 1987223..6795dca 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -305,12 +305,16 @@ private:
@ -637,7 +643,7 @@ index 163fce3..fd3f212 100644
}
bool cDvbTuner::Bond(cDvbTuner *Tuner)
@@ -497,8 +507,10 @@ bool cDvbTuner::Locked(int TimeoutMs)
@@ -518,8 +528,10 @@ bool cDvbTuner::Locked(int TimeoutMs)
return tunerStatus >= tsLocked;
}
@ -649,7 +655,7 @@ index 163fce3..fd3f212 100644
cPoller Poller(fd_frontend);
if (Poller.Poll(TUNER_POLL_TIMEOUT)) {
dvb_frontend_event Event;
@@ -507,7 +519,7 @@ void cDvbTuner::ClearEventQueue(void) const
@@ -528,7 +540,7 @@ void cDvbTuner::ClearEventQueue(void) const
}
}
@ -658,7 +664,7 @@ index 163fce3..fd3f212 100644
{
ClearEventQueue();
while (1) {
@@ -541,7 +553,7 @@ bool cDvbTuner::GetFrontendStatus(fe_status_t &Status) const
@@ -543,7 +555,7 @@ bool cDvbTuner::GetFrontendStatus(fe_status_t &Status) const
//#define DEBUG_SIGNALSTRENGTH
//#define DEBUG_SIGNALQUALITY
@ -667,7 +673,7 @@ index 163fce3..fd3f212 100644
{
ClearEventQueue();
uint16_t Signal;
@@ -568,7 +580,7 @@ int cDvbTuner::GetSignalStrength(void) const
@@ -570,7 +582,7 @@ int cDvbTuner::GetSignalStrength(void) const
#define LOCK_THRESHOLD 5 // indicates that all 5 FE_HAS_* flags are set
@ -676,7 +682,7 @@ index 163fce3..fd3f212 100644
{
fe_status_t Status;
if (GetFrontendStatus(Status)) {
@@ -708,6 +720,8 @@ static int GetRequiredDeliverySystem(const cChannel *Channel, const cDvbTranspon
@@ -710,6 +722,8 @@ static int GetRequiredDeliverySystem(const cChannel *Channel, const cDvbTranspon
bool cDvbTuner::SetFrontend(void)
{
@ -685,7 +691,7 @@ index 163fce3..fd3f212 100644
#define MAXFRONTENDCMDS 16
#define SETCMD(c, d) { Frontend[CmdSeq.num].cmd = (c);\
Frontend[CmdSeq.num].u.data = (d);\
@@ -853,9 +867,11 @@ void cDvbTuner::Action(void)
@@ -855,9 +869,11 @@ void cDvbTuner::Action(void)
bool LostLock = false;
fe_status_t Status = (fe_status_t)0;
while (Running()) {
@ -698,9 +704,9 @@ index 163fce3..fd3f212 100644
+ Status = NewStatus;
+ }
cMutexLock MutexLock(&mutex);
int WaitTime = 1000;
switch (tunerStatus) {
case tsIdle:
@@ -911,6 +927,40 @@ void cDvbTuner::Action(void)
@@ -913,6 +929,40 @@ void cDvbTuner::Action(void)
}
}
@ -741,7 +747,7 @@ index 163fce3..fd3f212 100644
// --- cDvbSourceParam -------------------------------------------------------
class cDvbSourceParam : public cSourceParam {
@@ -996,7 +1046,8 @@ const char *DeliverySystemNames[] = {
@@ -998,7 +1048,8 @@ const char *DeliverySystemNames[] = {
NULL
};
@ -751,7 +757,7 @@ index 163fce3..fd3f212 100644
{
adapter = Adapter;
frontend = Frontend;
@@ -1015,7 +1066,7 @@ cDvbDevice::cDvbDevice(int Adapter, int Frontend)
@@ -1018,7 +1069,7 @@ cDvbDevice::cDvbDevice(int Adapter, int Frontend)
fd_ca = DvbOpen(DEV_DVB_CA, adapter, frontend, O_RDWR);
if (fd_ca >= 0)
@ -760,7 +766,7 @@ index 163fce3..fd3f212 100644
// The DVR device (will be opened and closed as needed):
@@ -1123,7 +1176,11 @@ bool cDvbDevice::BondDevices(const char *Bondings)
@@ -1230,7 +1281,11 @@ bool cDvbDevice::BondDevices(const char *Bondings)
if (d >= 0) {
int ErrorDevice = 0;
if (cDevice *Device1 = cDevice::GetDevice(i)) {
@ -772,7 +778,7 @@ index 163fce3..fd3f212 100644
if (cDvbDevice *DvbDevice1 = dynamic_cast<cDvbDevice *>(Device1)) {
if (cDvbDevice *DvbDevice2 = dynamic_cast<cDvbDevice *>(Device2)) {
if (!DvbDevice1->Bond(DvbDevice2))
@@ -1242,7 +1297,10 @@ bool cDvbDevice::BondDevices(const char *Bondings)
@@ -1264,7 +1319,10 @@ bool cDvbDevice::BondDevices(const char *Bondings)
void cDvbDevice::UnBondDevices(void)
{
for (int i = 0; i < cDevice::NumDevices(); i++) {
@ -784,7 +790,7 @@ index 163fce3..fd3f212 100644
d->UnBond();
}
}
@@ -1211,6 +1271,26 @@ bool cDvbDevice::BondingOk(const cChannel *Channel, bool ConsiderOccupied) const
@@ -1318,6 +1376,26 @@ bool cDvbDevice::BondingOk(const cChannel *Channel, bool ConsiderOccupied) const
return true;
}
@ -811,7 +817,7 @@ index 163fce3..fd3f212 100644
bool cDvbDevice::HasCi(void)
{
return ciAdapter;
@@ -1370,7 +1450,7 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne
@@ -1484,7 +1562,7 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne
bool cDvbDevice::ProvidesEIT(void) const
{
@ -821,10 +827,10 @@ index 163fce3..fd3f212 100644
int cDvbDevice::NumProvidedSystems(void) const
diff --git a/dvbdevice.h b/dvbdevice.h
index 2072ab2..d9f6e8d 100644
index 85b0d9c..2dcb319 100644
--- a/dvbdevice.h
+++ b/dvbdevice.h
@@ -102,7 +102,7 @@ class cDvbTuner;
@@ -107,7 +107,7 @@ class cDvbTuner;
/// The cDvbDevice implements a DVB device which can be accessed through the Linux DVB driver API.
class cDvbDevice : public cDevice {
@ -833,7 +839,7 @@ index 2072ab2..d9f6e8d 100644
static cString DvbName(const char *Name, int Adapter, int Frontend);
static int DvbOpen(const char *Name, int Adapter, int Frontend, int Mode, bool ReportError = false);
private:
@@ -132,11 +132,13 @@ private:
@@ -133,11 +133,13 @@ private:
mutable bool needsDetachBondedReceivers;
bool QueryDeliverySystems(int fd_frontend);
public: