git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix build with normal dvb api v1 headers
[enigma2.git]
/
lib
/
dvb
/
demux.cpp
diff --git
a/lib/dvb/demux.cpp
b/lib/dvb/demux.cpp
index e1d8bbaf7b4d6aae9389dcbcb1a110d0fd8ed82d..f24fcddc798c9286967c57b631a88dc9371616c9 100644
(file)
--- a/
lib/dvb/demux.cpp
+++ b/
lib/dvb/demux.cpp
@@
-1,10
+1,19
@@
+#include <config.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <unistd.h>
+#if HAVE_DVB_API_VERSION < 3
+#include <ost/dmx.h>
+#ifndef DMX_SET_NEGFILTER_MASK
+ #define DMX_SET_NEGFILTER_MASK _IOW('o',48,uint8_t *)
+#endif
+#else
#include <linux/dvb/dmx.h>
#include <linux/dvb/dmx.h>
+#endif
+
#include "crc32.h"
#include <lib/base/eerror.h>
#include "crc32.h"
#include <lib/base/eerror.h>
@@
-13,7
+22,7
@@
#include <lib/dvb/esection.h>
#include <lib/dvb/decoder.h>
#include <lib/dvb/esection.h>
#include <lib/dvb/decoder.h>
-eDVBDemux::eDVBDemux(int adapter, int demux): adapter(adapter), demux(demux)
, ref(0)
+eDVBDemux::eDVBDemux(int adapter, int demux): adapter(adapter), demux(demux)
{
}
{
}
@@
-58,12
+67,18
@@
void eDVBSectionReader::data(int)
read(data);
}
read(data);
}
-eDVBSectionReader::eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res):
ref(0),
demux(demux)
+eDVBSectionReader::eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res): demux(demux)
{
char filename[128];
{
char filename[128];
+#if HAVE_DVB_API_VERSION < 3
+ sprintf(filename, "/dev/dvb/card%d/demux%d", demux->adapter, demux->demux);
+#else
sprintf(filename, "/dev/dvb/adapter%d/demux%d", demux->adapter, demux->demux);
sprintf(filename, "/dev/dvb/adapter%d/demux%d", demux->adapter, demux->demux);
+#endif
fd = ::open(filename, O_RDWR);
fd = ::open(filename, O_RDWR);
+ eDebug("eDVBSectionReader has fd %d", fd);
+
if (fd >= 0)
{
notifier=new eSocketNotifier(context, fd, eSocketNotifier::Read);
if (fd >= 0)
{
notifier=new eSocketNotifier(context, fd, eSocketNotifier::Read);
@@
-92,11
+107,18
@@
RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask)
if (fd < 0)
return -ENODEV;
if (fd < 0)
return -ENODEV;
+#if HAVE_DVB_API_VERSION < 3
+ dmxSctFilterParams sct;
+#else
dmx_sct_filter_params sct;
dmx_sct_filter_params sct;
-
+#endif
sct.pid = mask.pid;
sct.timeout = 0;
sct.pid = mask.pid;
sct.timeout = 0;
+#if HAVE_DVB_API_VERSION < 3
+ sct.flags = 0;
+#else
sct.flags = DMX_IMMEDIATE_START;
sct.flags = DMX_IMMEDIATE_START;
+#endif
if (mask.flags & eDVBSectionFilterMask::rfCRC)
{
sct.flags |= DMX_CHECK_CRC;
if (mask.flags & eDVBSectionFilterMask::rfCRC)
{
sct.flags |= DMX_CHECK_CRC;
@@
-106,11
+128,25
@@
RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask)
memcpy(sct.filter.filter, mask.data, DMX_FILTER_SIZE);
memcpy(sct.filter.mask, mask.mask, DMX_FILTER_SIZE);
memcpy(sct.filter.filter, mask.data, DMX_FILTER_SIZE);
memcpy(sct.filter.mask, mask.mask, DMX_FILTER_SIZE);
+#if HAVE_DVB_API_VERSION >= 3
memcpy(sct.filter.mode, mask.mode, DMX_FILTER_SIZE);
memcpy(sct.filter.mode, mask.mode, DMX_FILTER_SIZE);
+#endif
res = ::ioctl(fd, DMX_SET_FILTER, &sct);
if (!res)
res = ::ioctl(fd, DMX_SET_FILTER, &sct);
if (!res)
+ {
+#if HAVE_DVB_API_VERSION < 3
+ res = ::ioctl(fd, DMX_SET_NEGFILTER_MASK, mask.mode);
+ if (!res)
+ {
+ res = ::ioctl(fd, DMX_START, 0);
+ if (!res)
+ active = 1;
+ }
+#else
active = 1;
active = 1;
+#endif
+ }
return res;
}
return res;
}
@@
-126,6
+162,6
@@
RESULT eDVBSectionReader::stop()
RESULT eDVBSectionReader::connectRead(const Slot1<void,const __u8*> &r, ePtr<eConnection> &conn)
{
RESULT eDVBSectionReader::connectRead(const Slot1<void,const __u8*> &r, ePtr<eConnection> &conn)
{
- conn = new eConnection(read.connect(r));
+ conn = new eConnection(
this,
read.connect(r));
return 0;
}
return 0;
}