git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22dd42b
)
scan: add allocateFrontendByIndex, so ServiceScan uses a fixed frontend ID - currentl...
author
Felix Domke
<tmbinc@elitedvb.net>
Fri, 18 Nov 2005 03:35:17 +0000
(
03:35
+0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Fri, 18 Nov 2005 03:35:17 +0000
(
03:35
+0000)
lib/components/scan.cpp
patch
|
blob
|
history
lib/components/scan.h
patch
|
blob
|
history
lib/dvb/dvb.cpp
patch
|
blob
|
history
lib/dvb/dvb.h
patch
|
blob
|
history
lib/python/Components/ServiceScan.py
patch
|
blob
|
history
lib/python/Screens/ScanSetup.py
patch
|
blob
|
history
lib/python/Screens/ServiceScan.py
patch
|
blob
|
history
diff --git
a/lib/components/scan.cpp
b/lib/components/scan.cpp
index 2f3c4d62a3593021a987550947603b65cd684c66..bfbb02da667fc98a252d4694b977285ea77c05f6 100644
(file)
--- a/
lib/components/scan.cpp
+++ b/
lib/components/scan.cpp
@@
-78,7
+78,7
@@
void eComponentScan::addInitial(const eDVBFrontendParametersTerrestrial &p)
}
}
-int eComponentScan::start(int flags)
+int eComponentScan::start(int f
eid, int f
lags)
{
if (m_initial.empty())
return -2;
{
if (m_initial.empty())
return -2;
@@
-93,9
+93,9
@@
int eComponentScan::start(int flags)
eUsePtr<iDVBChannel> channel;
eUsePtr<iDVBChannel> channel;
- if (mgr->allocateRawChannel(channel))
+ if (mgr->allocateRawChannel(channel
, feid
))
{
{
- eDebug("scan: allocating raw channel
failed!"
);
+ eDebug("scan: allocating raw channel
(on frontend %d) failed!", feid
);
return -1;
}
return -1;
}
diff --git
a/lib/components/scan.h
b/lib/components/scan.h
index 04218b982067398b97ead1d9fb97e431cb5cdd45..eb18f10430de34fcddf2840e0540f2ca1da77003 100644
(file)
--- a/
lib/components/scan.h
+++ b/
lib/components/scan.h
@@
-42,7
+42,7
@@
public:
/* please keep the flags in sync with lib/dvb/scan.h ! */
enum { scanNetworkSearch=1 };
/* please keep the flags in sync with lib/dvb/scan.h ! */
enum { scanNetworkSearch=1 };
- int start(int flags=0);
+ int start(int f
eid, int f
lags=0);
};
#endif
};
#endif
diff --git
a/lib/dvb/dvb.cpp
b/lib/dvb/dvb.cpp
index 04c2b40eaf2f7edf49e49dcfb11d4c2718453a36..5315c0e5fb215e2ff502544a72f358d9f8ebd639 100644
(file)
--- 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;
{
ePtr<eDVBRegisteredFrontend> best;
int bestval = 0;
@@
-233,6
+233,19
@@
RESULT eDVBResourceManager::allocateFrontend(ePtr<iDVBFrontendParameters> &fepar
return -1;
}
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)
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;
ePtr<eDVBAllocatedFrontend> fe;
- if (allocateFrontend(fe
parm, fe
))
+ if (allocateFrontend(fe
, feparm
))
return errNoFrontend;
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);
RESULT res;
ePtr<eDVBChannel> ch;
ch = new eDVBChannel(this, fe);
@@
-341,20
+348,13
@@
RESULT eDVBResourceManager::allocateChannel(const eDVBChannelID &channelid, eUse
return 0;
}
return 0;
}
-RESULT eDVBResourceManager::allocateRawChannel(eUsePtr<iDVBChannel> &channel)
+RESULT eDVBResourceManager::allocateRawChannel(eUsePtr<iDVBChannel> &channel
, int frontend_index
)
{
ePtr<eDVBAllocatedFrontend> fe;
{
ePtr<eDVBAllocatedFrontend> fe;
-#warning FIXME allocateRawChannel
-
-// if (allocateFrontend(eDVBChannelID(), fe))
+ if (allocateFrontendByIndex(fe, frontend_index))
return errNoFrontend;
return errNoFrontend;
-// ePtr<eDVBAllocatedDemux> demux;
- //
-// if (allocateDemux(*fe, demux))
-// return errNoDemux;
-
eDVBChannel *ch;
ch = new eDVBChannel(this, fe);
eDVBChannel *ch;
ch = new eDVBChannel(this, fe);
@@
-367,9
+367,6
@@
RESULT eDVBResourceManager::allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel)
{
ePtr<eDVBAllocatedDemux> demux;
{
ePtr<eDVBAllocatedDemux> demux;
-// if (allocateDemux(0, demux))
-// return errNoDemux;
-
eDVBChannel *ch;
ch = new eDVBChannel(this, 0);
eDVBChannel *ch;
ch = new eDVBChannel(this, 0);
diff --git
a/lib/dvb/dvb.h
b/lib/dvb/dvb.h
index 924d4e6e6af52ee4a249fbcd031fbfc39322cd66..fcfbdfe7a3d71e18cee7808cdead1527db6777bd 100644
(file)
--- a/
lib/dvb/dvb.h
+++ b/
lib/dvb/dvb.h
@@
-106,15
+106,16
@@
class eDVBResourceManager: public iObject
void addAdapter(iDVBAdapter *adapter);
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
the frontend must be tuned lateron. there is no guarante
- that tuning will suceed - it just means that if this frontend
+ that tuning will suc
c
eed - 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. */
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);
/* 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);
/* 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);
RESULT allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel);
RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
diff --git
a/lib/python/Components/ServiceScan.py
b/lib/python/Components/ServiceScan.py
index 915a26a006f008f4f46ea69df5d55256bf056089..768369617e8b24d1b0e56fbced7e66b622357dff 100644
(file)
--- a/
lib/python/Components/ServiceScan.py
+++ b/
lib/python/Components/ServiceScan.py
@@
-34,11
+34,12
@@
class ServiceScan:
if self.state == self.Error:
self.text.setText("ERROR - failed to scan (%s)!" % (self.Errors[self.errorcode]) )
if self.state == self.Error:
self.text.setText("ERROR - failed to scan (%s)!" % (self.Errors[self.errorcode]) )
- def __init__(self, progressbar, text, transponders, flags):
+ def __init__(self, progressbar, text, transponders, f
eid, f
lags):
self.progressbar = progressbar
self.text = text
self.scan = eComponentScan()
self.state = self.Idle
self.progressbar = progressbar
self.text = text
self.scan = eComponentScan()
self.state = self.Idle
+ self.feid = feid
self.flags = flags
self.scanStatusChanged()
self.flags = flags
self.scanStatusChanged()
@@
-74,7
+75,7
@@
class ServiceScan:
def execBegin(self):
self.scan.statusChanged.get().append(self.scanStatusChanged)
self.state = self.Running
def execBegin(self):
self.scan.statusChanged.get().append(self.scanStatusChanged)
self.state = self.Running
- err = self.scan.start(self.flags)
+ err = self.scan.start(self.f
eid, self.f
lags)
if err:
self.state = self.Error
self.errorcode = 0
if err:
self.state = self.Error
self.errorcode = 0
diff --git
a/lib/python/Screens/ScanSetup.py
b/lib/python/Screens/ScanSetup.py
index 6b05cd47c4dda1dec5cd2a85ca6d879993cd39ae..2b25cce73eb2c8f66a4303f7322452ad11e6738f 100644
(file)
--- a/
lib/python/Screens/ScanSetup.py
+++ b/
lib/python/Screens/ScanSetup.py
@@
-269,7
+269,7
@@
class ScanSetup(Screen):
if (config.scan.type.value == 1): # single sat scan
getInitialTransponderList(tlist, int(self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1]))
if (config.scan.type.value == 1): # single sat scan
getInitialTransponderList(tlist, int(self.satList[config.scan.nims.value][config.scan.satselection[config.scan.nims.value].value][1]))
- flags |= eComponentScan.scanNetworkSearch
+
flags |= eComponentScan.scanNetworkSearch
if (config.scan.type.value == 2): # multi sat scan
SatList = nimmanager.getSatListForNim(config.scan.nims.value)
if (config.scan.type.value == 2): # multi sat scan
SatList = nimmanager.getSatListForNim(config.scan.nims.value)
@@
-278,14
+278,14
@@
class ScanSetup(Screen):
if x[1].parent.value == 0:
print " " + str(x[1].parent.configPath)
getInitialTransponderList(tlist, x[1].parent.configPath)
if x[1].parent.value == 0:
print " " + str(x[1].parent.configPath)
getInitialTransponderList(tlist, x[1].parent.configPath)
- flags |= eComponentScan.scanNetworkSearch
+
flags |= eComponentScan.scanNetworkSearch
for x in self["config"].list:
x[1].save()
for x in self["config"].list:
x[1].save()
-
+ feid = 0 # insert correct frontend id here (should be user-selectable)
# flags |= eComponentScan.scanSearchBAT
# flags |= eComponentScan.scanSearchBAT
- self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, flags)
+ self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, f
eid, f
lags)
#self.close()
#self.close()
@@
-304,7
+304,8
@@
class ScanSimple(Screen):
print " " + str(x[1].parent.configPath)
getInitialTransponderList(tlist, x[1].parent.configPath)
print " " + str(x[1].parent.configPath)
getInitialTransponderList(tlist, x[1].parent.configPath)
- self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, eComponentScan.scanNetworkSearch)
+ feid = 0 # FIXME
+ self.session.openWithCallback(self.keyCancel, ServiceScan, tlist, feid, eComponentScan.scanNetworkSearch)
def keyCancel(self):
self.close()
def keyCancel(self):
self.close()
diff --git
a/lib/python/Screens/ServiceScan.py
b/lib/python/Screens/ServiceScan.py
index 17b7da75e5de9c9db0565e621e3abe4c0222f9d4..88730ee9dcb2bf70623ff7882ba25afe47df7848 100644
(file)
--- a/
lib/python/Screens/ServiceScan.py
+++ b/
lib/python/Screens/ServiceScan.py
@@
-13,14
+13,14
@@
class ServiceScan(Screen):
def cancel(self):
self.close()
def cancel(self):
self.close()
- def __init__(self, session, transponders, flags):
+ def __init__(self, session, transponders, f
eid, f
lags):
Screen.__init__(self, session)
self.session.nav.stopService()
self["scan_progress"] = ProgressBar()
self["scan_state"] = Label("scan state")
Screen.__init__(self, session)
self.session.nav.stopService()
self["scan_progress"] = ProgressBar()
self["scan_state"] = Label("scan state")
- self["scan"] = CScan(self["scan_progress"], self["scan_state"], transponders, flags)
+ self["scan"] = CScan(self["scan_progress"], self["scan_state"], transponders, f
eid, f
lags)
self["actions"] = ActionMap(["OkCancelActions"],
{
self["actions"] = ActionMap(["OkCancelActions"],
{