projects
/
vuplus_dvbapp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fed93ee
)
pass more information about why a channel alloc fails, and display proper error messa...
author
Felix Domke
<tmbinc@elitedvb.net>
Thu, 24 Jan 2008 00:42:20 +0000
(
00:42
+0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Thu, 24 Jan 2008 00:42:20 +0000
(
00:42
+0000)
lib/dvb/dvb.cpp
patch
|
blob
|
history
lib/dvb/dvb.h
patch
|
blob
|
history
lib/dvb/pmt.cpp
patch
|
blob
|
history
lib/dvb/pmt.h
patch
|
blob
|
history
lib/python/Screens/InfoBarGenerics.py
patch
|
blob
|
history
lib/service/servicedvb.cpp
patch
|
blob
|
history
diff --git
a/lib/dvb/dvb.cpp
b/lib/dvb/dvb.cpp
index
b7d278c
..
0eb614d
100644
(file)
--- a/
lib/dvb/dvb.cpp
+++ b/
lib/dvb/dvb.cpp
@@
-280,31
+280,42
@@
RESULT eDVBResourceManager::allocateFrontend(ePtr<eDVBAllocatedFrontend> &fe, eP
{
ePtr<eDVBRegisteredFrontend> best;
int bestval = 0;
{
ePtr<eDVBRegisteredFrontend> best;
int bestval = 0;
+ int foundone = 0;
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
+ {
+ int c = i->m_frontend->isCompatibleWith(feparm);
+
+ if (c) /* if we have at least one frontend which is compatible with the source, flag this. */
+ foundone = 1;
+
if (!i->m_inuse)
{
if (!i->m_inuse)
{
- int c = i->m_frontend->isCompatibleWith(feparm);
if (c > bestval)
{
bestval = c;
best = i;
}
}
if (c > bestval)
{
bestval = c;
best = i;
}
}
+ }
if (best)
{
fe = new eDVBAllocatedFrontend(best);
return 0;
}
if (best)
{
fe = new eDVBAllocatedFrontend(best);
return 0;
}
-
+
fe = 0;
fe = 0;
-
- return -1;
+
+ if (foundone)
+ return errAllSourcesBusy;
+ else
+ return errNoSourceFound;
}
RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int slot_index)
{
}
RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int slot_index)
{
+ int err = errNoSourceFound;
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
if (!i->m_inuse && i->m_frontend->getSlotID() == slot_index)
{
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
if (!i->m_inuse && i->m_frontend->getSlotID() == slot_index)
{
@@
-316,6
+327,7
@@
RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend>
if (satpos_depends_to_fe->m_inuse)
{
eDebug("another satpos depending frontend is in use.. so allocateFrontendByIndex not possible!");
if (satpos_depends_to_fe->m_inuse)
{
eDebug("another satpos depending frontend is in use.. so allocateFrontendByIndex not possible!");
+ err = errAllSourcesBusy;
goto alloc_fe_by_id_not_possible;
}
}
goto alloc_fe_by_id_not_possible;
}
}
@@
-328,6
+340,7
@@
RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend>
if (next->m_inuse)
{
eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!");
if (next->m_inuse)
{
eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!");
+ err = errAllSourcesBusy;
goto alloc_fe_by_id_not_possible;
}
next = (eDVBRegisteredFrontend *)next->m_frontend->m_data[eDVBFrontend::LINKED_NEXT_PTR];
goto alloc_fe_by_id_not_possible;
}
next = (eDVBRegisteredFrontend *)next->m_frontend->m_data[eDVBFrontend::LINKED_NEXT_PTR];
@@
-339,6
+352,7
@@
RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend>
if (prev->m_inuse)
{
eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!");
if (prev->m_inuse)
{
eDebug("another linked frontend is in use.. so allocateFrontendByIndex not possible!");
+ err = errAllSourcesBusy;
goto alloc_fe_by_id_not_possible;
}
prev = (eDVBRegisteredFrontend *)prev->m_frontend->m_data[eDVBFrontend::LINKED_PREV_PTR];
goto alloc_fe_by_id_not_possible;
}
prev = (eDVBRegisteredFrontend *)prev->m_frontend->m_data[eDVBFrontend::LINKED_PREV_PTR];
@@
-349,7
+363,7
@@
RESULT eDVBResourceManager::allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend>
}
alloc_fe_by_id_not_possible:
fe = 0;
}
alloc_fe_by_id_not_possible:
fe = 0;
- return
-1
;
+ return
err
;
}
RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int cap)
}
RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int cap)
@@
-447,22
+461,23
@@
RESULT eDVBResourceManager::allocateChannel(const eDVBChannelID &channelid, eUse
if (!m_list)
{
eDebug("no channel list set!");
if (!m_list)
{
eDebug("no channel list set!");
- return
-ENOENT
;
+ return
errNoChannelList
;
}
ePtr<iDVBFrontendParameters> feparm;
if (m_list->getChannelFrontendData(channelid, feparm))
{
eDebug("channel not found!");
}
ePtr<iDVBFrontendParameters> feparm;
if (m_list->getChannelFrontendData(channelid, feparm))
{
eDebug("channel not found!");
- return
-ENOENT
;
+ return
errChannelNotInList
;
}
/* allocate a frontend. */
ePtr<eDVBAllocatedFrontend> fe;
}
/* allocate a frontend. */
ePtr<eDVBAllocatedFrontend> fe;
-
- if (allocateFrontend(fe, feparm))
- return errNoFrontend;
+
+ int err = allocateFrontend(fe, feparm);
+ if (err)
+ return err;
RESULT res;
ePtr<eDVBChannel> ch;
RESULT res;
ePtr<eDVBChannel> ch;
@@
-522,9
+537,10
@@
RESULT eDVBResourceManager::allocateRawChannel(eUsePtr<iDVBChannel> &channel, in
m_releaseCachedChannelTimer.stop();
}
m_releaseCachedChannelTimer.stop();
}
- if (allocateFrontendByIndex(fe, slot_index))
- return errNoFrontend;
-
+ int err = allocateFrontendByIndex(fe, slot_index);
+ if (err)
+ return err;
+
eDVBChannel *ch;
ch = new eDVBChannel(this, fe);
eDVBChannel *ch;
ch = new eDVBChannel(this, fe);
diff --git
a/lib/dvb/dvb.h
b/lib/dvb/dvb.h
index
e09f0fa
..
c71a4d1
100644
(file)
--- a/
lib/dvb/dvb.h
+++ b/
lib/dvb/dvb.h
@@
-196,9
+196,13
@@
public:
RESULT getChannelList(ePtr<iDVBChannelList> &list);
enum {
RESULT getChannelList(ePtr<iDVBChannelList> &list);
enum {
- errNoFrontend = -1,
+ /* errNoFrontend = -1 replaced by more spcific messages */
errNoDemux = -2,
errNoDemux = -2,
- errChidNotFound = -3
+ errChidNotFound = -3,
+ errNoChannelList = -4,
+ errChannelNotInList = -5,
+ errAllSourcesBusy = -6,
+ errNoSourceFound = -7,
};
RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
};
RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
diff --git
a/lib/dvb/pmt.cpp
b/lib/dvb/pmt.cpp
index
fc43338
..
f6f33b5
100644
(file)
--- a/
lib/dvb/pmt.cpp
+++ b/
lib/dvb/pmt.cpp
@@
-566,7
+566,10
@@
int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux,
}
} else
{
}
} else
{
- serviceEvent(eventNoResources);
+ if (res == eDVBResourceManager::errAllSourcesBusy)
+ serviceEvent(eventNoResources);
+ else /* errChidNotFound, errNoChannelList, errChannelNotInList, errNoSourceFound */
+ serviceEvent(eventMisconfiguration);
return res;
}
return res;
}
diff --git
a/lib/dvb/pmt.h
b/lib/dvb/pmt.h
index
eae05bb
..
f34d761
100644
(file)
--- a/
lib/dvb/pmt.h
+++ b/
lib/dvb/pmt.h
@@
-123,6
+123,8
@@
public:
eventSOF, // seek pre start
eventEOF, // a file playback did end
eventSOF, // seek pre start
eventEOF, // a file playback did end
+
+ eventMisconfiguration, // a channel was not found in any list, or no frontend was found which could provide this channel
};
#ifndef SWIG
Signal1<void,int> serviceEvent;
};
#ifndef SWIG
Signal1<void,int> serviceEvent;
diff --git
a/lib/python/Screens/InfoBarGenerics.py
b/lib/python/Screens/InfoBarGenerics.py
index
9191729
..
e222b4e
100644
(file)
--- a/
lib/python/Screens/InfoBarGenerics.py
+++ b/
lib/python/Screens/InfoBarGenerics.py
@@
-2087,7
+2087,8
@@
class InfoBarServiceErrorPopupSupport:
eDVBServicePMTHandler.eventNewProgramInfo: None,
eDVBServicePMTHandler.eventTuned: None,
eDVBServicePMTHandler.eventSOF: None,
eDVBServicePMTHandler.eventNewProgramInfo: None,
eDVBServicePMTHandler.eventTuned: None,
eDVBServicePMTHandler.eventSOF: None,
- eDVBServicePMTHandler.eventEOF: None
+ eDVBServicePMTHandler.eventEOF: None,
+ eDVBServicePMTHandler.eventMisconfiguration: _("Service unavailable!\nCheck tuner configuration!"),
}
error = errors.get(error) #this returns None when the key not exist in the dict
}
error = errors.get(error) #this returns None when the key not exist in the dict
diff --git
a/lib/service/servicedvb.cpp
b/lib/service/servicedvb.cpp
index
53bc17a
..
2d770fb
100644
(file)
--- a/
lib/service/servicedvb.cpp
+++ b/
lib/service/servicedvb.cpp
@@
-1103,6
+1103,7
@@
void eDVBServicePlay::serviceEvent(int event)
case eDVBServicePMTHandler::eventNoPATEntry:
case eDVBServicePMTHandler::eventNoPMT:
case eDVBServicePMTHandler::eventTuneFailed:
case eDVBServicePMTHandler::eventNoPATEntry:
case eDVBServicePMTHandler::eventNoPMT:
case eDVBServicePMTHandler::eventTuneFailed:
+ case eDVBServicePMTHandler::eventMisconfiguration:
{
eDebug("DVB service failed to tune - error %d", event);
m_event((iPlayableService*)this, evTuneFailed);
{
eDebug("DVB service failed to tune - error %d", event);
m_event((iPlayableService*)this, evTuneFailed);