m_streaming = 1;
if (m_state == stateIdle)
return doPrepare();
+ return -1;
}
RESULT eDVBServiceRecord::start()
RESULT eDVBServiceRecord::stop()
{
- eDebug("stop recording!!");
- m_event((iRecordableService*)this, evStop);
+ eDebug("stop recording!");
if (m_state == stateRecording)
{
if (m_record)
m_target_fd = -1;
}
m_state = statePrepared;
- }
-
+ } else
+ eDebug("(was not recording)");
if (m_state == statePrepared)
{
m_record = 0;
}
m_record->setTargetFD(fd);
m_record->setTargetFilename(m_filename.c_str());
+ m_record->connectEvent(slot(*this, &eDVBServiceRecord::recordEvent), m_con_record_event);
+
m_target_fd = fd;
}
return 0;
}
-static PyObject *createTuple(int pid, const char *type)
-{
- PyObject *r = PyTuple_New(2);
- PyTuple_SetItem(r, 0, PyInt_FromLong(pid));
- PyTuple_SetItem(r, 1, PyString_FromString(type));
- return r;
-}
-
RESULT eDVBServiceRecord::stream(ePtr<iStreamableService> &ptr)
{
ptr = this;
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);
+ }
+}