#include <lib/dvb/dvb.h>
#include <lib/dvb/idemux.h>
#include <lib/dvb/esection.h>
-#include <lib/dvb_si/pmt.h>
-#include <lib/dvb_si/pat.h>
+#include <dvbsi++/program_map_section.h>
+#include <dvbsi++/program_association_section.h>
+
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+class eDVBServicePMTHandler;
+
+class eDVBCAService: public Object
+{
+ eDVBServicePMTHandler &m_parent;
+ int m_sock, m_clilen;
+ struct sockaddr_un m_servaddr;
+ unsigned int m_sendstate;
+ unsigned char *m_capmt;
+ eTimer m_retryTimer;
+ void sendCAPMT();
+ void Connect();
+public:
+ eDVBCAService( eDVBServicePMTHandler &parent )
+ :m_parent(parent), m_sendstate(0), m_capmt(NULL), m_retryTimer(eApp)
+ {
+ CONNECT(m_retryTimer.timeout, eDVBCAService::sendCAPMT);
+ Connect();
+// eDebug("[eDVBCAHandler] new service %s", service.toString().c_str() );
+ }
+ ~eDVBCAService()
+ {
+ delete [] m_capmt;
+ ::close(m_sock);
+// eDebug("[eDVBCAHandler] leave service %s", me.toString().c_str() );
+ }
+ void buildCAPMT();
+};
class eDVBServicePMTHandler: public Object
{
+ friend class eDVBCAService;
eServiceReferenceDVB m_reference;
-// ePtr<eDVBService> m_service;
+ ePtr<eDVBService> m_service;
int m_last_channel_state;
-
- eAUTable<eTable<ProgramMapTable> > m_PMT;
- eAUTable<eTable<ProgramAssociationTable> > m_PAT;
+ uint16_t m_pmt_pid;
+ eDVBCAService *m_ca_servicePtr;
+
+ eAUTable<eTable<ProgramMapSection> > m_PMT;
+ eAUTable<eTable<ProgramAssociationSection> > m_PAT;
eUsePtr<iDVBChannel> m_channel;
+ eUsePtr<iDVBPVRChannel> m_pvr_channel;
ePtr<eDVBResourceManager> m_resourceManager;
ePtr<iDVBDemux> m_demux;
void PATready(int error);
public:
eDVBServicePMTHandler();
+ ~eDVBServicePMTHandler();
enum
{
int getProgramInfo(struct program &program);
int getDemux(ePtr<iDVBDemux> &demux);
+ int getPVRChannel(ePtr<iDVBPVRChannel> &pvr_channel);
int tune(eServiceReferenceDVB &ref);
};