1 #ifndef __servicedvbrecord_h
2 #define __servicedvbrecord_h
4 #include <lib/service/iservice.h>
5 #include <lib/dvb/idvb.h>
7 #include <lib/dvb/pmt.h>
8 #include <lib/dvb/eit.h>
11 #include <lib/service/servicedvb.h>
13 class eDVBServiceRecord: public eDVBServiceBase,
14 public iRecordableService,
15 public iStreamableService,
16 public iSubserviceList,
19 DECLARE_REF(eDVBServiceRecord);
21 RESULT connectEvent(const Slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection);
22 RESULT prepare(const char *filename, time_t begTime, time_t endTime, int eit_event_id, const char *name, const char *descr, const char *tags);
23 RESULT prepareStreaming();
24 RESULT start(bool simulate=false);
26 RESULT stream(ePtr<iStreamableService> &ptr);
27 RESULT getError(int &error) { error = m_error; return 0; }
28 RESULT frontendInfo(ePtr<iFrontendInformation> &ptr);
29 RESULT subServices(ePtr<iSubserviceList> &ptr);
32 PyObject *getStreamingData();
35 int getNumberOfSubservices();
36 RESULT getSubservice(eServiceReference &subservice, unsigned int n);
38 enum { stateIdle, statePrepared, stateRecording };
40 int m_state, m_want_record;
41 friend class eServiceFactoryDVB;
42 eDVBServiceRecord(const eServiceReferenceDVB &ref);
44 eDVBServiceEITHandler m_event_handler;
46 eServiceReferenceDVB m_ref;
48 ePtr<iDVBTSRecorder> m_record;
49 ePtr<eConnection> m_con_record_event;
51 int m_recording, m_tuned, m_error;
52 std::set<int> m_pids_active;
53 std::string m_filename;
55 std::map<int,pts_t> m_event_timestamps;
64 void serviceEvent(int event);
65 Signal2<void,iRecordableService*,int> m_event;
68 void recordEvent(int event);