diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-02-13 00:09:19 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-02-13 00:09:19 +0000 |
| commit | e677ac4a7bf81391877c909a703e5918ce4a511b (patch) | |
| tree | 4944b7cf6c8b6f1715d642fc0dd2f2b3e2b849d5 /lib/dvb | |
| parent | d7d291938c45893e28715fb12ae5b83d334084e9 (diff) | |
| download | enigma2-e677ac4a7bf81391877c909a703e5918ce4a511b.tar.gz enigma2-e677ac4a7bf81391877c909a703e5918ce4a511b.zip | |
- started work on EIT
- added "pcore", the navigation core for python
Diffstat (limited to 'lib/dvb')
| -rw-r--r-- | lib/dvb/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/dvb/eit.cpp | 50 | ||||
| -rw-r--r-- | lib/dvb/eit.h | 28 | ||||
| -rw-r--r-- | lib/dvb/pmt.cpp | 2 | ||||
| -rw-r--r-- | lib/dvb/pmt.h | 4 | ||||
| -rw-r--r-- | lib/dvb/specs.h | 22 |
6 files changed, 105 insertions, 3 deletions
diff --git a/lib/dvb/Makefile.am b/lib/dvb/Makefile.am index a3b81bc7..41ce1748 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 + sec.cpp scan.cpp crc32.cpp pmt.cpp decoder.cpp eit.cpp
\ No newline at end of file diff --git a/lib/dvb/eit.cpp b/lib/dvb/eit.cpp new file mode 100644 index 00000000..2462d333 --- /dev/null +++ b/lib/dvb/eit.cpp @@ -0,0 +1,50 @@ +#include <lib/dvb/eit.h> +#include <lib/dvb/specs.h> +#include <lib/base/eerror.h> +#include <lib/service/event.h> + +void eDVBServiceEITHandler::EITready(int error) +{ + if (!error) + { + ePtr<eTable<EventInformationTable> > ptr; + if (!m_EIT.getCurrent(ptr)) + { + int a = 0; + for (EventInformationTableConstIterator i = ptr->getSections().begin(); + i != ptr->getSections().end(); ++i) + { + for (EventConstIterator ev = (*i)->getEvents()->begin(); ev != (*i)->getEvents()->end(); ++ev) + { + ePtr<eServiceEvent> evt = new eServiceEvent(); + evt->parseFrom(*ev); + if (!a) + m_event_now = evt; + else + m_event_next = evt; + ++a; + } + } + } + } + + m_eit_changed(); +} + +eDVBServiceEITHandler::eDVBServiceEITHandler() +{ + CONNECT(m_EIT.tableReady, eDVBServiceEITHandler::EITready); +} + +void eDVBServiceEITHandler::start(iDVBDemux *demux, int sid) +{ + m_EIT.begin(eApp, eDVBEITSpec(sid), demux); +} + +RESULT eDVBServiceEITHandler::getEvent(ePtr<eServiceEvent> &event, int nownext) +{ + event = nownext ? m_event_next : m_event_now; + if (!event) + return -1; + return 0; +} diff --git a/lib/dvb/eit.h b/lib/dvb/eit.h new file mode 100644 index 00000000..7ec16bc8 --- /dev/null +++ b/lib/dvb/eit.h @@ -0,0 +1,28 @@ +#ifndef __lib_dvb_eit_h +#define __lib_dvb_eit_h + +#include <lib/dvb/isection.h> +#include <lib/dvb/esection.h> +#include <lib/dvb_si/eit.h> +#include <lib/service/event.h> + +class eDVBServiceEITHandler: public Object +{ + ePtr<iDVBDemux> m_demux; + eAUTable<eTable<EventInformationTable> > m_EIT; + void EITready(int error); + + RESULT parseEvent(ePtr<eServiceEvent> &serviceevent, const Event &dvbevent); + + ePtr<eServiceEvent> m_event_now, m_event_next; +public: + eDVBServiceEITHandler(); + + void start(iDVBDemux *demux, int sid); + + RESULT getEvent(ePtr<eServiceEvent> &event, int nownext); + + PSignal0<void> m_eit_changed; +}; + +#endif diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index 292012e1..8c4388a4 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -24,6 +24,8 @@ void eDVBServicePMTHandler::channelStateChanged(iDVBChannel *channel) if (m_channel->getDemux(m_demux)) eDebug("shit it failed.. again."); + serviceEvent(eventTuned); + if (m_demux) { eDebug("ok ... now we start!!"); diff --git a/lib/dvb/pmt.h b/lib/dvb/pmt.h index ee2040af..b3a0a538 100644 --- a/lib/dvb/pmt.h +++ b/lib/dvb/pmt.h @@ -26,7 +26,6 @@ class eDVBServicePMTHandler: public Object void PMTready(int error); void PATready(int error); - public: eDVBServicePMTHandler(); @@ -36,7 +35,8 @@ public: eventNoPAT, // no pat could be received (timeout) eventNoPATEntry, // no pat entry for the corresponding SID could be found eventNoPMT, // no pmt could be received (timeout) - eventNewProgramInfo // we just received a PMT + eventNewProgramInfo, // we just received a PMT + eventTuned // a channel was sucessfully (re-)tuned in, you may start additional filters now }; Signal1<void,int> serviceEvent; diff --git a/lib/dvb/specs.h b/lib/dvb/specs.h index 3c6908c2..54457342 100644 --- a/lib/dvb/specs.h +++ b/lib/dvb/specs.h @@ -8,6 +8,7 @@ #include <lib/dvb_si/nit.h> #include <lib/dvb_si/bat.h> #include <lib/dvb_si/pat.h> +#include <lib/dvb_si/eit.h> struct eDVBPMTSpec { @@ -105,4 +106,25 @@ public: } }; +class eDVBEITSpec +{ + eDVBTableSpec m_spec; +public: + /* this is for now&next on actual transponder. */ + eDVBEITSpec(int sid) + { + m_spec.pid = EventInformationTable::PID; + m_spec.tid = EventInformationTable::TID; + m_spec.tidext = sid; + m_spec.timeout = EventInformationTable::TIMEOUT; + m_spec.flags = eDVBTableSpec::tfAnyVersion | + eDVBTableSpec::tfHaveTID | eDVBTableSpec::tfHaveTIDExt | + eDVBTableSpec::tfCheckCRC | eDVBTableSpec::tfHaveTimeout; + } + operator eDVBTableSpec &() + { + return m_spec; + } +}; + #endif |
