+ }
+ m_error = 0;
+ m_event((iRecordableService*)this, evRecordRunning);
+ return 0;
+}
+
+RESULT eDVBServiceRecord::frontendInfo(ePtr<iFrontendInformation> &ptr)
+{
+ ptr = this;
+ return 0;
+}
+
+RESULT eDVBServiceRecord::connectEvent(const Slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection)
+{
+ connection = new eConnection((iRecordableService*)this, m_event.connect(event));
+ return 0;
+}
+
+RESULT eDVBServiceRecord::stream(ePtr<iStreamableService> &ptr)
+{
+ ptr = this;
+ return 0;
+}
+
+extern void PutToDict(ePyObject &dict, const char*key, long val); // defined in dvb/frontend.cpp
+
+PyObject *eDVBServiceRecord::getStreamingData()
+{
+ eDVBServicePMTHandler::program program;
+ if (!m_tuned || m_service_handler.getProgramInfo(program))
+ {
+ Py_RETURN_NONE;
+ }
+
+ ePyObject r = program.createPythonObject();
+ ePtr<iDVBDemux> demux;
+ if (!m_service_handler.getDataDemux(demux))
+ {
+ uint8_t demux_id;
+ if (!demux->getCADemuxID(demux_id))
+ PutToDict(r, "demux", demux_id);
+ }
+
+ return r;
+}
+
+void eDVBServiceRecord::recordEvent(int event)
+{
+ switch (event)
+ {
+ case iDVBTSRecorder::eventWriteError:
+ eWarning("[eDVBServiceRecord] record write error");
+ stop();
+ m_event((iRecordableService*)this, evRecordWriteError);
+ return;
+ default:
+ eDebug("unhandled record event %d", event);
+ }
+}
+
+void eDVBServiceRecord::gotNewEvent()
+{
+ ePtr<eServiceEvent> event_now;
+ m_event_handler.getEvent(event_now, 0);
+
+ if (!event_now)
+ return;
+
+ int event_id = event_now->getEventId();
+
+ pts_t p;
+
+ if (m_record)
+ {
+ if (m_record->getCurrentPCR(p))
+ eDebug("getting PCR failed!");
+ else