1 #include <lib/service/servicedvbrecord.h>
2 #include <lib/base/eerror.h>
5 DEFINE_REF(eDVBServiceRecord);
7 eDVBServiceRecord::eDVBServiceRecord(const eServiceReferenceDVB &ref): m_ref(ref)
9 CONNECT(m_service_handler.serviceEvent, eDVBServiceRecord::serviceEvent);
12 void eDVBServiceRecord::serviceEvent(int event)
14 eDebug("service event %d", event);
17 case eDVBServicePMTHandler::eventTuned:
22 case eDVBServicePMTHandler::eventNewProgramInfo:
24 int vpid = -1, apid = -1, pcrpid = -1;
25 eDVBServicePMTHandler::program program;
26 if (m_service_handler.getProgramInfo(program))
27 eDebug("getting program info failed.");
30 eDebugNoNewLine("RECORD: have %d video stream(s)", program.videoStreams.size());
31 if (!program.videoStreams.empty())
33 eDebugNoNewLine(" (");
34 for (std::vector<eDVBServicePMTHandler::videoStream>::const_iterator
35 i(program.videoStreams.begin());
36 i != program.videoStreams.end(); ++i)
40 if (i != program.videoStreams.begin())
41 eDebugNoNewLine(", ");
42 eDebugNoNewLine("%04x", i->pid);
46 eDebugNoNewLine(", and %d audio stream(s)", program.audioStreams.size());
47 if (!program.audioStreams.empty())
49 eDebugNoNewLine(" (");
50 for (std::vector<eDVBServicePMTHandler::audioStream>::const_iterator
51 i(program.audioStreams.begin());
52 i != program.audioStreams.end(); ++i)
56 if (i != program.audioStreams.begin())
57 eDebugNoNewLine(", ");
58 eDebugNoNewLine("%04x", i->pid);
62 eDebug(", and the pcr pid is %04x", program.pcrPid);
63 if (program.pcrPid != 0x1fff)
64 pcrpid = program.pcrPid;
67 // notify record thread...
73 RESULT eDVBServiceRecord::start()
75 eDebug("starting recording..");
76 return m_service_handler.tune(m_ref);
79 RESULT eDVBServiceRecord::stop()
81 eDebug("stop recording!!");