::close(fd);
}
+RESULT eDVBSectionReader::setBufferSize(int size)
+{
+ int res=::ioctl(fd, DMX_SET_BUFFER_SIZE, size);
+ if (res < 0)
+ eDebug("eDVBSectionReader DMX_SET_BUFFER_SIZE failed(%m)");
+ return res;
+}
+
RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask)
{
RESULT res;
memcpy(sct.filter.mask, mask.mask, DMX_FILTER_SIZE);
#if HAVE_DVB_API_VERSION >= 3
memcpy(sct.filter.mode, mask.mode, DMX_FILTER_SIZE);
- if (::ioctl(fd, DMX_SET_BUFFER_SIZE, 8192*8) < 0)
- eDebug("DMX_SET_BUFFER_SIZE failed(%m)");
+ setBufferSize(8192*8);
#endif
res = ::ioctl(fd, DMX_SET_FILTER, &sct);
if (m_fd >= 0)
{
- ::ioctl(m_fd, DMX_SET_BUFFER_SIZE, 64*1024);
+ setBufferSize(64*1024);
::fcntl(m_fd, F_SETFL, O_NONBLOCK);
m_notifier = eSocketNotifier::create(context, m_fd, eSocketNotifier::Read, false);
CONNECT(m_notifier->activated, eDVBPESReader::data);
}
}
+RESULT eDVBPESReader::setBufferSize(int size)
+{
+ int res = ::ioctl(m_fd, DMX_SET_BUFFER_SIZE, size);
+ if (res < 0)
+ eDebug("eDVBPESReader DMX_SET_BUFFER_SIZE failed(%m)");
+ return res;
+}
+
DEFINE_REF(eDVBPESReader)
eDVBPESReader::~eDVBPESReader()
m_running = 0;
m_target_fd = -1;
m_thread = new eDVBRecordFileThread();
- CONNECT(m_thread->m_event, eDVBTSRecorder::filepushEvent);
+ CONNECT(m_thread->m_event, eDVBTSRecorder::filepushEvent);
#ifndef HAVE_ADD_PID
m_demux->m_dvr_busy = 1;
#endif
eDebug("FAILED to open demux (%s) in ts recoder (%m)", filename);
return -3;
}
-
- ::ioctl(m_source_fd, DMX_SET_BUFFER_SIZE, 1024*1024);
+
+ setBufferSize(1024*1024);
dmx_pes_filter_params flt;
#if HAVE_DVB_API_VERSION > 3
return 0;
}
+RESULT eDVBTSRecorder::setBufferSize(int size)
+{
+ int res = ::ioctl(m_source_fd, DMX_SET_BUFFER_SIZE, size);
+ if (res < 0)
+ eDebug("eDVBTSRecorder DMX_SET_BUFFER_SIZE failed(%m)");
+ return res;
+}
+
RESULT eDVBTSRecorder::addPID(int pid)
{
if (m_pids.find(pid) != m_pids.end())
void data(int);
ePtr<eSocketNotifier> notifier;
public:
-
eDVBSectionReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
virtual ~eDVBSectionReader();
+ RESULT setBufferSize(int size);
RESULT start(const eDVBSectionFilterMask &mask);
RESULT stop();
RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn);
public:
eDVBPESReader(eDVBDemux *demux, eMainloop *context, RESULT &res);
virtual ~eDVBPESReader();
+ RESULT setBufferSize(int size);
RESULT start(int pid);
RESULT stop();
RESULT connectRead(const Slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
eDVBTSRecorder(eDVBDemux *demux);
~eDVBTSRecorder();
+ RESULT setBufferSize(int size);
RESULT start();
RESULT addPID(int pid);
RESULT removePID(int pid);
class iDVBSectionReader: public iObject
{
public:
+ virtual RESULT setBufferSize(int size)=0;
virtual RESULT start(const eDVBSectionFilterMask &mask)=0;
virtual RESULT stop()=0;
virtual RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn)=0;
class iDVBPESReader: public iObject
{
public:
+ virtual RESULT setBufferSize(int size)=0;
virtual RESULT start(int pid)=0;
virtual RESULT stop()=0;
virtual RESULT connectRead(const Slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn)=0;
class iDVBTSRecorder: public iObject
{
public:
+ virtual RESULT setBufferSize(int size) = 0;
virtual RESULT start() = 0;
virtual RESULT addPID(int pid) = 0;
virtual RESULT removePID(int pid) = 0;