class iRecordableService: public iObject
{
public:
- virtual RESULT prepare()=0;
+ virtual RESULT prepare(const char *filename)=0;
virtual RESULT start()=0;
virtual RESULT stop()=0;
};
// eServiceCenter
static RESULT getPrivInstance(eServiceCenterPtr &ptr) { ptr = instance; return 0; }
- static RESULT getInstance(iServiceHandlerPtr &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
+ static SWIG_VOID(RESULT) getInstance(iServiceHandlerPtr &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
RESULT addServiceFactory(int id, iServiceHandler *hnd);
RESULT removeServiceFactory(int id);
};
}
eDVBServicePlay::eDVBServicePlay(const eServiceReference &ref, eDVBService *service):
- m_reference(ref), m_dvb_service(service)
+ m_reference(ref), m_dvb_service(service), m_service_handler(0)
{
m_is_pvr = !ref.path.empty();
DEFINE_REF(eDVBServiceRecord);
-eDVBServiceRecord::eDVBServiceRecord(const eServiceReferenceDVB &ref): m_ref(ref)
+eDVBServiceRecord::eDVBServiceRecord(const eServiceReferenceDVB &ref): m_ref(ref), m_service_handler(1)
{
CONNECT(m_service_handler.serviceEvent, eDVBServiceRecord::serviceEvent);
m_state = stateIdle;
}
-RESULT eDVBServiceRecord::prepare()
+RESULT eDVBServiceRecord::prepare(const char *filename)
{
+ m_filename = filename;
if (m_state == stateIdle)
return m_service_handler.tune(m_ref);
else
/* allocate a ts recorder if we don't already have one. */
if (m_state == stateIdle)
{
- ::remove("recordings.ts");
- int fd = ::open("recording.ts", O_WRONLY|O_CREAT, 0644);
+ eDebug("Recording to %s...", m_filename.c_str());
+ ::remove(m_filename.c_str());
+ int fd = ::open(m_filename.c_str(), O_WRONLY|O_CREAT, 0644);
if (fd == -1)
{
eDebug("eDVBServiceRecord - can't open hardcoded recording file!");
{
DECLARE_REF(eDVBServiceRecord);
public:
- RESULT prepare();
+ RESULT prepare(const char *filename);
RESULT start();
RESULT stop();
private:
int m_recording;
std::set<int> m_pids_active;
+ std::string m_filename;
int doPrepare();
int doRecord();