aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2005-06-30 14:52:13 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2005-06-30 14:52:13 +0000
commita33ff213255db7f59090f70235ec06c502e2a2ce (patch)
treec8d42ff6b5002bd0f4575a20ce3c294b08c7139d /lib/dvb
parent62b8a649fcae500c983215fac2e5202916c0195f (diff)
downloadenigma2-a33ff213255db7f59090f70235ec06c502e2a2ce.tar.gz
enigma2-a33ff213255db7f59090f70235ec06c502e2a2ce.zip
add dvb time handling with transponder time correction algo.. this use a rtc, when avail, mainloop changes for set linux time
Diffstat (limited to 'lib/dvb')
-rw-r--r--lib/dvb/Makefile.am4
-rw-r--r--lib/dvb/dvb.cpp20
-rw-r--r--lib/dvb/dvb.h12
-rw-r--r--lib/dvb/esection.cpp5
-rw-r--r--lib/dvb/pmt.cpp5
5 files changed, 38 insertions, 8 deletions
diff --git a/lib/dvb/Makefile.am b/lib/dvb/Makefile.am
index 2a1402bb..857f5001 100644
--- a/lib/dvb/Makefile.am
+++ b/lib/dvb/Makefile.am
@@ -4,5 +4,5 @@ INCLUDES = \
noinst_LIBRARIES = libenigma_dvb.a
libenigma_dvb_a_SOURCES = dvb.cpp demux.cpp frontend.cpp esection.cpp db.cpp \
- sec.cpp scan.cpp crc32.cpp pmt.cpp decoder.cpp eit.cpp rotor_calc.cpp
-
+ sec.cpp scan.cpp crc32.cpp pmt.cpp decoder.cpp eit.cpp rotor_calc.cpp \
+ epgcache.cpp dvbtime.cpp
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index e0df1dc1..f1f5580a 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -321,6 +321,7 @@ RESULT eDVBResourceManager::addChannel(const eDVBChannelID &chid, eDVBChannel *c
{
eDebug("add channel %p", ch);
m_active_channels.push_back(active_channel(chid, ch));
+ /* emit */ m_channelAdded(ch);
return 0;
}
@@ -333,6 +334,7 @@ RESULT eDVBResourceManager::removeChannel(eDVBChannel *ch)
{
i = m_active_channels.erase(i);
++cnt;
+ /* emit */ m_channelRemoved(ch);
} else
++i;
}
@@ -342,6 +344,24 @@ RESULT eDVBResourceManager::removeChannel(eDVBChannel *ch)
return -ENOENT;
}
+RESULT eDVBResourceManager::connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection)
+{
+ connection = new eConnection((eDVBResourceManager*)this, m_channelAdded.connect(channelAdded));
+ return 0;
+}
+
+RESULT eDVBResourceManager::connectChannelRemoved(const Slot1<void,eDVBChannel*> &channelRemoved, ePtr<eConnection> &connection)
+{
+ connection = new eConnection((eDVBResourceManager*)this, m_channelRemoved.connect(channelRemoved));
+ return 0;
+}
+
+RESULT eDVBResourceManager::connectChannelRunning(const Slot1<void,iDVBChannel*> &channelRunning, ePtr<eConnection> &connection)
+{
+ connection = new eConnection((eDVBResourceManager*)this, m_channelRunning.connect(channelRunning));
+ return 0;
+}
+
DEFINE_REF(eDVBChannel);
eDVBChannel::eDVBChannel(eDVBResourceManager *mgr, eDVBAllocatedFrontend *frontend, eDVBAllocatedDemux *demux): m_state(state_idle), m_mgr(mgr)
diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h
index a4652e81..34c55492 100644
--- a/lib/dvb/dvb.h
+++ b/lib/dvb/dvb.h
@@ -132,10 +132,14 @@ class eDVBResourceManager: public iObject
ePtr<iDVBChannelList> m_list;
ePtr<iDVBSatelliteEquipmentControl> m_sec;
static eDVBResourceManager *instance;
-
+
friend class eDVBChannel;
RESULT addChannel(const eDVBChannelID &chid, eDVBChannel *ch);
RESULT removeChannel(eDVBChannel *ch);
+
+ Signal1<void,eDVBChannel*> m_channelAdded;
+ Signal1<void,eDVBChannel*> m_channelRemoved;
+ Signal1<void,iDVBChannel*> m_channelRunning;
public:
eDVBResourceManager();
virtual ~eDVBResourceManager();
@@ -156,6 +160,9 @@ public:
RESULT allocateRawChannel(ePtr<iDVBChannel> &channel);
RESULT allocatePVRChannel(int caps);
+ RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
+ RESULT connectChannelRemoved(const Slot1<void,eDVBChannel*> &channelRemoved, ePtr<eConnection> &connection);
+ RESULT connectChannelRunning(const Slot1<void,iDVBChannel*> &channelRemoved, ePtr<eConnection> &connection);
};
class eDVBChannel: public iDVBChannel, public Object
@@ -181,7 +188,8 @@ public:
/* only for managed channels - effectively tunes to the channelid. should not be used... */
RESULT setChannel(const eDVBChannelID &id);
-
+ eDVBChannelID getChannelID() { return m_channel_id; }
+
RESULT connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection);
RESULT getState(int &state);
diff --git a/lib/dvb/esection.cpp b/lib/dvb/esection.cpp
index 6f634ae1..a80168b5 100644
--- a/lib/dvb/esection.cpp
+++ b/lib/dvb/esection.cpp
@@ -22,8 +22,7 @@ void eGTable::sectionRead(const __u8 *d)
void eGTable::timeout()
{
- printf("timeout!\n");
-// eDebug("timeout!");
+ eDebug("timeout!");
m_reader->stop();
ready = 1;
error = -1;
@@ -58,7 +57,7 @@ RESULT eGTable::start(iDVBSectionReader *reader, const eDVBTableSpec &table)
if (m_table.flags & eDVBTableSpec::tfHaveTID)
{
mask.data[0] = m_table.tid;
- mask.mask[0] = 0xFF;
+ mask.mask[0] = mask.pid == 0x14 ? 0xFC : 0xFF;
}
if (m_table.flags & eDVBTableSpec::tfHaveTIDExt)
diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp
index 3f9ac7f7..c1ac5dd8 100644
--- a/lib/dvb/pmt.cpp
+++ b/lib/dvb/pmt.cpp
@@ -27,8 +27,11 @@ void eDVBServicePMTHandler::channelStateChanged(iDVBChannel *channel)
serviceEvent(eventTuned);
if (m_demux)
- {
+ {
eDebug("ok ... now we start!!");
+
+ /* emit */ m_resourceManager->m_channelRunning(channel);
+
m_PAT.begin(eApp, eDVBPATSpec(), m_demux);
}
}