aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-11-18 03:35:17 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-11-18 03:35:17 +0000
commit5cdabb1038ec3f628001f26f5d587eb95ca6465d (patch)
treec8b20083f641110d08ebff7bdc4c2ebd096a76d3 /lib/dvb
parent22dd42bd9ac717c439bd339f0c85adbf3defe2b6 (diff)
downloadenigma2-5cdabb1038ec3f628001f26f5d587eb95ca6465d.tar.gz
enigma2-5cdabb1038ec3f628001f26f5d587eb95ca6465d.zip
scan: add allocateFrontendByIndex, so ServiceScan uses a fixed frontend ID - currently hardcoded 0 in python.
Diffstat (limited to 'lib/dvb')
-rw-r--r--lib/dvb/dvb.cpp37
-rw-r--r--lib/dvb/dvb.h9
2 files changed, 22 insertions, 24 deletions
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index 04c2b40e..5315c0e5 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -206,7 +206,7 @@ void eDVBResourceManager::addAdapter(iDVBAdapter *adapter)
}
}
-RESULT eDVBResourceManager::allocateFrontend(ePtr<iDVBFrontendParameters> &feparm, ePtr<eDVBAllocatedFrontend> &fe)
+RESULT eDVBResourceManager::allocateFrontend(ePtr<eDVBAllocatedFrontend> &fe, ePtr<iDVBFrontendParameters> &feparm)
{
ePtr<eDVBRegisteredFrontend> best;
int bestval = 0;
@@ -233,6 +233,19 @@ RESULT eDVBResourceManager::allocateFrontend(ePtr<iDVBFrontendParameters> &fepar
return -1;
}
+RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int nr)
+{
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i, --nr)
+ if ((!nr) && !i->m_inuse)
+ {
+ fe = new eDVBAllocatedFrontend(i);
+ return 0;
+ }
+
+ fe = 0;
+ return -1;
+}
+
RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int cap)
{
/* find first unused demux which is on same adapter as frontend (or any, if PVR)
@@ -317,15 +330,9 @@ RESULT eDVBResourceManager::allocateChannel(const eDVBChannelID &channelid, eUse
ePtr<eDVBAllocatedFrontend> fe;
- if (allocateFrontend(feparm, fe))
+ if (allocateFrontend(fe, feparm))
return errNoFrontend;
-// will be allocated on demand:
-// ePtr<eDVBAllocatedDemux> demux;
-//
-// if (allocateDemux(*fe, demux))
-// return errNoDemux;
-
RESULT res;
ePtr<eDVBChannel> ch;
ch = new eDVBChannel(this, fe);
@@ -341,20 +348,13 @@ RESULT eDVBResourceManager::allocateChannel(const eDVBChannelID &channelid, eUse
return 0;
}
-RESULT eDVBResourceManager::allocateRawChannel(eUsePtr<iDVBChannel> &channel)
+RESULT eDVBResourceManager::allocateRawChannel(eUsePtr<iDVBChannel> &channel, int frontend_index)
{
ePtr<eDVBAllocatedFrontend> fe;
-#warning FIXME allocateRawChannel
-
-// if (allocateFrontend(eDVBChannelID(), fe))
+ if (allocateFrontendByIndex(fe, frontend_index))
return errNoFrontend;
-// ePtr<eDVBAllocatedDemux> demux;
- //
-// if (allocateDemux(*fe, demux))
-// return errNoDemux;
-
eDVBChannel *ch;
ch = new eDVBChannel(this, fe);
@@ -367,9 +367,6 @@ RESULT eDVBResourceManager::allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel)
{
ePtr<eDVBAllocatedDemux> demux;
-// if (allocateDemux(0, demux))
-// return errNoDemux;
-
eDVBChannel *ch;
ch = new eDVBChannel(this, 0);
diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h
index 924d4e6e..fcfbdfe7 100644
--- a/lib/dvb/dvb.h
+++ b/lib/dvb/dvb.h
@@ -106,15 +106,16 @@ class eDVBResourceManager: public iObject
void addAdapter(iDVBAdapter *adapter);
- /* allocates a frontend able to tune to channelID "chid".
+ /* allocates a frontend able to tune to frontend paramters 'feperm'.
the frontend must be tuned lateron. there is no guarante
- that tuning will suceed - it just means that if this frontend
+ that tuning will succeed - it just means that if this frontend
can't tune, no other frontend could do it.
there might be a priority given to certain frontend/chid
combinations. this will be evaluated here. */
- RESULT allocateFrontend(ePtr<iDVBFrontendParameters> &feparm, ePtr<eDVBAllocatedFrontend> &fe);
+ RESULT allocateFrontend(ePtr<eDVBAllocatedFrontend> &fe, ePtr<iDVBFrontendParameters> &feparm);
+ RESULT allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int index);
/* allocate a demux able to filter on the selected frontend. */
RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int cap);
@@ -158,7 +159,7 @@ public:
/* allocate channel... */
RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr<iDVBChannel> &channel);
- RESULT allocateRawChannel(eUsePtr<iDVBChannel> &channel);
+ RESULT allocateRawChannel(eUsePtr<iDVBChannel> &channel, int frontend_index);
RESULT allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel);
RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);